Notifications API
NOTIFICATIONS API, order notifications API, abandoned cart API, webhookUse these endpoints to enable WhatsApp notifications on your bot through APIs. Send BusinessOnBot an event when an order is created, cancelled, fulfilled or delivered, or when a cart is abandoned, and the matching notification goes to your customer.
Endpoints
Section titled “Endpoints”| Method | Endpoint | What it does |
|---|---|---|
| POST | {{businessonbot_domain_name}}/orders-create |
Order confirmation |
| POST | {{businessonbot_domain_name}}/orders-cancelled |
Order cancellation |
| POST | {{businessonbot_domain_name}}/fulfillments-create |
Order fulfilment (shipped) |
| POST | {{businessonbot_domain_name}}/fulfillments-events-create |
Order delivery status |
| POST | {{businessonbot_domain_name}}/abandoned-cart |
Abandoned cart |
Endpoints for internal usage, on your domain:
| Method | Endpoint | What it does |
|---|---|---|
| GET | {{brand_domain_name}}/order/{{orderId}} |
Get order details by order ID |
| GET | {{brand_domain_name}}/personal-details/{{phone_number}} |
Get customer details by phone number |
| GET | {{brand_domain_name}}/personal-details?email={{email_id}} |
Get customer details by email ID |
| GET | {{brand_domain_name}}/get-orders/{{phone_number}} |
Get the last 3 orders of a customer |
| POST | {{brand_domain_name}}/cancel-order |
Cancel an order |
Authentication
Section titled “Authentication”Contact support@businessonbot.com to get your guest API key and URL.
The API documentation is intended to be used as a reference to communicate with BusinessOnBot. BusinessOnBot will be calling the customer’s APIs with the request specified in the documentation and expects responses as mentioned.
For all the APIs, BusinessOnBot will be passing the API KEY with the custom http header ‘x-guest-id’.
Responses
Section titled “Responses”Every endpoint returns JSON with a status and a statusCode:
status |
statusCode |
Meaning |
|---|---|---|
success |
200 |
The request worked |
failure |
400 |
Bad payload or bad request. The error field says what went wrong. |
failure |
500 |
Internal server error |
Endpoints that return data (for example customer or product details) return that data instead of the success object. The exact response for each endpoint is shown below.
Order confirmation
Section titled “Order confirmation”Method: POST
URL: {{businessonbot_domain_name}}/orders-create
Request body (JSON)
Section titled “Request body (JSON)”{ "id": "4331283087516", "name": "#1581", "email": "test@gmail.com", "createdAt": "2021-10-23T15:40:19Z", "fullyPaid": false, "cancelReason": null, "cancelledAt": null, "note": "Order drafted by businessonbot", "channel": "shopify" | "amazon" (name of the channel from which order was made), "shippingAddress": { "name": "", "phone": "", "address1": "", "address2": "", "city": "", "province": "", "country": null, "zip": null }, "total_amount": "180.0", "currencyCode": "INR", //valid currency codes "lineItems": [ { "image": { "originalSrc": "Expecting ImageURL" }, "product": { "id": "96054", "title": "Rum Chocolate" }, "variant": { "id": "40344786960540", "title": "Default Title", "price": "100.00", "weight": "1 kg", "sku": "" }, "variantTitle": "", "quantity": 2 } ], "shipment_details": { "status": "delivered", "tracking_info": "Tracking URL if present" }}Success response
Section titled “Success response”{ "status": "success", "statusCode": 200}Error responses
Section titled “Error responses”{ "status": "failure", "statusCode": 400, "error": "Bad payload!!"}Order cancellation
Section titled “Order cancellation”Method: POST
URL: {{businessonbot_domain_name}}/orders-cancelled
Request body (JSON)
Section titled “Request body (JSON)”{ "id": "4331283087516", "name": "#1581", "email": "test@gmail.com", "createdAt": "2021-10-23T15:40:19Z", "fullyPaid": false, "cancelReason": "user cancellation request", "cancelledAt": "time in UTC", "note": "Order drafted by businessonbot", "channel": "shopify" | "amazon" (name of the channel from whichorder was made), "shippingAddress": { "name": "", "phone": "", "address1": "", "address2": "", "city": "", "province": "", "country": null, "zip": null }, "total_amount": "180.0", "currencyCode": "INR", //valid currency codes "lineItems": [ { "image": { "originalSrc": "Expecting ImageURL" }, "product": { "id": "96054", "title": "Rum Chocolate" }, "variant": { "id": "40344786960540", "title": "Default Title", "price": "100.00", "weight": "1 kg", "sku": "" }, "variantTitle": "", "quantity": 2 } ], "shipment_details": { "status": "delivered", "tracking_info": "Tracking URL if present" }}Success response
Section titled “Success response”{ "status": "success", "statusCode": 200}Error responses
Section titled “Error responses”{ "status": "failure", "statusCode": 400, "error": "Bad payload!!"}{ "status": "failure", "statusCode": 500, "error": "Internal Server Error!!"}Order fulfilment
Section titled “Order fulfilment”Method: POST
URL: {{businessonbot_domain_name}}/fulfillments-create
Request body (JSON)
Section titled “Request body (JSON)”{ "fulfillment_id": "String", "id": "String", "id_alias": "String" (optional), "lineItems": [ { "image": { "originalSrc": "Expecting ImageURL" }, "product": { "id": "96054", "title": "Rum Chocolate" }, "variant": { "id": "40344786960540", "title": "Default Title", "price": "100.00", "weight": "1 kg", "sku": "" }, "variantTitle": "", "quantity": 2 } ], "customer": { "email": "String", "first_name": "String", "last_name": "String", "orders_count": "Number" (optional), "total_spent": "Number" (optional), "last_order_id": "String" (optional), "phone": "String" }, "order_details": { "total_price": "Number", "total_tax": "Number", "total_discount": "Number", "currency": "String" }, "tracking_info": { "tracking_number": "String", "tracking_url": "String", "tracking_company_name": "String", "shipping_status": "String" }, "fulfilled_at": "Timestamp"}Success response
Section titled “Success response”{ "status": "success", "statusCode": 200}Error responses
Section titled “Error responses”{ "status": "failure", "statusCode": 400, "error": "Bad payload!!"}{ "status": "failure", "statusCode": 500, "error": "Internal Server Error!!"}Order delivery
Section titled “Order delivery”Method: POST
URL: {{businessonbot_domain_name}}/fulfillments-events-create
Request body (JSON)
Section titled “Request body (JSON)”{ "delivery_id": "String", "id": "String" (order id), "id_alias": "String" (optional), "fulfillment_id": "String", "status": "Delivered" | "In-transit" | "Returned" | "Dispatched", "delivered_at": "Timestamp"}Success response
Section titled “Success response”{ "status": "success", "statusCode": 200}Error responses
Section titled “Error responses”{ "status": "failure", "statusCode": 400, "error": "Bad payload!!"}{ "status": "failure", "statusCode": 500, "error": "Internal Server Error!!"}Abandoned cart
Section titled “Abandoned cart”Method: POST
URL: {{businessonbot_domain_name}}/abandoned-cart
Request body (JSON)
Section titled “Request body (JSON)”{ "checkout_id": "String", "cart_recovery_url": "String", "line_items": [ { "id": "String", "name": "String", "image": { "originalSrc": "string" "(image url) }, "quantity": "Number", "price": "Number" } ], "customer": { "email": "String", "first_name": "String", "last_name": "String", "orders_count": "Number" (optional), "total_spent": "Number" (optional), "last_order_id": "String" (optional), "phone": "String" }, "order_details": { "total_price": "Number", "total_tax": "Number", "total_discount": "Number", "currency": "String" }, "address": { "billing_address": { "address": "String", "city": "String", "province": "String", "country": "String", "zip": "String" }, "shipping_address": { "address": "String", "city": "String", "province": "String", "country": "String", "zip": "String" } }, "phone": "String", "created_at": "Timestamp"}Success response
Section titled “Success response”{ "status": "success", "statusCode": 200}Error responses
Section titled “Error responses”{ "status": "failure", "statusCode": 400, "error": "Bad payload!!"}{ "status": "failure", "statusCode": 500, "error": "Internal Server Error!!"}APIs for internal usage
Section titled “APIs for internal usage”These endpoints are on your domain ({{brand_domain_name}}).
Get order details by order ID
Section titled “Get order details by order ID”Method: GET
URL: {{brand_domain_name}}/order/{{orderId}}
Success response
Section titled “Success response”{ "id": "4331283087516", "name": "#1581", "email": "test@gmail.com", "createdAt": "2021-10-23T15:40:19Z", "fullyPaid": false, "cancelReason": null, "cancelledAt": null, "note": "Order drafted by businessonbot", "channel": "shopify" | "amazon" (name of the channel fromwhich order was made), "shippingAddress": { "name": "", "phone": "", "address1": "", "address2": "", "city": "", "province": "", "country": null, "zip": null }, "total_amount": "180.0", "currencyCode": "INR" //valid currency codes, "lineItems": [ { "image": { "originalSrc": "Expecting ImageURL" }, "product": { "id": "96054", "title": "Rum Chocolate" }, "variant": { "id": "40344786960540", "title": "Default Title", "price": "100.00", "weight": "1 kg", "sku": "" }, "variantTitle": "", "quantity": 2 } ], "shipment_details": { "status": "delivered", "tracking_info": "Tracking URL if present" }}Error responses
Section titled “Error responses”{ "status": "failure", "statusCode": 400, "error": "Bad Request!!"}{ "status": "failure", "statusCode": 500, "error": "Internal Server Error!!"}Get customer details by phone number
Section titled “Get customer details by phone number”Method: GET
URL: {{brand_domain_name}}/personal-details/{{phone_number}}
Success response
Section titled “Success response”{ "id": 5617639587996, "displayName": "Customer Name", "firstName": "Customer First Name", "lastName": "Customer Last Name", "ordersCount": 27, (total orders palced by the customer tillnow) "totalSpent": "6694.60", "currencyCode": "INR", //valid currency codes "defaultAddress": { "id": 6973421224092, "customer_id": 5617639587996, "first_name": "Customer First Name", "last_name": "Customer Last Name", "address1": "Address testing 01", "address2": "Address testing 02", "city": "City testing 01", "province": "Jharkhand", "country": "India", "zip": "831019", "phone": "phone Number", "name": "Customer Name", "province_code": "JH", "country_code": "IN", "country_name": "India" }, "email": "customer email", "lastOrder": { "cancelReason": null, "cancelledAt": null, "fullyPaid": false, "id": "4337222058140", "name": "#1589", "createdAt": "2021-10-26T09:40:28Z", "total_amount": "1.00", "currencyCode": "INR", //valid currency codes "shipment_details": { "status": "delivered", "tracking_info": "Tracking URL if present" }, "lineItems": [ { "image": { "originalSrc": "Expecting ImageURL" }, "product": { "id": "96054", "title": "Rum Chocolate" }, "variant": { "id": "40344786960540", "title": "Default Title", "price": "100.00", "weight": "1 kg", "sku": "" }, "variantTitle": "", "quantity": 2 } ] }}Error responses
Section titled “Error responses”{ "status": "failure", "statusCode": 400, "error": "Bad request!!"}{ "status": "failure", "statusCode": 500, "error": "Internal Server Error!!"}Get customer details by email ID
Section titled “Get customer details by email ID”Method: GET
URL: {{brand_domain_name}}/personal-details?email={{email_id}}
Success response
Section titled “Success response”{ "id": 5526366453916, "displayName": "Customer Name", "firstName": "Customer First Name", "lastName": "Customer Last Name", "ordersCount": 16, "totalSpent": "5229.00", "currencyCode": "INR", //valid currency codes "defaultAddress": { "id": 6697715433628, "customer_id": 5526366453916, "first_name": "Customer First Name", "last_name": "Customer Last Name", "address1": "Qw", "address2": "erty,uiop, asdf", "city": "", "province": "", "country": null, "zip": "987654", "phone": "phone number", "name": "Customer Name", "province_code": null, "country_code": null, "country_name": null, "default": false }, "email": "test@test.com", "lastOrder": { "cancelReason": "OTHER", "cancelledAt": "2021-10-09T11:57:15Z", "fullyPaid": false, "id": "4260628988060", "name": "#1385", "createdAt": "2021-09-29T16:43:22Z", "total_amount": "80.0", "currencyCode": "INR", //valid currency codes "shipment_details": { "status": "delivered", "tracking_info": "Tracking URL if present" }, "lineItems": [ { "image": { "originalSrc": "Expecting ImageURL" }, "product": { "title": "Honey Chocolate" }, "variant": { "id": "40470700359836", "title": "450gm", "price": "80.00", "weight": "1 kg" }, "quantity": 1 } ] }}Error responses
Section titled “Error responses”{ "status": "failure", "statusCode": 400, "error": "Bad request!!"}{ "status": "failure", "statusCode": 500, "error": "Internal Server Error!!"}Get the last 3 orders of a customer
Section titled “Get the last 3 orders of a customer”Method: GET
URL: {{brand_domain_name}}/get-orders/{{phone_number}}
Success response
Section titled “Success response”[ { "id": "4331283087516", "name": "#1581", "email": "test@gmail.com", "createdAt": "2021-10-23T15:40:19Z", "fullyPaid": false, "cancelReason": null, "cancelledAt": null, "shippingAddress": { "name": "", "phone": "", "address1": "", "address2": "", "city": "", "province": "", "country": null, "zip": null }, "total_amount": "180.0", "currencyCode": "INR", //valid currency codes "lineItems": [ { "image": { "originalSrc": "Expecting ImageURL" }, "product": { "id": "96054", "title": "Rum Chocolate" }, "variant": { "id": "40344786960540", "title": "Default Title", "price": "100.00", "weight": "1 kg", "sku": "" }, "variantTitle": "", "quantity": 2 } ], "shipment_details": { "status": "delivered", "tracking_info": "Tracking URL if present" } }, { "id": "4331283087516", "name": "#1581", "email": "test@gmail.com", "createdAt": "2021-10-23T15:40:19Z", "fullyPaid": false, "cancelReason": null, "cancelledAt": null, "shippingAddress": { "name": "", "phone": "", "address1": "", "address2": "", "city": "", "province": "", "country": null, "zip": null }, "total_amount": "180.0", "currencyCode": "INR", //valid currency codes "lineItems": [ { "image": { "originalSrc": "Expecting ImageURL" }, "product": { "id": "96054", "title": "Rum Chocolate" }, "variant": { "id": "40344786960540", "title": "Default Title", "price": "100.00", "weight": "1 kg", "sku": "" }, "variantTitle": "", "quantity": 2 } ], "shipment_details": { "status": "delivered", "tracking_info": "Tracking URL if present" } }, { "id": "4331283087516", "name": "#1581", "email": "test@gmail.com", "createdAt": "2021-10-23T15:40:19Z", "fullyPaid": false, "cancelReason": null, "cancelledAt": null, "shippingAddress": { "name": "", "phone": "", "address1": "", "address2": "", "city": "", "province": "", "country": null, "zip": null }, "total_amount": "180.0", "currencyCode": "INR", //valid currency codes "lineItems": [ { "image": { "originalSrc": "Expecting ImageURL" }, "product": { "id": "96054", "title": "Rum Chocolate" }, "variant": { "id": "40344786960540", "title": "Default Title", "price": "100.00", "weight": "1 kg", "sku": "" }, "variantTitle": "", "quantity": 2 } ], "shipment_details": { "status": "delivered", "tracking_info": "Tracking URL if present" } }]Error responses
Section titled “Error responses”{ "status": "failure", "statusCode": 400, "error": "Bad Request!!"}{ "status": "failure", "statusCode": 500, "error": "Internal Server Error!!"}Cancel an order
Section titled “Cancel an order”Method: POST
URL: {{brand_domain_name}}/cancel-order
Request body (JSON)
Section titled “Request body (JSON)”{ "id": "jvs" (order id), "cancellationReason": "string", "cancelledBy": "bot"}Success response
Section titled “Success response”{ "id": 5526366453916, "displayName": "Customer Name", "firstName": "Customer First Name", "lastName": "Customer Last Name", "ordersCount": 16, "totalSpent": "5229.00", "currencyCode": "INR", //valid currency codes, "defaultAddress": { "id": 6697715433628, "customer_id": 5526366453916, "first_name": "Customer First Name", "last_name": "Customer Last Name", "company": null, "address1": "Qw", "address2": "erty,uiop, asdf", "city": "", "province": "", "country": null, "zip": "987654", "phone": "phone number", "name": "Customer Name", "province_code": null, "country_code": null, "country_name": null, "default": false},"email": "test@test.com","lastOrder": { "cancelReason": "OTHER", "cancelledAt": "2021-10-09T11:57:15Z", "fullyPaid": false, "id": "4260628988060", "name": "#1385", "createdAt": "2021-09-29T16:43:22Z", "total_amount": "80.0", "shipment_details": { "status": "delivered", "tracking_info": "Tracking URL if present"},"lineItems": [ { "image": { "originalSrc": "Expecting ImageURL" }, "product": { "title": "Honey Chocolate" }, "variant": { "id": "40470700359836", "title": "450gm", "price": "80.00", "weight": "1 kg" }, "quantity": 1 } ] }}Error responses
Section titled “Error responses”{ "status": "failure", "statusCode": 400, "error": "Bad payload!!"}{ "status": "failure", "statusCode": 500, "error": "Internal Server Error!!"}Was this page helpful?
Thanks, this helps us improve this page.
Still stuck? Email support@businessonbot.com