Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create an order subscription

How to create an order subscription via API

To create a new order subscription, send a POST request to the /api/2026-05/order_subscriptions endpoint, passing the resource arguments in the request body.

Request

POST https://yourdomain.commercelayer.io/api/2026-05/order_subscriptions

Arguments

Body Parameter
Type
Required

type

string

Required

attributes.frequency

string

Required

attributes.activate_by_source_order

boolean

Optional, default is 'true'

attributes.place_target_order

boolean

Optional, default is 'true'

attributes.renewal_alert_period

integer

Optional, default is '1'

attributes.starts_at

string

Required, unless activate_by_source_order

attributes.expires_at

string

Optional

attributes.gift_card_code

string

Optional, required when the associated payment setting is a gift card one

attributes.reference

string

Optional

attributes.reference_origin

string

Optional

attributes.metadata

object

Optional

relationships.market

object

Optional

relationships.source_order

object

Required

relationships.payment_wallet

object

Optional

relationships.payment_setting

object

Optional

relationships.tags

array

Optional

Example

The following request creates a new order subscription:

On success, the API responds with a 201 Created status code, returning the created resource object:

Last updated