Payments API also enables businesses to collect payments from their customers via WhatsApp using Payment Links.
When using this integration, WhatsApp only facilitates the communication between merchants and buyers. Merchants are responsible for integrating with a PSP from which they can generate Payment Links, and confirm their payment.
The following sequence diagram shows the typical integration with Payment Links.
Follow the full integration guide in the Orders API page.
If Payment Link payment is available on this order, you will need to provide a payment_link to the payment_settings attribute.
| Field Name | Optional? | Type | Description |
|---|---|---|---|
| Optional | List of payment related configuration objects. |
| Field Name | Optional? | Type | Description |
|---|---|---|---|
| Required | String | Must be |
| Required | Payment Link object that will be used to render the option to buyers during the checkout flow. |
| Field Name | Optional? | Type | Description |
|---|---|---|---|
| Required | String | The Payment Link's uri which will be opened in the web browser, when user taps on the Payment Link CTA button. |
POST: /v1/messages
{
"recipient_type": "individual",
"to": "[recipient-wa-id]",
"type": "interactive",
"interactive": {
"type": "order_details",
"body": {
"text": "Your message content"
},
"action": {
"name": "review_and_pay",
"parameters": {
"reference_id": "unique-reference-id",
"type": "digital-goods",
"payment_type": "br",
"payment_settings": [
{
"type": "payment_link",
"payment_link": {
"uri": "https://my-payment-link-url",
}
}
],
"currency": "BRL",
"total_amount": {
"value": 50000,
"offset": 100
},
"order": {
"status": "pending",
"tax": {
"value": 0,
"offset": 100,
"description": "optional text"
},
"items": [
{
"retailer_id": "1234567",
"name": "Cake",
"amount": {
"value": 50000,
"offset": 100
},
"quantity": 1
}
],
"subtotal": {
"value": 50000,
"offset": 100
}
}
}
}
}
}
Once the payment is confirmed, you must send an order status update. Follow the integration guide in the Orders API page.