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

# Update a payment method

> Updates the details of the payment method associated with the supplied `payment_method_id`



## OpenAPI

````yaml /api-reference/openapi.yaml post /v2/payment_methods/{payment_method_id}
openapi: 3.1.0
info:
  title: Public Imprint API
  version: '2.0'
servers:
  - url: https://dev.sbx.imprint.co
    description: Imprint public api sandbox
security:
  - basicAuth: []
  - bearerAuth: []
paths:
  /v2/payment_methods/{payment_method_id}:
    post:
      tags:
        - Payment Methods
      summary: Update a payment method
      description: >-
        Updates the details of the payment method associated with the supplied
        `payment_method_id`
      operationId: updatePaymentMethod
      parameters:
        - name: payment_method_id
          in: path
          required: true
          description: The unique identifier of the payment method.
          schema:
            type: string
            example: 9ED4FE47-8E9C-48E9-BBEF-094DF1789012
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - type
                - customer_id
                - status
              properties:
                type:
                  type: string
                  enum:
                    - CARD
                    - BANK_ACCOUNT
                    - LOAN
                customer_id:
                  type: string
                  description: >-
                    The ID of the Imprint customer that the payment method
                    belongs to.
                  example: 9ED4FE47-8E9C-48E9-BBEF-094DF1789012
                status:
                  type: string
                  enum:
                    - ACTIVE
                    - INACTIVE
                amount:
                  type: integer
                  description: Required for loan applications
                  example: 10000
                term_months:
                  type: integer
                  description: Required for loan applications
                  example: 12
                metadata:
                  type: object
                  additionalProperties: true
                  description: Additional metadata for the payment method
                  example:
                    platform_version: 2.1.0
      responses:
        '200':
          description: Payment method updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentMethod'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidRequestError'
components:
  schemas:
    PaymentMethod:
      type: object
      required:
        - id
        - type
        - customer_id
        - created_at
        - status
        - metadata
      properties:
        id:
          type: string
          example: DCBFC736-2286-42DD-897D-160DCA80AED2
          description: The unique ID Imprint assigns to the payment method.
        type:
          type: string
          description: The type of payment method
          enum:
            - CARD
            - BANK_ACCOUNT
            - LOAN
        customer_id:
          type: string
          description: The `id` of the Imprint customer that the payment method belongs to.
          example: B40A789E-BD46-4BB9-B63E-F9919582694C
        card:
          type: object
          description: >-
            When payment method is a `CARD` type, this object will have card
            specific data.
          required:
            - last4
            - brand
          properties:
            last4:
              type: string
              example: '1234'
              minLength: 4
              maxLength: 4
              description: The last 4 digits of the card PAN
            network:
              type: string
              description: Name of the card issuer
              enum:
                - VISA
                - MASTERCARD
                - AMEX
                - ''
            card_type:
              $ref: '#/components/schemas/CardType'
            card_design_id:
              $ref: '#/components/schemas/CardDesignID'
            pci_details:
              type: object
              description: >-
                The pci details of the returned card. Only verified PCI
                compliant partners will be able to retrieve pci details in
                production environments.
              properties:
                pan:
                  type: string
                  description: >-
                    The unique 16-digit number printed on the front of a payment
                    card, used to identify the cardholder's account.
                  example: '5105105105105100'
                exp_month:
                  type: string
                  description: The month the card expires
                  example: '06'
                exp_year:
                  type: string
                  description: The year the card expires
                  example: '26'
                cvv:
                  type: string
                  description: >-
                    A three- or four-digit security code used to verify
                    card-not-present transactions and prevent fraud.
                  example: '123'
            tokens:
              type: array
              description: >-
                Payment method tokens that are defined by a third-party provider
                are included in this array by Imprint.
              items:
                $ref: '#/components/schemas/PaymentMethodToken'
        bank_account:
          type: object
          description: >-
            When payment method is a `BANK_ACCOUNT` type, this object will have
            bank account specific data.
          required:
            - last4
            - routing_number
            - bank_name
          properties:
            last4:
              type: string
              example: '1234'
              description: Last 4 numbers of the account.
              minLength: 4
              maxLength: 4
            routing_number:
              type: string
              description: The bank routing number assigned to this account.
            bank_name:
              type: string
              example: Wells Fargo
              description: Name of the banking institution
            account_type:
              type: string
              description: Type of the account.
              enum:
                - CHECKING
                - SAVINGS
        loan:
          type: object
          description: >-
            When payment method is a `LOAN` type, this object will have loan
            specific data.
          required:
            - amount
            - term_months
          properties:
            amount:
              type: integer
              description: Amount in min units.
              example: 10000
            currency:
              $ref: '#/components/schemas/TransactionCurrency'
            remaining_balance:
              type: integer
              description: remaining unspent balance on the loan
            term_months:
              type: integer
              description: Length of the loan term in months
              example: 12
            apr:
              type: string
              description: Annual percentage rate of the loan in floating point
              example: '5.89'
            loan_status:
              type: string
              description: Current status of the loan
              enum:
                - PENDING
                - APPROVED
                - REJECTED
                - ACTIVE
                - CLOSED
        created_at:
          type: string
          description: the RFC-3339 timestamp when the payment method was created
          example: '2025-02-13T19:08:07.000Z'
        updated_at:
          type: string
          description: the RFC-3339 timestamp when the payment method was last updated
          example: '2025-02-13T19:08:07.000Z'
        status:
          type: string
          description: Current status of the payment method
          enum:
            - ACTIVE
            - INACTIVE
            - CANCELED
        metadata:
          type: object
          additionalProperties: true
          description: Additional metadata for the payment method
          example:
            platform_version: 2.1.0
    InvalidRequestError:
      type: object
      properties:
        path:
          type: string
          description: The path of the endpoint returning the error
          example: /v2/customers
        details:
          type: array
          items:
            type: string
          description: The details of the error being returned
          example:
            - 'email: must be a well-formed email address'
        error:
          type: string
          description: The category of error being returned
          example: Bad Request
        status:
          type: integer
          description: The HTTP status code of the error
          example: 400
        timestamp:
          type: string
          description: The timestamp that the error occurred
          example: '2025-01-20T18:18:22.923+00:00'
    CardType:
      type: string
      description: The type of card
      enum:
        - PHYSICAL
        - VIRTUAL
    CardDesignID:
      type: string
      description: Imprint ID for the graphic design printed on the card
      example: 3b9c1f3e-52a0-44c1-b131-a7ab0099a214
    PaymentMethodToken:
      type: object
      required:
        - type
        - token
        - created_at
        - updated_at
      properties:
        type:
          type: string
          enum:
            - ADYEN
            - APPLE_WALLET
        token:
          type: string
          description: The token, as defined by the processor
        pan_reference_id:
          type: string
          description: An ID that represents the PAN and is defined by the processor
        created_at:
          type: string
          description: the RFC-3339 timestamp when the payment method was created
          example: '2025-02-13T19:08:07.000Z'
        updated_at:
          type: string
          example: '2025-02-13T19:08:07.000Z'
          description: the RFC-3339 timestamp when the payment method was updated
    TransactionCurrency:
      type: string
      description: >-
        The 3-character currency code of the amount in ISO 4217 format (e.g.,
        "USD")
      example: USD
  securitySchemes:
    bearerAuth:
      bearerFormat: auth-scheme
      description: >-
        Bearer HTTP authentication. Allowed headers-- Authorization: Bearer
        <api_key>
      scheme: bearer
      type: http

````