Commerce Layer customer_payment_sources API

resource type

Operations 5

GET /customer_payment_sources List all customer payment sources #
POST /customer_payment_sources Create a customer payment source #
GET /customer_payment_sources/{customerPaymentSourceId} Retrieve a customer payment source #
PATCH /customer_payment_sources/{customerPaymentSourceId} Update a customer payment source #
DELETE /customer_payment_sources/{customerPaymentSourceId} Delete a customer payment source #

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-customer-payment-sources-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-customer-payment-sources-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Commerce Layer Customer Payment Sources 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: customer_payment_sources
  description: resource type
paths:
  /customer_payment_sources:
    get:
      operationId: GET/customer_payment_sources
      summary: List all customer payment sources
      description: List all customer payment sources
      tags:
      - customer_payment_sources
      responses:
        '200':
          description: A list of customer payment source objects
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/customerPaymentSourceResponseList'
    post:
      operationId: POST/customer_payment_sources
      summary: Create a customer payment source
      description: Create a customer payment source
      tags:
      - customer_payment_sources
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/customerPaymentSourceCreate'
      responses:
        '201':
          description: The created customer payment source object
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/customerPaymentSourceResponse'
  /customer_payment_sources/{customerPaymentSourceId}:
    get:
      operationId: GET/customer_payment_sources/customerPaymentSourceId
      summary: Retrieve a customer payment source
      description: Retrieve a customer payment source
      tags:
      - customer_payment_sources
      parameters:
      - name: customerPaymentSourceId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The customer payment source object
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/customerPaymentSourceResponse'
    patch:
      operationId: PATCH/customer_payment_sources/customerPaymentSourceId
      summary: Update a customer payment source
      description: Update a customer payment source
      tags:
      - customer_payment_sources
      parameters:
      - name: customerPaymentSourceId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/customerPaymentSourceUpdate'
      responses:
        '200':
          description: The updated customer payment source object
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/customerPaymentSourceResponse'
    delete:
      operationId: DELETE/customer_payment_sources/customerPaymentSourceId
      summary: Delete a customer payment source
      description: Delete a customer payment source
      tags:
      - customer_payment_sources
      parameters:
      - name: customerPaymentSourceId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '204':
          description: No content
components:
  schemas:
    customerPaymentSource:
      type: object
      properties:
        data:
          type: object
          required:
          - type
          - attributes
          properties:
            type:
              type: string
              description: The resource's type
              enum:
              - customer_payment_sources
            attributes:
              type: object
              properties:
                name:
                  type: string
                  description: Returns the associated payment source's name.
                  example: XXXX-XXXX-XXXX-1111
                  nullable: true
                customer_token:
                  type: string
                  description: Returns the customer gateway token stored in the gateway.
                  example: cus_xxxyyyzzz
                  nullable: true
                payment_source_token:
                  type: string
                  description: Returns the payment source token stored in the gateway.
                  example: pm_xxxyyyzzz
                  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:
                customer:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - customers
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                payment_method:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - payment_methods
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                payment_source:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - adyen_payments
                          - axerve_payments
                          - braintree_payments
                          - checkout_com_payments
                          - external_payments
                          - klarna_payments
                          - paypal_payments
                          - satispay_payments
                          - stripe_payments
                          - wire_transfers
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                  oneOf:
                  - $ref: '#/components/schemas/adyenPayment'
                  - $ref: '#/components/schemas/axervePayment'
                  - $ref: '#/components/schemas/braintreePayment'
                  - $ref: '#/components/schemas/checkoutComPayment'
                  - $ref: '#/components/schemas/externalPayment'
                  - $ref: '#/components/schemas/klarnaPayment'
                  - $ref: '#/components/schemas/paypalPayment'
                  - $ref: '#/components/schemas/satispayPayment'
                  - $ref: '#/components/schemas/stripePayment'
                  - $ref: '#/components/schemas/wireTransfer'
                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
    customerPaymentSourceResponseList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/customerPaymentSourceResponse/properties/data'
    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
    customerPaymentSourceUpdate:
      required:
      - data
      type: object
      properties:
        data:
          type: object
          required:
          - type
          - id
          - attributes
          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
            attributes:
              type: object
              properties:
                customer_token:
                  type: string
                  description: Returns the customer gateway token stored in the gateway.
                  example: cus_xxxyyyzzz
                  nullable: true
                payment_source_token:
                  type: string
                  description: Returns the payment source token stored in the gateway.
                  example: pm_xxxyyyzzz
                  nullable: 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
                  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:
                customer:
                  required:
                  - data
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - customers
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                payment_method:
                  required:
                  - data
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - payment_methods
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                payment_source:
                  required:
                  - data
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - adyen_payments
                          - axerve_payments
                          - braintree_payments
                          - checkout_com_payments
                          - external_payments
                          - klarna_payments
                          - paypal_payments
                          - satispay_payments
                          - stripe_payments
                          - wire_transfers
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                  oneOf:
                  - $ref: '#/components/schemas/adyenPayment'
                  - $ref: '#/components/schemas/axervePayment'
                  - $ref: '#/components/schemas/braintreePayment'
                  - $ref: '#/components/schemas/checkoutComPayment'
                  - $ref: '#/components/schemas/externalPayment'
                  - $ref: '#/components/schemas/klarnaPayment'
                  - $ref: '#/components/schemas/paypalPayment'
                  - $ref: '#/components/schemas/satispayPayment'
                  - $ref: '#/components/schemas/stripePayment'
                  - $ref: '#/components/schemas/wireTransfer'
    customerPaymentSourceCreate:
      required:
      - data
      type: object
      properties:
        data:
          type: object
          required:
          - type
          - attributes
          properties:
            type:
              type: string
              description: The resource's type
              enum:
              - customer_payment_sources
            attributes:
              type: object
              properties:
                customer_token:
                  type: string
                  description: Returns the customer gateway token stored in the gateway.
                  example: cus_xxxyyyzzz
                payment_source_token:
                  type: string
                  description: Returns the payment source token stored in the gateway.
                  example: pm_xxxyyyzzz
                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
            relationships:
              type: object
              properties:
                customer:
                  required:
                  - data
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - customers
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                payment_method:
                  required:
                  - data
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - payment_methods
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                payment_source:
                  required:
                  - data
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - adyen_payments
                          - axerve_payments
                          - braintree_payments
                          - checkout_com_payments
                          - external_payments
                          - klarna_payments
                          - paypal_payments
                          - satispay_payments
                          - stripe_payments
                          - wire_transfers
                        id:
                          type: string
                          description: Unique identifier for the resource (hash).
                          example: XAyRWNUzyN
                  oneOf:
                  - $ref: '#/components/schemas/adyenPayment'
                  - $ref: '#/components/schemas/axervePayment'
                  - $ref: '#/components/schemas/braintreePayment'
                  - $ref: '#/components/schemas/checkoutComPayment'
                  - $ref: '#/components/schemas/externalPayment'
                  - $ref: '#/components/schemas/klarnaPayment'
                  - $ref: '#/components/schemas/paypalPayment'
                  - $ref: '#/components/schemas/satispayPayment'
                  - $ref: '#/components/schemas/stripePayment'
                  - $ref: '#/components/schemas/wireTransfer'
              required:
              - customer
    customerPaymentSourceResponse:
      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:
              - customer_payment_sources
            links:
              type: object
              properties:
                self:
                  type: string
                  description: URL
            attributes:
              $ref: '#/components/schemas/customerPaymentSource/properties/data/properties/attributes'
            relationships:
              type: object
              properties:
                customer:
                  type: object
                  properties:
                    links:
                      type: object
                      properties:
                        self:
                          type: string
                          description: URL
                        related:
                          type: string
                          description: URL
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - customer
                        id:
                          type: string
                          description: The resource ID
                payment_method:
                  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:
                          - payment_method
                        id:
                          type: string
                          description: The resource ID
                payment_source:
                  type: object
                  properties:
                    links:
                      type: object
                      properties:
                        self:
                          type: string
                          description: URL
                        related:
                          type: string
                          description: URL
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - payment_source
                        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
    braintreePayment:
      type: object
      properties:
        data:
          type: object
          required:
          - type
          - attributes
          properties:
            type:
              type: string
              description: The resource's type
              enum:
              - braintree_payments
            attributes:
              type: object
              properties:
                client_token:
                  type: string
                  description: The Braintree payment client token. Required by the Braintree JS SDK.
                  example: xxxx.yyyy.zzzz
                  nullable: false
                payment_method_nonce:
                  type: string
                  description: The Braintree payment method nonce. Sent by the Braintree JS SDK.
                  example: xxxx.yyyy.zzzz
                  nullable: true
                payment_id:
                  type: string
                  description: The Braintree payment ID used by local payment and sent by the Braintree JS SDK.
                  example: xxxx.yyyy.zzzz
                  nullable: true
                local:
                  type: boolean
                  description: Indicates if the payment is local, in such case Braintree will trigger a webhook call passing the "payment_id" and "payment_method_nonce" in order to complete the transaction.
                  example: true
                  nullable: true
                options:
                  type: object
                  description: Braintree payment options, 'customer_id' and 'payment_method_token'.
                  example:
                    customer_id: '1234567890'
                  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:
            

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