API Reference

Payment history

To have payment history for a specific transaction, you must specify the transaction ID

POST :https://safacilpay.com/sandbox/transaction

Request Body

NameType
txIDString

<?php
$url = "https://safacilpay.com/sandbox/transaction";

$data = array("txID" => '1694628626');
$token = "YOUR TOKEN";

$ch = curl_init($url);

// Set options
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

// Set the headers including the Bearer token
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/x-www-form-urlencoded',
     'Authorization: Bearer '. $token
));

$response = curl_exec($ch);

// Check for errors
if(curl_errno($ch)) {
echo 'Request Error:' . curl_error($ch);
}

// Close the cURL session
curl_close($ch);

// Decode the JSON response
$responseData = json_decode($response, true);
echo $response;
?>

Response :
          {

             "message": "successful",
             "transactionId": 12345678,
             "orderId": 01230440,
             "payer": 509000000,
             "amount": 55,
             "date": 0000-00-00 00:00:00

          }