Create a promotion
Creates an item promotion on the product: its discount applies to the plans listed in plan_ids, which must belong to the product (at least one). The promotion is created active, or as a draft while the product has never been active.
Plans can be attached and detached later with attachPlanPromotion and detachPlanPromotion. Catalog divisions only.
Admins and Developers can obtain their Bolt API key from the Bolt Merchant Dashboard. Send it together with X-Publishable-Key.
In: header
Path Parameters
ID of the product.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "https://example.com/v1/subscriptions/products/sp_Tlj0Osm0N76T/promotions" \ -H "Content-Type: application/json" \ -d '{ "name": "Launch discount", "target": "item", "duration": "repeating", "allowed_cycle_counts": 3, "percent_off": 2000, "plan_ids": [ "spl_ba_PpkW16oIW" ], "codes": [ { "code": "LAUNCH20" } ] }'{ "id": "bcp_V9y3q4Jw8kQe", "name": "Launch discount", "status": "active", "target": "item", "automatic": true, "combinable": true, "priority": 0, "duration": "once", "percent_off": 0, "amount_off": 0, "currency": "USD", "minimum_amount": 0, "allowed_cycle_counts": 0, "max_redemptions": 0, "times_redeemed": 0, "allowed_customers": [ "string" ], "plan_ids": [ "string" ], "codes": [ { "id": "string", "code": "LAUNCH20", "active": true, "max_redemptions": 0, "times_redeemed": 0, "expires_at": "2019-08-24T14:15:22Z", "first_time_transaction": true } ], "redeem_by": "2019-08-24T14:15:22Z", "activated_at": "2019-08-24T14:15:22Z", "deactivated_at": "2019-08-24T14:15:22Z"}List a product's promotions GET
Retrieves the promotions on this product's plans, along with the division's cart promotions.
Delete a promotion DELETE
Deactivates the promotion. New carts stop receiving the discount; subscriptions that already captured it keep their terms. A promotion still in draft is deleted outright.