How subscription checkout works
CallPOST /store/carts/:id/subscribe in place of the standard cart-complete route when the cart contains a subscription item. Reorder reads the subscription configuration from line item metadata to determine the billing cadence and offer terms.
subscription.created activity-log event for that subscription. In Admin, operators will see the storefront customer as the actor for that first event.
Required line item metadata
Each subscription line item must include the following metadata fields:
These fields are the source of truth for the subscription’s cadence. Reorder reads them directly from the line item, regardless of any cart-level metadata.
Optional cart metadata
You can also setpurchase_mode on the cart itself to make the intent explicit:
If
purchase_mode is present, it must be set to "subscription". Any other value returns a 400 error.
Setting metadata before checkout
Set line item and cart metadata when the customer confirms their subscription selection. The example below shows a typical pre-checkout call using the Medusa JS SDK:Constraints
The subscribe endpoint enforces the following rules in the current release:- Exactly one subscription line item — the cart must contain a single subscription item. Multiple subscription line items are not supported.
- Quantity of 1 — the subscription line item must have a quantity of
1. - No mixed carts — a cart cannot combine subscription and one-time-purchase items. Submit a separate cart for one-time items.
400 error.