post https://api.vendy.money/transactions/initiate
Endpoint to initiate transactions on Vendy.
Request:
Field | Type | Description |
---|---|---|
businessId | Integer | Merchant registered business Id. Transaction is only valid for one business id. BusinessId can be found on the Settings > API section of the dashboard |
amount | Double | The amount being debited. |
msisdn | string | A valid identification phone number that is linked to a specific network. |
channel | Enum (String) | Payment checkout channel where transaction will be processed; 'ussd' or 'whatsapp' |
currency | Enum(String) | ISO currency code (USD,NGN,KES). Defaults to the currency for the business upon creation. |
meta | JSON Object | Object containing any extra information you want recorded with the transaction. |
Example request
curl --location 'https://api.vendy.money/transactions/initiate' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{
"businessId":1,
"amount":100,
"msisdn":"2348112345678",
"channel":"ussd",
"meta": {
"email": "[email protected]",
"narration": "Any narration",
"custom_field": "custom field"
}
}'
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
{
"status": true,
"code": 200,
"msg": "Transaction Sent",
"data": {
"vended": "-1",
"reversed": "-1",
"debited": "-1",
"isreversing": "-1",
"processing": "-1",
"flag": "-1",
"id": 605513775,
"uid": 1,
"businessId": "1",
"msisdn": "2348112345678",
"requestamount": 100,
"amount": 100,
"method": "ussd",
"currency": "NGN",
"refid": "4930517800770623045",
"failed": -1,
"delivered": -1,
"meta": {
"email": "[email protected]",
"custom_field": "custom field",
"narration": "Any narration",
"fee": 0,
"commission": 0,
"charge_customer": false,
"fee_structure": {
"fee": 0,
"percent": true,
"threshold": {
"max": 100,
"min": 0
},
"commission": 0,
"charge_customer": false
},
"total": 11
},
"walletId": 1689,
"commissionWallet": 1690,
"staffId": null,
"updated_on": "2023-05-18T15:37:50.523Z",
"created_on": "2023-05-18T15:37:50.523Z"
}
}
Possible errors;
Error code | Description |
---|---|
326 | Business not found |