Commerce Layer customer_payment_sources API

resource type

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

commerce-layer-customer-payment-sources-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Commerce Layer addresses 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
  /customers/{customerId}/customer_payment_sources:
    get:
      operationId: GET/customerId/customer_payment_sources
      summary: Retrieve the customer payment sources associated to the customer
      description: Retrieve the customer payment sources associated to the customer
      tags:
      - customer_payment_sources
      parameters:
      - name: customerId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The customer_payment_sources associated to the customer
  /external_payments/{externalPaymentId}/wallet:
    get:
      operationId: GET/externalPaymentId/wallet
      summary: Retrieve the wallet associated to the external payment
      description: Retrieve the wallet associated to the external payment
      tags:
      - customer_payment_sources
      parameters:
      - name: externalPaymentId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The wallet associated to the external payment
  /order_subscriptions/{orderSubscriptionId}/customer_payment_source:
    get:
      operationId: GET/orderSubscriptionId/customer_payment_source
      summary: Retrieve the customer payment source associated to the order subscription
      description: Retrieve the customer payment source associated to the order subscription
      tags:
      - customer_payment_sources
      parameters:
      - name: orderSubscriptionId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The customer_payment_source associated to the order subscription
  /orders/{orderId}/available_customer_payment_sources:
    get:
      operationId: GET/orderId/available_customer_payment_sources
      summary: Retrieve the available customer payment sources associated to the order
      description: Retrieve the available customer payment sources associated to the order
      tags:
      - customer_payment_sources
      parameters:
      - name: orderId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The available_customer_payment_sources associated to the order
components:
  schemas:
    customerPaymentSource:
      properties:
        data:
          properties:
            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
    stripePayment:
      type: object
      properties:
        data:
          type: object
          required:
          - type
          - attributes
          properties:
            type:
              type: string
              description: The resource's type
              enum:
              - stripe_payments
            attributes:
              type: object
              properties:
                stripe_id:
                  type: string
                  description: The Stripe payment intent ID. Required to identify a payment session on stripe.
                  example: pi_1234XXX
                  nullable: true
                client_secret:
                  type: string
                  description: The Stripe payment intent client secret. Required to create a charge through Stripe.js.
                  example: pi_1234XXX_secret_5678YYY
                  nullable: true
                connected_account:
                  type: string
                  description: The account (if any) for which the funds of the PaymentIntent are intended.
                  example: acct_xxxx-yyyy-zzzz
                  nullable: true
                charge_id:
                  type: string
                  description: The Stripe charge ID. Identifies money movement upon the payment intent confirmation.
                  example: ch_1234XXX
                  nullable: true
                publishable_key:
                  type: string
                  description: The Stripe publishable API key.
                  example: pk_live_xxxx-yyyy-zzzz
                  nullable: true
                on_behalf_of:
                  type: string
                  description: The Stripe account ID that these funds are intended for.
                  example: xxxx-yyyy-zzzz
                  nullable: true
                transfer_group:
                  type: string
                  description: A string that identifies the resulting payment as part of a group.
                  example: xxxx-yyyy-zzzz
                  nullable: true
                options:
                  type: object
                  description: 'Stripe payment options: ''customer'', ''payment_method'', ''return_url'', etc. Check Stripe payment intent API for more details.'
                  example:
                    customer: cus_xxx
                    payment_method: pm_xxx
                  nullable: true
                payment_method:
                  type: object
                  description: Stripe 'payment_method', set by webhook.
                  example:
                    id: pm_xxx
                  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
                return_url:
                  type: string
                  description: The URL to return to when a redirect payment is completed.
                  example: https://yourdomain.com/thankyou
                  nullable: true
                receipt_email:
                  type: string
                  description: The email address to send the receipt to.
                  example: john@example.com
                  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
    satispayPayment:
      type: object
      properties:
        data:
          type: object
          required:
          - type
          - attributes
          properties:
            type:
              type: string
              description: The resource's type
              enum:
              - satispay_payments
            attributes:
              type: object
              properties:
                payment_id:
                  type: string
                  description: The payment unique identifier.
                  example: xxxx-yyyy-zzzz
                  nullable: true
                flow:
                  type: string
                  description: The Satispay payment flow, inspect gateway API details for more information.
                  example: MATCH_CODE
                  nullable: true
                status:
                  type: string
                  description: The Satispay payment status.
                  example: PENDING
                  nullable: true
                redirect_url:
                  type: string
                  description: The url to redirect the customer after the payment flow is completed.
                  example: http://commercelayer.dev/satispay/redirect
                  nullable: true
                payment_url:
                  type: string
                  description: Redirect url to the payment page.
                  example: https://online.satispay.com/pay/xxxx-yyyy-zzzz?redirect_url={redirect_url}
                  nullable: true
                payment_response:
                  type: object
                  description: The Satispay payment response, used to fetch internal data.
                  example:
                    foo: bar
                  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
    axervePayment:
      type: object
      properties:
        data:
          type: object
          required:
          - type
          - attributes
          properties:
            type:
              type: string
              description: The resource's type
              enum:
              - axerve_payments
            attributes:
              type: object
              properties:
                login:
                  type: string
                  description: The merchant login code.
                  example: xxxx-yyyy-zzzz
                  nullable: false
                return_url:
                  type: string
                  description: The URL where the payer is redirected after they approve the payment.
                  example: https://yourdomain.com/thankyou
                  nullable: false
                payment_request_data:
                  type: object
                  description: The Axerve payment request data, collected by client.
                  example:
                    foo: bar
                  nullable: true
                client_ip:
                  type: string
                  description: The IP adress of the client creating the payment.
                  example: 213.45.120.5
                  nullable: true
                buyer_details:
                  type: object
                  description: The details of the buyer creating the payment.
                  example:
                    cardHolder:
                      email: george.harrison@gmail.com
                    shippingAddress:
                      firstName: George
                  nullable: true
                request_token:
                  type: boolean
                  description: Requires the creation of a token to represent this payment, mandatory to use customer's wallet and order subscriptions.
                  example: true
                  nullable: true
                mismatched_amounts:
                  type: boolean
                  description: Indicates if the order current amount differs form the one of the associated authorization.
                  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
    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
    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
             

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