Fetch payment
Verify payment
It is critical that you confirm payments using your customerReference. Just because the webhook URL was visited doesn't prove that the transaction was successful or incase the webhook notification fails to hit your server you can confirm payment by using our API to fetch a payment using the customer reference.
curl https://api.waza.co/api/payments/references/:customerReference
-H "waza-x-key: YOUR_API_KEY"
-X GET
const https = require('https')
const options = {
hostname: 'api.waza.co',
port: 443,
path: '/api/payments/references/:customerReference',
method: 'GET',
headers: {
'waza-x-key': 'YOUR_API_KEY'
}
}
https.request(options, res => {
let data = ''
res.on('data', (chunk) => {
data += chunk
});
res.on('end', () => {
console.log(JSON.parse(data))
})
}).on('error', error => {
console.error(error)
})
A successful Fetch Payment API call should return a similar response structure as seen below:
{
"status": "success",
"message": "Payment information fetched successfully.",
"data": {
"id": "a453091d-bf2f-4e26-af2b-89da5fc534c9",
"sendAmount": 3000,
"sendCurrency": "GHS",
"businessId": 1,
"customerReference": "my-customer",
"dateCreated": "06/23/2022",
"timeCreated": "8:32:17 PM",
"dateCreatedFormatted": "Jun 23, 2022",
"paymentReceiveDate": "Jun 23, 2022 8:34:46 PM",
"payoutSendDate": "Jun 23, 2022 8:34:47 PM",
"payoutCompletedDate": "Jun 23, 2022 8:34:48 PM",
"state": "COMPLETE",
"feeAmount": 20,
"feeCurrency": "GHS",
"receiveAmount": 93000,
"receiveCurrency": "NGN",
"beneficiaryName": "BeeTech",
"beneficiaryType": "BUSINESS",
"beneficiaryEmail": "[email protected]",
"accountNumber": "1234567890",
"routeName": "BANK",
"channelName": "Access Bank",
"beneficiaryAddress": "Sample address",
"wazaRef": "WZ-1453630RaY6EpSsftqmsC",
"deliveryTime": "3 min, 30 secs"
}
}
Updated 4 months ago