Payments History
Last updated
Last updated
Use the following endpoint to retrieve detailed information about payments, including amounts, transactions, conversions, and notifications.
Parameter Descriptions:
Parameter | Description |
---|---|
Example API call using Node.js:
const axios = require('axios');
async function getPaymentHistory() {
try {
const response = await axios.get('https://api.example.com/Payments/info/history', {
params: {
PaymentId: '12345',
TerminalId: '67890',
Page: 1,
PageSize: 20
// Add more query parameters as needed
},
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
}
});
console.log(response.data);
} catch (error) {
console.error('Error fetching payment history:', error);
}
}
getPaymentHistory();
Example API call using JAVA:
import okhttp3.HttpUrl;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.io.IOException;
public class ApiClient {
private static final String BASE_URL = "https://api.example.com/Payments/info/history";
public static void main(String[] args) {
OkHttpClient client = new OkHttpClient();
HttpUrl.Builder urlBuilder = HttpUrl.parse(BASE_URL).newBuilder();
urlBuilder.addQueryParameter("PaymentId", "12345");
urlBuilder.addQueryParameter("TerminalId", "67890");
urlBuilder.addQueryParameter("Page", "1");
urlBuilder.addQueryParameter("PageSize", "20");
// Add more query parameters as needed
String url = urlBuilder.build().toString();
Request request = new Request.Builder()
.url(url)
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.build();
try (Response response = client.newCall(request).execute()) {
if (!response.isSuccessful()) {
throw new IOException("Unexpected code " + response);
}
System.out.println(response.body().string());
} catch (IOException e) {
e.printStackTrace();
}
}
}
PaymentId
Unique identifier of the payment
TerminalId
Identifier of the terminal
MerchantId
Identifier of the merchant
TrackingId
Tracking identifier
Page
Page number for pagination (default is 0)
PageSize
Number of items per page (default is 10)
From
Start date for filtering
To
End date for filtering
SortBy
Field to sort by
SortDirection
Direction of sorting (asc or desc)
const response = await fetch('https://api.qa.devs.beadpay.io/Payments/info/history', {
method: 'GET',
headers: {},
});
const data = await response.json();
{
"data": [
{
"id": "text",
"created": "2024-12-10T07:55:49.015Z",
"updated": "2024-12-10T07:55:49.015Z",
"externalId": "text",
"terminalId": "text",
"paymentCode": "text",
"trackingId": "text",
"pageId": "text",
"statusCode": "created",
"reqCurrencyId": 0,
"payCurrencyId": 0,
"amounts": {
"requested": {
"inPaymentCurrency": {
"amount": 0,
"amountPrecision": 0,
"currencyId": 0
},
"inRequestedCurrency": {
"amount": 0,
"amountPrecision": 0,
"currencyId": 0
}
},
"paid": {
"inPaymentCurrency": {
"amount": 0,
"amountPrecision": 0,
"currencyId": 0
}
},
"settleableAmount": {
"amount": 0,
"amountPrecision": 0,
"currencyId": 0
},
"partnerFees": [
{
"amountInBaseUnit": 0,
"formula": {
"feeFactor": 0,
"fixedFee": 0
},
"ownerId": "text"
}
]
},
"reference": "text",
"description": "text",
"customerId": "text",
"emailReceipt": false,
"smsReceipt": false,
"cartItems": [
{
"id": "text",
"name": "text",
"quantity": 0,
"price": 0
}
],
"expiration": "2024-12-10T07:55:49.015Z",
"quoteExpiration": "2024-12-10T07:55:49.015Z",
"paymentAddress": "text",
"redirectUrl": "text",
"paymentUrlType": "web",
"transactions": [
{
"statusCode": "pendingExact",
"fromAddress": "text",
"toAddress": "text",
"txId": "text",
"receivedTime": "2024-12-10T07:55:49.015Z",
"amountInfo": {
"amount": 0,
"amountPrecision": 0,
"currencyId": 0
},
"numOfConfirmations": 0,
"requiredNumOfConfirmations": 0,
"trackingUrl": "text"
}
],
"conversions": [
{
"statusCode": "quoted",
"priceQuoteId": "text",
"quotedExchangeRate": 0,
"conversionFee": 0,
"presentedExchangeRate": 0,
"quoteId": "text",
"tradeId": "text",
"invoiceId": "text",
"activePaymentInstructionId": "text",
"paymentInstructionIds": [
"text"
],
"executedExchangeRate": 0,
"tradeFee": 0,
"amountToConvertInfo": {
"amount": 0,
"amountPrecision": 0,
"currencyId": 0
},
"convertedAmountInfo": {
"amount": 0,
"amountPrecision": 0,
"currencyId": 0
},
"exchangeGain": {
"amount": 0,
"amountPrecision": 0,
"currencyId": 0
},
"conversionTime": "2024-12-10T07:55:49.015Z"
}
],
"paymentSettlementStatusCode": "created",
"paymentNotifications": [
{
"type": "firstBlockReached",
"email": "text",
"status": "pending",
"notificationTime": "2024-12-10T07:55:49.015Z"
}
],
"webhookUrls": [
"text"
],
"refundEmail": "text"
}
],
"total": 0
}