Get Transaction API
Overview
This ** Transaction API** retrieves the details of a specific transaction using its unique transaction ID. The transaction ID is obtained from the Get All Transactions API.
Endpoint
GET https://{{baseURL}}/v1/transaction/{{transactionId}}
Headers
Header | Type | Description | Required |
---|---|---|---|
x-api-key | String | API key for authentication | ✅ Yes |
content-type | String | Must be application/json | ✅ Yes |
Sample cURL
Request
curl --location --request GET 'https://{{baseURL}}/v1/transaction/{{transactionId}}' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'content-type: application/json'
Success Response (200 OK)
If the request is successful, the API returns the following JSON response:
response.json
{
"message": "transaction fetched successfully",
"status": "success",
"data": {
"id": "8c684c17-ef91-4133-a624-53f31514f059",
"remark": "Tested",
"reason": "Gift",
"referenceNumber": "W1TDB6RWSQMKF",
"type": "SEND",
"state": "FAILED",
"quote": {
"id": "b39b64b9-3ca0-4566-b66b-a5fef8e81e7a",
"source": {
"currency": "NGN",
"country": "NG",
"amount": 15000
},
"target": {
"currency": "CNY",
"country": "CN",
"amount": 59.28
},
"rate": 253.05,
"fee": {
"amount": 1850
}
},
"recipient": {
"name": "Zen Lui",
"firstName": "Zen",
"lastName": "Lui",
"relationship": "SELF",
"type": "MOBILE",
"account": {
"sortCode": "",
"accountNumber": "8612343562723",
"branchCode": "",
"mobileProvider": ""
},
"paymentChannel": "ALI_PAY",
"currency": "CNY",
"country": "CN"
},
"created": "2025-02-27T14:17:48.038044",
"processed": "2025-02-27T14:20:49.712685"
}
}
Response Breakdown
General Information
Field | Type | Description |
---|---|---|
message | String | Response message |
status | String | Status of the response (success or error) |
Transaction Details
Field | Type | Description |
---|---|---|
id | String | Unique transaction ID |
remark | String | Additional transaction remarks |
reason | String | Reason for the transaction (e.g., Gift) |
referenceNumber | String | Unique reference number for tracking |
type | String | Transaction type (e.g., SEND) |
state | String | Transaction status (COMPLETED, PENDING, etc.) |
created | String (ISO 8601) | Timestamp when the transaction was created |
processed | String (ISO 8601) | Timestamp when the transaction was processed |
Quote Details
Field | Type | Description |
---|---|---|
quote.id | String | Unique identifier for the quote |
quote.source.currency | String | Source currency (e.g., NGN) |
quote.source.country | String | Source country (e.g., NG) |
quote.source.amount | Float | Amount sent in source currency |
quote.target.currency | String | Target currency (e.g., CNY) |
quote.target.country | String | Target country (e.g., CN) |
quote.target.amount | Float | Amount received in target currency |
quote.rate | Float | Exchange rate applied |
quote.fee.amount | Float | Transaction fee applied |
Recipient Details
Field | Type | Description |
---|---|---|
recipient.name | String | Full name of the recipient |
recipient.firstName | String | First name of the recipient |
recipient.lastName | String | Last name of the recipient |
recipient.relationship | String | Relationship to the sender (e.g., SELF) |
recipient.type | String | Payment type (e.g., MOBILE) |
recipient.account.accountNumber | String | Account or mobile number |
recipient.paymentChannel | String | Payment method (e.g., ALI_PAY) |
recipient.currency | String | Recipient's currency |
recipient.country | String | Recipient's country |
Payout States
The transaction can have one of the following states:
State | Description |
---|---|
COMPLETED | The transaction was successfully processed. |
PENDING | The transaction is still being processed. |
REFUNDED | The transaction has been refunded. |
FAILED | The transaction failed to process. |
Error Handling
Status Code | Meaning | Example Response |
---|---|---|
400 | Bad Request | { "message": "Invalid transaction ID" } |
401 | Unauthorized | { "message": "Invalid API key" } |
404 | Not Found | { "message": "Transaction not found" } |
500 | Internal Server Error | { "message": "An internal error occurred" } |
Best Practices
- ✅ Include a valid API key (
x-api-key
) in the request headers for authentication. - ✅ Use the correct transaction ID obtained from the Get All Transactions API.