Commerce Layer coupons API

resource type

Operations 5

GET /coupons List all coupons #
POST /coupons Create a coupon #
GET /coupons/{couponId} Retrieve a coupon #
PATCH /coupons/{couponId} Update a coupon #
DELETE /coupons/{couponId} Delete a coupon #

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-coupons-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-coupons-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Commerce Layer Coupons 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: coupons
  description: resource type
paths:
  /coupons:
    get:
      operationId: GET/coupons
      summary: List all coupons
      description: List all coupons
      tags:
      - coupons
      responses:
        '200':
          description: A list of coupon objects
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/couponResponseList'
    post:
      operationId: POST/coupons
      summary: Create a coupon
      description: Create a coupon
      tags:
      - coupons
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/couponCreate'
      responses:
        '201':
          description: The created coupon object
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/couponResponse'
  /coupons/{couponId}:
    get:
      operationId: GET/coupons/couponId
      summary: Retrieve a coupon
      description: Retrieve a coupon
      tags:
      - coupons
      parameters:
      - name: couponId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The coupon object
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/couponResponse'
    patch:
      operationId: PATCH/coupons/couponId
      summary: Update a coupon
      description: Update a coupon
      tags:
      - coupons
      parameters:
      - name: couponId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/couponUpdate'
      responses:
        '200':
          description: The updated coupon object
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/couponResponse'
    delete:
      operationId: DELETE/coupons/couponId
      summary: Delete a coupon
      description: Delete a coupon
      tags:
      - coupons
      parameters:
      - name: couponId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '204':
          description: No content
components:
  schemas:
    couponResponseList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/couponResponse/properties/data'
    couponResponse:
      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:
              - coupons
            links:
              type: object
              properties:
                self:
                  type: string
                  description: URL
            attributes:
              $ref: '#/components/schemas/coupon/properties/data/properties/attributes'
            relationships:
              type: object
              properties:
                promotion_rule:
                  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:
                          - promotion_rule
                        id:
                          type: string
                          description: The resource ID
                coupon_recipient:
                  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:
                          - coupon_recipient
                        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
    couponCreate:
      required:
      - data
      type: object
      properties:
        data:
          type: object
          required:
          - type
          - attributes
          properties:
            type:
              type: string
              description: The resource's type
              enum:
              - coupons
            attributes:
              type: object
              properties:
                code:
                  type: string
                  description: The coupon code, that uniquely identifies the coupon within the promotion rule.
                  example: 04371af2-70b3-48d7-8f4e-316b374224c3
                customer_single_use:
                  type: boolean
                  description: Indicates if the coupon can be used just once per customer.
                  example: false
                usage_limit:
                  type: integer
                  description: The total number of times this coupon can be used.
                  example: 50
                recipient_email:
                  type: string
                  description: The email address of the associated recipient. When creating or updating a coupon, this is a shortcut to find or create the associated recipient by email.
                  example: john@example.com
                expires_at:
                  type: string
                  description: Time at which the coupon will expire.
                  example: '2018-01-01T12: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:
              - code
            relationships:
              type: object
              properties:
                promotion_rule:
                  required:
                  - data
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - coupon_codes_promotion_rules
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                coupon_recipient:
                  required:
                  - data
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - coupon_recipients
                        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:
              - promotion_rule
    coupon:
      type: object
      properties:
        data:
          type: object
          required:
          - type
          - attributes
          properties:
            type:
              type: string
              description: The resource's type
              enum:
              - coupons
            attributes:
              type: object
              properties:
                code:
                  type: string
                  description: The coupon code, that uniquely identifies the coupon within the promotion rule.
                  example: 04371af2-70b3-48d7-8f4e-316b374224c3
                  nullable: false
                customer_single_use:
                  type: boolean
                  description: Indicates if the coupon can be used just once per customer.
                  example: false
                  nullable: true
                usage_limit:
                  type: integer
                  description: The total number of times this coupon can be used.
                  example: 50
                  nullable: true
                usage_count:
                  type: integer
                  description: The number of times this coupon has been used.
                  example: 20
                  nullable: true
                recipient_email:
                  type: string
                  description: The email address of the associated recipient. When creating or updating a coupon, this is a shortcut to find or create the associated recipient by email.
                  example: john@example.com
                  nullable: true
                expires_at:
                  type: string
                  description: Time at which the coupon will expire.
                  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:
                promotion_rule:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - coupon_codes_promotion_rules
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                coupon_recipient:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - coupon_recipients
                        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
    couponUpdate:
      required:
      - data
      type: object
      properties:
        data:
          type: object
          required:
          - type
          - id
          - attributes
          properties:
            type:
              type: string
              description: The resource's type
              enum:
              - coupons
            id:
              type: string
              description: Unique identifier for the resource (hash).
              example: XAyRWNUzyN
            attributes:
              type: object
              properties:
                code:
                  type: string
                  description: The coupon code, that uniquely identifies the coupon within the promotion rule.
                  example: 04371af2-70b3-48d7-8f4e-316b374224c3
                  nullable: false
                customer_single_use:
                  type: boolean
                  description: Indicates if the coupon can be used just once per customer.
                  example: false
                  nullable: false
                usage_limit:
                  type: integer
                  description: The total number of times this coupon can be used.
                  example: 50
                  nullable: true
                recipient_email:
                  type: string
                  description: The email address of the associated recipient. When creating or updating a coupon, this is a shortcut to find or create the associated recipient by email.
                  example: john@example.com
                  nullable: true
                expires_at:
                  type: string
                  description: Time at which the coupon will expire.
                  example: '2018-01-01T12:00:00.000Z'
                  nullable: true
                _add_tags:
                  type: string
                  description: Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.
                _remove_tags:
                  type: string
                  description: Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.
                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:
                promotion_rule:
                  required:
                  - data
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - coupon_codes_promotion_rules
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                coupon_recipient:
                  required:
                  - data
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - coupon_recipients
                        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
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT