Knowledge Hub

Search

Tutorials

FAQs

WhatsApp Strategies

Logo

BusinessOnBot Pvt. Ltd.

InstagramLinkedInYouTubeWhatsApp
Knowledge Hub
/
Categories
/
API DOCUMENTATION
/
NOTIFICATIONS API

NOTIFICATIONS API

Steps to enable notifications on your WhatsApp Bot via APIs.

  1. Contact support@businessonbot.com to get your guest API key and URL.

Once you’ve received the guest API key and URL, follow the steps below:

Introduction:

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.

API’s :

For all the APIs, BusinessOnBot will be passing the API KEY with the custom http header ‘x-guest-id’.

Order Confirmation

Method: POST

URL: {{businessonbot_domain_name}}/orders-create

Body (Format - JSON):

Success Response:

{
  "status": "success",
  "statusCode": 200
}

Error Responses:

{
  "status": "failure",
  "statusCode": 400,
  "error": "Bad payload!!"
}

Order Cancellation

Method: POST

URL: {{businessonbot_domain_name}}/orders-cancelled

Body (Format - JSON):

Success Response:

{
  "status": "success",
  "statusCode": 200
}

Error Responses:

{
  "status": "failure",
  "statusCode": 400,
  "error": "Bad payload!!"
}
{
  "status": "failure",
  "statusCode": 500,
  "error": "Internal Server Error!!"
}

Fulfillments Create

Method: POST

URL: {{businessonbot_domain_name}}/fulfillments-create

Body (Format - JSON):

Success Response:

{
  "status": "success",
  "statusCode": 200
}

Error Responses:

{
  "status": "failure",
  "statusCode": 400,
  "error": "Bad payload!!"
}
{
  "status": "failure",
  "statusCode": 500,
  "error": "Internal Server Error!!"
}

Order Delivery

Method: POST

URL: {{businessonbot_domain_name}}/fulfillments-events-create

Body (Format - 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:

{
  "status": "success",
  "statusCode": 200
}

Error Responses:

{
  "status": "failure",
  "statusCode": 400,
  "error": "Bad payload!!"
}
{
  "status": "failure",
  "statusCode": 500,
  "error": "Internal Server Error!!"
}

Abandoned Cart

Method: POST

URL: {{businessonbot_domain_name}}/abandoned-cart

Body (Format - JSON):

Success Response:

{
  "status": "success",
  "statusCode": 200
}

Error Responses:

{
  "status": "failure",
  "statusCode": 400,
  "error": "Bad payload!!"
}
{
  "status": "failure",
  "statusCode": 500,
  "error": "Internal Server Error!!"
}

Some APIs for Internal Usage

Get Order Details By Order ID

Method: GET

URL: {{brand_domain_name}}/order/{{orderId}}

Success Response:

Error Responses:

{
  "status": "failure",
  "statusCode": 400,
  "error": "Bad Request!!"
}
{
  "status": "failure",
  "statusCode": 500,
  "error": "Internal Server Error!!"
}

Get Customer Details By Phone Number

Method: GET

URL: {{brand_domain_name}}/personal-details/{{phone_number}}

Success Response:

Error Responses:

{
  "status": "failure",
  "statusCode": 400,
  "error": "Bad request!!"
}
{
  "status": "failure",
  "statusCode": 500,
  "error": "Internal Server Error!!"
}

Get Customer Details By Email ID

Method: GET

URL: {{brand_domain_name}}/personal-details?email={{email_id}}

Success Response:

Error Responses:

{
  "status": "failure",
  "statusCode": 400,
  "error": "Bad request!!"
}
{
  "status": "failure",
  "statusCode": 500,
  "error": "Internal Server Error!!"
}

Get Last 3 Orders of a Customer

Method: GET

URL: {{brand_domain_name}}/get-orders/{{phone_number}}

Success Response:

Error Responses:

{
  "status": "failure",
  "statusCode": 400,
  "error": "Bad Request!!"
}
{
  "status": "failure",
  "statusCode": 500,
  "error": "Internal Server Error!!"
}

Cancel An Order

Method: POST

URL: {{brand_domain_name}}/cancel-order

Body (Format - JSON):

{
  "id": "jvs" (order id),
  "cancellationReason": "string",
  "cancelledBy": "bot"
}

Success Response:

Error Responses:

{
  "status": "failure",
  "statusCode": 400,
  "error": "Bad payload!!"
}
{
  "status": "failure",
  "statusCode": 500,
  "error": "Internal Server Error!!"
}

Happy Coding!

{
  "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"
  }
}
{
  "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 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"
  }
}
{
  "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"
}
{
  "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"
}
{
  "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"
  }
}
{
  "id": 5617639587996,
  "displayName": "Customer Name",
  "firstName": "Customer First Name",
  "lastName": "Customer Last Name",
  "ordersCount": 27, (total orders palced by the customer till
now)
  "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
      }
    ]
  }
}
{
  "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
      }
    ]
  }
}
[
  {
    "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"
    }
  }
]
{
  "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
   }
  ]
 }
}