Messenger components
These components only work on Facebook Messenger and Meya's live chat
meya.receipt
A receipt card that outputs a variety of information pertaining to a purchase.
Support
Currently only Messenger and Meya Live chat support the receipt card.
Property | Description | |
---|---|---|
recipient_name | the name of the purchaser | Required |
order_number | the order number (must be unique) | Required |
currency | the currency in which the purchase was made | Required |
payment_method | a shorthand string to show the purchase method (e.g. Visa 1234) | Required |
summary | a summary of the purchase, including total | Required total_cost: the total cost of the order Required* shipping_cost: the cost of shipping subtotal: the total before tax * total_tax: the total tax |
elements | the list of elements purchased | Required title: the title of the item purchased Required* subtitle: a descriptor of the item purchased image_url: an image url of the item purchased quantity: the number of items purchased price: the price of the item currency: the currency of the price |
address | the shipping address | street_1: the shipping address street info Required* street_2: a second line for the shipping address street info city: the shipping address city Required state: the shipping address state Required* postal_code: the shipping address postal_code (or zip code) Required* country: the shipping address country Required* |
adjustments | the list of adjustments made to the price | name: the name of the adjustment amount: the amount of the adjustment |
timestamp | the time the purchase was made | |
order_url | a link to more purchase information |
Example of a receipt card in a flow and custom component.
component: meya.receipt
properties:
recipient_name: Nikola Tesla
order_number: "123456789"
currency: USD
payment_method: Mastercard 1234
summary:
subtotal: 42.00
total_cost: 45.00
elements:
- title: Red bag flux
price: 22.00
image_url: 'http://i.imgur.com/1c3xI4a.jpg'
- title: Blue bag coil
price: 20
image_url: 'http://i.imgur.com/FdF9EXB.jpg'
address:
street_1: 125 Main St
postal_code: "123456"
city: Megacity
state: 'OH'
country: USA
adjustments:
- name: New customer
amount: 5
from meya.cards import Receipt
receipt_data = {
'recipient_name': 'Nikola Tesla',
'order_number': '123456789',
'currency': "CAD",
'payment_method': "Mastercard 1234",
'order_url': "https://meya.ai/asdfasdf",
'timestamp': "1465492181",
'summary': {
'subtotal': 42.00,
'total_cost': 45.22
},
'elements': [
{
'title': "Red bag flux",
'price': 22,
'image_url': "http://i.imgur.com/1c3xI4a.jpg"
},
{
'title': "Blue bag coil",
'price': 20,
}
],
'address': {
'street_1': "125 Main St.",
'street_2': "Unit 100",
'postal_code': "1234562",
'city': "Megacity",
'state': "OH",
'country': "USA",
},
'adjustments': [
{
'name': "New customer",
'amount': 5.00
}
]
}
card = Receipt(payload=receipt_data)
Updated over 6 years ago