> ## Documentation Index
> Fetch the complete documentation index at: https://developers.trycents.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Add Payment Method

> Attach a new payment method to the customer



## OpenAPI

````yaml POST /customers/payment-methods
openapi: 3.1.0
info:
  title: OpenAPI Cents
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api3.trycents.com/api/v1/common
security: []
paths:
  /customers/payment-methods:
    post:
      description: Attach a new payment method to the customer
      parameters:
        - $ref: '#/components/parameters/OriginHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                token:
                  type: string
                  format: The Payment Method ID from Stripe
                type:
                  type: string
                  format: 'The card type, also from the Stripe Payment Method object '
              required:
                - token
                - type
      responses:
        '200':
          description: Payment method successfully added
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: number
                    description: Internal payment method ID
                  paymentMethodToken:
                    type: string
                    description: The Stripe Payment Method ID (pm_...)
                  type:
                    type: string
                    description: Payment method type (e.g. card)
                  provider:
                    type: string
                    description: Payment provider — always stripe
                  centsCustomerId:
                    type: number
                    description: ID of the customer this payment method belongs to
        '400':
          description: Customer is required or Payment token not created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
                example: Payment token not created
        '409':
          description: >-
            Conflict — payment method already exists for this customer, or
            belongs to a different customer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Validation error — required field missing or Stripe token not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Payment method token is required
      security:
        - bearerAuth: []
components:
  parameters:
    OriginHeader:
      name: fwdorigin
      in: header
      required: true
      schema:
        type: string
        default: DISPATCH_API
        enum:
          - DISPATCH_API
  schemas:
    Error:
      required:
        - error
      type: object
      properties:
        error:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````