Payment Information
Utilize the Payment Information endpoint to retrieve detailed information about a specific payment using its track_id
. After generating an invoice, you will receive a track_id
, which serves as a reference for requesting payment details.
GET
https://api.oxapay.com/v1/payment/{track_id}
Authentication
You must include the Merchant API Key in the request header to authenticate your access to the API.
merchant_api_key*
string
Your merchant API Key for authentication and authorization.
{
"data": {
"track_id": "string", // Unique identifier for each payment session in the OxaPay payment gateway. It is used to track the payment status and generate reports.
"type": "string", // Describes the payment type, e.g., invoice, white-label, etc.
"amount": "decimal", // The total amount of the invoice in the specified currency.
"currency": "string", // The currency of the payment, e.g., USD, EUR, BTC.
"status": "string", // The current status of the invoice, such as pending, completed, failed, etc.
"mixed_payment": "boolean", // A flag indicating whether the payment is mixed (involving multiple payment currencies).
"callback_url": "string", // The URL to which payment status updates will be sent
"description": "string", // A description for the invoice
"email": "string", // The email address of the payer
"fee_paid_by_payer": "decimal", // Indicates if the payer is responsible for paying the network fees (1 = yes, 0 = no)
"lifetime": "integer", // The lifetime of the invoice in minutes before it expires
"order_id": "string", // A unique identifier for the order associated with this invoice
"under_paid_coverage": "decimal", // The percentage of underpayment that will still be considered valid
"return_url": "string", // The URL the user will be redirected to after completing the payment.
"thanks_message": "string", // A custom message to thank the user for the payment.
"expired_at": "integer", // Timestamp (UNIX epoch) when the invoice will expire
"date": "integer" // Timestamp (UNIX epoch) of when the invoice was created
"txs": [
{
"tx_hash": string, // Unique hash of the transaction on the blockchain, used to identify the transaction.
"amount": decimal, // The amount involved in the transaction.
"currency": string, // The currency of the transaction.
"network": string, // The blockchain network on which the transaction was made (e.g., Bitcoin, Ethereum).
"address": string, // The receiver wallet address.
"status": string, // The current status of the transaction, such as confirming, confirmed, failed, etc.
"confirmations": integer, // The number of confirmations the transaction has received on the network.
"auto_convert": {
"processed": boolean, // Indicates whether the transaction was automatically converted to another currency.
"amount": decimal, // The amount of currency that was converted.
"currency": string // The currency to which the amount was converted.
},
"auto_withdrawal": {
"processed": boolean // Indicates whether the funds were automatically withdrawn after the transaction.
},
"date": integer // The timestamp when the transaction occurred.
}
]
},
"message": string, // A message containing additional information about the result of the request.
"error": {
"type": string,
"key": string,
"message": string
} || {}, // An object that provides details about any errors that occurred.
"status": integer, // The status of the request response. Typically provided as a numeric code (e.g., 200 for success or other codes for errors).
"version": string // The version of the API being used.
}
API Request Sample Codes
curl -X GET https://api.oxapay.com/v1/payment/{track_id}\
-H "merchant_api_key: YOUR_MERCHANT_API_KEY" \
-H "Content-Type: application/json"
<?php
$track_id = 'TRACK_ID';
$url = 'https://api.oxapay.com/v1/payment/' . $track_id;
$headers = [
'Content-Type: application/json',
'merchant_api_key: YOUR_MERCHANT_API_KEY'
];
$options = array(
'http' => array(
'header' => implode("\r\n", $headers),
'method' => 'GET'
),
);
$context = stream_context_create($options);
$response = file_get_contents($url, false, $context);
if ($response === FALSE) {
die('Error occurred');
}
$result = json_decode($response, true);
var_dump($result);
?>
const axios = require('axios');
const track_id = 'TRACK_ID';
const url = `https://api.oxapay.com/v1/payment/${track_id}`;
const headers = {
'merchant_api_key': `YOUR_MERCHANT_API_KEY`,
'Content-Type': 'application/json',
};
axios.get(url, { headers })
.then((response) => {
console.log(response.data);
})
.catch((error) => {
console.error(error);
});
import requests
import json
track_id = 'TRACK_ID'
url = f'https://api.oxapay.com/v1/payment/{track_id}'
headers = {
'merchant_api_key': 'YOUR_MERCHANT_API_KEY',
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers)
result = response.json()
print(result)
Please make sure to replace YOUR_MERCHANT_API_KEY
in the code snippets with your actual merchant API Key.
These example code snippets demonstrate how to request the "Payment Information" endpoint using different programming languages. You can customize the data parameters according to your specific requirements.
API Response Example
{
"data": {
"track_id": "168931368",
"type": "invoice",
"amount": 15,
"currency": "USD",
"status": "paid",
"mixed_payment": false,
"fee_paid_by_payer": 0,
"under_paid_coverage": 21.5,
"lifetime": 60,
"callback_url": "https://example.com/callback",
"return_url": "https://example.com/success",
"email": "customer@oxapay.com",
"order_id": "ORD-12345",
"description": "Order #12345",
"thanks_message": "Thanks Message",
"expired_at": 1728121075,
"date": 1728117475,
"txs": [
{
"tx_hash": "0x2DehmnxMDFMhS3KHXCPpGSx41NeLBjH34q5vjN1oGbUDFFAMC9rG3",
"amount": 0.00613418,
"currency": "ETH",
"network": "Ethereum Network",
"address": "HEHCVjnxD8cQrFwfo4k9WXJXErpmK9Ym1nRaEiJJ8DP4",
"status": "confirmed",
"confirmations": 11,
"auto_convert": {
"processed": true,
"amount": 14.73130872,
"currency": "USDT"
},
"auto_withdrawal": {
"processed": false
},
"date": 1728117736
}
]
},
"message": "Operation completed successfully!",
"error": {},
"status": 200,
"version": "1.0.0"
}
The response example above is provided to help you understand the format and structure of the response. If you have any further questions or need assistance, please feel free to contact to your account manager.
Last updated