Virtual accounts are generated account details (account number and bank) that allow Vendy merchants to receive payments from customers via bank transfer. Virtual accounts are currently only available in naira.
Vendy only support temporary virtual accounts at the moment. Temporary virtual accounts expires after 24hrs, therefore, they cannot be used to collect funds subsequently. Temporary virtual accounts are useful for receiving one-off payments via bank transfer. When the customer is checking out, you generate a temporary virtual account with a fixed amount and provide to them. When they make payment, we'll send you a webhook and you can handle it.
How does it work
- You generate a virtual account for the customer with our API and provide them with the details
- The customer transfers to their assigned account
- We send you a webhook notifying you that we've received the payment
- You credit the needed funds to the customer's wallet on your platform.
Generate temporary virtual account
Request:
Field | Type | Description |
---|---|---|
businessId | Integer | Merchant registered business Id. Transaction is only valid for one business id. |
amount | Double | The amount being debited. |
msisdn | string | A valid identification phone number that is linked to a specific network. |
Example request
curl --location 'https://api.vendy.money/transactions/virtual-accounts' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{
"businessId":1,
"amount":100,
"msisdn":"2348101851915",
"meta": {"email":"[email protected]", "your-reference":"reference"}
}'
Response:
Field | Type | Description |
---|---|---|
status | Boolean | States if request was successfully executed or not |
code | Integer | Internal code, success if 200 |
msg | String | A description of the status of the request |
data | Transaction | Newly initiated transaction details |
Example response
{
"message":"Awaiting transfer",
"code":"00",
"data":{
"trackingId":"283158179104628033",
"msisdn":"2348083042156",
"date":"2023-07-18 11:41:47",
"accountNo":"7809410414",
"accountName":"VENDY - 2348083042156",
"bankName": "Wema Bank"
},
"status":true
}
Possible errors;
Error code | Description |
---|---|
326 | Business not found |
Virtual account webhooks
Next, pass the details on to your customer, and they can make a transfer into the account. When they do, we'll send you a webhook that looks like this:
{
"event.type": "transaction_success",
"data": {
"amount": 60,
"requestamount": 60,
"delivered": 1,
"vended": 1,
"failed": 0,
"debited": 1,
"processing": 0,
"meta": {
"email":"[email protected]",
"your-reference":"reference",
"accountNo": "7806798105",
"accountName": "VENDY - 2348083042156",
"bankName": "Wema Bank",
"historyId": "VND-TMP-05251242252824953551527152161101",
"walletId": "VND-TMP-3625360416633442",
"provider": "wema_wallet"
},
"refid": "6281400565827151883",
"vendref": "6281400565827151883",
"debitref": "6281400565827151883",
"currency": "ngn",
"request": "Vendy\nDear Customer, Disu Kayode requested payment of NGN60.\nEnter the amount to pay:",
"msisdn": "2347043556860",
"reason": "189c8ff2-18bc-46d5-a2f3-5d78cd2e6e56 vended successfully",
"raw_reason": "Successful transaction",
"client": "189c8ff2-18bc-46d5-a2f3-5d78cd2e6e56",
"channel": "fcmb",
"method": "ussd",
"account": "5566769145",
"created_on": "2023-05-19 08:22:02",
"updated_on": "2023-05-19 08:22:02",
"vended_date": "2023-05-19 08:22:19",
"debited_date": "2023-05-19 08:22:19",
"page": "pin-page"
}
}