Receipt Template
Use the Receipt Template with the Send API to send a order confirmation, with the transaction summary and description for each item.

Example
curl -X POST -H "Content-Type: application/json" -d '{
"recipient":{
"id":"USER_ID"
},
"message":{
"attachment":{
"type":"template",
"payload":{
"template_type":"receipt",
"recipient_name":"Stephane Crozatier",
"order_number":"12345678902",
"currency":"USD",
"payment_method":"Visa 2345",
"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"
},
{
"title":"Classic Gray T-Shirt",
"subtitle":"100% Soft and Luxurious Cotton",
"quantity":1,
"price":25,
"currency":"USD",
"image_url":"http://petersapparel.parseapp.com/img/grayshirt.png"
}
],
"address":{
"street_1":"1 Hacker Way",
"street_2":"",
"city":"Menlo Park",
"postal_code":"94025",
"state":"CA",
"country":"US"
},
"summary":{
"subtotal":75.00,
"shipping_cost":4.95,
"total_tax":6.19,
"total_cost":56.14
},
"adjustments":[
{
"name":"New Customer Discount",
"amount":20
},
{
"name":"$10 Off Coupon",
"amount":10
}
]
}
}
}
}' "https://graph.facebook.com/v2.6/me/messages?access_token=PAGE_ACCESS_TOKEN" Fields
attachment object
| Property Name | Description | Required |
|---|---|---|
| Value must be | Y |
|
| Y |
payload object
| Property Name | Description | Type | Required |
|---|---|---|---|
| Value must be | String | Y |
| Recipient's name. | String | Y |
| Merchant's name. If present this is shown as logo text. | String | N |
| Order number. | String | Y, must be unique |
| Currency for order. | String | Y |
| Payment method details. This can be a custom string. ex: "Visa 1234". | String | Y |
| Timestamp of the order, in seconds. | String | N |
| URL of order. | String | N |
| Items in order. | Array of | N |
| Shipping address. |
| N |
| Payment summary. |
| Y |
| Payment adjustments. | Array of | N |
order_numbermust be unique for each userpayment_methodis required but is a String. You may insert an arbitrary string here but we recommend providing enough information for the person to decipher which payment method and account they used (e.g., the name of the payment method and partial account number)elementshas a maximum of 100elementssort order is not guaranteedaddressis optional. If you do not ship an item, you may omit these fieldsstatecan be a region or province for international addressesadjustmentsallow a way to insert adjusted pricing (e.g., sales). Adjustments are optional
element object
| Property Name | Description | Type | Required |
|---|---|---|---|
| Title of item | String | Y |
| Subtitle of item | String | N |
| Quantity of item | Number | N |
| Item price | Number | Y, but 0 is allowed |
| Currency of price | String | N |
| Image URL of item | String | N |
address object
| Property Name | Description | Type | Required |
|---|---|---|---|
| Street address, line 1 | String | Y, if |
| Street address, line 2 | String | N |
| City | String | Y, if |
| Postal code | String | Y, if |
| State abbreviation or Region/Province (international) | String | Y, if |
| Two-letter country abbreviation | String | Y, if |
summary object
| Property Name | Description | Type | Required |
|---|---|---|---|
| Subtotal | Number | N |
| Cost of shipping | Number | N |
| Total tax | Number | N |
| Total cost | Number | Y |
- These numbers should be valid and well formatted decimal numbers, using '
.' (dot) as the decimal separator. Note that most currencies only accept up to 2 decimal places.
adjustment object
| Property Name | Description | Type | Required |
|---|---|---|---|
| Name of adjustment | String | N |
| Adjustment amount | Number | N |