Paying existing beneficiaries
Paying saved beneficiaries
To make a payment to a beneficiary that has been saved to your account with Waza, you need to pass the reference of that beneficiary as described in the payment API
Payment information
Param | Required? | Description |
---|---|---|
beneficiaryReference | Yes | The reference of the beneficiary that was returned by us when you created one |
amount | Yes | Amount (in the lowest currency value - kobo, pesewas or cent) you intend sending to the beneficiary. |
description | Yes | Description of the payment you're initiating |
customerReference | No | Unique case sensitive transaction reference. If you do not pass this parameter, Waza will generate a unique reference for you. |
metaData | No | Object containing any extra information you want recorded with the transaction. |
Initialise payment
When you have all the details needed to initiate the payment, the next step is to pass these details over to our Payments API.
curl --request POST \
--url https://api.waza.co/api/payments \
--header 'waza-x-key: YOUR-API-KEY' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"beneficiaryReference" : "beneficiary-reference",
"amount": 100,
"description": "MY API Transfer",
"customerReference": "my_first_ghs_payment",
"metaData": {"extra": "Sending GHS for NGN"}
}
'
const https = require('https')
const params = JSON.stringify({
"beneficiaryReference" : "beneficiary-reference",
"amount": 100,
"description": "MY API Transfer",
"customerReference": "my_first_ghs_payment",
"metaData": {"extra": "Sending GHS for NGN"}
})
const options = {
hostname: 'api.waza.co',
port: 443,
path: '/api/payments',
method: 'POST',
headers: {
x-waza-key: 'YOUR-API-KEY',
'Content-Type': 'application/json'
}
}
const req = 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)
})
req.write(params)
req.end()
A successful Payment API call should return a similar response structure as seen below:
{
"status": "success",
"message": "Transfer is being processed",
"data": {
"id": "d7fe321f-e2da-43746-ad0b-213b00de1463",
"beneficiaryReference": "cla77076a000871215mgbdxye",
"dateCreated": "2022-11-07T20:08:33.713Z",
"customerReference": "my_first_ghs_payment",
"state": "AWAITING_RECEIVE"
}
}
Updated 10 months ago