Use the Promotions API to manage promotions on your commerce account.
Returns all promotions applied to an order. See Get Order Details API for more information. Returned attributes must be specified as fields in the request.
curl -X GET -G \ -d 'access_token=<ACCESS_TOKEN>' \ -d 'fields=promotion_details{applied_after_tax,applied_amount,campaign_name,promotion_id,target_granularity,sponsor,coupon_code,retailer_id}' \ https://graph.facebook.com/<ORDER_ID>
Attribute | Type | Description |
---|---|---|
| Details about promotions applied to an order. |
promotion_details
objectAttribute | Type | Description |
---|---|---|
| boolean | Promotion is applied after tax ( |
| Total discount amount. | |
| string | Promotion campaign name. |
| string | Unique ID representing the promotion. |
| The granularity of the promotion. For example, | |
| Entity sponsoring the promotion. | |
| string | Coupon code label. |
| string | Unique coupon ID used to identify the coupon in the merchant system. |
currency_amount
objectAttribute | Type | Description |
---|---|---|
| string | Amount in decimal format. Example: |
| string | Three digit ISO-4217-3 code for the amount, e.g. USD. |
sponsor enum
Value | Description |
---|---|
| Promotion sponsored by the merchant. |
| Promotion sponsored by Meta. |
offer target granularity enum
Value | Description |
---|---|
| Discount is applied to each target product item included at checkout (e.g., a $5.00 discount targeting all footwear would deduct $5.00 for each pair of shoes in a user's shopping cart at checkout.) |
| Discount is applied per merchant order and distributed across the target items (e.g., a coupon for $10 off an entire order). |
curl -X GET -G \ -d 'access_token=<ACCESS_TOKEN>' \ -d 'fields=promotion_details{promotion_id,retailer_id,applied_amount,campaign_name,target_granularity}' \ https://graph.facebook.com/<ORDER_ID>
{ "promotion_details": { "data": [ { "promotion_id": "123456789", "applied_amount": { "amount": "0.60", "currency": "USD" }, "campaign_name": "$0.60 off", "target_granularity": "order_level" }, { "promotion_id": "987654321", "retailer_id": "sample_retailer_id", "applied_amount": { "amount": "23.00", "currency": "USD" }, "campaign_name": "$23 Off", "target_granularity": "order_level" } ] } }
Promotions applied to an Order Item. See List Order Items for more information.
curl -X GET -G \ -d 'access_token=<ACCESS_TOKEN>' \ -d 'fields=promotion_details{applied_after_tax,applied_amount,campaign_name,target_granularity,promotion_id,sponsor,coupon_code,retailer_id}' \ https://graph.facebook.com/<ORDER_ID>/items
Attribute | Type | Description |
---|---|---|
| Details about promotions applied to an item. |
curl -X GET -G \ -d 'access_token=<ACCESS_TOKEN>' \ -d 'fields=promotion_details{applied_after_tax,applied_amount,campaign_name,promotion_id,target_granularity,sponsor,retailer_id}' \ https://graph.facebook.com/<ORDER_ID>/items
{ "data": [ { "promotion_details": { "data": [ { "applied_after_tax": true, "applied_amount": { "amount": "0.60", "currency": "USD" }, "campaign_name": "$0.60 off", "promotion_id": "123456789", "sponsor": "facebook", "target_granularity": "item_level" }, { "applied_after_tax": false, "applied_amount": { "amount": "23.00", "currency": "USD" }, "campaign_name": "$23 Off", "promotion_id": "987654321", "sponsor": "merchant", "retailer_id": "sample_retailer_id", "target_granularity": "item_level" } ] } } ], }