How to get the data from excel sheet and show it at the bot messenger like this

(Ahmed Mashal) #1

dear all,
i got one issue i have bot take the order from the customer and insert them at excel sheet add,update and delete also the calculation everything is going fine.
but now i need to show the bill for the customer after he finishing order.
i don’t know how i can make it like card as per this image its card if you press on it it will show the second card

did anyone have any solution like mentioned or similar , i don’t like to show the bill to show as only plain text typing .

thanks for all
Mashal

(Khashayar) #2

This is what Facebook calls the Receipt template

You can implement it by copy pasting this code into Bot > Make a Custom Request

{
  "attachment": {
    "type": "template",
    "payload": {
      "template_type": "receipt",
      "recipient_name": "Recipient Name",
      "order_number": "ORDERNUMBER",
      "currency": "USD",
      "payment_method": "Cash on Delivery",
      "order_url": "http://petersapparel.parseapp.com/order?order_id=123456",
      "timestamp": "1428444852",
      "elements": [
        {
          "title": "Classic White T-Shirt",
          "subtitle": "100% Soft and Luxurious Cotton",
          "quantity": 2,
          "price": 50,
          "currency": "USD",
          "image_url": "http://petersapparel.parseapp.com/img/whiteshirt.png"
        }
      ],
      "address": {
        "street_1": "1 Hacker Way",
        "street_2": "",
        "city": "Menlo Park",
        "postal_code": "94025",
        "state": "CA",
        "country": "US"
      },
      "summary": {
        "subtotal": 75,
        "shipping_cost": 4.95,
        "total_tax": 6.19,
        "total_cost": 56.14
      }
    }
  }
}

Of course, you would change the data to what you have from your Sheets.

Have a look at this page for more information on what each field is:
https://developers.facebook.com/docs/messenger-platform/send-api-reference/receipt-template

1 Like
(Ahmed Mashal) #3

thanks a lot for your cooperation