Commerce Layer customers API

resource type

Operations 5

GET /customers List all customers #
POST /customers Create a customer #
GET /customers/{customerId} Retrieve a customer #
PATCH /customers/{customerId} Update a customer #
DELETE /customers/{customerId} Delete a customer #

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-customers-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-customers-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Commerce Layer Customers 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: customers
  description: resource type
paths:
  /customers:
    get:
      operationId: GET/customers
      summary: List all customers
      description: List all customers
      tags:
      - customers
      responses:
        '200':
          description: A list of customer objects
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/customerResponseList'
    post:
      operationId: POST/customers
      summary: Create a customer
      description: Create a customer
      tags:
      - customers
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/customerCreate'
      responses:
        '201':
          description: The created customer object
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/customerResponse'
  /customers/{customerId}:
    get:
      operationId: GET/customers/customerId
      summary: Retrieve a customer
      description: Retrieve a customer
      tags:
      - customers
      parameters:
      - name: customerId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The customer object
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/customerResponse'
    patch:
      operationId: PATCH/customers/customerId
      summary: Update a customer
      description: Update a customer
      tags:
      - customers
      parameters:
      - name: customerId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/customerUpdate'
      responses:
        '200':
          description: The updated customer object
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/customerResponse'
    delete:
      operationId: DELETE/customers/customerId
      summary: Delete a customer
      description: Delete a customer
      tags:
      - customers
      parameters:
      - name: customerId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '204':
          description: No content
components:
  schemas:
    customerUpdate:
      required:
      - data
      type: object
      properties:
        data:
          type: object
          required:
          - type
          - id
          - attributes
          properties:
            type:
              type: string
              description: The resource's type
              enum:
              - customers
            id:
              type: string
              description: Unique identifier for the resource (hash).
              example: XAyRWNUzyN
            attributes:
              type: object
              properties:
                email:
                  type: string
                  description: The customer's email address.
                  example: john@example.com
                  nullable: false
                password:
                  type: string
                  description: The customer's password. Initiate a customer password reset flow if you need to change it.
                  example: secret
                shopper_reference:
                  type: string
                  description: A reference to uniquely identify the shopper during payment sessions.
                  example: xxx-yyy-zzz
                  nullable: true
                profile_id:
                  type: string
                  description: A reference to uniquely identify the customer on any connected external services.
                  example: xxx-yyy-zzz
                  nullable: true
                tax_exemption_code:
                  type: string
                  description: A specific code to identify the tax exemption reason for this customer.
                  example: xxx-yyy-zzz
                  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
                _request_anonymization:
                  type: boolean
                  description: Send this attribute if you want to trigger anonymization. Cannot be passed by sales channels.
                  example: true
                  nullable: false
                _cancel_anonymization:
                  type: boolean
                  description: Send this attribute if you want to trigger a cancellation of anonymization. Cannot be passed by sales channels.
                  example: true
                  nullable: false
            relationships:
              type: object
              properties:
                customer_group:
                  required:
                  - data
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - customer_groups
                        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
    customerResponse:
      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:
              - customers
            links:
              type: object
              properties:
                self:
                  type: string
                  description: URL
            attributes:
              $ref: '#/components/schemas/customer/properties/data/properties/attributes'
            relationships:
              type: object
              properties:
                customer_group:
                  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_group
                        id:
                          type: string
                          description: The resource ID
                customer_addresses:
                  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_addresses
                        id:
                          type: string
                          description: The resource ID
                customer_payment_sources:
                  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_sources
                        id:
                          type: string
                          description: The resource ID
                customer_subscriptions:
                  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_subscriptions
                        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
                order_subscriptions:
                  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_subscriptions
                        id:
                          type: string
                          description: The resource ID
                returns:
                  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:
                          - returns
                        id:
                          type: string
                          description: The resource ID
                sku_lists:
                  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:
                          - sku_lists
                        id:
                          type: string
                          description: The resource ID
                attachments:
                  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:
                          - attachments
                        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
                jwt_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:
                          - jwt_customer
                        id:
                          type: string
                          description: The resource ID
                jwt_markets:
                  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:
                          - jwt_markets
                        id:
                          type: string
                          description: The resource ID
                jwt_stock_locations:
                  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:
                          - jwt_stock_locations
                        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
    customer:
      type: object
      properties:
        data:
          type: object
          required:
          - type
          - attributes
          properties:
            type:
              type: string
              description: The resource's type
              enum:
              - customers
            attributes:
              type: object
              properties:
                email:
                  type: string
                  description: The customer's email address.
                  example: john@example.com
                  nullable: false
                status:
                  type: string
                  description: The customer's status. One of 'prospect' (default), 'acquired', or 'repeat'.
                  example: prospect
                  nullable: false
                  enum:
                  - prospect
                  - acquired
                  - repeat
                has_password:
                  type: boolean
                  description: Indicates if the customer has a password.
                  example: false
                  nullable: true
                total_orders_count:
                  type: integer
                  description: The total number of orders for the customer.
                  example: 6
                  nullable: true
                shopper_reference:
                  type: string
                  description: A reference to uniquely identify the shopper during payment sessions.
                  example: xxx-yyy-zzz
                  nullable: true
                profile_id:
                  type: string
                  description: A reference to uniquely identify the customer on any connected external services.
                  example: xxx-yyy-zzz
                  nullable: true
                tax_exemption_code:
                  type: string
                  description: A specific code to identify the tax exemption reason for this customer.
                  example: xxx-yyy-zzz
                  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
                jwt_custom_claim:
                  type: object
                  description: The custom_claim attached to the current JWT (if any).
                  example: {}
                  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
                anonymization_info:
                  type: object
                  description: The anonymization info object.
                  example:
                    status: requested
                    requested_at: 2025-03-15 11:39:21 UTC
                    requester:
                      id: fdgt56hh
                      first_name: Travis
                      last_name: Muller
                      email: test@labadie.test
                  properties:
                    status:
                      type: string
                      description: The status of the anonymization.
                    requested_at:
                      type: string
                      description: The time when the anonymization was requested.
                    started_at:
                      type: string
                      description: The time when the anonymization request was started.
                    completed_at:
                      type: string
                      description: The time when the anonymization request was completed.
                    failed_at:
                      type: string
                      description: The time when the anonymization request failed.
                    cancelled_at:
                      type: string
                      description: The time when the anonymization request was cancelled.
                    requester:
                      type: object
                      description: The user who requested the anonymization.
                      properties:
                        id:
                          type: string
                          description: The ID of the user.
                        first_name:
                          type: string
                          description: First name of the user.
                        last_name:
                          type: string
                          description: Last name of the user.
                        email:
                          type: string
                          description: Email of the user.
                    cancellation_requester:
                      type: object
                      description: The user who requested the cancellation of the anonymization.
                      properties:
                        id:
                          type: string
                          description: The ID of the user.
                        first_name:
                          type: string
                          description: First name of the user.
                        last_name:
                          type: string
                          description: Last name of the user.
                        email:
                          type: string
                          description: Email of the user.
                  nullable: true
                anonymization_status:
                  type: string
                  description: Status of the current anonymization request (if any). One of 'requested', 'started', 'completed', 'failed', or 'cancelled'.
                  example: requested
                  nullable: true
                  enum:
                  - requested
                  - started
                  - completed
                  - failed
                  - cancelled
            relationships:
              type: object
              properties:
                customer_group:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - customer_groups
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                customer_addresses:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - customer_addresses
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                customer_payment_sources:
                  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
                customer_subscriptions:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - customer_subscriptions
                        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
                order_subscriptions:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - order_subscriptions
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                returns:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - returns
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                sku_lists:
                  type: object
                  properties:
                    data:
                 

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