Learn how to collect payments on your chatbot with Vendy
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Overview
Vendy lets businesses collect payments inside their WhatsApp bots. Your bot calls this endpoint to create a payment link, then shows the link to the customer as a button. The customer taps it and pays on Vendy's checkout page.

Sample WhatsAppBot Integration
Authentication
Use one of these:
| Option | Headers | Use it when |
|---|---|---|
| Public key | Authorization: Bearer <public key> | Your bot code runs somewhere your SecretKey shouldn't be stored. Find the public key at Settings → APIs |
| API keys | AccessKey and SecretKey | The call is made from your own server. See Authentication |
The public key can also be sent as a public-key header or a publicKey query parameter.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| amount | Number | Yes | The amount to collect |
| msisdn | String | One of msisdn or email | Customer phone number with country code |
| String | One of msisdn or email | Customer email | |
| currency | String | No | ISO 4217 code, for example NGN. Defaults to your business currency |
| product | Enum (String) | No | transactions, events, foods, retail, services, reservations or vendings. Defaults to transactions |
| walletId | Integer | No | Wallet to credit. Its currency must match currency |
| expiry | String | No | ISO 8601 date-time when the link expires, at least 2 minutes in the future |
| charge_customer | Boolean | No | Add Vendy's fee to the amount the customer pays |
| device | Enum (String) | No | Customer's device: android, ios or web |
| meta | JSON Object | No | Any extra data to store with the transaction. It's returned in webhooks |
Sample cURL Request
curl --location 'https://api.myvendy.com/public/transactions/payment-url' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer $VENDY_PUBLIC_KEY" \
--data '{
"amount": 100,
"msisdn": "2348012345678",
"currency": "NGN",
"device": "ios",
"meta": {
"narration": "Payment for services",
"custom-field": "your-custom-field",
"transactionId": "your-transaction-id"
},
"charge_customer": false,
"product": "transactions"
}'Successful Response
data.payment_link is the link to send to the customer.
{
"status": true,
"code": 200,
"msg": "Transaction Sent",
"error": "Transaction Sent",
"data": {
"id": 605562920,
"businessId": 994,
"msisdn": "2348012345678",
"requestamount": 100,
"amount": 100,
"method": "web",
"currency": "NGN",
"refid": "4213780500635415668",
"meta": {
"narration": "Request from Ada's Store for NGN100.00",
"total": 100,
"payment_link": true
},
"businessName": "Ada's Store",
"payment_link": "https://checkout.myvendy.com/pyr_y29t4hlgJBSMfgXQ"
}
}Steps to Create WhatsApp Payment Link Button
Step 1: Generate Payment Link
Make the above API call to generate the payment link.
Step 2: Use WhatsApp API
Utilize the WhatsApp Business API or any preferred WhatsApp bot service.
Step 3: Create Interactive Message
Construct a WhatsApp message with an interactive URL button. Follow Meta's guide to interactive CTA URL messages.
Step 4: Send to Customer
Send the message with your WhatsApp API provider. For example, with the WhatsApp Cloud API:
curl 'https://graph.facebook.com/v23.0/<PHONE_NUMBER_ID>/messages' \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $WHATSAPP_ACCESS_TOKEN" \
-d '
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "+2348012345678",
"type": "interactive",
"interactive": {
"type": "cta_url",
"body": {
"text": "Tap the button below to pay for your order."
},
"action": {
"name": "cta_url",
"parameters": {
"display_text": "Pay Now",
"url": "<payment_link from Vendy>"
}
},
"footer": {
"text": "Powered by Vendy"
}
}
}'Webhooks
Configure your webhook URLs at Settings → Webhooks, or with Create Webhook. Vendy sends transaction events when the customer pays.
Possible errors
| Error code | Description |
|---|---|
204 | Input is invalid. data lists each field |
229 / 203 | Your AccessKey or SecretKey is wrong (HTTP 401) |
326 | Business not found |
337 | Invalid public key (HTTP 401) |
338 | Amount above or below your transaction limit |
438 | The customer is no longer allowed to transact |
