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

# Create payment method

> Create payment method



## OpenAPI

````yaml post /v1/payment-methods
openapi: 3.0.0
info:
  description: Open API's for WizCommerce API's
  title: WizCommerce Open API's
  termsOfService: https://wizcommerce.com/terms/
  contact:
    name: Tech Support
    url: https://help.wizcommerce.com/
    email: tech@wizcommerce.com
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  version: '1.0'
servers:
  - url: https://api.wizcommerce.com
    description: Production BaseURL
  - url: https://api-staging.sourcerer.tech
    description: Staging BaseURL
security: []
paths:
  /v1/payment-methods:
    post:
      tags:
        - PaymentMethod
      summary: Create payment method
      description: Create payment method
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/dtos.PaymentMethodCreateRequest'
        description: body
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/dtos.SuccessResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/dtos.PaymentMethodResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    dtos.PaymentMethodCreateRequest:
      type: object
      required:
        - brand
        - card_expiry
        - card_type
        - customer_id
        - last_four_digits
        - payment_method_type
        - provider
        - reference_id
        - token
      properties:
        reference_id:
          type: string
          maxLength: 255
          x-order: '1'
          example: CRD_1234567890
        customer_id:
          type: string
          x-order: '2'
          example: 00000000-0000-0000-0000-000000000000
        provider:
          type: string
          maxLength: 50
          x-order: '2.5'
          example: stripe
        external_customer_id:
          type: string
          maxLength: 255
          x-order: '2.6'
          example: cus_ABC123456
        payment_method_type:
          type: string
          maxLength: 50
          x-order: '3'
          example: card
        card_type:
          type: string
          maxLength: 50
          x-order: '4'
          example: debit
        brand:
          type: string
          maxLength: 50
          x-order: '5'
          example: visa
        card_expiry:
          type: string
          x-order: '6'
          example: 09/25
        last_four_digits:
          type: string
          maxLength: 4
          x-order: '7'
          example: '1111'
        display_name:
          type: string
          maxLength: 50
          x-order: '8'
          example: John Doe
        is_default:
          type: boolean
          default: false
          x-order: '9'
        token:
          type: string
          x-order: '10'
          example: PIuTv1UgBqESZ2KRDixPtDJt~1234567890
        address_line_1:
          type: string
          maxLength: 255
          x-order: '11'
          example: 123 Main St
        address_line_2:
          type: string
          maxLength: 255
          x-order: '12'
          example: Apt 101
        city:
          type: string
          maxLength: 50
          x-order: '13'
          example: Anytown
        state:
          type: string
          maxLength: 50
          x-order: '14'
          example: CA
        country:
          type: string
          x-order: '15'
          example: US
        zip_code:
          type: string
          maxLength: 50
          x-order: '16'
          example: '12345'
        email:
          type: string
          x-order: '17'
          example: john.doe@example.com
        phone:
          type: string
          x-order: '18'
          example: '+14155552671'
        first_name:
          type: string
          maxLength: 50
          x-order: '19'
          example: John
        last_name:
          type: string
          maxLength: 50
          x-order: '20'
          example: Doe
    dtos.SuccessResponse:
      type: object
      properties:
        data:
          x-order: '1'
    dtos.PaymentMethodResponse:
      type: object
      properties:
        id:
          description: UUID
          type: string
          x-order: '1'
          example: 01f5d171-d3e3-4b2b-bd57-0727194b5bed
        reference_id:
          type: string
          x-order: '2'
          example: EXT-878
        customer_id:
          type: string
          x-order: '3'
          example: CST-137
        provider:
          type: string
          x-order: '3.5'
          example: stax
        payment_method_type:
          type: string
          x-order: '4'
          example: card
        card_type:
          type: string
          x-order: '5'
          example: debit
        brand:
          type: string
          x-order: '6'
          example: visa
        status:
          type: string
          x-order: '7'
          example: active
        card_expiry:
          type: string
          x-order: '8'
          example: 09/25
        last_four_digits:
          type: string
          x-order: '9'
          example: '1234'
        display_name:
          type: string
          x-order: '10'
          example: John Doe
        address_line_1:
          type: string
          x-order: '13'
          example: 123 Main St
        address_line_2:
          type: string
          x-order: '14'
          example: Apt 101
        city:
          type: string
          x-order: '15'
          example: Anytown
        state:
          type: string
          x-order: '16'
          example: CA
        country:
          type: string
          x-order: '17'
          example: US
        zip_code:
          type: string
          x-order: '18'
          example: '12345'
        email:
          type: string
          x-order: '19'
          example: john.doe@example.com
        phone:
          type: string
          x-order: '20'
          example: '+14155552671'
        first_name:
          type: string
          x-order: '21'
          example: John
        last_name:
          type: string
          x-order: '22'
          example: Doe
        created_at:
          type: string
          x-order: '23'
          example: '2025-01-01T15:04:05Z'
        updated_at:
          type: string
          x-order: '24'
          example: '2025-01-01T15:04:05Z'
        is_default:
          type: boolean
          x-order: '25'
          example: false
    errors.HttpError:
      type: object
      properties:
        code:
          type: string
          x-order: '1'
        message:
          type: string
          x-order: '2'
        details:
          type: array
          items:
            $ref: '#/components/schemas/errors.HttpErrorDetails'
          x-order: '3'
    errors.HttpErrorDetails:
      type: object
      properties:
        field:
          type: string
          x-order: '1'
        reason:
          type: string
          x-order: '2'
  securitySchemes:
    ApiKeyAuth:
      description: API Key for authentication
      type: apiKey
      name: X-API-Key
      in: header

````