Current inbound Sent message-event payload
{
"app": "DemoAPI",
"timestamp": 1585344475993,
"version": 2,
"type": "message-event",
"payload": {
"id": "gBEGkYaYVSEEAgnZxQ3JmKK6Wvg",
"gsId": "ee4a68a0-1203-4c85-8dc3-49d0b3226a35",
"type": "sent",
"destination": "918x98xx21x4",
"payload": {
"ts": 1585344475
}
}
}
Proposed Sent message-event payload post CBP implementation
{
"app":"DemoAPI",
"timestamp":1580546677791,
"version":2,
"type":"message-event",
"payload":{
"id":"59f8db90-c37e-4408-90ab-cc54ef8246ad",
"gsId":"ee4a68a0-1203-4c85-8dc3-49d0b3226a35",
"type":"sent",
"destination":"91XX985XX10X",
"payload":{
"ts":1585344475
},
"conversation":{
"id":"532b57b5f6e63595ccd74c6010e5c5c7",
"expiresAt":1518780636,
"type": "FEP/UIC/BIC"
},
"pricing":{
"policy": "CBP/NBP",
"category": "FEP/UIC/BIC"
}
}
}
We understand that the billable parameter is important and hence we have introduced a new event that you will receive on your callback URL, known as billing-event. The billing-event is described at the bottom of this article.
Conversation object description
Key |
Type |
Description |
Example |
id |
string |
Unique ID for a conversation. |
532b57b5f6e63595ccd74c6010e5c5c7 |
expiresAt |
number |
Conversation expiration timestamp in seconds |
1518780636 |
type |
string |
The type of conversation. Possible values:
|
FEP |
Pricing object description
Key |
Type |
Description |
Example |
policy |
string |
The pricing policy applied for this message. Possible values:
|
CBP |
category |
string |
The pricing category. Possible values:
|
FEP |
New callback event: billing-event
{
"app": "DemoAPI",
"timestamp":1580546677791,
"version":2,
"type": "billing-event",
"payload":{
"deductions":{
"type": "FEP/UIC/BIC/FTC",
"model": "NBP/CBP",
"source": "whatsapp",
"billable": "true/false"
},
"references":{
"id":"59f8db90c37e-4408-90ab-cc54ef8246ad",
"gsId":"ee4a68a0-1203-4c85-8dc3-49d0b3226a35",
"conversationId":"532b57b5f6e63595ccd74c6010e5c5c7",
"destination":"91XX985XX10X"
}
}
}
Note: You will start receiving the 'billable' flag in the billing-event from the 1st of March.
Deductions object description
Key | Type | Description | Example |
type | string |
The type of conversation. Possible values:
|
FEP/UIC/BIC |
model | string |
The pricing policy model applied for this message. Possible values:
|
NBP/CBP |
source | string | Origin source of the conversation | |
billable | Boolean | The value is either true or false depending on whether a conversation is billable or not. | false |
References object description
Key | Type | Description | Example |
id | string | Unique WhatsApp identifier for a message | 59f8db90c37e-4408-90ab-cc54ef8246ad |
gsId | string | Unique Gupshup identifier for a message | ee4a68a0-1203-4c85-8dc3-49d0b3226a35 |
conversationId | string | Unique identifier for a conversation | 532b57b5f6e63595ccd74c6010e5c5c7 |
destination | string |
Phone number of the user engaged in the conversation. Phone Number will be in E.164 format. |
91XX985XX10X |
Note:
- Once the conversational pricing is in place, businesses will receive the new message-event payload, which has additional properties: conversation and pricing.
- Only the DLR event: sent (This event indicates that WhatsApp’s server has received the message) will be the one where you will obtain these additional details on conversational pricing.
- The order of these notifications in your app may not reflect the actual timing of the message status. View the timestamp to determine the timing, if necessary.
Comments
0 comments
Please sign in to leave a comment.