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

# Create a payment method

> Create a payment method



## OpenAPI

````yaml Flutterwave_v4_Open_API.json post /payment-methods
openapi: 3.1.0
info:
  version: '1.0'
  title: Flutterwave APIs
  description: APIs for Enterprise Customers
  contact:
    name: Flutterwave
    email: hi@flutterwavego.com
servers:
  - url: https://developersandbox-api.flutterwave.com
    description: Dev server
security:
  - bearerAuth: []
paths:
  /payment-methods:
    post:
      tags:
        - Payment Methods
      summary: Create a payment method
      description: Create a payment method
      operationId: payment_methods_post
      parameters:
        - $ref: '#/components/parameters/trace_id'
        - $ref: '#/components/parameters/idempotency_key'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/payment_method_in'
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/status'
                  message:
                    type: string
                  data:
                    $ref: '#/components/schemas/payment_method'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/400'
        '401':
          description: Unauthorised request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/403'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/409'
components:
  parameters:
    trace_id:
      description: >-
        A unique identifier to track this operation. It must be between 12 and
        255 characters in length.
      in: header
      name: X-Trace-Id
      schema:
        type: string
        minLength: 12
        maxLength: 255
      example: acb123e4-f567-4a8b-9c0d-1e2f3a4b5c6d
    idempotency_key:
      description: >-
        A unique identifier to prevent duplicate requests. It must be between 12
        and 255 characters in length.
      in: header
      name: X-Idempotency-Key
      required: false
      schema:
        type: string
        minLength: 12
        maxLength: 255
      example: req-5c0a2e8c-f3b9-4d1a-8e2f-0c1d2e3f4a5b
  schemas:
    '400':
      description: Bad Request
      type: object
      properties:
        status:
          type: string
          nullable: false
          enum:
            - failed
        error:
          type: object
          properties:
            type:
              type: string
              example: REQUEST_NOT_VALID
            code:
              type: string
              example: '10400'
            message:
              type: string
              nullable: true
              example: Request is not valid
            validation_errors:
              type: array
              items:
                type: object
                properties:
                  field_name:
                    type: string
                    example: amount
                  message:
                    type: string
                    example: must not be null
          description: >-
            The request cannot be accepted and is malformed and/or missing
            required parameters.
    '401':
      description: Unauthorized
      type: object
      properties:
        status:
          type: string
          nullable: false
          enum:
            - failed
        message:
          type: string
          nullable: true
          description: Invalid API key provided
          example: UNAUTHORIZED
        error:
          type: object
          properties:
            type:
              type: string
              example: UNAUTHORIZED
            code:
              type: string
              example: '10401'
            message:
              type: string
              example: unauthorized
    '403':
      description: Forbidden
      type: object
      properties:
        status:
          type: string
          nullable: false
          enum:
            - failed
        message:
          type: string
          description: API key doesn't have permission to access this resource
        error:
          type: object
          properties:
            type:
              type: string
              example: FORBIDDEN
            code:
              type: string
              example: '10403'
            message:
              type: string
              example: Forbidden
    '409':
      description: Conflict
      type: object
      properties:
        status:
          type: string
          nullable: false
          enum:
            - failed
        message:
          type: string
          description: The request conflicts with another request
        error:
          type: object
          properties:
            type:
              type: string
              example: RESOURCE_CONFLICT
            code:
              type: string
              example: '10409'
            message:
              type: string
              example: Resource conflict
    payment_method_in:
      oneOf:
        - $ref: '#/components/schemas/card_payment_method_in'
        - $ref: '#/components/schemas/bank_account_payment_method_in'
        - $ref: '#/components/schemas/mobile_money_payment_method_in'
        - $ref: '#/components/schemas/opay_payment_method_in'
        - $ref: '#/components/schemas/applepay_payment_method_in'
        - $ref: '#/components/schemas/googlepay_payment_method_in'
        - $ref: '#/components/schemas/ussd_payment_method_in'
        - $ref: '#/components/schemas/pwbt_payment_method_in'
      discriminator:
        propertyName: type
        mapping:
          card: '#/components/schemas/card_payment_method_in'
          bank_account: '#/components/schemas/bank_account_payment_method_in'
          mobile_money: '#/components/schemas/mobile_money_payment_method_in'
          opay: '#/components/schemas/opay_payment_method_in'
          applepay: '#/components/schemas/applepay_payment_method_in'
          googlepay: '#/components/schemas/googlepay_payment_method_in'
          ussd: '#/components/schemas/ussd_payment_method_in'
          bank_transfer: '#/components/schemas/pwbt_payment_method_in'
    status:
      type: string
      nullable: false
      enum:
        - success
        - failed
    payment_method:
      oneOf:
        - $ref: '#/components/schemas/card_payment_method'
        - $ref: '#/components/schemas/bank_account_payment_method'
        - $ref: '#/components/schemas/mobile_money_payment_method'
        - $ref: '#/components/schemas/opay_payment_method'
        - $ref: '#/components/schemas/applepay_payment_method'
        - $ref: '#/components/schemas/googlepay_payment_method'
        - $ref: '#/components/schemas/ussd_payment_method'
        - $ref: '#/components/schemas/pwbt_payment_method'
      discriminator:
        propertyName: type
        mapping:
          card: '#/components/schemas/card_payment_method'
          bank_account: '#/components/schemas/bank_account_payment_method'
          mobile_money: '#/components/schemas/mobile_money_payment_method'
          opay: '#/components/schemas/opay_payment_method'
          applepay: '#/components/schemas/applepay_payment_method'
          googlepay: '#/components/schemas/googlepay_payment_method'
          ussd: '#/components/schemas/ussd_payment_method'
          bank_transfer: '#/components/schemas/pwbt_payment_method'
    card_payment_method_in:
      allOf:
        - $ref: '#/components/schemas/base_payment_method_in'
      type: object
      required:
        - type
        - card
      properties:
        type:
          type: string
          description: The type of the payment method.
          default: card
          readOnly: true
        card:
          $ref: '#/components/schemas/encrypted_card_in'
    bank_account_payment_method_in:
      allOf:
        - $ref: '#/components/schemas/base_payment_method_in'
      type: object
      required:
        - type
      properties:
        type:
          type: string
          description: The type of the payment method.
          default: bank_account
          readOnly: true
        bank_account:
          $ref: '#/components/schemas/bank_account_in'
    mobile_money_payment_method_in:
      allOf:
        - $ref: '#/components/schemas/base_payment_method_in'
      type: object
      required:
        - type
        - mobile_money
      properties:
        type:
          type: string
          description: The type of the payment method.
          default: mobile_money
          readOnly: true
        mobile_money:
          $ref: '#/components/schemas/mobile_money_in'
    opay_payment_method_in:
      allOf:
        - $ref: '#/components/schemas/base_payment_method_in'
      type: object
      required:
        - type
      properties:
        type:
          type: string
          description: The type of the payment method.
          default: opay
          readOnly: true
        opay:
          $ref: '#/components/schemas/opay_in'
    applepay_payment_method_in:
      allOf:
        - $ref: '#/components/schemas/base_payment_method_in'
      type: object
      required:
        - type
      properties:
        type:
          type: string
          description: The type of the payment method.
          default: applepay
          readOnly: true
        applepay:
          $ref: '#/components/schemas/applepay_in'
    googlepay_payment_method_in:
      allOf:
        - $ref: '#/components/schemas/base_payment_method_in'
      type: object
      required:
        - type
      properties:
        type:
          type: string
          description: The type of the payment method.
          default: googlepay
          readOnly: true
        googlepay:
          $ref: '#/components/schemas/googlepay_in'
    ussd_payment_method_in:
      allOf:
        - $ref: '#/components/schemas/base_payment_method_in'
      type: object
      required:
        - type
        - ussd
      properties:
        type:
          type: string
          description: The type of the payment method.
          default: ussd
          readOnly: true
        ussd:
          $ref: '#/components/schemas/ussd_in'
    pwbt_payment_method_in:
      allOf:
        - $ref: '#/components/schemas/base_payment_method_in'
      type: object
      required:
        - type
        - bank_transfer
      properties:
        type:
          type: string
          description: The type of the payment method.
          default: bank_transfer
          readOnly: true
        bank_transfer:
          $ref: '#/components/schemas/pwbt_in'
    card_payment_method:
      allOf:
        - $ref: '#/components/schemas/base_payment_method'
      type: object
      required:
        - type
        - card
      properties:
        type:
          type: string
          description: The type of the payment method.
          default: card
          readOnly: true
        card:
          $ref: '#/components/schemas/card'
    bank_account_payment_method:
      allOf:
        - $ref: '#/components/schemas/base_payment_method'
      type: object
      required:
        - type
      properties:
        type:
          type: string
          description: The type of the payment method.
          default: bank_account
          readOnly: true
        bank_account:
          $ref: '#/components/schemas/bank_account'
    mobile_money_payment_method:
      allOf:
        - $ref: '#/components/schemas/base_payment_method'
      type: object
      required:
        - type
        - mobile_money
      properties:
        type:
          type: string
          description: The type of the payment method.
          default: mobile_money
          readOnly: true
        mobile_money:
          $ref: '#/components/schemas/mobile_money'
    opay_payment_method:
      allOf:
        - $ref: '#/components/schemas/base_payment_method'
      type: object
      required:
        - type
      properties:
        type:
          type: string
          description: The type of the payment method.
          default: opay
          readOnly: true
        opay:
          $ref: '#/components/schemas/opay'
    applepay_payment_method:
      allOf:
        - $ref: '#/components/schemas/base_payment_method'
      type: object
      required:
        - type
      properties:
        type:
          type: string
          description: The type of the payment method.
          default: applepay
          readOnly: true
        applepay:
          $ref: '#/components/schemas/applepay'
    googlepay_payment_method:
      allOf:
        - $ref: '#/components/schemas/base_payment_method'
      type: object
      required:
        - type
      properties:
        type:
          type: string
          description: The type of the payment method.
          default: googlepay
          readOnly: true
        googlepay:
          $ref: '#/components/schemas/googlepay'
    ussd_payment_method:
      allOf:
        - $ref: '#/components/schemas/base_payment_method'
      type: object
      required:
        - type
      properties:
        type:
          type: string
          description: The type of the payment method.
          default: ussd
          readOnly: true
        ussd:
          $ref: '#/components/schemas/ussd'
    pwbt_payment_method:
      allOf:
        - $ref: '#/components/schemas/base_payment_method'
      type: object
      required:
        - type
        - bank_transfer
      properties:
        type:
          type: string
          description: The type of the payment method.
          default: bank_transfer
          readOnly: true
        bank_transfer:
          $ref: '#/components/schemas/pwbt'
    base_payment_method_in:
      properties:
        type:
          type: string
          description: The type of the payment method.
          example: card
        customer_id:
          type: string
          description: ID of the customer.
          example: cus_3XarBILKQS
        meta:
          $ref: '#/components/schemas/meta'
    encrypted_card_in:
      type: object
      required:
        - encrypted_expiry_month
        - encrypted_expiry_year
        - encrypted_card_number
        - nonce
      properties:
        nonce:
          $ref: '#/components/schemas/nonce'
        encrypted_expiry_month:
          type: string
          description: Encrypted value of the card's expiry month.
          pattern: ^.+$
          x-pattern-message: value must not be empty
          example: sQpvQEb7GrUCjPuEN/NmHiPl
        encrypted_expiry_year:
          type: string
          description: Encrypted value of the card's expiry year.
          pattern: ^.+$
          x-pattern-message: value must not be empty
          example: sgHNEDkJ/RmwuWWq/RymToU5
        encrypted_card_number:
          type: string
          description: Encrypted value of the card number.
          pattern: ^.+$
          x-pattern-message: value must not be empty
          example: sAE3hEDaDQ+yLzo4Py+Lx15OZjBGduHu/DcdILh3En0=
        encrypted_cvv:
          type: string
          description: Encrypted value of the card's security code (CVV/CSC).
          pattern: ^.+$
          x-pattern-message: value must not be empty
          example: tAUzH7Qjma7diGdi7938F/ESNA==
        billing_address:
          $ref: '#/components/schemas/address'
        cof:
          $ref: '#/components/schemas/credential_on_file_in'
        card_holder_name:
          type: string
          description: Name on the card
          example: Alex James
    bank_account_in:
      type: object
    mobile_money_in:
      type: object
      required:
        - network
        - phone_number
        - country_code
      properties:
        network:
          type: string
          description: The mobile network of the customer's phone number.
          example: MTN
        country_code:
          type: string
          example: '234'
          pattern: ^[0-9]{1,3}$
          description: ISO 3166 alpha-3 country code.
          x-pattern-message: must be a valid 3 digit country code
        phone_number:
          type: string
          example: '8001122334'
          pattern: ^[0-9]{7,10}$
          x-pattern-message: must be a valid 7 to 10 digit phone number
          description: Unformatted 7-10-digit phone number without the country code.
    opay_in:
      type: object
    applepay_in:
      type: object
      properties:
        card_holder_name:
          type: string
          description: The cardholder name.
          example: Yohan Blake
          pattern: ^(?![ ,.'-]*$)[A-Za-z ,.'-]{2,50}$
          x-pattern-message: >-
            must be between 2 and 50 characters long, cannot be empty, only
            spaces, or only symbols, and can only contain letters, spaces,
            commas, periods, apostrophes, or hyphens.
    googlepay_in:
      type: object
      properties:
        card_holder_name:
          type: string
          description: The cardholder name.
          example: Yohan Blake
          pattern: ^(?![ ,.'-]*$)[A-Za-z ,.'-]{2,50}$
          x-pattern-message: >-
            must be between 2 and 50 characters long, cannot be empty, only
            spaces, or only symbols, and can only contain letters, spaces,
            commas, periods, apostrophes, or hyphens.
    ussd_in:
      type: object
      required:
        - account_bank
      properties:
        account_bank:
          type: string
          pattern: ^\d{3,}$
          description: A valid Nigerian bank code consisting of 3 or more digits.
          example: '050'
          x-pattern-message: must be more than 3 digits long and contain only numbers.
    pwbt_in:
      type: object
      required:
        - account_type
      properties:
        account_expires_in:
          type: integer
          description: The expiry time of the virtual account.
          maximum: 432000
        account_type:
          $ref: '#/components/schemas/pwbt_type'
        bvn:
          type: string
          description: This is the customer's Bank Verification Number.
          pattern: ^[1-9][0-9]{10}$
          x-pattern-message: bvn must be exactly 11 characters long and a signed integer
          example: '12345678912'
        nin:
          type: string
          description: This is the customer's National Identity Number.
          pattern: ^[1-9][0-9]{10}$
          x-pattern-message: nin must be exactly 11 characters long and a signed integer
          example: '12345678912'
    base_payment_method:
      required:
        - id
        - type
      properties:
        id:
          $ref: '#/components/schemas/payment_method_id'
        type:
          type: string
          description: The type of the payment method.
          example: card
        customer_id:
          type: string
          description: ID of the customer.
          example: cus_3XarBILKQS
        meta:
          $ref: '#/components/schemas/meta'
        device_fingerprint:
          description: The customer's device fingerprint.
          type: string
          example: 62wd23423rq324323qew1
        client_ip:
          description: The customer's device IP.
          type: string
          example: 154.123.220.1
        created_datetime:
          type: string
          format: date-time
          description: The date and time when the virtual account was created.
          example: '2024-12-03T13:54:21.546559974Z'
    card:
      type: object
      required:
        - expiry_month
        - expiry_year
        - first6
        - last4
        - network
      properties:
        expiry_month:
          type: integer
          description: Expiry month of the card.
          example: '09'
        expiry_year:
          type: integer
          description: Expiry year of the card.
          example: '32'
        first6:
          type: string
          description: Bank identification number (BIN) of the card.
          minLength: 6
          maxLength: 6
          example: '123412'
        last4:
          type: string
          description: The last four digits of the card number.
          minLength: 4
          maxLength: 4
          example: '1234'
        network:
          $ref: '#/components/schemas/card_network'
        billing_address:
          $ref: '#/components/schemas/address'
        cof:
          $ref: '#/components/schemas/credential_on_file'
        card_holder_name:
          type: string
          description: Name on the card
          example: Alex James
    bank_account:
      type: object
    mobile_money:
      type: object
      required:
        - network
        - phone_number
        - country_code
      properties:
        network:
          type: string
          description: The mobile network of the customer's phone number.
          example: MTN
        country_code:
          type: string
          description: ISO 3166 alpha-3 country code.
          example: '233'
        phone_number:
          type: string
          description: The phone number of customer.
          example: '9012345678'
    opay:
      type: object
    applepay:
      type: object
      properties:
        card_holder_name:
          type: string
          description: The cardholder name.
          example: Yohan Blake
    googlepay:
      type: object
      properties:
        card_holder_name:
          type: string
          description: The cardholder name.
          example: Yohan Blake
    ussd:
      type: object
      properties:
        account_bank:
          type: string
          description: The bank code of the USSD string to generate.
          example: '050'
    pwbt:
      type: object
      required:
        - account_type
      properties:
        account_expires_in:
          type: integer
          description: The expiry time of the virtual account.
          example: 360
          maximum: 432000
        account_display_name:
          type: string
          description: >-
            The name that is shown to the customer when the account is resolved
            to a name.
          example: Alex James
          minLength: 3
          maxLength: 256
        account_type:
          $ref: '#/components/schemas/pwbt_type'
        originator_bank_name:
          type: string
          description: The sender's Bank name
          example: Mock Bank
        originator_account_number:
          type: string
          description: The Sender's masked account number
          example: 002*******78
        originator_name:
          type: string
          description: The sender's name
          example: Jane Doe
    meta:
      type: object
      additionalProperties:
        type: string
    nonce:
      type: string
      pattern: ^[a-zA-Z0-9]+$
      minLength: 12
      maxLength: 12
      description: >-
        A single-use 12 character alphanumeric string for field-level
        encryption.
      x-pattern-message: must be an alphanumeric string of length 12
    address:
      type: object
      description: Customer address information.
      required:
        - line1
        - city
        - state
        - country
        - postal_code
      properties:
        city:
          type: string
          description: The name of the city.
          example: New York
          pattern: ^.+$
          x-pattern-message: value must not be empty
        country:
          description: ISO2 country code
          type: string
          pattern: ^[A-Z]{2}$
          example: US
          x-pattern-message: must be a valid country ISO2 format
        line1:
          type: string
          description: The first line of the Customer's address.
          example: 123 Main Street
          pattern: ^.+$
          x-pattern-message: value must not be empty
        line2:
          type: string
          description: The second line of the Customer's address.
          example: Apt 4B
          pattern: ^.+$
          x-pattern-message: value must not be empty
        postal_code:
          type: string
          example: '10001'
          pattern: ^.+$
          x-pattern-message: value must not be empty
        state:
          type: string
          description: The state or region.
          example: New York
          pattern: ^.+$
          x-pattern-message: value must not be empty
    credential_on_file_in:
      type: object
      required:
        - enabled
      properties:
        enabled:
          type: boolean
          description: >-
            Set to true to enable recurring card charge with Credential-on-File
            (COF).
          example: true
        agreement_id:
          type: string
          description: >-
            A unique reference generated by Flutterwave during the initial
            Customer Initiated Transaction (CIT).
          example: Agreement00w02W1
        trace_id:
          type: string
          description: >-
            A reference generated by the card scheme during the initial Customer
            Initiated Transaction (CIT).
          example: '123456789'
    pwbt_type:
      type: string
      description: The type of virtual account.
      example: static
      enum:
        - static
        - dynamic
    payment_method_id:
      type: string
      description: ID of the payment method.
      example: pmd_WRq7L4TM8p
    card_network:
      type: string
      description: The card network.
      example: MASTERCARD
      enum:
        - MASTERCARD
        - VISA
        - AMERICAN EXPRESS
        - DISCOVER
        - VERVE
        - AFRIGO
        - UNKNOWN
    credential_on_file:
      type: object
      required:
        - enabled
      properties:
        enabled:
          type: boolean
          description: >-
            Indicates whether the recurring card charge with Credential-on-File
            (COF) is enabled.
          example: true
        agreement_id:
          type: string
          description: >-
            A unique reference generated by Flutterwave during the initial
            Customer Initiated Transaction (CIT).
          example: Agreement00w02W1
        recurring_amount_variability:
          type: string
          description: >-
            This indicates whether the amount charged for subsequent payments
            remains the same, or differs.
          example: VARIABLE
          enum:
            - VARIABLE
        agreement_type:
          type: string
          definition: This indicates the type of charge agreement with Flutterwave.
          example: UNSCHEDULED
          enum:
            - UNSCHEDULED
        trace_id:
          type: string
          description: >-
            A reference generated by the card scheme during the initial Customer
            Initiated Transaction (CIT).
          example: '123456789'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````