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

# Refund a payment

> Refund a payment



## OpenAPI

````yaml /api-reference/openapi3.json post /payments/refund/{id}
openapi: 3.0.1
info:
  contact: {}
  description: Billing API
  title: Billing
  version: '2.0'
servers:
  - url: https://sandbox-api.paynext.com/
security: []
paths:
  /payments/refund/{id}:
    post:
      tags:
        - Payments
      summary: Refund a payment
      description: Refund a payment
      parameters:
        - description: Specifies the version of the API to use
          in: header
          name: X-API-Version
          schema:
            enum:
              - 1.0.0
            type: string
            default: 1.0.0
          required: true
        - description: The ID of the payment to refund
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/core_model.PaymentWithSubscriptionPlanCustomerRelationsResDTO
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pkg_server.HttpResErrorDTO'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pkg_server.HttpResErrorDTO'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pkg_server.HttpResErrorDTO'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pkg_server.HttpResErrorDTO'
          description: Internal Server Error
      security:
        - Auth: []
components:
  schemas:
    core_model.PaymentWithSubscriptionPlanCustomerRelationsResDTO:
      properties:
        amount:
          description: Payment amount in the specified currency (e.g., cents)
          example: 15000
          type: integer
        amount_usd:
          description: Payment amount converted to USD (e.g., cents)
          example: 15000
          type: integer
        avs_check:
          allOf:
            - $ref: '#/components/schemas/core_model.PaymentResAvsCheckDTO'
          description: Avs check
          type: object
        created_at:
          description: The date and time at which the payment was created in UTC format.
          example: '2025-05-25T14:30:00Z'
          type: string
          x-order: '1'
        currency_code:
          description: >-
            The 3-letter currency code in ISO 4217 format. e.g. use USD for US
            dollars.
          enum:
            - AED
            - AFN
            - ALL
            - AMD
            - AOA
            - ARS
            - AUD
            - AWG
            - AZN
            - BAM
            - BBD
            - BDT
            - BGN
            - BHD
            - BIF
            - BMD
            - BND
            - BOB
            - BRL
            - BSD
            - BTN
            - BWP
            - BYN
            - BZD
            - CAD
            - CDF
            - CHF
            - CLP
            - CNY
            - COP
            - CRC
            - CUC
            - CUP
            - CVE
            - CZK
            - DJF
            - DKK
            - DOP
            - DZD
            - EGP
            - ERN
            - ETB
            - EUR
            - FJD
            - FKP
            - GBP
            - GEL
            - GHS
            - GIP
            - GMD
            - GNF
            - GTQ
            - GYD
            - HKD
            - HNL
            - HTG
            - HUF
            - IDR
            - ILS
            - IMP
            - INR
            - IQD
            - IRR
            - ISK
            - JEP
            - JMD
            - JOD
            - JPY
            - KES
            - KGS
            - KHR
            - KMF
            - KPW
            - KRW
            - KWD
            - KYD
            - KZT
            - LAK
            - LBP
            - LKR
            - LRD
            - LSL
            - LYD
            - MAD
            - MDL
            - MGA
            - MKD
            - MMK
            - MNT
            - MOP
            - MRU
            - MUR
            - MVR
            - MWK
            - MXN
            - MYR
            - MZN
            - NAD
            - NGN
            - NIO
            - NOK
            - NPR
            - NZD
            - OMR
            - PAB
            - PEN
            - PGK
            - PHP
            - PKR
            - PLN
            - PYG
            - QAR
            - RON
            - RSD
            - RUB
            - RWF
            - SAR
            - SBD
            - SCR
            - SDG
            - SEK
            - SGD
            - SHP
            - SLE
            - SOS
            - SRD
            - SSP
            - STD
            - STN
            - SVC
            - SYP
            - SZL
            - THB
            - TJS
            - TMT
            - TND
            - TOP
            - TRY
            - TTD
            - TWD
            - TZS
            - BOV
            - COU
            - CHE
            - CHW
            - MXV
            - UGX
            - VES
            - VND
            - VUV
            - XAF
            - XCD
            - XCG
            - XOF
            - XPF
            - YER
            - USD
          type: string
        customer:
          $ref: '#/components/schemas/core_model.CustomerResDTO'
        cvc_check:
          allOf:
            - $ref: '#/components/schemas/core_model.PaymentResCVCCheckDTO'
          description: CVC check
          type: object
        id:
          description: Unique identifier of the payment.
          example: pay_e8a1b2c3-d4f5-6789-abcd-ef0123456789
          type: string
          x-order: '0'
        metadata:
          additionalProperties:
            type: string
          description: |-
            Custom metadata associated with the payment
            A dictionary of key-value pairs.
          example:
            key: value
          type: object
        payment_details:
          allOf:
            - $ref: '#/components/schemas/core_model.PaymentResPaymentDetailsDTO'
          description: Transaction details related to payment
          type: object
        payment_method:
          allOf:
            - $ref: '#/components/schemas/core_model.PaymentMethodResDTO'
          nullable: true
        payment_status:
          description: Current status of the payment
          enum:
            - PENDING
            - FAILED
            - AUTHORIZED
            - SETTLING
            - SETTLED
            - DECLINED
            - BLOCKED
            - CANCELLED
          type: string
        payment_token_type:
          description: Type of card token used, if applicable
          enum:
            - CARD_PAN
            - NETWORK_TOKEN
            - PROCESSOR_TOKEN
          type: string
        payment_type:
          description: >-
            Indicates whether the transaction was merchant-initiated (MIT) or
            customer-initiated (CIT).
          enum:
            - MIT
            - CIT
          type: string
        processor:
          $ref: '#/components/schemas/core_model.ProcessorResDTO'
        refund:
          allOf:
            - $ref: '#/components/schemas/core_model.RefundData'
          description: Information about refund
          type: object
        refunded_amount:
          description: Amount refunded from the original payment
          example: 0
          type: integer
        refund_reason:
          description: >-
            Server-attested reason the payment was refunded; present only once a
            refund has executed, null otherwise
          enum:
            - merchant_initiated
            - fraud_prevention
          example: fraud_prevention
          type: string
        statement_descriptor:
          description: Statement descriptor shown on the customer's bank statement
          example: MY COMPANY
          type: string
        status_reason:
          allOf:
            - $ref: '#/components/schemas/core_model.PaymentResStatusReasonDTO'
          description: Reason of payment status
          type: object
        subscription:
          $ref: >-
            #/components/schemas/core_model.SubscriptionResWithPlanCustomerRelationsDTO
        tax:
          allOf:
            - $ref: '#/components/schemas/core_model.PaymentTax'
          description: Tax info (provider, calculation/transaction ids, amounts, status)
          type: object
        three_d_secure:
          allOf:
            - $ref: '#/components/schemas/core_model.ThreeDSecureDataResDTO'
          description: Information about 3DS
          type: object
        updated_at:
          description: The date and time of the last payment update in UTC format.
          example: '2025-05-26T10:15:00Z'
          type: string
          x-order: '2'
      type: object
    pkg_server.HttpResErrorDTO:
      properties:
        error:
          allOf:
            - $ref: '#/components/schemas/pkg_server.HttpErrorDTO'
          description: Description of the error
          type: object
      type: object
    core_model.PaymentResAvsCheckDTO:
      properties:
        result:
          allOf:
            - $ref: '#/components/schemas/core_model.PaymentResAvsCheckResultDTO'
          description: Avs check result
          type: object
      type: object
    core_model.CustomerResDTO:
      properties:
        address:
          allOf:
            - $ref: '#/components/schemas/core_model.BillingAddress'
          description: Address associated with customer
          type: object
          x-order: '3'
        created_at:
          description: The date and time the customer was created in UTC format
          example: '2025-05-28T14:00:00Z'
          type: string
          x-order: '1'
        email:
          description: Email of the customer
          example: alice.johnson@example.com
          type: string
          x-order: '4'
        external_id:
          description: External ID of the customer
          example: ext_001
          type: string
          x-order: '5'
        full_name:
          description: Full name of the customer
          example: Alice Johnson
          type: string
          x-order: '7'
        id:
          description: Unique identifier
          example: cus_b8d0fe7e-3a7f-4b5f-a68b-d31358b49c3f
          type: string
          x-order: '0'
        metadata:
          additionalProperties:
            type: string
          description: Additional metadata as a JSON object
          example:
            key: value
          type: object
          x-order: '6'
        phone:
          description: Customer's phone number
          example: +1-555-123-4567
          type: string
          x-order: '8'
        updated_at:
          description: The date and time the customer was last updated in UTC format
          example: '2025-05-28T14:05:00Z'
          type: string
          x-order: '2'
      type: object
    core_model.PaymentResCVCCheckDTO:
      properties:
        result:
          allOf:
            - $ref: '#/components/schemas/core_model.PaymentResCVCCheckResultDTO'
          description: CVC check result
          type: object
      type: object
    core_model.PaymentResPaymentDetailsDTO:
      properties:
        arn:
          description: ARN
          example: '123453'
          type: string
        auth_code:
          description: Auth code
          example: '334385'
          type: string
        network_payment_id:
          description: Network payment ID
          example: '119676610486528'
          type: string
        processor_transaction_id:
          description: Processor transaction ID
          example: pi_3RgN6TJVVBuowJOx0B4fpGWi
          type: string
      type: object
    core_model.PaymentMethodResDTO:
      discriminator:
        mapping:
          APPLEPAY:
            $ref: '#/components/schemas/ApplepayAPISchema'
          CARD:
            $ref: '#/components/schemas/CardAPISchema'
          CASHAPP:
            $ref: '#/components/schemas/CashappAPISchema'
          GPAY:
            $ref: '#/components/schemas/GpayAPISchema'
          PAYPAL:
            $ref: '#/components/schemas/PaypalAPISchema'
          VENMO:
            $ref: '#/components/schemas/VenmoAPISchema'
        propertyName: type
      oneOf:
        - $ref: '#/components/schemas/CardAPISchema'
        - $ref: '#/components/schemas/PaypalAPISchema'
        - $ref: '#/components/schemas/VenmoAPISchema'
        - $ref: '#/components/schemas/CashappAPISchema'
        - $ref: '#/components/schemas/ApplepayAPISchema'
        - $ref: '#/components/schemas/GpayAPISchema'
    core_model.ProcessorResDTO:
      properties:
        description:
          description: Description of the processor
          example: Stripe US
          type: string
        id:
          description: Unique identifier of the processor
          example: a1b2c3d4-5678-90ab-cdef-1234567890ab
          type: string
          x-order: '0'
        processor_merchant_id:
          description: Merchant ID of the processor
          example: '12345678'
          type: string
        type:
          description: Type of the processor
          example: STRIPE
          type: string
      type: object
    core_model.RefundData:
      properties:
        amount:
          type: integer
        amount_usd:
          type: integer
        created_at:
          type: string
        processor_transaction_id:
          type: string
        status:
          $ref: '#/components/schemas/core_model.RefundStatus'
        updated_at:
          type: string
      type: object
    core_model.PaymentResStatusReasonDTO:
      properties:
        status:
          description: Status of error
          enum:
            - declined
            - failed
          example: declined
          type: string
        status_reason:
          allOf:
            - $ref: '#/components/schemas/core_model.PaymentStatusReason'
          description: Status Reason
          type: object
      type: object
    core_model.SubscriptionResWithPlanCustomerRelationsDTO:
      properties:
        created_at:
          description: >-
            The date and time at which the subscription was created in UTC
            format
          example: '2025-05-26T10:00:00Z'
          type: string
          x-order: '1'
        current_period_end:
          type: string
        cancelled_at:
          description: >-
            UTC timestamp of when the subscription became cancelled; null unless
            the subscription is cancelled
          example: '2026-06-10T14:32:08Z'
          type: string
        cancellation_details:
          description: >-
            Server-attested cancellation attribution. Always present; sub-fields
            are null unless the subscription is cancelled (or scheduled for
            cancellation).
          properties:
            reason:
              description: Why the subscription was cancelled
              enum:
                - merchant_initiated
                - past_due_max_attempts_reached
                - workflow_action
                - fraud_prevention
              example: fraud_prevention
              type: string
            trigger_payment_id:
              description: >-
                Payment that triggered a system cancellation (prefixed pay_);
                null for merchant-initiated cancels
              example: pay_e8a1b2c3-1d2e-3f4a-5b6c-7d8e9f0a1b2c
              type: string
          type: object
        current_period_start:
          type: string
        id:
          description: Unique identifier for the subscription
          example: sub_123e4567-e89b-12d3-a456-426614174000
          type: string
          x-order: '0'
        metadata:
          additionalProperties:
            type: string
          description: |-
            Custom metadata associated with the subscription
            A dictionary of key-value pairs.
          example:
            key: value
          type: object
        next_billing_date:
          description: Next scheduled billing date for the subscription
          example: '2025-06-26T12:00:00Z'
          type: string
        past_due:
          allOf:
            - $ref: '#/components/schemas/core_model.SubscriptionPastDueAttemptsInfo'
          description: Information about past due attempts
          type: object
        plan:
          $ref: '#/components/schemas/core_model.PlanCustomerResDTO'
        status:
          description: Current status of the subscription
          enum:
            - trial
            - active
            - past_due
            - cancelled
            - scheduled_for_cancellation
          type: string
        updated_at:
          description: The date and time of the last subscription update in UTC format
          example: '2025-05-27T10:00:00Z'
          type: string
          x-order: '2'
      type: object
    core_model.PaymentTax:
      properties:
        amount_subtotal:
          type: integer
        amount_subtotal_usd:
          type: integer
        amount_tax:
          type: integer
        amount_tax_usd:
          type: integer
        behavior:
          allOf:
            - $ref: '#/components/schemas/core_model.TaxCalculationType'
          description: exclusive / inclusive
          type: object
        calculation_id:
          type: string
        error:
          $ref: '#/components/schemas/core_model.PaymentTaxError'
        provider:
          $ref: '#/components/schemas/core_model.PaymentTaxProvider'
        status:
          allOf:
            - $ref: '#/components/schemas/core_model.PaymentTaxStatus'
          description: calculated, submitted, reversed, failed
          type: object
        transaction_id:
          type: string
      type: object
    core_model.ThreeDSecureDataResDTO:
      properties:
        authentication_flow:
          type: string
        electronic_commerce_indicator:
          $ref: '#/components/schemas/core_model.ThreeDSecureDataECIResDTO'
        status:
          $ref: '#/components/schemas/core_model.ThreeDSStatus'
        status_reason:
          type: string
        transaction_id:
          type: string
        version:
          type: string
      type: object
    pkg_server.HttpErrorDTO:
      properties:
        message:
          description: Description of the error
          example: some error message
          type: string
      type: object
    core_model.PaymentResAvsCheckResultDTO:
      properties:
        postal_code:
          description: |-
            Avs check postal code result
            Available values: `fail`, `pass`, `unavailable`, `unchecked`
          example: pass
          type: string
        street_address:
          description: |-
            Avs check street address result.
            Available values: `fail`, `pass`, `unavailable`, `unchecked`
          example: pass
          type: string
      type: object
    core_model.BillingAddress:
      properties:
        city:
          example: San Francisco
          type: string
        country:
          enum:
            - AD
            - AE
            - AF
            - AG
            - AL
            - AM
            - AO
            - AR
            - AS
            - AT
            - AU
            - AW
            - AX
            - AZ
            - BA
            - BB
            - BD
            - BE
            - BF
            - BG
            - BH
            - BI
            - BJ
            - BL
            - BM
            - BN
            - BO
            - BQ
            - BR
            - BS
            - BT
            - BW
            - BY
            - BZ
            - CA
            - CD
            - CF
            - CG
            - CH
            - CI
            - CL
            - CM
            - CN
            - CO
            - CR
            - CU
            - CU-P
            - CV
            - CW
            - CY
            - CZ
            - DE
            - DJ
            - DK
            - DM
            - DO
            - DZ
            - EC
            - EE
            - EG
            - ER
            - ES
            - ET
            - FI
            - FJ
            - FK
            - FM
            - FR
            - GA
            - GB
            - GD
            - GE
            - GF
            - GG
            - GH
            - GI
            - GL
            - GM
            - GN
            - GP
            - GQ
            - GR
            - GT
            - GU
            - GW
            - GY
            - HK
            - HN
            - HR
            - HT
            - HU
            - ID
            - IE
            - IL
            - IM
            - IN
            - IQ
            - IR
            - IS
            - IT
            - JE
            - JM
            - JO
            - JP
            - KE
            - KG
            - KH
            - KI
            - KM
            - KN
            - KP
            - KR
            - KW
            - KY
            - KZ
            - LA
            - LB
            - LC
            - LI
            - LK
            - LR
            - LS
            - LT
            - LU
            - LV
            - LY
            - MA
            - MC
            - MD
            - ME
            - MF
            - MG
            - MH
            - MK
            - ML
            - MM
            - MN
            - MO
            - MP
            - MQ
            - MR
            - MS
            - MT
            - MU
            - MV
            - MW
            - MX
            - MY
            - MZ
            - NA
            - NC
            - NE
            - NG
            - NI
            - NL
            - 'NO'
            - NP
            - NR
            - NU
            - NZ
            - OM
            - PA
            - PE
            - PF
            - PG
            - PH
            - PK
            - PL
            - PM
            - PN
            - PR
            - PS
            - PT
            - PW
            - PY
            - QA
            - RE
            - RO
            - RS
            - RU
            - RW
            - SA
            - SB
            - SC
            - SD
            - SE
            - SG
            - SH
            - SI
            - SK
            - SL
            - SM
            - SN
            - SO
            - SR
            - SS
            - ST
            - SV
            - SX
            - SY
            - SZ
            - TC
            - TD
            - TG
            - TH
            - TJ
            - TK
            - TL
            - TM
            - TN
            - TO
            - TR
            - TT
            - TV
            - TW
            - TZ
            - UA
            - UG
            - US
            - UY
            - UZ
            - VA
            - VC
            - VE
            - VG
            - VI
            - VN
            - VU
            - WF
            - WS
            - XK
            - YE
            - YT
            - ZA
            - ZM
            - ZW
          type: string
        line1:
          example: 123 Market Street
          type: string
        line2:
          example: Suite 400
          type: string
        postal_code:
          example: '94105'
          type: string
        state:
          example: CA
          type: string
      type: object
    core_model.PaymentResCVCCheckResultDTO:
      properties:
        cvc:
          description: |-
            CVC check result
            Available values: `fail`, `pass`, `unavailable`, `unchecked`
          example: pass
          type: string
      type: object
    ApplepayAPISchema:
      properties:
        billing_address:
          allOf:
            - $ref: '#/components/schemas/core_model.BillingAddress'
          description: Billing address associated with the payment method
          type: object
          x-order: '2'
        details:
          $ref: '#/components/schemas/ApplePayPaymentMethodDetails'
        status:
          description: >-
            Lifecycle status of the payment method. For a card this describes
            the card itself, not its network token.
          enum:
            - active
            - expired
            - replaced
            - closed
            - invalid
            - revoked
          example: active
          type: string
          x-order: '5'
        type:
          enum:
            - APPLEPAY
          type: string
      required:
        - type
        - details
      title: Apple Pay API Schema
      type: object
    CardAPISchema:
      properties:
        billing_address:
          allOf:
            - $ref: '#/components/schemas/core_model.BillingAddress'
          description: Billing address associated with the payment method
          type: object
          x-order: '2'
        card_updater:
          description: Whether the card is enrolled in the Card Account Updater service.
          example: true
          type: boolean
          x-order: '6'
        details:
          $ref: '#/components/schemas/CardPaymentMethodDetails'
        fpan_out_of_sync:
          description: >-
            Informational. The stored card number is known to be out of date and
            a refresh is pending. Do not gate charging on this field.
          example: false
          type: boolean
          x-order: '7'
        status:
          description: >-
            Lifecycle status of the payment method. For a card this describes
            the card itself, not its network token.
          enum:
            - active
            - expired
            - replaced
            - closed
            - invalid
            - revoked
          example: active
          type: string
          x-order: '5'
        type:
          enum:
            - CARD
          type: string
      required:
        - type
        - details
      title: Card API Schema
      type: object
    CashappAPISchema:
      properties:
        details:
          $ref: '#/components/schemas/CashAppPaymentMethodDetails'
        status:
          description: >-
            Lifecycle status of the payment method. For a card this describes
            the card itself, not its network token.
          enum:
            - active
            - expired
            - replaced
            - closed
            - invalid
            - revoked
          example: active
          type: string
          x-order: '5'
        type:
          enum:
            - CASHAPP
          type: string
      required:
        - type
        - details
      title: CashApp API Schema
      type: object
    GpayAPISchema:
      properties:
        billing_address:
          allOf:
            - $ref: '#/components/schemas/core_model.BillingAddress'
          description: Billing address associated with the payment method
          type: object
          x-order: '2'
        card_updater:
          description: Whether the card is enrolled in the Card Account Updater service.
          example: true
          type: boolean
          x-order: '6'
        details:
          $ref: '#/components/schemas/GooglePayPaymentMethodDetails'
        fpan_out_of_sync:
          description: >-
            Informational. The stored card number is known to be out of date and
            a refresh is pending. Do not gate charging on this field.
          example: false
          type: boolean
          x-order: '7'
        status:
          description: >-
            Lifecycle status of the payment method. For a card this describes
            the card itself, not its network token.
          enum:
            - active
            - expired
            - replaced
            - closed
            - invalid
            - revoked
          example: active
          type: string
          x-order: '5'
        type:
          enum:
            - GPAY
          type: string
      required:
        - type
        - details
      title: Google Pay API Schema
      type: object
    PaypalAPISchema:
      properties:
        details:
          $ref: '#/components/schemas/PayPalPaymentMethodDetails'
        status:
          description: >-
            Lifecycle status of the payment method. For a card this describes
            the card itself, not its network token.
          enum:
            - active
            - expired
            - replaced
            - closed
            - invalid
            - revoked
          example: active
          type: string
          x-order: '5'
        type:
          enum:
            - PAYPAL
          type: string
      required:
        - type
        - details
      title: PayPal API Schema
      type: object
    VenmoAPISchema:
      properties:
        details:
          $ref: '#/components/schemas/VenmoPaymentMethodDetails'
        status:
          description: >-
            Lifecycle status of the payment method. For a card this describes
            the card itself, not its network token.
          enum:
            - active
            - expired
            - replaced
            - closed
            - invalid
            - revoked
          example: active
          type: string
          x-order: '5'
        type:
          enum:
            - VENMO
          type: string
      required:
        - type
        - details
      title: Venmo API Schema
      type: object
    core_model.RefundStatus:
      enum:
        - PENDING
        - DECLINED
        - SETTLING
        - SETTLED
      type: string
      x-enum-varnames:
        - RefundStatusPENDING
        - RefundStatusDECLINED
        - RefundStatusSETTLING
        - RefundStatusSETTLED
    core_model.PaymentStatusReason:
      properties:
        advice_code:
          description: Advice code
          enum:
            - try_again_later
            - do_not_try_again
          example: do_not_try_again
          type: string
        decline_code:
          description: Decline code
          enum:
            - insufficient_funds
            - authentication_required
            - card_issuer_decline
            - generic_decline
            - withdrawal_limit_exceeded
            - do_not_honor
            - expired_card
            - suspected_fraud
            - incorrect_cvc
            - invalid_card_number
            - issuer_unavailable
            - card_lost_or_stolen
            - card_declined
          type: string
        message:
          description: Message from psp
          type: string
      type: object
    core_model.SubscriptionPastDueAttemptsInfo:
      properties:
        attempt_count:
          description: Number of current attempts count
          example: 2
          type: integer
        max_attempts_count:
          description: Maximum count of attempts
          example: 7
          type: integer
      type: object
    core_model.PlanCustomerResDTO:
      properties:
        id:
          description: Unique identifier for the plan
          example: price_1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
          type: string
          x-order: '0'
        interval:
          description: Type of the billing period
          enum:
            - days
            - months
            - years
          example: days
          type: string
          x-order: '4'
        interval_count:
          description: Number of billing periods per cycle
          example: 1
          type: integer
          x-order: '5'
        name:
          description: Display name of the plan
          example: Pro Plan
          type: string
          x-order: '2'
        price:
          allOf:
            - $ref: '#/components/schemas/core_model.PlanPrice'
          description: Pricing details for the plan
          type: object
          x-order: '6'
        tax:
          allOf:
            - $ref: '#/components/schemas/core_model.PlanTax'
          description: Tax info
          type: object
          x-order: '10'
        trial_interval:
          description: Type of trial period
          enum:
            - days
            - months
            - years
          example: days
          type: string
          x-order: '7'
        trial_interval_count:
          description: Length of the trial period
          example: 14
          type: integer
          x-order: '8'
        trial_price:
          allOf:
            - $ref: '#/components/schemas/core_model.PlanPrice'
          description: Trial pricing details
          type: object
          x-order: '9'
        type:
          description: Type of the plan
          enum:
            - recurring
            - one-off
          example: recurring
          type: string
          x-order: '3'
      type: object
    core_model.TaxCalculationType:
      enum:
        - INCLUSIVE
        - EXCLUSIVE
      type: string
      x-enum-varnames:
        - TaxCalculationTypeINCLUSIVE
        - TaxCalculationTypeEXCLUSIVE
    core_model.PaymentTaxError:
      properties:
        code:
          allOf:
            - $ref: '#/components/schemas/core_model.PaymentTaxErrorCode'
          description: timeout or calculation_failed
          type: object
        message:
          type: string
      type: object
    core_model.PaymentTaxProvider:
      properties:
        id:
          type: string
        type:
          $ref: '#/components/schemas/core_model.TaxProviderTypeName'
      type: object
    core_model.PaymentTaxStatus:
      enum:
        - calculated
        - submitted
        - reversed
        - failed
      type: string
      x-enum-varnames:
        - PaymentTaxStatusCalculated
        - PaymentTaxStatusSubmitted
        - PaymentTaxStatusReversed
        - PaymentTaxStatusFailed
    core_model.ThreeDSecureDataECIResDTO:
      properties:
        liability_shift:
          type: boolean
        result:
          type: string
        value:
          type: string
      type: object
    core_model.ThreeDSStatus:
      enum:
        - action-required
        - success
        - failure
      type: string
      x-enum-varnames:
        - ThreeDSStatusActionRequired
        - ThreeDSStatusSuccess
        - ThreeDSStatusFailure
    ApplePayPaymentMethodDetails:
      properties:
        token:
          description: Apple Pay token number
          example: '12345678'
          type: string
          x-order: '7'
        token_exp_month:
          description: Expiration month of the card
          example: 12
          type: integer
          x-order: '91'
        token_exp_year:
          description: Expiration year of the card
          example: 2028
          type: integer
          x-order: '92'
        token_service_provider:
          description: Apple Pay token service provider
          example: provider
          type: string
          x-order: '8'
      type: object
    CardPaymentMethodDetails:
      properties:
        bin:
          description: First 6 digits of the card number
          example: '411111'
          type: string
          x-order: '0'
        bin_data:
          allOf:
            - $ref: '#/components/schemas/core_model.EvervaultCardBinData'
          description: Bin data
          type: object
          x-order: '95'
        exp_month:
          description: Expiration month of the card
          example: 12
          type: integer
          x-order: '2'
        exp_year:
          description: Expiration year of the card
          example: 2028
          type: integer
          x-order: '3'
        is_network_tokenized:
          description: Is network tokenized
          example: true
          type: boolean
          x-order: '4'
        last4:
          description: Last 4 digits of the card number
          example: '1111'
          type: string
          x-order: '1'
        network_token:
          allOf:
            - $ref: '#/components/schemas/CardNetworkToken'
          description: Network token details, when the card is network tokenized
          type: object
          x-order: '6'
        number:
          description: Full card number
          example: '4111111111111111'
          type: string
          x-order: '5'
      type: object
    CashAppPaymentMethodDetails:
      properties:
        processor_customer_id:
          description: Processor customer ID
          example: cus_1234567890
          type: string
          x-order: '96'
        processor_payment_method_id:
          description: Processor payment method ID
          example: pm_1234567890
          type: string
          x-order: '97'
      type: object
    GooglePayPaymentMethodDetails:
      properties:
        token:
          description: Apple Pay token number
          example: '12345678'
          type: string
          x-order: '7'
        token_exp_month:
          description: Expiration month of the card
          example: 12
          type: integer
          x-order: '91'
        token_exp_year:
          description: Expiration year of the card
          example: 2028
          type: integer
          x-order: '92'
        token_service_provider:
          description: Apple Pay token service provider
          example: provider
          type: string
          x-order: '8'
      type: object
    PayPalPaymentMethodDetails:
      properties:
        payer_info:
          allOf:
            - $ref: '#/components/schemas/core_model.PaypalDataPayerInfo'
          description: Paypal payer info
          type: object
          x-order: '94'
        processor_customer_email:
          description: Processor customer email
          example: example@gmail.com
          type: string
          x-order: '98'
        processor_customer_id:
          description: Processor customer ID
          example: cus_1234567890
          type: string
          x-order: '96'
        processor_payment_method_id:
          description: Processor payment method ID
          example: pm_1234567890
          type: string
          x-order: '97'
      type: object
    VenmoPaymentMethodDetails:
      properties:
        processor_payment_method_id:
          description: Processor payment method ID
          example: pm_1234567890
          type: string
          x-order: '97'
      type: object
    core_model.PlanPrice:
      properties:
        amount:
          description: Price amount  in minor units
          example: 1999
          type: integer
        currency:
          description: >-
            The 3-letter currency code in ISO 4217 format. e.g. use USD for US
            dollars
          enum:
            - AED
            - AFN
            - ALL
            - AMD
            - AOA
            - ARS
            - AUD
            - AWG
            - AZN
            - BAM
            - BBD
            - BDT
            - BGN
            - BHD
            - BIF
            - BMD
            - BND
            - BOB
            - BRL
            - BSD
            - BTN
            - BWP
            - BYN
            - BZD
            - CAD
            - CDF
            - CHF
            - CLP
            - CNY
            - COP
            - CRC
            - CUC
            - CUP
            - CVE
            - CZK
            - DJF
            - DKK
            - DOP
            - DZD
            - EGP
            - ERN
            - ETB
            - EUR
            - FJD
            - FKP
            - GBP
            - GEL
            - GHS
            - GIP
            - GMD
            - GNF
            - GTQ
            - GYD
            - HKD
            - HNL
            - HTG
            - HUF
            - IDR
            - ILS
            - IMP
            - INR
            - IQD
            - IRR
            - ISK
            - JEP
            - JMD
            - JOD
            - JPY
            - KES
            - KGS
            - KHR
            - KMF
            - KPW
            - KRW
            - KWD
            - KYD
            - KZT
            - LAK
            - LBP
            - LKR
            - LRD
            - LSL
            - LYD
            - MAD
            - MDL
            - MGA
            - MKD
            - MMK
            - MNT
            - MOP
            - MRU
            - MUR
            - MVR
            - MWK
            - MXN
            - MYR
            - MZN
            - NAD
            - NGN
            - NIO
            - NOK
            - NPR
            - NZD
            - OMR
            - PAB
            - PEN
            - PGK
            - PHP
            - PKR
            - PLN
            - PYG
            - QAR
            - RON
            - RSD
            - RUB
            - RWF
            - SAR
            - SBD
            - SCR
            - SDG
            - SEK
            - SGD
            - SHP
            - SLE
            - SOS
            - SRD
            - SSP
            - STD
            - STN
            - SVC
            - SYP
            - SZL
            - THB
            - TJS
            - TMT
            - TND
            - TOP
            - TRY
            - TTD
            - TWD
            - TZS
            - BOV
            - COU
            - CHE
            - CHW
            - MXV
            - UGX
            - VES
            - VND
            - VUV
            - XAF
            - XCD
            - XCG
            - XOF
            - XPF
            - YER
            - USD
          example: AED
          type: string
      type: object
    core_model.PlanTax:
      properties:
        collect_tax:
          allOf:
            - $ref: '#/components/schemas/core_model.PlanTaxCollection'
          example: DEFAULT
          type: object
      type: object
    core_model.PaymentTaxErrorCode:
      enum:
        - timeout
        - calculation_failed
      type: string
      x-enum-varnames:
        - PaymentTaxErrorCodeTimeout
        - PaymentTaxErrorCodeCalculationFailed
    core_model.TaxProviderTypeName:
      enum:
        - NUMERAL
      type: string
      x-enum-varnames:
        - TaxProviderTypeNameNUMERAL
    core_model.EvervaultCardBinData:
      properties:
        brand:
          description: Brand of the card
          enum:
            - visa
            - mastercard
            - american-express
            - discover
            - diners-club
            - jcb
            - unionpay
          type: string
        country:
          description: ISO country code (e.g., US, DE)
          enum:
            - AD
            - AE
            - AF
            - AG
            - AL
            - AM
            - AO
            - AR
            - AS
            - AT
            - AU
            - AW
            - AX
            - AZ
            - BA
            - BB
            - BD
            - BE
            - BF
            - BG
            - BH
            - BI
            - BJ
            - BL
            - BM
            - BN
            - BO
            - BQ
            - BR
            - BS
            - BT
            - BW
            - BY
            - BZ
            - CA
            - CD
            - CF
            - CG
            - CH
            - CI
            - CL
            - CM
            - CN
            - CO
            - CR
            - CU
            - CU-P
            - CV
            - CW
            - CY
            - CZ
            - DE
            - DJ
            - DK
            - DM
            - DO
            - DZ
            - EC
            - EE
            - EG
            - ER
            - ES
            - ET
            - FI
            - FJ
            - FK
            - FM
            - FR
            - GA
            - GB
            - GD
            - GE
            - GF
            - GG
            - GH
            - GI
            - GL
            - GM
            - GN
            - GP
            - GQ
            - GR
            - GT
            - GU
            - GW
            - GY
            - HK
            - HN
            - HR
            - HT
            - HU
            - ID
            - IE
            - IL
            - IM
            - IN
            - IQ
            - IR
            - IS
            - IT
            - JE
            - JM
            - JO
            - JP
            - KE
            - KG
            - KH
            - KI
            - KM
            - KN
            - KP
            - KR
            - KW
            - KY
            - KZ
            - LA
            - LB
            - LC
            - LI
            - LK
            - LR
            - LS
            - LT
            - LU
            - LV
            - LY
            - MA
            - MC
            - MD
            - ME
            - MF
            - MG
            - MH
            - MK
            - ML
            - MM
            - MN
            - MO
            - MP
            - MQ
            - MR
            - MS
            - MT
            - MU
            - MV
            - MW
            - MX
            - MY
            - MZ
            - NA
            - NC
            - NE
            - NG
            - NI
            - NL
            - 'NO'
            - NP
            - NR
            - NU
            - NZ
            - OM
            - PA
            - PE
            - PF
            - PG
            - PH
            - PK
            - PL
            - PM
            - PN
            - PR
            - PS
            - PT
            - PW
            - PY
            - QA
            - RE
            - RO
            - RS
            - RU
            - RW
            - SA
            - SB
            - SC
            - SD
            - SE
            - SG
            - SH
            - SI
            - SK
            - SL
            - SM
            - SN
            - SO
            - SR
            - SS
            - ST
            - SV
            - SX
            - SY
            - SZ
            - TC
            - TD
            - TG
            - TH
            - TJ
            - TK
            - TL
            - TM
            - TN
            - TO
            - TR
            - TT
            - TV
            - TW
            - TZ
            - UA
            - UG
            - US
            - UY
            - UZ
            - VA
            - VC
            - VE
            - VG
            - VI
            - VN
            - VU
            - WF
            - WS
            - XK
            - YE
            - YT
            - ZA
            - ZM
            - ZW
          type: string
        currency_code:
          description: >-
            The 3-letter currency code in ISO 4217 format. e.g. use USD for US
            dollars
          type: string
        description:
          description: Product or card name assigned by the issuer
          example: Chase Sapphire Preferred
          type: string
        funding:
          description: Type of funding source
          enum:
            - debit
            - credit
            - prepaid
            - deferred-debit
            - charge
          type: string
        issuer:
          description: Issuing bank or institution name
          example: Chase Bank
          type: string
        type:
          description: Classification of the card type
          enum:
            - consumer
            - commercial
            - business
            - payouts
            - all
          type: string
      type: object
    CardNetworkToken:
      properties:
        bin:
          description: BIN of the network token. Differs from the card BIN.
          example: '48953700'
          type: string
          x-order: '0'
        last4:
          description: >-
            Last 4 digits of the network token. Differs from the last 4 digits
            of the card.
          example: '0370'
          type: string
          x-order: '1'
        exp_month:
          description: Expiration month of the network token
          example: 5
          type: integer
          x-order: '2'
        exp_year:
          description: Expiration year of the network token, 2 digits
          example: 31
          type: integer
          x-order: '3'
        status:
          description: >-
            Lifecycle status of the network token. On a customer this is the
            current status; on a payment it is the status at the time of the
            charge. A card whose own status is expired is still chargeable while
            this is active.
          enum:
            - active
            - inactive
            - blocked
            - provisioning
            - suspended
            - deleted
            - expired
            - retired
            - unknown
          example: active
          type: string
          x-order: '4'
        last_synced_at:
          description: >-
            When the network token state was last refreshed from the card
            network. On a customer this is the current value; on a payment it is
            the value at the time of the charge.
          example: '2025-05-26T10:15:00Z'
          type: string
          x-order: '5'
      type: object
    core_model.PaypalDataPayerInfo:
      properties:
        email:
          description: Paypal payer email
          example: example@email.com
          type: string
        first_name:
          description: Paypal payer first name
          example: John
          type: string
        last_name:
          description: Paypal payer last name
          example: Doe
          type: string
        payer_id:
          description: Paypal payer id
          example: '1234567'
          type: string
        tenant:
          description: Paypal payer tenant
          example: Tenant
          type: string
      type: object
    core_model.PlanTaxCollection:
      enum:
        - DEFAULT
        - COLLECT
        - DONT_COLLECT
      type: string
      x-enum-varnames:
        - PlanTaxCollectionDEFAULT
        - PlanTaxCollectionCOLLECT
        - PlanTaxCollectionDONTCOLLECT
  securitySchemes:
    Auth:
      bearerFormat: JWT
      description: >-
        Authentication header of the form `api key`, where `api key` is your
        organization api key.
      scheme: bearer
      type: http

````