
"payload": {
"template_type":"product",
"elements":[
{
"id":<PRODUCT_ID>
},
]
}
product_ids can be obtained via Catalog API or via Facebook Commerce Manager. Product template only supports product_ids owned by the same page.elements array of the payload."payload": {
"template_type":"product",
"elements":[
{
"id":<PRODUCT_ID_1>
},
{
"id":<PRODUCT_ID_2>
}
...
]
}
curl -X POST -H "Content-Type: application/json" -d '{ "recipient":{ "id":"<PSID>" }, "message":{ "attachment":{ "type":"template", "payload": { "template_type": "product", "elements": [ { "id": "<PRODUCT_ID_1>" }, { "id": "<PRODUCT_ID_2>" } ] } } } }' "https://graph.facebook.com/v8.0/me/messages?access_token=<PAGE_ACCESS_TOKEN>"
{
"recipient_id": "1254477777772919",
"message_id": "AG5Hz2Uq7tuwNEhXfYYKj8mJEM_QPpz5jdCK48PnKAjSdjfipqxqMvK8ma6AC8fplwlqLP_5cgXIbu7I3rBN0P"
}
| Code | Subcode | Message |
|---|---|---|
100 | 2018320 | Invalid product id. See Product Template |
100 | 2018328 | Product template is not supported below version 8. Use api version 8 or higher to use product templates. See Product Template |