Commerce Layer order_subscriptions API

resource type

Operations 5

GET /order_subscriptions List all order subscriptions #
POST /order_subscriptions Create an order subscription #
GET /order_subscriptions/{orderSubscriptionId} Retrieve an order subscription #
PATCH /order_subscriptions/{orderSubscriptionId} Update an order subscription #
DELETE /order_subscriptions/{orderSubscriptionId} Delete an order subscription #

Documentation

Specifications

Schemas & Data

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/commerce-layer-order-subscriptions-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

commerce-layer-order-subscriptions-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Commerce Layer Order Subscriptions API
  version: 7.10.1
  contact:
    name: API Support
    url: https://commercelayer.io
    email: support@commercelayer.io
  description: Headless Commerce for Global Brands.
servers:
- url: https://{your_organization_slug}.commercelayer.io/api
  description: API
- url: https://core.commercelayer.io/users/sign_in
  description: Sign in
- url: https://docs.commercelayer.io/api
  description: API reference
security:
- bearerAuth: []
tags:
- name: order_subscriptions
  description: resource type
paths:
  /order_subscriptions:
    get:
      operationId: GET/order_subscriptions
      summary: List all order subscriptions
      description: List all order subscriptions
      tags:
      - order_subscriptions
      responses:
        '200':
          description: A list of order subscription objects
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/orderSubscriptionResponseList'
    post:
      operationId: POST/order_subscriptions
      summary: Create an order subscription
      description: Create an order subscription
      tags:
      - order_subscriptions
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/orderSubscriptionCreate'
      responses:
        '201':
          description: The created order subscription object
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/orderSubscriptionResponse'
  /order_subscriptions/{orderSubscriptionId}:
    get:
      operationId: GET/order_subscriptions/orderSubscriptionId
      summary: Retrieve an order subscription
      description: Retrieve an order subscription
      tags:
      - order_subscriptions
      parameters:
      - name: orderSubscriptionId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The order subscription object
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/orderSubscriptionResponse'
    patch:
      operationId: PATCH/order_subscriptions/orderSubscriptionId
      summary: Update an order subscription
      description: Update an order subscription
      tags:
      - order_subscriptions
      parameters:
      - name: orderSubscriptionId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/orderSubscriptionUpdate'
      responses:
        '200':
          description: The updated order subscription object
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/orderSubscriptionResponse'
    delete:
      operationId: DELETE/order_subscriptions/orderSubscriptionId
      summary: Delete an order subscription
      description: Delete an order subscription
      tags:
      - order_subscriptions
      parameters:
      - name: orderSubscriptionId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '204':
          description: No content
components:
  schemas:
    orderSubscriptionResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            id:
              type: string
              description: Unique identifier for the resource (hash).
              example: XAyRWNUzyN
            type:
              type: string
              description: The resource's type
              enum:
              - order_subscriptions
            links:
              type: object
              properties:
                self:
                  type: string
                  description: URL
            attributes:
              $ref: '#/components/schemas/orderSubscription/properties/data/properties/attributes'
            relationships:
              type: object
              properties:
                market:
                  type: object
                  properties:
                    links:
                      type: object
                      properties:
                        self:
                          type: string
                          description: URL
                        related:
                          type: string
                          description: URL
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - market
                        id:
                          type: string
                          description: The resource ID
                subscription_model:
                  type: object
                  properties:
                    links:
                      type: object
                      properties:
                        self:
                          type: string
                          description: URL
                        related:
                          type: string
                          description: URL
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - subscription_model
                        id:
                          type: string
                          description: The resource ID
                source_order:
                  type: object
                  properties:
                    links:
                      type: object
                      properties:
                        self:
                          type: string
                          description: URL
                        related:
                          type: string
                          description: URL
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - source_order
                        id:
                          type: string
                          description: The resource ID
                customer:
                  type: object
                  properties:
                    links:
                      type: object
                      properties:
                        self:
                          type: string
                          description: URL
                        related:
                          type: string
                          description: URL
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - customer
                        id:
                          type: string
                          description: The resource ID
                customer_payment_source:
                  type: object
                  properties:
                    links:
                      type: object
                      properties:
                        self:
                          type: string
                          description: URL
                        related:
                          type: string
                          description: URL
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - customer_payment_source
                        id:
                          type: string
                          description: The resource ID
                order_subscription_items:
                  type: object
                  properties:
                    links:
                      type: object
                      properties:
                        self:
                          type: string
                          description: URL
                        related:
                          type: string
                          description: URL
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - order_subscription_items
                        id:
                          type: string
                          description: The resource ID
                order_factories:
                  type: object
                  properties:
                    links:
                      type: object
                      properties:
                        self:
                          type: string
                          description: URL
                        related:
                          type: string
                          description: URL
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - order_factories
                        id:
                          type: string
                          description: The resource ID
                recurring_order_copies:
                  type: object
                  properties:
                    links:
                      type: object
                      properties:
                        self:
                          type: string
                          description: URL
                        related:
                          type: string
                          description: URL
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - recurring_order_copies
                        id:
                          type: string
                          description: The resource ID
                orders:
                  type: object
                  properties:
                    links:
                      type: object
                      properties:
                        self:
                          type: string
                          description: URL
                        related:
                          type: string
                          description: URL
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - orders
                        id:
                          type: string
                          description: The resource ID
                events:
                  type: object
                  properties:
                    links:
                      type: object
                      properties:
                        self:
                          type: string
                          description: URL
                        related:
                          type: string
                          description: URL
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - events
                        id:
                          type: string
                          description: The resource ID
                tags:
                  type: object
                  properties:
                    links:
                      type: object
                      properties:
                        self:
                          type: string
                          description: URL
                        related:
                          type: string
                          description: URL
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - tags
                        id:
                          type: string
                          description: The resource ID
                event_stores:
                  type: object
                  properties:
                    links:
                      type: object
                      properties:
                        self:
                          type: string
                          description: URL
                        related:
                          type: string
                          description: URL
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - event_stores
                        id:
                          type: string
                          description: The resource ID
    orderSubscription:
      type: object
      properties:
        data:
          type: object
          required:
          - type
          - attributes
          properties:
            type:
              type: string
              description: The resource's type
              enum:
              - order_subscriptions
            attributes:
              type: object
              properties:
                number:
                  type: string
                  description: Unique identifier for the subscription (numeric).
                  example: '1234'
                  nullable: true
                status:
                  type: string
                  description: The subscription status. One of 'draft' (default), 'inactive', 'active', 'running', or 'cancelled'.
                  example: draft
                  nullable: false
                  enum:
                  - draft
                  - inactive
                  - active
                  - running
                  - cancelled
                frequency:
                  type: string
                  description: The frequency of the subscription. Use one of the supported within 'hourly', 'daily', 'weekly', 'monthly', 'two-month', 'three-month', 'four-month', 'six-month', 'yearly', or provide your custom crontab expression (min unit is hour). Must be supported by existing associated subscription_model.
                  example: monthly
                  nullable: false
                activate_by_source_order:
                  type: boolean
                  description: Indicates if the subscription will be activated considering the placed source order as its first run.
                  example: true
                  nullable: true
                place_target_order:
                  type: boolean
                  description: Indicates if the subscription created orders are automatically placed at the end of the copy.
                  example: true
                  nullable: true
                renewal_alert_period:
                  type: integer
                  description: Indicates the number of hours the renewal alert will be triggered before the subscription next run. Must be included between 1 and 720 hours.
                  example: 1
                  nullable: true
                customer_email:
                  type: string
                  description: The email address of the customer, if any, associated to the source order.
                  example: john@example.com
                  nullable: true
                starts_at:
                  type: string
                  description: The activation date/time of this subscription.
                  example: '2018-01-01T12:00:00.000Z'
                  nullable: true
                expires_at:
                  type: string
                  description: The expiration date/time of this subscription (must be after starts_at).
                  example: '2018-01-02T12:00:00.000Z'
                  nullable: true
                last_run_at:
                  type: string
                  description: The date/time of the subscription last run.
                  example: '2018-01-01T12:00:00.000Z'
                  nullable: true
                next_run_at:
                  type: string
                  description: The date/time of the subscription next run. Can be updated but only in the future, to copy with frequency changes.
                  example: '2018-01-01T12:00:00.000Z'
                  nullable: true
                occurrencies:
                  type: integer
                  description: The number of times this subscription has run.
                  example: 2
                  nullable: true
                errors_count:
                  type: integer
                  description: Indicates the number of subscription errors, if any.
                  example: 3
                  nullable: true
                succeeded_on_last_run:
                  type: boolean
                  description: Indicates if the subscription has succeeded on its last run.
                  example: true
                  nullable: true
                created_at:
                  type: string
                  description: Time at which the resource was created.
                  example: '2018-01-01T12:00:00.000Z'
                  nullable: false
                updated_at:
                  type: string
                  description: Time at which the resource was last updated.
                  example: '2018-01-01T12:00:00.000Z'
                  nullable: false
                reference:
                  type: string
                  description: A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.
                  example: ANY-EXTERNAL-REFEFERNCE
                  nullable: true
                reference_origin:
                  type: string
                  description: Any identifier of the third party system that defines the reference code.
                  example: ANY-EXTERNAL-REFEFERNCE-ORIGIN
                  nullable: true
                metadata:
                  type: object
                  description: Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.
                  example:
                    foo: bar
                  nullable: true
            relationships:
              type: object
              properties:
                market:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - markets
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                subscription_model:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - subscription_models
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                source_order:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - orders
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                customer:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - customers
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                customer_payment_source:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - customer_payment_sources
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                order_subscription_items:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - order_subscription_items
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                order_factories:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - order_factories
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                recurring_order_copies:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - recurring_order_copies
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                orders:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - orders
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                events:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - events
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                tags:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - tags
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                event_stores:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - event_stores
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
    orderSubscriptionCreate:
      required:
      - data
      type: object
      properties:
        data:
          type: object
          required:
          - type
          - attributes
          properties:
            type:
              type: string
              description: The resource's type
              enum:
              - order_subscriptions
            attributes:
              type: object
              properties:
                frequency:
                  type: string
                  description: The frequency of the subscription. Use one of the supported within 'hourly', 'daily', 'weekly', 'monthly', 'two-month', 'three-month', 'four-month', 'six-month', 'yearly', or provide your custom crontab expression (min unit is hour). Must be supported by existing associated subscription_model.
                  example: monthly
                activate_by_source_order:
                  type: boolean
                  description: Indicates if the subscription will be activated considering the placed source order as its first run.
                  example: true
                place_target_order:
                  type: boolean
                  description: Indicates if the subscription created orders are automatically placed at the end of the copy.
                  example: true
                renewal_alert_period:
                  type: integer
                  description: Indicates the number of hours the renewal alert will be triggered before the subscription next run. Must be included between 1 and 720 hours.
                  example: 1
                starts_at:
                  type: string
                  description: The activation date/time of this subscription.
                  example: '2018-01-01T12:00:00.000Z'
                expires_at:
                  type: string
                  description: The expiration date/time of this subscription (must be after starts_at).
                  example: '2018-01-02T12:00:00.000Z'
                reference:
                  type: string
                  description: A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.
                  example: ANY-EXTERNAL-REFEFERNCE
                reference_origin:
                  type: string
                  description: Any identifier of the third party system that defines the reference code.
                  example: ANY-EXTERNAL-REFEFERNCE-ORIGIN
                metadata:
                  type: object
                  description: Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.
                  example:
                    foo: bar
              required:
              - frequency
            relationships:
              type: object
              properties:
                market:
                  required:
                  - data
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - markets
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                source_order:
                  required:
                  - data
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - orders
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                tags:
                  required:
                  - data
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - tags
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
              required:
              - source_order
    orderSubscriptionResponseList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/orderSubscriptionResponse/properties/data'
    orderSubscriptionUpdate:
      required:
      - data
      type: object
      properties:
        data:
          type: object
          required:
          - type
          - id
          - attributes
          properties:
            type:
              type: string
              description: The resource's type
              enum:
              - order_subscriptions
            id:
              type: string
              description: Unique identifier for the resource (hash).
              example: XAyRWNUzyN
            attributes:
              type: object
              properties:
  

# --- truncated at 32 KB (37 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/commerce-layer/refs/heads/main/openapi/commerce-layer-order-subscriptions-api-openapi.yml