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

# Create payment source



## OpenAPI

````yaml post /customers/{customerId}/paymentsources
openapi: 3.0.1
info:
  title: Plude
  description: Headless subscription management and recurring billing.
  termsOfService: https://plude.com/terms
  contact:
    name: Corporate Contact
    url: https://plude.com/contact
  license:
    name: License
    url: https://plude.com/license
  version: v4.2024.7.1
servers: []
security:
  - Bearer: []
paths:
  /customers/{customerId}/paymentsources:
    post:
      tags:
        - Customers
      summary: Create payment source
      parameters:
        - name: customerId
          in: path
          description: Id of customer to add payment source to.
          required: true
          schema:
            type: string
            format: uuid
        - name: x-environment
          in: header
          description: >-
            Configure which environment the request will handle. If the provided
            credentials do not allow access to this specified environment, a 403
            Forbidden response is returned.
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePaymentSourceRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '422':
          description: Unprocessable Content
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Internal Server Error
components:
  schemas:
    CreatePaymentSourceRequest:
      type: object
      properties:
        provider:
          type: string
          description: >-
            Required. Name of the payment provider. See list of supported here
            https://go.plude.io/h82201
          nullable: true
        source:
          type: string
          description: "Optional. Data of the specific payment source. See individual provider.\r\nSource data must be escapted."
          nullable: true
        redirectUrl:
          type: string
          description: Optional. Redirect URL passed to the payment provider.
          nullable: true
        parameters:
          type: object
          additionalProperties: {}
          description: >-
            Optional. Additional parameters to be passed to the payment
            provider.
          nullable: true
      additionalProperties: false
    Response:
      type: object
      properties:
        url:
          type: string
          nullable: true
        message:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        type:
          type: string
          nullable: true
        state:
          $ref: '#/components/schemas/PaymentSourceState'
        expiration:
          type: string
          format: date-time
          nullable: true
        id:
          type: string
          format: uuid
          nullable: true
      additionalProperties: false
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
    PaymentSourceState:
      enum:
        - initial
        - active
        - disabled
        - not_supported
        - invalid
      type: string
  securitySchemes:
    Bearer:
      type: http
      description: "JWT Authorization header using the Bearer scheme. \r\n\r\n Enter 'Bearer' [space] and then your token in the text input below.\r\n\r\nExample: \"Bearer 12345abcdef\""
      scheme: Bearer

````