Request the Status of a Transaction
This endpoint allows you to retrieve the status and details of a specific transaction using the unique `partnerReference` provided when the transaction was created.
Method
- GET
URL
- /operation?partnerReference={partnerReference}
Input
- partnerReference (query parameter): A unique reference supplied by the user when performing the operation creation request. This parameter is required to identify the specific transaction.
Output
- Transaction Details: A JSON object containing the transaction details such as
reference
,amount
,status
, and other relevant information.
HTTP Status Codes
- 200 OK: The request was successful, and the transaction details are returned.
- 404 Not Found: The requested operation does not exist.
Example Request
Here is an example of how to request the status of a transaction using the partnerReference
:
import axios from 'axios';
const apiKey = 'your-api-key';
const apiSecret = 'your-api-secret';
const partnerReference = 'unique-partner-reference';
axios.get(`https://svc.test.bestcash.me/external/operation`, {
headers: {
'X-Auth-ApiKey': apiKey,
'X-Auth-ApiSecret': apiSecret
},
params: {
partnerReference: partnerReference
}
})
.then(response => {
console.log('Transaction Details:', response.data);
})
.catch(error => {
if (error.response.status === 404) {
console.error('Error: Transaction not found.');
} else {
console.error('An error occurred:', error.message);
}
});
Summary
Use this endpoint to check the status of a specific transaction by providing the partnerReference. Ensure that the reference is correct to avoid a 404 Not Found error.