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

# POST Payment Methods

> Add a new payment method



## OpenAPI

````yaml POST /v1/users/{user_id}/payment-methods
openapi: 3.0.3
info:
  title: NFT Service APIs
  description: ''
  license:
    name: ''
  version: '2.0'
servers:
  - url: https://api.bitski.com
security: []
paths:
  /v1/users/{user_id}/payment-methods:
    post:
      tags:
        - Commerce
      summary: Add a new payment method
      description: Add a new payment method
      operationId: add_payment_method
      parameters:
        - name: user_id
          in: path
          description: The id of the current user
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - paymentMethod
              properties:
                paymentMethod:
                  $ref: '#/components/schemas/NewPaymentMethod'
        required: true
      responses:
        '200':
          description: New payment method details
          content:
            application/json:
              schema:
                type: object
                required:
                  - paymentMethod
                properties:
                  paymentMethod:
                    $ref: '#/components/schemas/PaymentMethod'
        '400':
          description: List of payment methods
          content:
            application/json:
              schema:
                type: object
              example:
                error:
                  message: Invalid card
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
              example:
                error:
                  code: 401
                  message: The request could not be authorized
                  request: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                  status: Unauthorized
      security:
        - oauth2:
            - commerce
components:
  schemas:
    NewPaymentMethod:
      type: object
      required:
        - token
      properties:
        testMode:
          type: boolean
          description: If the payment method is in test mode
        token:
          type: string
          description: The token provided by the gateway
          example: tok_1NoBfo2eZvKYlo2CIXAeVWy3
    PaymentMethod:
      type: object
      required:
        - id
        - cardLast4
        - cardBrand
      properties:
        cardBrand:
          type: string
          description: The brand of the card
          example: visa
        cardLast4:
          type: string
          description: Last 4 digits of the card number
          example: '1111'
        id:
          type: string
          description: Id of the payment method
          example: pm_1NoBH4E7964oeAEGtfSbXJ5v
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://account.bitski.com/oauth2/token
          scopes:
            apps: manage my applications
      description: Client credentials

````