Confirm a Debit
This endpoint allows you to confirm a previously initiated debit operation by providing the operation reference and the confirmation code.
Method
- POST
URL
- /operations/confirm-debit
Input
The input data for this operation should be provided in the request body as a JSON object:
{
"operation": "reference of the operation to be confirmed",
"confirmationCode": "confirmation code"
}
Example Request
Here's an example of how to confirm a debit operation:
{
"operation": "OPAD20201006000000000005",
"confirmationCode": 8207
}
Output
The API will return a JSON object with the details of the confirmed debit transaction, including:
-
Transaction Reference
-
Customer Details
-
Amount Debited
-
Transaction Status
-
Other relevant details.
HTTP Status Codes
- 200 OK: The request was successful, and the debit transaction details are returned.
Example Code
Here is an example of how to make a POST request to confirm a debit operation:
import axios from 'axios';
const apiKey = 'your-api-key';
const apiSecret = 'your-api-secret';
const requestData = {
operation: "OPAD20201006000000000005",
confirmationCode: 8207
};
axios.post('https://svc.test.bestcash.me/external/operations/confirm-debit', requestData, {
headers: {
'X-Auth-ApiKey': apiKey,
'X-Auth-ApiSecret': apiSecret,
'Content-Type': 'application/json'
}
})
.then(response => {
console.log('Confirmed Debit Transaction Details:', response.data);
})
.catch(error => {
console.error('An error occurred:', error.message);
});
Summary
Use this endpoint to confirm a debit operation by providing the operation reference and the confirmation code. Once confirmed, the debit transaction details will be returned.