Payment Link Message

Use this API to send a payment link message to a WhatsApp user.

Request Parameters

Key

Description

Values

Data Types

Required/Optional

Constraints

Authorization

Access Token for the application

{{PARTNER_APP_TOKEN}}

String

Required

Should be a valid Partner App Access Token.

appId

App ID to fetch the access token

{{APP_ID}}

String

Required

The Id should be a valid app Id of Gupshup

messaging_product

Messaging product

whatsapp

String

Required

recipient_type

Recipient type

individual

String

Required

to

Destination phone no where the message need to be send

91785876xxxx

String

Required

Must be a valid phone number.

type

Messaging type

order_details

String

Required

order_details

Add interactive

body

Interactive body

Object

Required

Key should be a interactive to send interactive message.

Sample Request

curl --location 'https://partner.gupshup.io/partner/app/dbb0afed-9377-4f82-bd28-77e419c818c9/v3/message' \
--header 'Content-Type: application/json' \
--header 'Authorization: sk_c33e12d15ab84e16baab042d8ffd468a' \
--data '{
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": "5511972932562",
    "type": "interactive",
    "interactive": {
        "type": "order_details",
        "body": {
            "text": "Your message content"
        },
        "action": {
            "name": "review_and_pay",
            "parameters": {
                "reference_id": "unique-reference-id-918208",
                "type": "digital-goods",
                "payment_type": "br",
                "payment_settings": [
                    {
                        "type": "payment_link",
                        "payment_link": {
                            "uri": "https://my-payment-link-url"
                        }
                    }
                ],
                "currency": "BRL",
                "total_amount": {
                    "value": 100,
                    "offset": 100
                },
                "order": {
                    "status": "pending",
                    "tax": {
                        "value": 0,
                        "offset": 100,
                        "description": "optional text"
                    },
                    "items": [
                        {
                            "retailer_id": "1234567",
                            "name": "Cake",
                            "amount": {
                                "value": 100,
                                "offset": 100
                            },
                            "quantity": 1
                        }
                    ],
                    "subtotal": {
                        "value": 100,
                        "offset": 100
                    }
                }
            }
        }
    }
}'

Sample Response

{
    "messages": [
        {
            "id": "GUPSHUP_MESSAGE_ID"
        }
    ],
    "messaging_product": "whatsapp",
    "contacts": [
        {
            "input": "DESTINATION_PHONE_NO",
            "wa_id": "DESTINATION_PHONE_NO"
        }
    ]
}

Status Codes

Status CodeResponseComments
Success
200{ "messages": [ { "id": "GUPSHUP_MESSAGE_ID" } ], "messaging_product": "whatsapp", "contacts": [ { "input": "DESTINATION_PHONE_NO", "wa_id": "DESTINATION_PHONE_NO" } ] }`
Error
401{ "status": "error", "message": "Authentication Failed" }`When API key authentication fails
400{ "message": "Callback Billing must be enabled for this API", "status": "error" }`If Callback billing is not enabled for the app
400{ "message": "Invalid App Details", "status": "error" }`If app details are not found