Attach a promotion to a plan
Attaches a promotion of the plan's product to the plan. The discount applies to new carts on that plan; running subscriptions are not re-priced. 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 plan.
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/plans/spl_ba_PpkW16oIW/promotions" \ -H "Content-Type: application/json" \ -d '{ "promotion_id": "bcp_V9y3q4Jw8kQe" }'{ "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"}Set a plan's trial PUT
Sets the plan's free trial, replacing any trial it already has. The trial applies to new subscriptions only; running subscriptions keep the terms they started with. Works on active products too. Catalog divisions only.
Detach a promotion from a plan DELETE
Detaches the promotion from the plan. New carts on the plan stop receiving the discount; subscriptions that already captured it keep their terms.