# Cancel a PaymentIntent

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/payment_intents/{id}/cancel:
    post:
      summary: Cancel a PaymentIntent
      deprecated: false
      description: >-
        A PaymentIntent object can be canceled when it is in one of these
        statuses: requires_payment_method, requires_capture,
        requires_confirmation, requires_action.

        Once canceled, no additional charges will be made by the PaymentIntent
        and any operations on the PaymentIntent will fail with an error. For
        PaymentIntents with status=’requires_capture’, the remaining
        amount_capturable will automatically be refunded.


        You cannot cancel the PaymentIntent for a Checkout Session. Expire the
        Checkout Session instead.
      tags:
        - API Reference/Payment Intents
      parameters:
        - name: id
          in: path
          description: ''
          required: true
          schema:
            type: string
        - name: Accept
          in: header
          description: ''
          required: true
          example: application/json
          schema:
            type: string
        - name: Content-Type
          in: header
          description: ''
          required: true
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                cancellation_reason:
                  type: string
                  description: Reason for canceling this PaymentIntent.
              required:
                - cancellation_reason
              x-apifox-orders:
                - cancellation_reason
              x-apifox-ignore-properties: []
            example:
              cancellation_reason: customer cancelled
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                x-apifox-refs:
                  01GMN392R2PFCSD5ZV7BHTPAH0:
                    $ref: '#/components/schemas/Payment%20Intent'
                    x-apifox-overrides:
                      automatic_payment_methods: null
                      application_fee_amount: null
                      application: null
                      transfer_group: null
                      transfer_data: null
                      review: null
                      processing: null
                      on_behalf_of: null
                      statement_descriptor: null
                      statement_descriptor_suffix: null
                x-apifox-orders:
                  - 01GMN392R2PFCSD5ZV7BHTPAH0
                properties:
                  id:
                    type: string
                    description: Unique identifier for the object, like 'pi_xxx'
                  object:
                    type: string
                    description: '''payment_intent'''
                  created:
                    type: integer
                    description: >-
                      Time at which the object was created. Measured in seconds
                      since the Unix epoch.
                  currency:
                    type: string
                    description: >-
                      Three-letter ISO currency code, in uppercase. Must be a
                      supported currency.
                  customer:
                    type: string
                    description: ID of the Customer
                  amount:
                    type: integer
                    description: >-
                      Amount intended to be collected by this PaymentIntent. A
                      positive integer representing how much to charge in the
                      smallest currency unit (e.g., 100 cents to charge $1.00 or
                      100 to charge ¥100, a zero-decimal currency). . The amount
                      value supports up to eight digits (e.g., a value of
                      99999999 for a USD charge of $999,999.99).
                  status:
                    type: string
                    description: >-
                      Status of this PaymentIntent, one of
                      requires_payment_method, requires_confirmation,
                      requires_action, processing, requires_capture, canceled,
                      or succeeded
                  description:
                    type: string
                    description: >-
                      An arbitrary string attached to the object. Often useful
                      for displaying to users.
                  metadata:
                    type: object
                    properties: {}
                    x-apifox-orders: []
                    description: >-
                      Set of key-value pairs that you can attach to an object.
                      This can be useful for storing additional information
                      about the object in a structured format.
                    x-apifox-ignore-properties: []
                  livemode:
                    type: boolean
                    description: >-
                      Has the value true if the object exists in live mode or
                      the value false if the object exists in test mode.
                  shipping: &ref_0
                    description: Shipping information for this PaymentIntent.
                    $ref: '#/components/schemas/Shipping'
                  merchant_order_id:
                    type: string
                    description: >-
                      The order ID created in merchant's order system that
                      corresponds to this PaymentIntent
                  client_secret:
                    type: string
                    description: >-
                      The client secret of this PaymentIntent. Used for
                      client-side retrieval using a publishable key.
                  last_payment_error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          For some errors that could be handled
                          programmatically, a short string indicating the error
                          code reported.
                      message:
                        type: string
                        description: >-
                          A human-readable message providing more details about
                          the error. For card errors, these messages can be
                          shown to your users.
                      payment_method:
                        type: object
                        properties: {}
                        description: >-
                          The PaymentMethod object for errors returned on a
                          request involving a PaymentMethod.
                        x-apifox-orders: []
                        x-apifox-ignore-properties: []
                      type:
                        type: string
                        description: >-
                          The type of error returned. One of api_error,
                          card_error, idempotency_error, or
                          invalid_request_error.
                      decline_code:
                        type: string
                        description: >-
                          For card errors resulting from a card issuer decline,
                          a short string indicating the card issuer’s reason for
                          the decline if they provide one.
                    description: >-
                      The payment error encountered in the previous
                      PaymentIntent confirmation. It will be cleared if the
                      PaymentIntent is later updated for any reason.
                    x-apifox-orders:
                      - code
                      - message
                      - payment_method
                      - type
                      - decline_code
                    x-apifox-ignore-properties: []
                  next_action: &ref_1
                    description: >-
                      If present, this property tells you what actions you need
                      to take in order for your customer to fulfill a payment
                      using the provided source.
                    $ref: '#/components/schemas/Next%20Action'
                  payment_method_types:
                    type: array
                    items:
                      type: string
                      enum:
                        - alipay
                        - alipay_hk
                        - boost
                        - card
                        - truemoney
                        - gcash
                        - kakaopay
                        - touchngo
                        - rabbit_line_pay
                        - dana
                        - klarna
                        - ideal
                        - giropay
                        - sofort
                        - eps
                        - trustly
                        - bancontact
                        - p24
                        - unionpay
                        - fpx
                        - mcash
                        - grabpay
                        - bank_transfer_id
                        - qris
                        - promptpay
                        - ovo
                        - shopeepay
                        - upi
                        - boleto
                        - paynow
                        - pix
                        - 9pay
                        - stitch
                        - bpi
                      x-apifox-enum:
                        - value: alipay
                          name: ''
                          description: ''
                        - value: alipay_hk
                          name: ''
                          description: ''
                        - value: boost
                          name: ''
                          description: ''
                        - value: card
                          name: ''
                          description: ''
                        - value: truemoney
                          name: ''
                          description: ''
                        - value: gcash
                          name: ''
                          description: ''
                        - value: kakaopay
                          name: ''
                          description: ''
                        - value: touchngo
                          name: ''
                          description: ''
                        - value: rabbit_line_pay
                          name: ''
                          description: ''
                        - value: dana
                          name: ''
                          description: ''
                        - value: klarna
                          name: ''
                          description: ''
                        - value: ideal
                          name: ''
                          description: ''
                        - value: giropay
                          name: ''
                          description: ''
                        - value: sofort
                          name: ''
                          description: ''
                        - value: eps
                          name: ''
                          description: ''
                        - value: trustly
                          name: ''
                          description: ''
                        - value: bancontact
                          name: ''
                          description: ''
                        - value: p24
                          name: ''
                          description: ''
                        - value: unionpay
                          name: ''
                          description: ''
                        - value: fpx
                          name: ''
                          description: ''
                        - value: mcash
                          name: ''
                          description: ''
                        - value: grabpay
                          name: ''
                          description: ''
                        - value: bank_transfer_id
                          name: ''
                          description: ''
                        - value: qris
                          name: ''
                          description: ''
                        - value: promptpay
                          name: ''
                          description: ''
                        - value: ovo
                          name: ''
                          description: ''
                        - value: shopeepay
                          name: ''
                          description: ''
                        - value: upi
                          name: ''
                          description: ''
                        - value: boleto
                          name: ''
                          description: ''
                        - value: paynow
                          name: ''
                          description: ''
                        - value: pix
                          name: ''
                          description: ''
                        - value: 9pay
                          name: ''
                          description: ''
                        - value: stitch
                          name: ''
                          description: ''
                        - value: bpi
                          name: ''
                          description: ''
                    description: >-
                      The list of payment method types (e.g. card) that this
                      PaymentIntent is allowed to use.
                  payment_method_options: &ref_2
                    description: >-
                      Payment-method-specific configuration for this
                      PaymentIntent.
                    $ref: '#/components/schemas/Payment%20Method%20Options'
                  payment_method:
                    type: string
                    description: ID of the payment method used in this PaymentIntent.
                  receipt_email:
                    type: string
                    description: >-
                      Email address that the receipt for the resulting payment
                      will be sent to.
                  canceled_at:
                    type: integer
                    description: >-
                      Populated when status is canceled, this is the time at
                      which the PaymentIntent was canceled. Measured in seconds
                      since the Unix epoch.
                  cancellation_reason:
                    type: string
                    description: >-
                      Reason for cancellation of this PaymentIntent, either
                      user-provided (duplicate, fraudulent,
                      requested_by_customer, or abandoned) .
                  confirmation_method:
                    type: string
                    description: >-
                      Possible enum values： 

                      **automatic** (Default)

                      PaymentIntent can be confirmed using a publishable key.
                      After next_action s are handled, no additional
                      confirmation is required to complete the payment. 

                      **manual** 

                      All payment attempts must be made using a secret key. The
                      PaymentIntent returns to the requires_confirmation  state
                      after handling next_actions, and requires your server to
                      initiate each payment attempt with an explicit
                      confirmation.
                  3ds_status:
                    type: object
                    properties:
                      cavv:
                        type: string
                        description: >-
                          This is the Cardholder Authentication Verification
                          Value, indicating that the transaction has been
                          authenticated. This only exists when no challenge is
                          required, i.e., a successful frictionless
                          authentication.
                      eci:
                        type: integer
                        description: >-
                          This is the Electronic Commerce Indicator code, which
                          gets returned by the card issuer indicating whether
                          the cardholder was successfully authenticated. Note
                          that in some cases the eci value includes a leading
                          zero, e.g., 01 or 02. Visa, Amex, JCB, and Diners Club
                          5 – Identifies a successfully authenticated
                          transaction. 6 – Identifies an attempted authenticated
                          transaction. 7 – Identifies a non-authenticated
                          transaction. Mastercard 0 – Identifies a
                          non-authenticated transaction. 1 – Identifies an
                          attempted authenticated transaction. 2 – Identifies a
                          successfully authenticated transaction. This only
                          exists when no challenge is required, i.e., a
                          frictionless authentication.
                      status:
                        type: string
                        description: |-
                          This is the status of the Authentication request. 
                          Possible values are:
                          COMPLETED – The transaction has been completed.
                          PENDING – The transaction has not been completed yet.
                          FAILED – The authentication request failed.
                      three_d_result:
                        type: string
                        description: >-
                          This indicates the outcome of the authentication.
                          Possible values are:

                          Y – The cardholder successfully authenticated with
                          their card issuer.

                          A – The cardholder authentication was attempted.

                          N – The cardholder failed to successfully authenticate
                          with their card issuer.

                          U – Authentication with the card issuer was
                          unavailable.

                          C – Challenge Required; additional authentication is
                          required.

                          R – Rejected transaction.
                      three_d_enrollment:
                        type: string
                        description: >-
                          This indicates whether the cardholder is enrolled in
                          3D Secure. Possible values are:

                          Y – Cardholder authentication is available

                          N – Cardholder is not enrolled in authentication

                          U – Cardholder authentication unavailable
                      three_d_secure_version:
                        type: string
                        description: This is the 3D secure protocol version.
                      xid:
                        type: string
                        description: >-
                          This is the transaction identifier returned by the
                          card issuer. This exists only for 3DS 1.0.2.
                      three_d_secure_server_transaction_id:
                        type: string
                        description: >-
                          The 3D Secure Server transaction Id. This exists only
                          for 3D Secure 2.
                    x-apifox-orders:
                      - cavv
                      - eci
                      - status
                      - three_d_result
                      - three_d_enrollment
                      - three_d_secure_version
                      - xid
                      - three_d_secure_server_transaction_id
                    description: The status of 3DS result
                    x-apifox-ignore-properties: []
                  amount_capturable:
                    type: integer
                    description: Amount that can be captured from this PaymentIntent.
                  return_url:
                    type: string
                    description: The url that the cutomer will be redirected to.
                  quantity:
                    type: integer
                    description: The quantity of the items being purchased.
                  latest_charge:
                    type: string
                    description: The latest charge created by this payment intent.
                  merchant_user_id:
                    type: string
                    description: >-
                      The user ID created in merchant's order system that
                      corresponds to this PaymentIntent
                  amount_received:
                    type: integer
                    description: Amount that was collected by this PaymentIntent.
                  capture_method:
                    type: string
                    description: Possible enum values：automatic（default），manual
                  invoice:
                    type: string
                    description: >-
                      ID of the invoice that created this PaymentIntent, if it
                      exists.
                  setup_future_usage:
                    type: string
                    description: >-
                      Indicates that you intend to make future payments with
                      this PaymentIntent’s payment method. Providing this
                      parameter will attach the payment method to the
                      PaymentIntent’s Customer, if present, after the
                      PaymentIntent is confirmed and any required actions from
                      the user are complete. If no Customer was provided, the
                      payment method can still be attached to a Customer after
                      the transaction completes. 
                    enum:
                      - off_session
                      - on_session
                    x-apifox-enum:
                      - value: off_session
                        name: ''
                        description: >-
                          Use off_session if your customer may or may not be
                          present in your checkout flow.
                      - value: on_session
                        name: ''
                        description: >-
                          Use on_session if you intend to only reuse the payment
                          method when your customer is present in your checkout
                          flow.
                  localization:
                    type: object
                    properties:
                      applied:
                        type: boolean
                        description: >-
                          Indicates whether localized currency conversion was
                          applied. true means the customer paid in a local
                          currency different from the pricing currency and an FX
                          rate was used; false means no conversion occurred.
                      source:
                        type: object
                        properties:
                          amount:
                            type: string
                            description: >-
                              The transaction amount in the merchant’s pricing
                              currency, expressed in the smallest currency unit
                              (for example, cents for USD, no decimals for JPY).
                          currency:
                            type: string
                            description: >-
                              The merchant’s pricing currency in ISO 4217
                              format, uppercase (e.g., "USD", "SGD").
                        x-apifox-orders:
                          - amount
                          - currency
                        x-apifox-ignore-properties: []
                      localized:
                        type: object
                        properties:
                          amount:
                            type: string
                            description: >-
                              The actual amount paid by the customer in their
                              local currency, expressed in the smallest currency
                              unit.
                          currency:
                            type: string
                            description: >-
                              The local currency used by the customer to
                              complete the payment, in ISO 4217 format,
                              uppercase (e.g., "CNY", "JPY").
                        x-apifox-orders:
                          - amount
                          - currency
                        x-apifox-ignore-properties: []
                      fx:
                        type: object
                        properties:
                          rate:
                            type: string
                            description: >-
                              The actual exchange rate applied from the pricing
                              currency to the local currency.
                        x-apifox-orders:
                          - rate
                        x-apifox-ignore-properties: []
                    x-apifox-orders:
                      - applied
                      - source
                      - localized
                      - fx
                    description: >-
                      An object containing details about localized currency
                      conversion when the customer pays in a currency different
                      from the your pricing currency.
                    x-apifox-ignore-properties: []
                required:
                  - currency
                  - amount
                x-apifox-ignore-properties:
                  - id
                  - object
                  - created
                  - currency
                  - customer
                  - amount
                  - status
                  - description
                  - metadata
                  - livemode
                  - shipping
                  - merchant_order_id
                  - client_secret
                  - last_payment_error
                  - next_action
                  - payment_method_types
                  - payment_method_options
                  - payment_method
                  - receipt_email
                  - canceled_at
                  - cancellation_reason
                  - confirmation_method
                  - 3ds_status
                  - amount_capturable
                  - return_url
                  - quantity
                  - latest_charge
                  - merchant_user_id
                  - amount_received
                  - capture_method
                  - invoice
                  - setup_future_usage
                  - localization
          headers: {}
          x-apifox-name: OK
      security:
        - basic: []
      x-apifox-folder: API Reference/Payment Intents
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/1296482/apis/api-52305869-run
components:
  schemas:
    Payment Method Options:
      type: object
      properties:
        card:
          type: object
          properties:
            request_three_d_secure:
              type: string
              description: >-
                Values can be auto, any, void When a user selects the void
                option, Wooshpay will still perform 3DS if it encounters a
                policy.
              enum:
                - any
                - auto
                - void
              x-apifox-enum:
                - value: any
                  name: ''
                  description: Use any to request 3DS with a preference for 3ds flow
                - value: auto
                  name: ''
                  description: >-
                    (Default) Our SCA Engine automatically prompts your
                    customers for authentication based on risk level and other
                    requirements.
                - value: void
                  name: ''
                  description: Do not prefer the 3ds flow
            setup_future_usage:
              type: string
              description: >-
                Indicates that you intend to make future payments with this
                PaymentIntent’s payment method. Providing this parameter will
                attach the payment method to the PaymentIntent’s Customer, if
                present, after the PaymentIntent is confirmed and any required
                actions from the user are complete.
              enum:
                - on_session
                - off_session
                - none
              x-apifox-enum:
                - value: on_session
                  name: ''
                  description: >-
                    if you intend to only reuse the payment method when your
                    customer is present in your checkout flow.
                - value: off_session
                  name: ''
                  description: ' if your customer may or may not be present in your checkout flow.'
                - value: none
                  name: ''
                  description: >-
                    if you do not intend to reuse this payment method and want
                    to override the top-level setup_future_usage value for this
                    payment method.
            capture_method:
              type: string
              description: >-
                Controls when the funds will be captured from the customer’s
                account. If capture_method is already set on the PaymentIntent,
                providing an empty value for this parameter will unset the
                stored value for this payment method type.
            tax_id:
              type: string
          x-apifox-orders:
            - request_three_d_secure
            - setup_future_usage
            - capture_method
            - tax_id
          x-apifox-ignore-properties: []
        alipayplus:
          type: object
          properties:
            terminal_type:
              type: string
              description: >-
                enum:"WEB","WAP","APP","MINI_APP". WEB: indicates that a PC
                browser is used.WAP: indicates that a mobile browser is
                used.APP: indicates that a mobile app is used.MINI_APP:
                indicates that a mini program is used.
              enum:
                - APP
                - WAP
                - WEB
              x-apifox-enum:
                - value: APP
                  name: ''
                  description: ''
                - value: WAP
                  name: ''
                  description: ''
                - value: WEB
                  name: ''
                  description: ''
            os_type:
              type: string
              description: >-
                enum:"IOS", "ANDROID". os_type is required if terminal_type is
                "APP" or "WAP"
              enum:
                - IOS
                - ANDROID
              x-apifox-enum:
                - value: IOS
                  name: ''
                  description: ''
                - value: ANDROID
                  name: ''
                  description: ''
          x-apifox-orders:
            - terminal_type
            - os_type
          x-apifox-ignore-properties: []
        alipay_hk:
          type: object
          properties:
            terminal_type:
              type: string
              description: >-
                enum:"IOS", "ANDROID". os_type is required if terminal_type is
                "APP" or "WAP"
              enum:
                - APP
                - WAP
                - WEB
              x-apifox-enum:
                - value: APP
                  name: ''
                  description: ''
                - value: WAP
                  name: ''
                  description: ''
                - value: WEB
                  name: ''
                  description: ''
            os_type:
              type: string
              description: >-
                enum:"WEB","WAP","APP","MINI_APP". WEB: indicates that a PC
                browser is used.WAP: indicates that a mobile browser is
                used.APP: indicates that a mobile app is used.MINI_APP:
                indicates that a mini program is used.
              enum:
                - IOS
                - ANDROID
              x-apifox-enum:
                - value: IOS
                  name: ''
                  description: ''
                - value: ANDROID
                  name: ''
                  description: ''
          x-apifox-orders:
            - terminal_type
            - os_type
          x-apifox-ignore-properties: []
        alipay:
          type: object
          properties:
            terminal_type:
              type: string
              description: >-
                enum:"IOS", "ANDROID". os_type is required if terminal_type is
                "APP" or "WAP"
              enum:
                - APP
                - WAP
                - WEB
              x-apifox-enum:
                - value: APP
                  name: ''
                  description: ''
                - value: WAP
                  name: ''
                  description: ''
                - value: WEB
                  name: ''
                  description: ''
            os_type:
              type: string
              description: >-
                enum:"WEB","WAP","APP","MINI_APP". WEB: indicates that a PC
                browser is used.WAP: indicates that a mobile browser is
                used.APP: indicates that a mobile app is used.MINI_APP:
                indicates that a mini program is used.
              enum:
                - IOS
                - ANDROID
              x-apifox-enum:
                - value: IOS
                  name: ''
                  description: ''
                - value: ANDROID
                  name: ''
                  description: ''
          x-apifox-orders:
            - terminal_type
            - os_type
          x-apifox-ignore-properties: []
        wechat_pay:
          type: object
          properties:
            terminal_type:
              type: string
              enum:
                - WEB
                - SCAN_CODE
                - WAP
                - OFFICIAL_ACCOUNT
              description: |-
                enum:"WEB","WAP","SCAN_CODE","OFFICIAL_ACCOUNT".
                "WEB": QR Code Payment
                "WAP": H5 Payment
                "SCAN_CODE": Quick Pay
                "OFFICIAL_ACCOUNT":Official Account Payment
              x-apifox-enum:
                - value: WEB
                  name: ''
                  description: >-
                    Users use WeChat's "Scan" feature to scan a payment code
                    generated by a merchant on a web page to make a payment.
                - value: SCAN_CODE
                  name: ''
                  description: Users present their WeChat Pay payment code to the merchant
                - value: WAP
                  name: ''
                  description: Users make purchases in merchant apps using WeChat Pay.
                - value: OFFICIAL_ACCOUNT
                  name: ''
                  description: ''
            client_ip:
              type: string
            os_type:
              type: string
              enum:
                - IOS
                - ANDROID
              x-apifox-enum:
                - value: IOS
                  name: ''
                  description: ''
                - value: ANDROID
                  name: ''
                  description: ''
            openid:
              type: string
              description: user's identification in the WeChat official account
          x-apifox-orders:
            - terminal_type
            - client_ip
            - os_type
            - openid
          x-apifox-ignore-properties: []
        sepa_debit:
          type: object
          properties: {}
          x-apifox-orders: []
          x-apifox-ignore-properties: []
        akulaku:
          type: object
          properties:
            terminal_type:
              type: string
              description: >-
                enum:"WEB","WAP","APP","MINI_APP". WEB: indicates that a PC
                browser is used.WAP: indicates that a mobile browser is
                used.APP: indicates that a mobile app is used.MINI_APP:
                indicates that a mini program is used.
              enum:
                - WEB
                - WAP
                - APP
                - MINI_APP
              x-apifox-enum:
                - value: WEB
                  name: ''
                  description: ''
                - value: WAP
                  name: ''
                  description: ''
                - value: APP
                  name: ''
                  description: ''
                - value: MINI_APP
                  name: ''
                  description: ''
            os_type:
              type: string
              description: >-
                enum:"IOS", "ANDROID". os_type is required if terminal_type is
                "APP" or "WAP"
              enum:
                - IOS
                - ANDROID
              x-apifox-enum:
                - value: IOS
                  name: ''
                  description: ''
                - value: ANDROID
                  name: ''
                  description: ''
          x-apifox-orders:
            - terminal_type
            - os_type
          x-apifox-ignore-properties: []
        truemoney:
          type: object
          properties:
            terminal_type:
              type: string
              description: >-
                enum:"WEB","WAP","APP","MINI_APP". WEB: indicates that a PC
                browser is used.WAP: indicates that a mobile browser is
                used.APP: indicates that a mobile app is used.MINI_APP:
                indicates that a mini program is used.
              enum:
                - WEB
                - WAP
                - APP
                - MINI_APP
              x-apifox-enum:
                - value: WEB
                  name: ''
                  description: ''
                - value: WAP
                  name: ''
                  description: ''
                - value: APP
                  name: ''
                  description: ''
                - value: MINI_APP
                  name: ''
                  description: ''
            os_type:
              type: string
              description: >-
                enum:"IOS", "ANDROID". os_type is required if terminal_type is
                "APP" or "WAP"
              enum:
                - IOS
                - ANDROID
              x-apifox-enum:
                - value: IOS
                  name: ''
                  description: ''
                - value: ANDROID
                  name: ''
                  description: ''
          x-apifox-orders:
            - terminal_type
            - os_type
          x-apifox-ignore-properties: []
        kakaopay:
          type: object
          properties:
            terminal_type:
              type: string
              description: >-
                enum:"WEB","WAP","APP","MINI_APP". WEB: indicates that a PC
                browser is used.WAP: indicates that a mobile browser is
                used.APP: indicates that a mobile app is used.MINI_APP:
                indicates that a mini program is used.
              enum:
                - WEB
                - WAP
                - APP
                - MINI_APP
              x-apifox-enum:
                - value: WEB
                  name: ''
                  description: ''
                - value: WAP
                  name: ''
                  description: ''
                - value: APP
                  name: ''
                  description: ''
                - value: MINI_APP
                  name: ''
                  description: ''
            os_type:
              type: string
              description: >-
                enum:"IOS", "ANDROID". os_type is required if terminal_type is
                "APP" or "WAP"
              enum:
                - IOS
                - ANDROID
              x-apifox-enum:
                - value: IOS
                  name: ''
                  description: ''
                - value: ANDROID
                  name: ''
                  description: ''
          x-apifox-orders:
            - terminal_type
            - os_type
          x-apifox-ignore-properties: []
        shopeepay:
          type: object
          properties:
            terminal_type:
              type: string
              description: >-
                enum:"WEB","WAP","APP","MINI_APP". WEB: indicates that a PC
                browser is used.WAP: indicates that a mobile browser is
                used.APP: indicates that a mobile app is used.MINI_APP:
                indicates that a mini program is used.
            os_type:
              type: string
              description: >-
                enum:"IOS", "ANDROID". os_type is required if terminal_type is
                "APP" or "WAP"
          x-apifox-orders:
            - terminal_type
            - os_type
          x-apifox-ignore-properties: []
        dana:
          type: object
          properties:
            terminal_type:
              type: string
              description: >-
                enum:"WEB","WAP","APP","MINI_APP". WEB: indicates that a PC
                browser is used.WAP: indicates that a mobile browser is
                used.APP: indicates that a mobile app is used.MINI_APP:
                indicates that a mini program is used.
            os_type:
              type: string
              description: >-
                enum:"IOS", "ANDROID". os_type is required if terminal_type is
                "APP" or "WAP"
          x-apifox-orders:
            - terminal_type
            - os_type
          x-apifox-ignore-properties: []
        pix:
          type: object
          properties:
            tax_id:
              type: string
          x-apifox-orders:
            - tax_id
          required:
            - tax_id
          x-apifox-ignore-properties: []
      x-apifox-orders:
        - card
        - alipayplus
        - alipay_hk
        - alipay
        - wechat_pay
        - sepa_debit
        - akulaku
        - truemoney
        - kakaopay
        - shopeepay
        - dana
        - pix
      description: Payment-method-specific configuration for this PaymentIntent.
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
    Next Action:
      type: object
      properties:
        type:
          type: string
          description: Type of the next action to perform
        redirect_to_url:
          type: object
          properties:
            return_url:
              type: string
              description: >-
                If the customer does not exit their browser while
                authenticating, they will be redirected to this specified URL
                after completion.
            url:
              type: string
              description: >-
                The URL you must redirect your customer to in order to
                authenticate the payment.
          x-apifox-orders:
            - return_url
            - url
          x-apifox-ignore-properties: []
        ddc_redirect:
          type: object
          properties:
            return_url:
              type: string
              description: >-
                If the customer does not exit their browser while
                authenticating, they will be redirected to this specified URL
                after completion.
            url:
              type: string
              description: >-
                The URL you must redirect your customer to in order to
                authenticate the payment.
          x-apifox-orders:
            - return_url
            - url
          x-apifox-ignore-properties: []
        challenge_redirect:
          type: object
          properties:
            return_url:
              type: string
              description: >-
                If the customer does not exit their browser while
                authenticating, they will be redirected to this specified URL
                after completion.
            url:
              type: string
              description: >-
                The URL you must redirect your customer to in order to
                authenticate the payment.
          x-apifox-orders:
            - return_url
            - url
          x-apifox-ignore-properties: []
        alipayplus_handle_redirect:
          type: object
          properties:
            return_url:
              type: string
              description: >-
                If the customer does not exit their browser while
                authenticating, they will be redirected to this specified URL
                after completion.
            schemeUrl:
              type: string
              description: This url redirects users to an app.
            applinkUrl:
              type: string
              description: >-
                This url redirects users to an app, or, if no APP is installed,
                to a WAP page.
            normalUrl:
              type: string
              description: >-
                This url redirects users to a WAP or Web page in the browser or
                in the WebView
          x-apifox-orders:
            - return_url
            - schemeUrl
            - applinkUrl
            - normalUrl
          x-apifox-ignore-properties: []
        alipay_handle_redirect:
          type: object
          properties:
            native_data:
              type: string
              description: >-
                The native URL you must redirect your customer to in order to
                authenticate the payment in an Android App.
            native_url:
              type: string
              description: >-
                The native URL you must redirect your customer to in order to
                authenticate the payment in an iOS App.
            return_url:
              type: string
              description: >-
                If the customer does not exit their browser while
                authenticating, they will be redirected to this specified URL
                after completion.
            url:
              type: string
              description: >-
                The URL you must redirect your customer to in order to
                authenticate the payment.
          x-apifox-orders:
            - native_data
            - native_url
            - return_url
            - url
          x-apifox-ignore-properties: []
        wechat_pay_display_qr_code:
          type: object
          properties:
            data:
              type: string
              description: The data being used to generate QR code
            data_ur:
              type: string
              description: The base64 image data for a pre-generated QR code
            image_url_png:
              type: string
              description: The image_url_png string used to render QR code
            image_url_svg:
              type: string
              description: The image_url_svg string used to render QR code
          x-apifox-orders:
            - data
            - data_ur
            - image_url_png
            - image_url_svg
          x-apifox-ignore-properties: []
        wechat_pay_redirect_to_android_app:
          type: object
          properties:
            native_url:
              type: string
              description: An universal link that redirect to WeChat Pay app
          x-apifox-orders:
            - native_url
          x-apifox-ignore-properties: []
        wechat_pay_redirect_to_ios_app:
          type: object
          properties:
            native_url:
              type: string
              description: An universal link that redirect to WeChat Pay app
          x-apifox-orders:
            - native_url
          x-apifox-ignore-properties: []
        wechat_pay_redirect_to_web:
          type: object
          properties:
            url:
              type: string
              description: >-
                The URL you must redirect your customer to in order to
                authenticate the payment.
          x-apifox-orders:
            - url
          x-apifox-ignore-properties: []
        wechat_pay_official_account_params:
          type: object
          properties:
            appId:
              type: string
            timeStamp:
              type: string
            nonceStr:
              type: string
            signType:
              type: string
            paySign:
              type: string
            package:
              type: string
          x-apifox-orders:
            - appId
            - timeStamp
            - nonceStr
            - signType
            - paySign
            - package
          x-apifox-ignore-properties: []
        truemoney_handle_redirect:
          type: object
          properties:
            url:
              type: string
          x-apifox-orders:
            - url
          x-apifox-ignore-properties: []
        akulaku_handle_redirect:
          type: object
          properties:
            url:
              type: string
          x-apifox-orders:
            - url
          x-apifox-ignore-properties: []
        bank_transfer_id_handle_redirect:
          type: object
          properties:
            url:
              type: string
          x-apifox-orders:
            - url
          x-apifox-ignore-properties: []
        promptpay_handle_redirect:
          type: object
          properties:
            url:
              type: string
          x-apifox-orders:
            - url
          x-apifox-ignore-properties: []
        dana_handle_redirect:
          type: object
          properties:
            url:
              type: string
          x-apifox-orders:
            - url
          x-apifox-ignore-properties: []
        shopeepay_handle_redirect:
          type: object
          properties:
            url:
              type: string
          x-apifox-orders:
            - url
          x-apifox-ignore-properties: []
        gcash_handle_redirect:
          type: object
          properties:
            url:
              type: string
          x-apifox-orders:
            - url
          x-apifox-ignore-properties: []
        rabbit_line_pay_handle_redirect:
          type: object
          properties:
            url:
              type: string
          x-apifox-orders:
            - url
          x-apifox-ignore-properties: []
        alipay_hk_handle_redirect:
          type: object
          properties:
            url:
              type: string
          x-apifox-orders:
            - url
          x-apifox-ignore-properties: []
        bpi_handle_redirect:
          type: object
          properties:
            url:
              type: string
          x-apifox-orders:
            - url
          x-apifox-ignore-properties: []
        pix_handle_redirect:
          type: object
          properties:
            url:
              type: string
            qrcode:
              type: string
            timeout:
              type: integer
          x-apifox-orders:
            - url
            - qrcode
            - timeout
          x-apifox-ignore-properties: []
        oxxo_handle_redirect:
          type: object
          properties:
            timeout:
              type: string
              description: The timestamp after which the OXXO voucher expires.
            bar_code:
              type: string
              description: OXXO reference number.
            url:
              type: string
          x-apifox-orders:
            - timeout
            - bar_code
            - url
          x-apifox-ignore-properties: []
        spei_display_details:
          type: object
          properties: {}
          x-apifox-orders: []
          x-apifox-ignore-properties: []
      x-apifox-orders:
        - type
        - redirect_to_url
        - ddc_redirect
        - challenge_redirect
        - alipayplus_handle_redirect
        - alipay_handle_redirect
        - wechat_pay_display_qr_code
        - wechat_pay_redirect_to_android_app
        - wechat_pay_redirect_to_ios_app
        - wechat_pay_redirect_to_web
        - wechat_pay_official_account_params
        - truemoney_handle_redirect
        - akulaku_handle_redirect
        - bank_transfer_id_handle_redirect
        - promptpay_handle_redirect
        - dana_handle_redirect
        - shopeepay_handle_redirect
        - gcash_handle_redirect
        - rabbit_line_pay_handle_redirect
        - alipay_hk_handle_redirect
        - bpi_handle_redirect
        - pix_handle_redirect
        - oxxo_handle_redirect
        - spei_display_details
      description: >-
        If present, this property tells you what actions you need to take in
        order for your customer to fulfill a payment using the provided source.
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
    Shipping:
      type: object
      properties:
        address:
          $ref: '#/components/schemas/Address'
        carrier:
          type: string
          description: >-
            The delivery service that shipped a physical product, such as FedEx,
            UPS, USPS, etc. 
        name:
          type: string
          description: 'Recipient name. '
        phone:
          type: string
          description: 'Recipient phone (including extension). '
        tracking_number:
          type: string
          description: >-
            The tracking number for a physical product, obtained from the
            delivery service. If multiple tracking numbers were generated for
            this purchase, please separate them with commas.
      x-apifox-orders:
        - address
        - carrier
        - name
        - phone
        - tracking_number
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
    Address:
      type: object
      properties:
        city:
          type: string
          description: City, district, suburb, town, or village.
        country:
          type: string
          description: Two-letter country code (ISO 3166-1 alpha-2 ).
        line1:
          type: string
          description: Address line 1 (e.g., street, PO Box, or company name).
        line2:
          type: string
          description: Address line 2 (e.g., apartment, suite, unit, or building).
        postal_code:
          type: string
          description: ZIP or postal code.
        state:
          type: string
          description: State, county, province, or region.
      x-apifox-orders:
        - city
        - country
        - line1
        - line2
        - postal_code
        - state
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
    Payment Intent:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the object, like 'pi_xxx'
        object:
          type: string
          description: '''payment_intent'''
        created:
          type: integer
          description: >-
            Time at which the object was created. Measured in seconds since the
            Unix epoch.
        currency:
          type: string
          description: >-
            Three-letter ISO currency code, in uppercase. Must be a supported
            currency.
        customer:
          type: string
          description: ID of the Customer
        amount:
          type: integer
          description: >-
            Amount intended to be collected by this PaymentIntent. A positive
            integer representing how much to charge in the smallest currency
            unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a
            zero-decimal currency). . The amount value supports up to eight
            digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
        status:
          type: string
          description: >-
            Status of this PaymentIntent, one of requires_payment_method,
            requires_confirmation, requires_action, processing,
            requires_capture, canceled, or succeeded
        description:
          type: string
          description: >-
            An arbitrary string attached to the object. Often useful for
            displaying to users.
        metadata:
          type: object
          properties: {}
          x-apifox-orders: []
          description: >-
            Set of key-value pairs that you can attach to an object. This can be
            useful for storing additional information about the object in a
            structured format.
          x-apifox-ignore-properties: []
        livemode:
          type: boolean
          description: >-
            Has the value true if the object exists in live mode or the value
            false if the object exists in test mode.
        shipping: *ref_0
        merchant_order_id:
          type: string
          description: >-
            The order ID created in merchant's order system that corresponds to
            this PaymentIntent
        client_secret:
          type: string
          description: >-
            The client secret of this PaymentIntent. Used for client-side
            retrieval using a publishable key.
        last_payment_error:
          type: object
          properties:
            code:
              type: string
              description: >-
                For some errors that could be handled programmatically, a short
                string indicating the error code reported.
            message:
              type: string
              description: >-
                A human-readable message providing more details about the error.
                For card errors, these messages can be shown to your users.
            payment_method:
              type: object
              properties: {}
              description: >-
                The PaymentMethod object for errors returned on a request
                involving a PaymentMethod.
              x-apifox-orders: []
              x-apifox-ignore-properties: []
            type:
              type: string
              description: >-
                The type of error returned. One of api_error, card_error,
                idempotency_error, or invalid_request_error.
            decline_code:
              type: string
              description: >-
                For card errors resulting from a card issuer decline, a short
                string indicating the card issuer’s reason for the decline if
                they provide one.
          description: >-
            The payment error encountered in the previous PaymentIntent
            confirmation. It will be cleared if the PaymentIntent is later
            updated for any reason.
          x-apifox-orders:
            - code
            - message
            - payment_method
            - type
            - decline_code
          x-apifox-ignore-properties: []
        next_action: *ref_1
        payment_method_types:
          type: array
          items:
            type: string
            enum:
              - alipay
              - alipay_hk
              - boost
              - card
              - truemoney
              - gcash
              - kakaopay
              - touchngo
              - rabbit_line_pay
              - dana
              - klarna
              - ideal
              - giropay
              - sofort
              - eps
              - trustly
              - bancontact
              - p24
              - unionpay
              - fpx
              - mcash
              - grabpay
              - bank_transfer_id
              - qris
              - promptpay
              - ovo
              - shopeepay
              - upi
              - boleto
              - paynow
              - pix
              - 9pay
              - stitch
              - bpi
            x-apifox-enum:
              - value: alipay
                name: ''
                description: ''
              - value: alipay_hk
                name: ''
                description: ''
              - value: boost
                name: ''
                description: ''
              - value: card
                name: ''
                description: ''
              - value: truemoney
                name: ''
                description: ''
              - value: gcash
                name: ''
                description: ''
              - value: kakaopay
                name: ''
                description: ''
              - value: touchngo
                name: ''
                description: ''
              - value: rabbit_line_pay
                name: ''
                description: ''
              - value: dana
                name: ''
                description: ''
              - value: klarna
                name: ''
                description: ''
              - value: ideal
                name: ''
                description: ''
              - value: giropay
                name: ''
                description: ''
              - value: sofort
                name: ''
                description: ''
              - value: eps
                name: ''
                description: ''
              - value: trustly
                name: ''
                description: ''
              - value: bancontact
                name: ''
                description: ''
              - value: p24
                name: ''
                description: ''
              - value: unionpay
                name: ''
                description: ''
              - value: fpx
                name: ''
                description: ''
              - value: mcash
                name: ''
                description: ''
              - value: grabpay
                name: ''
                description: ''
              - value: bank_transfer_id
                name: ''
                description: ''
              - value: qris
                name: ''
                description: ''
              - value: promptpay
                name: ''
                description: ''
              - value: ovo
                name: ''
                description: ''
              - value: shopeepay
                name: ''
                description: ''
              - value: upi
                name: ''
                description: ''
              - value: boleto
                name: ''
                description: ''
              - value: paynow
                name: ''
                description: ''
              - value: pix
                name: ''
                description: ''
              - value: 9pay
                name: ''
                description: ''
              - value: stitch
                name: ''
                description: ''
              - value: bpi
                name: ''
                description: ''
          description: >-
            The list of payment method types (e.g. card) that this PaymentIntent
            is allowed to use.
        payment_method_options: *ref_2
        payment_method:
          type: string
          description: ID of the payment method used in this PaymentIntent.
        receipt_email:
          type: string
          description: >-
            Email address that the receipt for the resulting payment will be
            sent to.
        canceled_at:
          type: integer
          description: >-
            Populated when status is canceled, this is the time at which the
            PaymentIntent was canceled. Measured in seconds since the Unix
            epoch.
        cancellation_reason:
          type: string
          description: >-
            Reason for cancellation of this PaymentIntent, either user-provided
            (duplicate, fraudulent, requested_by_customer, or abandoned) .
        confirmation_method:
          type: string
          description: >-
            Possible enum values： 

            **automatic** (Default)

            PaymentIntent can be confirmed using a publishable key. After
            next_action s are handled, no additional confirmation is required to
            complete the payment. 

            **manual** 

            All payment attempts must be made using a secret key. The
            PaymentIntent returns to the requires_confirmation  state after
            handling next_actions, and requires your server to initiate each
            payment attempt with an explicit confirmation.
        3ds_status:
          type: object
          properties:
            cavv:
              type: string
              description: >-
                This is the Cardholder Authentication Verification Value,
                indicating that the transaction has been authenticated. This
                only exists when no challenge is required, i.e., a successful
                frictionless authentication.
            eci:
              type: integer
              description: >-
                This is the Electronic Commerce Indicator code, which gets
                returned by the card issuer indicating whether the cardholder
                was successfully authenticated. Note that in some cases the eci
                value includes a leading zero, e.g., 01 or 02. Visa, Amex, JCB,
                and Diners Club 5 – Identifies a successfully authenticated
                transaction. 6 – Identifies an attempted authenticated
                transaction. 7 – Identifies a non-authenticated transaction.
                Mastercard 0 – Identifies a non-authenticated transaction. 1 –
                Identifies an attempted authenticated transaction. 2 –
                Identifies a successfully authenticated transaction. This only
                exists when no challenge is required, i.e., a frictionless
                authentication.
            status:
              type: string
              description: |-
                This is the status of the Authentication request. 
                Possible values are:
                COMPLETED – The transaction has been completed.
                PENDING – The transaction has not been completed yet.
                FAILED – The authentication request failed.
            three_d_result:
              type: string
              description: >-
                This indicates the outcome of the authentication. Possible
                values are:

                Y – The cardholder successfully authenticated with their card
                issuer.

                A – The cardholder authentication was attempted.

                N – The cardholder failed to successfully authenticate with
                their card issuer.

                U – Authentication with the card issuer was unavailable.

                C – Challenge Required; additional authentication is required.

                R – Rejected transaction.
            three_d_enrollment:
              type: string
              description: >-
                This indicates whether the cardholder is enrolled in 3D Secure.
                Possible values are:

                Y – Cardholder authentication is available

                N – Cardholder is not enrolled in authentication

                U – Cardholder authentication unavailable
            three_d_secure_version:
              type: string
              description: This is the 3D secure protocol version.
            xid:
              type: string
              description: >-
                This is the transaction identifier returned by the card issuer.
                This exists only for 3DS 1.0.2.
            three_d_secure_server_transaction_id:
              type: string
              description: >-
                The 3D Secure Server transaction Id. This exists only for 3D
                Secure 2.
          x-apifox-orders:
            - cavv
            - eci
            - status
            - three_d_result
            - three_d_enrollment
            - three_d_secure_version
            - xid
            - three_d_secure_server_transaction_id
          description: The status of 3DS result
          x-apifox-ignore-properties: []
        amount_capturable:
          type: integer
          description: Amount that can be captured from this PaymentIntent.
        return_url:
          type: string
          description: The url that the cutomer will be redirected to.
        quantity:
          type: integer
          description: The quantity of the items being purchased.
        latest_charge:
          type: string
          description: The latest charge created by this payment intent.
        merchant_user_id:
          type: string
          description: >-
            The user ID created in merchant's order system that corresponds to
            this PaymentIntent
        amount_received:
          type: integer
          description: Amount that was collected by this PaymentIntent.
        capture_method:
          type: string
          description: Possible enum values：automatic（default），manual
        invoice:
          type: string
          description: ID of the invoice that created this PaymentIntent, if it exists.
        setup_future_usage:
          type: string
          description: >-
            Indicates that you intend to make future payments with this
            PaymentIntent’s payment method. Providing this parameter will attach
            the payment method to the PaymentIntent’s Customer, if present,
            after the PaymentIntent is confirmed and any required actions from
            the user are complete. If no Customer was provided, the payment
            method can still be attached to a Customer after the transaction
            completes. 
          enum:
            - off_session
            - on_session
          x-apifox-enum:
            - value: off_session
              name: ''
              description: >-
                Use off_session if your customer may or may not be present in
                your checkout flow.
            - value: on_session
              name: ''
              description: >-
                Use on_session if you intend to only reuse the payment method
                when your customer is present in your checkout flow.
        localization:
          type: object
          properties:
            applied:
              type: boolean
              description: >-
                Indicates whether localized currency conversion was applied.
                true means the customer paid in a local currency different from
                the pricing currency and an FX rate was used; false means no
                conversion occurred.
            source:
              type: object
              properties:
                amount:
                  type: string
                  description: >-
                    The transaction amount in the merchant’s pricing currency,
                    expressed in the smallest currency unit (for example, cents
                    for USD, no decimals for JPY).
                currency:
                  type: string
                  description: >-
                    The merchant’s pricing currency in ISO 4217 format,
                    uppercase (e.g., "USD", "SGD").
              x-apifox-orders:
                - amount
                - currency
              x-apifox-ignore-properties: []
            localized:
              type: object
              properties:
                amount:
                  type: string
                  description: >-
                    The actual amount paid by the customer in their local
                    currency, expressed in the smallest currency unit.
                currency:
                  type: string
                  description: >-
                    The local currency used by the customer to complete the
                    payment, in ISO 4217 format, uppercase (e.g., "CNY", "JPY").
              x-apifox-orders:
                - amount
                - currency
              x-apifox-ignore-properties: []
            fx:
              type: object
              properties:
                rate:
                  type: string
                  description: >-
                    The actual exchange rate applied from the pricing currency
                    to the local currency.
              x-apifox-orders:
                - rate
              x-apifox-ignore-properties: []
          x-apifox-orders:
            - applied
            - source
            - localized
            - fx
          description: >-
            An object containing details about localized currency conversion
            when the customer pays in a currency different from the your pricing
            currency.
          x-apifox-ignore-properties: []
        statement_descriptor_suffix:
          type: string
          description: （未实现）
        statement_descriptor:
          type: string
          description: （未实现）
        on_behalf_of:
          type: string
          description: （未实现）
        processing:
          type: string
          description: （未实现）
        review:
          type: string
          description: （未实现）
        transfer_data:
          type: string
          description: （未实现）
        transfer_group:
          type: string
          description: （未实现）
        application:
          type: string
          description: （未实现）
        application_fee_amount:
          type: string
          description: （未实现）
        automatic_payment_methods:
          type: string
          description: （未实现）
      x-apifox-orders:
        - id
        - object
        - created
        - currency
        - customer
        - amount
        - status
        - description
        - metadata
        - livemode
        - shipping
        - merchant_order_id
        - client_secret
        - last_payment_error
        - next_action
        - payment_method_types
        - payment_method_options
        - payment_method
        - receipt_email
        - canceled_at
        - cancellation_reason
        - confirmation_method
        - 3ds_status
        - amount_capturable
        - return_url
        - quantity
        - latest_charge
        - merchant_user_id
        - amount_received
        - capture_method
        - invoice
        - setup_future_usage
        - localization
        - statement_descriptor_suffix
        - statement_descriptor
        - on_behalf_of
        - processing
        - review
        - transfer_data
        - transfer_group
        - application
        - application_fee_amount
        - automatic_payment_methods
      required:
        - currency
        - amount
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
  securitySchemes:
    basic:
      type: http
      scheme: basic
servers:
  - url: https://apitest.wooshpay.com
    description: 官网测试
security:
  - basic: []

```
