Transaction endpoint
After getting a response from Pay endpoint you can use this endpoint to fetch informations about the transaction such as status, transaction id , total amount paid, ETC...
URL
testing server:
GET https://staging.xpay.app/api/v1/communities/{community_id}/transactions/{transaction_uuid}/
production(Live) server:
GET https://community.xpay.app/api/v1/communities/{community_id}/transactions/{transaction_uuid}/
Authentication
Supply your API key in the request header
"x-api-key" : string
Parameters
Path parameters
Required Properties
| Property name | Value | Description | Notes |
|---|---|---|---|
| community_id | string | ID that references prefrences to your community | value that your community recieved from XPay |
| transaction_uuid | string | UUID of the transaction to be fetched | you usually have this value from the response of PAY endpoint |
Request body
Do not supply a request body.
Response body
If successful, this method returns a response body with the following structure:
{
"status": {
"code": integer,
"message": string,
"errors": []
},
"data": {
"created": string,
"id": integer,
"uuid": string,
"member_id": string, // in case the payment is connected to a membership id
"total_amount": string,
"total_amount_currency": string,
"payment_for": string, // ex: "API_PAYMENT", "EVENT", "BILL", etc..
"payment_for": number, // in case the payment was for event, service, product or training.
"status": string,
"custom_fields_json": object,
"total_amount_piasters": number,
"recurring": { // only present for recurring payments
"parent_transaction": string, // UUID of the parent/initial transaction
"recurring_count": integer, // Count of actually executed recurring transactions so far
"transaction_order": integer, // Order number of this transaction in the recurring series (1, 2, 3, etc.)
"type": string, // "RECURRING" for recurring payments
"expiry_date": string, // Date when the recurring payment series expires (YYYY-MM-DD format)
"minimum_days_between_payments": integer, // Minimum number of days between each recurring payment
"active": boolean // Whether the recurring payment series is still active
}
},
"count": integer,
"next": string,
"previous": string
}
Example
The following example uses Axios which is a Promise based HTTP client for the browser and node.js
Axios Github repoinstalling
Using npm:
$ npm install axios
Using jsDelivr CDN:
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
- Request Body
- Response Body
- Response Body (Recurring)
axios({
method: "get",
url:
"https://staging.xpay.app/api/v1/communities/JZ40KjN/transactions/2e1b68de-53f3-4228-a509-53560477a860/",
headers: {
"x-api-key": "fVmOK4Y6.gHjL48wKy47MoIUwIBGCht8M8kSg7QCP",
},
})
.then((response) => {
console.log(response.data.data);
})
.catch((e) => {
console.log(e.response.data.status);
});
{
"created": "2020-02-25T23:43:20.505541+02:00",
"custom_fields_json": null,
"id": 1760,
"member_id": "13333",
"payment_for": "BILL",
"quantity": null,
"status": "SUCCESSFUL",
"total_amount": "12.50",
"total_amount_currency": "EGP",
"total_amount_piasters": 1250,
"uuid": "2e1b68de-53f3-4228-a509-53560477a860"
}
{
"created": "2025-01-20T14:30:15.123456+02:00",
"custom_fields_json": null,
"id": 2845,
"member_id": "98765",
"payment_for": "API_PAYMENT",
"quantity": null,
"status": "SUCCESSFUL",
"total_amount": "150.00",
"total_amount_currency": "EGP",
"total_amount_piasters": 15000,
"uuid": "8ac127e0-e046-4dc1-83a9-baf388b974a7",
"recurring": {
"parent_transaction": "7bc028f1-f157-5ed2-94ba-cbg499c085b8",
"recurring_count": 2,
"transaction_order": 2,
"type": "RECURRING",
"expiry_date": "2026-01-23",
"minimum_days_between_payments": 30,
"active": true
}
}