Commerce Layer links API

resource type

Operations 5

GET /links/{linkId} Retrieve a link #
PATCH /links/{linkId} Update a link #
DELETE /links/{linkId} Delete a link #

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-links-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-links-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Commerce Layer Links 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: links
  description: resource type
paths:
  /links:
    get:
      operationId: GET/links
      summary: List all links
      description: List all links
      tags:
      - links
      responses:
        '200':
          description: A list of link objects
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/linkResponseList'
    post:
      operationId: POST/links
      summary: Create a link
      description: Create a link
      tags:
      - links
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/linkCreate'
      responses:
        '201':
          description: The created link object
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/linkResponse'
  /links/{linkId}:
    get:
      operationId: GET/links/linkId
      summary: Retrieve a link
      description: Retrieve a link
      tags:
      - links
      parameters:
      - name: linkId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The link object
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/linkResponse'
    patch:
      operationId: PATCH/links/linkId
      summary: Update a link
      description: Update a link
      tags:
      - links
      parameters:
      - name: linkId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/linkUpdate'
      responses:
        '200':
          description: The updated link object
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/linkResponse'
    delete:
      operationId: DELETE/links/linkId
      summary: Delete a link
      description: Delete a link
      tags:
      - links
      parameters:
      - name: linkId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '204':
          description: No content
components:
  schemas:
    link:
      type: object
      properties:
        data:
          type: object
          required:
          - type
          - attributes
          properties:
            type:
              type: string
              description: The resource's type
              enum:
              - links
            attributes:
              type: object
              properties:
                name:
                  type: string
                  description: The link internal name.
                  example: FW SALE 2023
                  nullable: false
                client_id:
                  type: string
                  description: The link application client id, used to fetch JWT.
                  example: xxxx-yyyy-zzzz
                  nullable: false
                scope:
                  type: string
                  description: The link application scope, used to fetch JWT.
                  example: market:id:GhvCxsElAQ,market:id:kJhgVcxZDr
                  nullable: false
                starts_at:
                  type: string
                  description: The activation date/time of this link.
                  example: '2018-01-01T12:00:00.000Z'
                  nullable: true
                expires_at:
                  type: string
                  description: The expiration date/time of this link (must be after starts_at).
                  example: '2018-01-02T12:00:00.000Z'
                  nullable: true
                active:
                  type: boolean
                  description: Indicates if the link is active (enabled and not expired).
                  example: true
                  nullable: true
                status:
                  type: string
                  description: The link status. One of 'disabled', 'expired', 'pending', or 'active'.
                  example: pending
                  nullable: true
                  enum:
                  - disabled
                  - expired
                  - pending
                  - active
                domain:
                  type: string
                  description: The link URL second level domain.
                  example: commercelayer.link
                  nullable: true
                url:
                  type: string
                  description: The link URL.
                  example: https://commercelayer.link/ZXUtd2VzdC0xLzE5ZjBlMGVlLTg4OGMtNDQ1Yi1iYTA0LTg3MTUxY2FjZjFmYQ
                  nullable: true
                item_type:
                  type: string
                  description: The type of the associated item. One of 'orders', 'skus', or 'sku_lists'.
                  example: orders
                  nullable: true
                  enum:
                  - orders
                  - skus
                  - sku_lists
                params:
                  type: object
                  description: The link params to be passed in URL the query string.
                  example:
                    param1: ABC
                    param2: XYZ
                  nullable: true
                disabled_at:
                  type: string
                  description: Time at which this resource was disabled.
                  example: '2018-01-01T12:00:00.000Z'
                  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:
                item:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - orders
                          - skus
                          - sku_lists
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                  oneOf:
                  - $ref: '#/components/schemas/order'
                  - $ref: '#/components/schemas/sku'
                  - $ref: '#/components/schemas/skuList'
                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
                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
    klarnaPayment:
      type: object
      properties:
        data:
          type: object
          required:
          - type
          - attributes
          properties:
            type:
              type: string
              description: The resource's type
              enum:
              - klarna_payments
            attributes:
              type: object
              properties:
                session_id:
                  type: string
                  description: The identifier of the payment session.
                  example: xxxx-yyyy-zzzz
                  nullable: true
                client_token:
                  type: string
                  description: The public token linked to your API credential. Available upon session creation.
                  example: xxxx-yyyy-zzzz
                  nullable: true
                payment_methods:
                  type: array
                  description: The merchant available payment methods for the assoiated order. Available upon session creation.
                  example:
                  - foo: bar
                  nullable: false
                  items:
                    type: object
                auth_token:
                  type: string
                  description: The token returned by a successful client authorization, mandatory to place the order.
                  example: xxxx-yyyy-zzzz
                  nullable: true
                mismatched_amounts:
                  type: boolean
                  description: Indicates if the order current amount differs form the one of the created payment intent.
                  example: false
                  nullable: true
                payment_instrument:
                  type: object
                  description: Information about the payment instrument used in the transaction.
                  example:
                    issuer: cl bank
                    card_type: visa
                  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:
                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
                payment_gateway:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - payment_gateways
                        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
    linkResponse:
      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:
              - links
            links:
              type: object
              properties:
                self:
                  type: string
                  description: URL
            attributes:
              $ref: '#/components/schemas/link/properties/data/properties/attributes'
            relationships:
              type: object
              properties:
                item:
                  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:
                          - item
                        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
                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
    linkCreate:
      required:
      - data
      type: object
      properties:
        data:
          type: object
          required:
          - type
          - attributes
          properties:
            type:
              type: string
              description: The resource's type
              enum:
              - links
            attributes:
              type: object
              properties:
                name:
                  type: string
                  description: The link internal name.
                  example: FW SALE 2023
                client_id:
                  type: string
                  description: The link application client id, used to fetch JWT.
                  example: xxxx-yyyy-zzzz
                scope:
                  type: string
                  description: The link application scope, used to fetch JWT.
                  example: market:id:GhvCxsElAQ,market:id:kJhgVcxZDr
                starts_at:
                  type: string
                  description: The activation date/time of this link.
                  example: '2018-01-01T12:00:00.000Z'
                expires_at:
                  type: string
                  description: The expiration date/time of this link (must be after starts_at).
                  example: '2018-01-02T12:00:00.000Z'
                domain:
                  type: string
                  description: The link URL second level domain.
                  example: commercelayer.link
                item_type:
                  type: string
                  description: The type of the associated item. One of 'orders', 'skus', or 'sku_lists'.
                  example: orders
                  enum:
                  - orders
                  - skus
                  - sku_lists
                params:
                  type: object
                  description: The link params to be passed in URL the query string.
                  example:
                    param1: ABC
                    param2: XYZ
                _disable:
                  type: boolean
                  description: Send this attribute if you want to mark this resource as disabled.
                  example: true
                _enable:
                  type: boolean
                  description: Send this attribute if you want to mark this resource as enabled.
                  example: true
                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:
              - name
              - client_id
              - scope
            relationships:
              type: object
              properties:
                item:
                  required:
                  - data
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - orders
                          - skus
                          - sku_lists
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                  oneOf:
                  - $ref: '#/components/schemas/order'
                  - $ref: '#/components/schemas/sku'
                  - $ref: '#/components/schemas/skuList'
              required:
              - item
    order:
      type: object
      properties:
        data:
          type: object
          required:
          - type
          - attributes
          properties:
            type:
              type: string
              description: The resource's type
              enum:
              - orders
            attributes:
              type: object
              properties:
                number:
                  type: string
                  description: The order identifier. Can be specified if unique within the organization (for enterprise plans only), default to numeric ID otherwise. Cannot be passed by sales channels.
                  example: '1234'
                  nullable: true
                affiliate_code:
                  type: string
                  description: The affiliate code, if any, to track commissions using any third party services.
                  example: xxxx-yyyy-zzzz
                  nullable: true
                autorefresh:
                  type: boolean
                  description: Save this attribute as 'false' if you want prevent the order to be refreshed automatically at each change (much faster).
                  example: true
                  nullable: true
                place_async:
                  type: boolean
                  description: Save this attribute as 'true' if you want perform the place asynchronously. Payment errors, if any, will be collected afterwards.
                  example: true
                  nullable: true
                status:
                  type: string
                  description: The order status. One of 'draft' (default), 'pending', 'editing', 'placing', 'placed', 'approved', or 'cancelled'.
                  example: draft
                  nullable: false
                  enum:
                  - draft
                  - pending
                  - editing
                  - placing
                  - placed
                  - approved
                  - cancelled
                payment_status:
                  type: string
                  description: The order payment status. One of 'unpaid' (default), 'authorized', 'partially_authorized', 'paid', 'partially_paid', 'voided', 'partially_voided', 'refunded', 'partially_refunded', or 'free'.
                  example: unpaid
                  nullable: false
                  enum:
                  - unpaid
                  - authorized
                  - partially_authorized
                  - paid
                  - partially_paid
                  - voided
                  - partially_voided
                  - refunded
                  - partially_refunded
                  - free
                fulfillment_status:
                  type: string
                  description: The order fulfillment status. One of 'unfulfilled' (default), 'in_progress', 'fulfilled', or 'not_required'.
                  example: unfulfilled
                  nullable: false
                  enum:
                  - unfulfilled
                  - in_progress
                  - fulfilled
                  - not_required
                guest:
                  type: boolean
                  description: Indicates if the order has been placed as guest.
                  example: true
                  nullable: true
                editable:
                  type: boolean
                  description: Indicates if the order can be edited.
                  example: true
                  nullable: true
                customer_email:
                  type: string
                  description: The email address of the associated customer. When creating or updating an order, this is a shortcut to find or create the associated customer by email.
                  example: john@example.com
                  nullable: true
                customer_type:
                  type: string
                  description: The type of the associated customer. One of 'new', or 'returning'.
                  example: returning
                  nullable: true
                  enum:
                  - new
                  - returning
                language_code:
                  type: string
                  description: The preferred language code (ISO 639-1) to be used when communicating with the customer. This can be useful when sending the order to 3rd party marketing tools and CRMs. If the language is supported, the hosted checkout will be localized accordingly.
                  example: it
                  nullable: true
                currency_code:
                  type: string
                  description: The international 3-letter currency code as defined by the ISO 4217 standard, automatically inherited from the order's market.
                  example: EUR
                  nullable: true
                tax_included:
                  type: boolean
                  description: Indicates if taxes are included in the order amounts, automatically inherited from the order's price list.
                  example: true
                  nullable: true
                tax_rate:
                  type: number
                  description: The tax rate for this order (if calculated).
                  example: 0.22
                  nullable: true
                freight_taxable:
                  type: boolean
                  description: Indicates if taxes are applied to shipping costs.
                  example: true
                  nullable: true
                payment_method_taxable:
                  type: boolean
                  description: Indicates if taxes are applied to payment methods costs.
                  example: true
                  nullable: true
                adjustment_taxable:
                  type: boolean
                  description: Indicates if taxes are applied to positive adjustments.
                  example: true
                  nullable: true
                gift_card_taxable:
                  type: boolean
                  description: Indicates if taxes are applied to purchased gift cards.
                  example: false
                  nullable: true
                requires_billing_info:
                  type: boolean
                  description: Indicates if the billing address associated to this order requires billing info to be present.
                  example: false
                  nullable: true
                country_code:
                  type: string
                  description: The international 2-letter country code as defined by the ISO 3166-1 standard, automatically inherited from the order's shipping or billing addresses.
                  example: IT
                  nullable: true
                shipping_country_code_lock:
                  type: string
                  description: The country code that you want the shipping address to be locked to. This can be useful to make sure the shipping address belongs to a given shipping country, e.g. the one selected in a country selector page. Not relevant if order contains only digital products.
                  example: IT
                  nullable: true
                coupon_code:
                  type: string
                  description: The coupon code to be used for the order. If valid, it triggers a promotion adding a discount line item to the order.
                  example: SUMMERDISCOUNT
                  nullable: true
                gift_card_code:
                  type: string
                  description: The gift card code (at least the first 8 characters) to be used for the order. If valid, it uses the gift card balance to pay for the order.
                  example: cc92c23e-967e-48b2-a323-59add603301f
                  nullable: true
                subtotal_amount_cents:
                  type: integer
                  description: The sum of all the SKU line items total amounts, in cents.
                  example: 5000
                  nullable: true
                subtotal_amount_float:
                  type: number
                  description: The sum of all the SKU line items total amounts, float.
                  example: 50.0
                  nullable: true
                formatted_subtotal_amount:
                  type: string
                  description: The sum of all the SKU line items total amounts, formatted.
                  example: €50,00
                  nullable: true
                shipping_amount_cents:
                  type: integer
                  description: The sum of all the shipping costs, in cents.
                  example: 1200
                  nullable: true
                shipping_amount_float:
                  type: number
                  description: The sum of all the shipping costs, float.
                  example: 12.0
                  nullable: true
                formatted_shipping_amount:
                  type: string
                  description: The sum of all the shipping costs, formatted.
                  example: €12,00
                  nullable: true
                payment_method_amount_cents:
                  type: integer
                  description: The payment method costs, in cents.
                  example: 0
                  nullable: true
                payment_method_amount_float:
                  type: number
                  description: The payment method costs, float.
                  example: 0.0
                  nullable: true
                formatted_payment_method_amount:
                  type: string
                  description: The payment method costs, formatted.
                  example: €0,00
                  nullable: true
                discount_amount_cents:
                  type: integer
                  description: The sum of all the discounts applied to the order, in cents (negative amount).
                  example: -500
                  nullable: true
                discount_amount_float:
                  type: number
                  description: The sum of all the discounts applied to the order, float.
                  example: -5.0
          

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