PIX Session Message

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

📘

Note:

  1. Use the recipient parameter only when BSUID is enabled for the app.
  2. When both to and recipient fields are used in the payload, the to field gets the priority.

Request Parameters

KeyDescriptionValueData typeRequired/OptionalConstraints
AuthorizationAccess Token for the application{{PARTNER_APP_TOKEN}}StringRequiredShould be a valid Partner App Access Token
appIdApp ID to fetch the access token{{APP_ID}}StringRequiredThe Id should be a valid app Id of Gupshup.
messaging_productMessaging productwhatsappStringRequired
recipient_typeRecipient typeindividualStringRequired
toDestination phone number where the message needs to be sent91785876xxxxStringRequired (Can be optional if BSUID is enabled for the app and recipient parameter is used instead)Must be a valid phone number
recipientDestination BSUID where the message needs to be sentIN.461449821882xxxxStringOptionalMust be a valid BSUID
typeMessaging typetextStringRequired

Type should be interactive to send

interactive message.

interactive

Add interactive

body

"interactive": {<Interactive body>}objectRequiredKey should be a interactive to send interactive message.

Sample Request

curl --location 'https://partner.gupshup.io/partner/app/{{APP_ID}}/v3/message' \
--header 'Authorization: {{PARTNER_APP_TOKEN}}' \
--header 'Content-Type: application/json' \
--data '{
 "messaging_product": "whatsapp",
 "recipient_type": "individual",
 "to": {{destinationNumber}},
"recipient": "{{BSUID}}",
 "type": "interactive",
 "interactive": {
   "type": "order_details",
   "body": {
     "text": "Your message content"
   },
   "action": {
     "name": "review_and_pay",
     "parameters": {
       "reference_id": "987654333",
       "type": "digital-goods",
       "payment_type": "br",
       "payment_settings": [
         {
           "type": "pix_dynamic_code",
           "pix_dynamic_code": {
             "code": "00020101021226.gov.bcb.pix.example.com...",
             "merchant_name": "Account holder name",
             "key": "39580525000189",
             "key_type": "CNPJ"
           }
         }
       ],
       "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
         }
       }
     }
   }
 }
}'

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
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
401

{

"status": "error",
"message": "Authentication Failed"}

When API key authentication fails
Path Params
string
required

Unique identifier of the app.

Body Params
Headers
string
required

Your app token, please refer Get access token api to get the token from partner documentation.

string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/octet-stream
application/json