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

# Create payment method

> Import an existing customer payment method from a connected payment provider.



## OpenAPI

````yaml post /v1/customers/{id}/payment-methods
openapi: 3.1.0
info:
  title: Hyperline API
  version: 0.0.0
servers:
  - url: https://api.hyperline.co
  - url: https://sandbox.api.hyperline.co
security: []
paths:
  /v1/customers/{id}/payment-methods:
    post:
      tags:
        - Customers > Payment methods
      summary: Create payment method
      description: >-
        Import an existing customer payment method from a connected payment
        provider.
      operationId: createCustomerPaymentMethod
      parameters:
        - schema:
            type: string
          required: true
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePaymentMethod'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentMethodDetails'
      security:
        - bearer: []
components:
  schemas:
    CreatePaymentMethod:
      type: object
      properties:
        provider_name:
          type: string
          enum:
            - airwallex
            - gocardless
            - mollie
            - stripe
          description: Provider name.
        provider_id:
          type: string
          description: >-
            Provider ID. Required if multiple instances of the same provider are
            connected in Hyperline.
        provider_payment_method_id:
          type: string
          description: ID of the payment method on the provider's side.
      required:
        - provider_name
        - provider_payment_method_id
    PaymentMethodDetails:
      anyOf:
        - type: object
          properties:
            id:
              type: string
              description: Payment method ID.
              example: pm_1xMpj5bwRqN7LM
            status:
              type: string
              enum:
                - active
                - pending
                - expired
                - errored
              description: >-

                Payment method status.


                - `active`: The payment method is ready to be used.

                - `pending`: The payment method is pending activation or being
                validated.
                  
              example: active
            type:
              type: string
              enum:
                - card
                - apple_pay
                - google_pay
              description: |-

                Payment method type.

                - `card`: Credit or debit card
                - `apple_pay`: Apple Pay
                - `google_pay`: Google Pay
                - `direct_debit_sepa`: SEPA Direct Debit
                - `direct_debit_ach`: ACH Direct Debit
                - `direct_debit_bacs`: Bacs Direct Debit
                - `stripe_link`: Stripe Link
                  
              example: card
            last_4_digits:
              type:
                - number
                - 'null'
              description: Last four digits of the card.
              example: 2718
            expiration_date:
              type:
                - string
                - 'null'
              description: Expiration date of the card using YYYY-MM format.
              example: 2027-11
            brand:
              type:
                - string
                - 'null'
              description: Brand of the card.
              examples:
                - visa
                - mastercard
                - amex
            integration:
              type:
                - object
                - 'null'
              properties:
                entity_id:
                  type: string
                  description: ID of the entity in the provider.
                provider_name:
                  type: string
                  enum:
                    - adyen
                    - stripe
                    - mollie
                    - gocardless
                    - airwallex
                    - salesforce
                    - hubspot
                    - attio
                    - xero
                    - pennylane
                    - zoho-books
                    - exact-online
                    - quickbooks
                    - netsuite
                    - anrok
                    - chargebee
                    - slack
                    - plain
                    - zendesk
                    - pylon
                    - intercom
                    - claap
                  description: Provider name.
                provider_account_id:
                  type: string
                  description: ID of the connected provider account.
              required:
                - entity_id
                - provider_name
                - provider_account_id
              description: Reference to the entity in an external provider.
              example:
                entity_id: '123456789'
                provider_name: stripe
                provider_account_id: acc_1234567890
          required:
            - id
            - status
            - type
            - last_4_digits
            - expiration_date
            - brand
            - integration
          title: Card
        - type: object
          properties:
            id:
              type: string
              description: Payment method ID.
              example: pm_1xMpj5bwRqN7LM
            status:
              type: string
              enum:
                - errored
              description: >-

                Payment method status.


                - `errored`: The payment method has failed and can no longer be
                used.
                  
              example: errored
            error_type:
              type: string
              enum:
                - authentication_required
                - authorization_error
                - insufficient_funds
                - declined
                - expired
                - fraud
                - invalid
                - mandate_invalid
                - not_supported
                - unknown
              description: >-

                Payment method error type.


                - `authentication_required`: The card was declined as the
                transaction requires authentication (e.g. 3-D Secure). The
                customer should go to their portal page and authenticate their
                card. If the error happened on an already authenticated
                transaction, the customer needs to contact their card issuer for
                more information.

                - `authorization_error`: A transaction authorization cannot be
                created for a variety of reasons such as the card issuer
                couldn't be reached, or the card requires a PIN.

                - `declined`: The payment method was declined for a variety of
                reasons such as a card reported as lost or stolen, insufficient
                funds or reaching the limit available on the method to complete
                the purchase, a payment method on a known block list, etc.

                - `expired`: The payment method is expired. The customer should
                go to their portal page and change their payment method.

                - `fraud`: The payment provider suspected the payment method was
                fraudulent and has been blocked. Don't report more detailed
                information to your customer, and check on your provider
                account.

                - `invalid`: The payment method is invalid in most cases because
                of incorrect details (card/account number, CVC, expiration date,
                postal code).

                - `not_supported`: The payment method doesn't support this type
                of purchase (e.g. currency, online payment).

                - `unknown`: A generic error happened on the payment provider
                side.
                  
              example: expired
            type:
              type: string
              enum:
                - card
                - apple_pay
                - google_pay
              description: |-

                Payment method type.

                - `card`: Credit or debit card
                - `apple_pay`: Apple Pay
                - `google_pay`: Google Pay
                - `direct_debit_sepa`: SEPA Direct Debit
                - `direct_debit_ach`: ACH Direct Debit
                - `direct_debit_bacs`: Bacs Direct Debit
                - `stripe_link`: Stripe Link
                  
              example: card
            last_4_digits:
              type:
                - number
                - 'null'
              description: Last four digits of the card.
              example: 2718
            expiration_date:
              type:
                - string
                - 'null'
              description: Expiration date of the card using YYYY-MM format.
              example: 2027-11
            brand:
              type:
                - string
                - 'null'
              description: Brand of the card.
              examples:
                - visa
                - mastercard
                - amex
            integration:
              type:
                - object
                - 'null'
              properties:
                entity_id:
                  type: string
                  description: ID of the entity in the provider.
                provider_name:
                  type: string
                  enum:
                    - adyen
                    - stripe
                    - mollie
                    - gocardless
                    - airwallex
                    - salesforce
                    - hubspot
                    - attio
                    - xero
                    - pennylane
                    - zoho-books
                    - exact-online
                    - quickbooks
                    - netsuite
                    - anrok
                    - chargebee
                    - slack
                    - plain
                    - zendesk
                    - pylon
                    - intercom
                    - claap
                  description: Provider name.
                provider_account_id:
                  type: string
                  description: ID of the connected provider account.
              required:
                - entity_id
                - provider_name
                - provider_account_id
              description: Reference to the entity in an external provider.
              example:
                entity_id: '123456789'
                provider_name: stripe
                provider_account_id: acc_1234567890
          required:
            - id
            - status
            - error_type
            - type
            - last_4_digits
            - expiration_date
            - brand
            - integration
          title: Card (errored)
        - type: object
          properties:
            id:
              type: string
              description: Payment method ID.
              example: pm_1xMpj5bwRqN7LM
            status:
              type: string
              enum:
                - active
                - pending
                - expired
                - errored
              description: >-

                Payment method status.


                - `active`: The payment method is ready to be used.

                - `pending`: The payment method is pending activation or being
                validated.
                  
              example: active
            type:
              type: string
              enum:
                - direct_debit
                - direct_debit_ach
                - direct_debit_bacs
              description: |-

                Payment method type.

                - `card`: Credit or debit card
                - `apple_pay`: Apple Pay
                - `google_pay`: Google Pay
                - `direct_debit_sepa`: SEPA Direct Debit
                - `direct_debit_ach`: ACH Direct Debit
                - `direct_debit_bacs`: Bacs Direct Debit
                - `stripe_link`: Stripe Link
                  
              example: direct_debit
            account_number_ending:
              type:
                - string
                - 'null'
              description: Last characters of the account number.
              example: '6789'
            integration:
              type:
                - object
                - 'null'
              properties:
                entity_id:
                  type: string
                  description: ID of the entity in the provider.
                provider_name:
                  type: string
                  enum:
                    - adyen
                    - stripe
                    - mollie
                    - gocardless
                    - airwallex
                    - salesforce
                    - hubspot
                    - attio
                    - xero
                    - pennylane
                    - zoho-books
                    - exact-online
                    - quickbooks
                    - netsuite
                    - anrok
                    - chargebee
                    - slack
                    - plain
                    - zendesk
                    - pylon
                    - intercom
                    - claap
                  description: Provider name.
                provider_account_id:
                  type: string
                  description: ID of the connected provider account.
              required:
                - entity_id
                - provider_name
                - provider_account_id
              description: Reference to the entity in an external provider.
              example:
                entity_id: '123456789'
                provider_name: stripe
                provider_account_id: acc_1234567890
          required:
            - id
            - status
            - type
            - account_number_ending
            - integration
          title: Direct Debit
        - type: object
          properties:
            id:
              type: string
              description: Payment method ID.
              example: pm_1xMpj5bwRqN7LM
            status:
              type: string
              enum:
                - errored
              description: >-

                Payment method status.


                - `errored`: The payment method has failed and can no longer be
                used.
                  
              example: errored
            error_type:
              type: string
              enum:
                - authentication_required
                - authorization_error
                - insufficient_funds
                - declined
                - expired
                - fraud
                - invalid
                - mandate_invalid
                - not_supported
                - unknown
              description: >-

                Payment method error type.


                - `authentication_required`: The card was declined as the
                transaction requires authentication (e.g. 3-D Secure). The
                customer should go to their portal page and authenticate their
                card. If the error happened on an already authenticated
                transaction, the customer needs to contact their card issuer for
                more information.

                - `authorization_error`: A transaction authorization cannot be
                created for a variety of reasons such as the card issuer
                couldn't be reached, or the card requires a PIN.

                - `declined`: The payment method was declined for a variety of
                reasons such as a card reported as lost or stolen, insufficient
                funds or reaching the limit available on the method to complete
                the purchase, a payment method on a known block list, etc.

                - `expired`: The payment method is expired. The customer should
                go to their portal page and change their payment method.

                - `fraud`: The payment provider suspected the payment method was
                fraudulent and has been blocked. Don't report more detailed
                information to your customer, and check on your provider
                account.

                - `invalid`: The payment method is invalid in most cases because
                of incorrect details (card/account number, CVC, expiration date,
                postal code).

                - `not_supported`: The payment method doesn't support this type
                of purchase (e.g. currency, online payment).

                - `unknown`: A generic error happened on the payment provider
                side.
                  
              example: expired
            type:
              type: string
              enum:
                - direct_debit
                - direct_debit_ach
                - direct_debit_bacs
              description: |-

                Payment method type.

                - `card`: Credit or debit card
                - `apple_pay`: Apple Pay
                - `google_pay`: Google Pay
                - `direct_debit_sepa`: SEPA Direct Debit
                - `direct_debit_ach`: ACH Direct Debit
                - `direct_debit_bacs`: Bacs Direct Debit
                - `stripe_link`: Stripe Link
                  
              example: direct_debit
            account_number_ending:
              type:
                - string
                - 'null'
              description: Last characters of the account number.
              example: '6789'
            integration:
              type:
                - object
                - 'null'
              properties:
                entity_id:
                  type: string
                  description: ID of the entity in the provider.
                provider_name:
                  type: string
                  enum:
                    - adyen
                    - stripe
                    - mollie
                    - gocardless
                    - airwallex
                    - salesforce
                    - hubspot
                    - attio
                    - xero
                    - pennylane
                    - zoho-books
                    - exact-online
                    - quickbooks
                    - netsuite
                    - anrok
                    - chargebee
                    - slack
                    - plain
                    - zendesk
                    - pylon
                    - intercom
                    - claap
                  description: Provider name.
                provider_account_id:
                  type: string
                  description: ID of the connected provider account.
              required:
                - entity_id
                - provider_name
                - provider_account_id
              description: Reference to the entity in an external provider.
              example:
                entity_id: '123456789'
                provider_name: stripe
                provider_account_id: acc_1234567890
          required:
            - id
            - status
            - error_type
            - type
            - account_number_ending
            - integration
          title: Direct Debit (errored)
        - type: object
          properties:
            id:
              type: string
              description: Payment method ID.
              example: pm_1xMpj5bwRqN7LM
            status:
              type: string
              enum:
                - active
                - pending
                - expired
                - errored
              description: >-

                Payment method status.


                - `active`: The payment method is ready to be used.

                - `pending`: The payment method is pending activation or being
                validated.
                  
              example: active
            type:
              type: string
              enum:
                - stripe_link
              description: |-

                Payment method type.

                - `card`: Credit or debit card
                - `apple_pay`: Apple Pay
                - `google_pay`: Google Pay
                - `direct_debit_sepa`: SEPA Direct Debit
                - `direct_debit_ach`: ACH Direct Debit
                - `direct_debit_bacs`: Bacs Direct Debit
                - `stripe_link`: Stripe Link
                  
              example: stripe_link
            integration:
              type:
                - object
                - 'null'
              properties:
                entity_id:
                  type: string
                  description: ID of the entity in the provider.
                provider_name:
                  type: string
                  enum:
                    - adyen
                    - stripe
                    - mollie
                    - gocardless
                    - airwallex
                    - salesforce
                    - hubspot
                    - attio
                    - xero
                    - pennylane
                    - zoho-books
                    - exact-online
                    - quickbooks
                    - netsuite
                    - anrok
                    - chargebee
                    - slack
                    - plain
                    - zendesk
                    - pylon
                    - intercom
                    - claap
                  description: Provider name.
                provider_account_id:
                  type: string
                  description: ID of the connected provider account.
              required:
                - entity_id
                - provider_name
                - provider_account_id
              description: Reference to the entity in an external provider.
              example:
                entity_id: '123456789'
                provider_name: stripe
                provider_account_id: acc_1234567890
          required:
            - id
            - status
            - type
            - integration
          title: Stripe Link
        - type: object
          properties:
            id:
              type: string
              description: Payment method ID.
              example: pm_1xMpj5bwRqN7LM
            status:
              type: string
              enum:
                - errored
              description: >-

                Payment method status.


                - `errored`: The payment method has failed and can no longer be
                used.
                  
              example: errored
            error_type:
              type: string
              enum:
                - authentication_required
                - authorization_error
                - insufficient_funds
                - declined
                - expired
                - fraud
                - invalid
                - mandate_invalid
                - not_supported
                - unknown
              description: >-

                Payment method error type.


                - `authentication_required`: The card was declined as the
                transaction requires authentication (e.g. 3-D Secure). The
                customer should go to their portal page and authenticate their
                card. If the error happened on an already authenticated
                transaction, the customer needs to contact their card issuer for
                more information.

                - `authorization_error`: A transaction authorization cannot be
                created for a variety of reasons such as the card issuer
                couldn't be reached, or the card requires a PIN.

                - `declined`: The payment method was declined for a variety of
                reasons such as a card reported as lost or stolen, insufficient
                funds or reaching the limit available on the method to complete
                the purchase, a payment method on a known block list, etc.

                - `expired`: The payment method is expired. The customer should
                go to their portal page and change their payment method.

                - `fraud`: The payment provider suspected the payment method was
                fraudulent and has been blocked. Don't report more detailed
                information to your customer, and check on your provider
                account.

                - `invalid`: The payment method is invalid in most cases because
                of incorrect details (card/account number, CVC, expiration date,
                postal code).

                - `not_supported`: The payment method doesn't support this type
                of purchase (e.g. currency, online payment).

                - `unknown`: A generic error happened on the payment provider
                side.
                  
              example: expired
            type:
              type: string
              enum:
                - stripe_link
              description: |-

                Payment method type.

                - `card`: Credit or debit card
                - `apple_pay`: Apple Pay
                - `google_pay`: Google Pay
                - `direct_debit_sepa`: SEPA Direct Debit
                - `direct_debit_ach`: ACH Direct Debit
                - `direct_debit_bacs`: Bacs Direct Debit
                - `stripe_link`: Stripe Link
                  
              example: stripe_link
            integration:
              type:
                - object
                - 'null'
              properties:
                entity_id:
                  type: string
                  description: ID of the entity in the provider.
                provider_name:
                  type: string
                  enum:
                    - adyen
                    - stripe
                    - mollie
                    - gocardless
                    - airwallex
                    - salesforce
                    - hubspot
                    - attio
                    - xero
                    - pennylane
                    - zoho-books
                    - exact-online
                    - quickbooks
                    - netsuite
                    - anrok
                    - chargebee
                    - slack
                    - plain
                    - zendesk
                    - pylon
                    - intercom
                    - claap
                  description: Provider name.
                provider_account_id:
                  type: string
                  description: ID of the connected provider account.
              required:
                - entity_id
                - provider_name
                - provider_account_id
              description: Reference to the entity in an external provider.
              example:
                entity_id: '123456789'
                provider_name: stripe
                provider_account_id: acc_1234567890
          required:
            - id
            - status
            - error_type
            - type
            - integration
          title: Stripe Link (errored)
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````