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
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.options
object
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:
On success, the API responds with a 201 Created status code, returning the created resource object:
Last updated