fbbotw.post_receipt_template

fbbotw.post_receipt_template(fbid, recipient_name, order_number, currency, payment_method, summary, merchant_name=”, timestamp=”, order_url=”, elements=None, address=None, adjustments=None, sharable=True, messaging_type=’RESPONSE’, tag=None)[source]

Sends a receipt template for the specified user

Parameters:
  • fbid (str) – User id to send the receipt template.
  • recipient_name (str) – Recipient’s name.
  • order_number (str) – Unique order number.
  • currency (str) – Currency for order.
  • payment_method (str) – Payment method details. ex - “Visa 1234”.
  • summary (dict) –

    Payment summary, format :

    >>> summary = {
      “subtotal”: 75.00,
      “shipping_cost”: 4.95,
      “total_tax”: 6.19,
      “total_cost”: 56.14
    }
    
  • merchant_name (str) – Optional. The merchant’s name. If present this is shown as logo text.
  • timestamp (str) – Timestamp of the order, in seconds.
  • order_url (str) – URL of order.
  • elements (list) –

    Items in order (Max 100), format :

    >>> elements = [
      {
        “title”: “Classic White T-Shirt”,
        “subtitle”: “100% Soft and Luxurious Cotton”,
        “quantity”: 2,
        “price”: 50,
        “currency”: “USD”,
        “image_url”: “http://i.imgur.com/GHC4ZHl.jpg”
      },
      {
        “title”: “Classic Gray T-Shirt”,
        “subtitle”: “100% Soft and Luxurious Cotton”,
        “quantity”: 1,
        “price”: 25,
        “currency”: “USD”,
        “image_url”: “http://i.imgur.com/GHC4ZHl.jpg”
      }
    ],
    
  • address (dict) –

    Shipping address (If order has shipping), format :

    >>> address = {
      “street_1”: “1 Hacker Way”,
      “street_2”: “”,
      “city”: “Menlo Park”,
      “postal_code”: “94025”,
      “state”: “CA”,
      “country”: “US”
    }
    
  • adjustments (list) –

    Payment adjustments, format :

    >>> adjustments = [
      {
        “name”:”New Customer Discount”,
        “amount”:20
      },
      {
        “name”:”$10 Off Coupon”,
        “amount”:10
      }
    ]
    
  • sharable (bool) – Able/Disable native share button in Messenger for the template message (Default: True).
  • messaging_type (str) – Identifies the message type from: RESPONSE, UPDATE AND MESSAGE_TAG (Default: RESPONSE, if MESSAGE_TAG, tag param is required)
  • tag (str) – Tag classifying the message, must be one of the following tags
Returns:

Response object

Facebook docs:

/receipt-template