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/order_subscriptions endpoint, passing the resource arguments in the request body.

Request

POST https://yourdomain.commercelayer.io/api/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

datetime

Required, unless activate_by_source_order

attributes.expires_at

datetime

Optional

attributes.reference

string

Optional

attributes.reference_origin

string

Optional

attributes.metadata

object

Optional

relationships.market

object

Optional

relationships.source_order

object

Required

relationships.tags

array

Optional

Example

The following request creates a new order subscription:

Last updated