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

# Cancel Payment Link

> Cancel a Payment Link (using a specific `payment_link_id`). This sets the Payment Link `status` to `CANCELLED` and Finverse will no longer process any user inputs or payments for the Payment Link.

Cancellation is optional.

**Authorization**: `customer_token`

## Response fields

The response is a Payment Link object, or an error object if the Payment Llink is not cancellable (e.g. payment is already processing).

Refer to Payment Link object data model in `GET /payments_links/{payment_link_id}`.



## OpenAPI

````yaml /api-reference/openapi.json post /payment_links/{paymentLinkId}/cancel
openapi: 3.0.0
info:
  description: Documentation of the early finverse services
  title: Finverse Public
  termsOfService: https://example.com
  contact:
    name: Maintainers
    email: info@finverse.com
  license:
    name: unknown license
  version: 0.0.1
servers:
  - url: https://api.prod.finverse.net
security:
  - Oauth2:
      - test
tags:
  - name: public
    description: Publicly accessible endpoints
    x-group: Public
  - name: customer
    description: Customer app and institution endpoints
    x-group: Customer
  - name: link
    description: Finverse Link flows
    x-group: Link
  - name: login_identity
    description: Login identity lifecycle and metadata
    x-group: Login identity
  - name: accounts
    description: Accounts, balances, and account numbers
    x-group: Accounts
  - name: statements
    description: Statements and composite statements
    x-group: Statements
  - name: transactions
    description: Transaction history
    x-group: Transactions
  - name: identity_income
    description: Identity and income insights
    x-group: Identity & income
  - name: payment_links
    description: Payment link creation and checkout
    x-group: Payment links
  - name: mandates
    description: Direct debit mandates
    x-group: Mandates
  - name: payments
    description: Payment initiation and status
    x-group: Payment operations
  - name: payouts
    description: Payouts and scheduled payouts
    x-group: Payouts
  - name: payment_users
    description: Payment user profiles
    x-group: Payment users
  - name: payment_accounts
    description: Payment accounts for users
    x-group: Payment accounts
  - name: payment_methods
    description: Stored payment methods
    x-group: Payment methods
  - name: bills
    description: Bill presentment
    x-group: Bills
  - name: disputes
    description: Payment disputes
    x-group: Disputes
  - name: ledger
    description: Ledger and statements
    x-group: Ledger
paths:
  /payment_links/{paymentLinkId}/cancel:
    post:
      tags:
        - payment_links
      summary: Cancel Payment Link
      description: >-
        Cancel a Payment Link (using a specific `payment_link_id`). This sets
        the Payment Link `status` to `CANCELLED` and Finverse will no longer
        process any user inputs or payments for the Payment Link.


        Cancellation is optional.


        **Authorization**: `customer_token`


        ## Response fields


        The response is a Payment Link object, or an error object if the Payment
        Llink is not cancellable (e.g. payment is already processing).


        Refer to Payment Link object data model in `GET
        /payments_links/{payment_link_id}`.
      operationId: CancelPaymentLink
      parameters:
        - description: The payment link id
          name: paymentLinkId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
      responses:
        '200':
          description: Success (Link cancelled)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentLinkResponse'
              examples:
                link_cancelled:
                  summary: Success (Link cancelled)
                  value:
                    amount: 10000
                    created_at: '2024-08-16T15:32:09.814Z'
                    currency: HKD
                    link_customizations:
                      language: en
                    metadata:
                      key: value
                      tracking_flow: webapp-checkout
                    mode: PAYMENT
                    payment_details:
                      description: TEST Payment
                      external_transaction_reference: INV12345
                    payment_link_id: 01J5DX2KYPS8E35HRTPVM545B1
                    payment_metadata:
                      contract_id: '1234'
                      key: value
                    sender:
                      email: info+test@finverse.com
                      external_user_id: user_id_1||1723822330
                      name: John Doe
                      user_id: 01J5DX2KZ39YTKMDHGFTAVT2XR
                    session_status: OPEN
                    status: CANCELLED
                    unique_reference_id: Inv12345|1723822330
                    updated_at: '2024-08-16T15:32:12.980Z'
                    url: >-
                      https://pay.prod.finverse.net/link/01J5DX2KYPS8E35HRTPVM545B1
        '400':
          description: Error (Link not cancellable)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrBodyModelV2'
              examples:
                link_not_cancellable:
                  summary: Error (Link not cancellable)
                  value:
                    error:
                      details: 'Payment link cannot be cancelled (status: IN_PROGRESS)'
                      error_code: NOT_CANCELLABLE
                      message: Cancellation not allowed
                      request_id: '1709288382'
                      type: API_ERROR
                payment_link_id_not_found:
                  summary: Error (Payment Link ID not found)
                  value:
                    error:
                      details: ''
                      error_code: RESOURCE_NOT_FOUND
                      message: >-
                        Resource cannot be found. Resource does not exist, has
                        been deleted, or is not accessible.
                      request_id: '1705910432'
                      type: API_ERROR
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrBodyModelV2'
              examples:
                link_not_cancellable_setup_mode_already_successful:
                  summary: 'Error (Link not cancellable: Setup mode already successful)'
                  value:
                    error:
                      details: ''
                      error_code: INTERNAL_SERVER_ERROR
                      message: >-
                        We encountered an internal error. Please contact
                        Finverse customer support for further assistance.
                      request_id: '1713755415'
                      type: API_ERROR
      security:
        - Oauth2:
            - paymentlink:cancel
components:
  schemas:
    PaymentLinkResponse:
      properties:
        amount:
          description: >-
            Amount of the payment (in minor currency unit). Only returned if
            `mode` = `PAYMENT`.
          type: integer
          example: 100
        created_at:
          description: Timestamp when the payment link was first created
          type: string
          format: date-time
        currency:
          type: string
          example: HKD
          description: Currency of the payment (e.g. HKD)
        integration_metadata:
          $ref: '#/components/schemas/IntegrationMetadataResponse'
        link_customizations:
          $ref: '#/components/schemas/PaymentLinkCustomizations'
          description: >-
            Optional parameters to customize the behaviour of Finverse Link's UI
            to fit your implementation requirements. See `POST /payment_links`.
        metadata:
          description: >-
            Customer-supplied attributes in key:value format. E.g. `contract_id:
            1234`.
          type: object
          additionalProperties:
            type: string
        mode:
          description: >-
            Specified payment link mode. **Possible values:** \- `PAYMENT`:
            payment link is used to collect the specified payment amount now; \-
            `SETUP`: payment link is used to register a payment method to be
            charged later (using `POST /payments`).
          type: string
          enum:
            - PAYMENT
          example: PAYMENT
        payment:
          $ref: '#/components/schemas/PaymentResponse'
          description: >-
            Latest Payment object (if any) associated with the payment link Only
            returned if `mode` = `PAYMENT`.
        payment_details:
          $ref: '#/components/schemas/PaymentLinkDetails'
          description: Details on the payment Only returned if `mode` = `PAYMENT`.
        payment_link_id:
          description: >-
            Finverse Payment Link ID for this payment link. Always unique.
            Creating a payment link with different `unique_reference_id` values
            will result in two payment links with different IDs.
          type: string
        payment_metadata:
          description: >-
            Customer-supplied attributes in key:value format, to facilitate
            payment reconciliation. E.g. `contract_id: 1234`. These will be
            added as `metadata` on any Payment object directly created by the
            Payment Link, and will be included in Finverse's reporting (e.g.
            statements issued to customer apps). Only used if `mode` =
            `PAYMENT`. Will be ignored if `mode` = `SETUP`.
          type: object
          additionalProperties:
            type: string
        payment_method:
          $ref: '#/components/schemas/PaymentMethodResponse'
          description: Details on the payment method authorized by the end-user
        payment_setup_options:
          $ref: '#/components/schemas/PaymentSetupOptions'
          description: >-
            Additional parameters recording how payment methods and future
            payments have been configured
        sender:
          $ref: '#/components/schemas/PaymentLinkSenderResponse'
          description: Details on the sender of the payment
        session_status:
          description: >-
            Current session status of the payment link. Possible values: `OPEN`,
            `PROCESSING`, `COMPLETE`, `FAILED`. Session status returns interim
            status details on a payment link in `status` = `CREATED`: \- Session
            status starts as `OPEN`, then may progress to `PROCESSING`
            (indicating an async payment method or payment is currently
            processing), `COMPLETE` (for successful payment links), or `FAILED`
            (for failed payment method setup or payments). \- Session status is
            computed at read-time based on the status of any payment method
            setup or payment initiated by the payment link, until the payment
            link is successful. \- Session status may reset if a user retries a
            payment method setup or payment using the same payment link until it
            is successful (e.g. session_status may go from `FAILED` >
            `PROCESSING`, `FAILED` > `COMPLETE`, etc). \- The final
            `session_status` is `COMPLETE`, which corresponds to payment link
            `status` = `PAID` or `SETUP_SUCCEEDED`. We recommend using the
            payment link `status` as the primary indicator of payment link
            success (e.g. `status` = `PAID` or `SETUP_CREATED`). However, if
            your user flow or UI needs interim session details while the payment
            link `status` is still `CREATED`, then you should use
            `session_status` (for example to display to the user a "Your payment
            is processing" or "Your payment failed" message).
          type: string
          enum:
            - OPEN
            - PROCESSING
            - COMPLETE
            - FAILED
        status:
          description: >-
            Status of the payment link. Possible values: `CREATED`, `PAID`,
            `SETUP_SUCCEEDED`, `CANCELLED`. The status for a successful payment
            link varies based on the payment link `mode`: \- `mode` = `PAYMENT`
            => success `status` = `PAID` \- `mode` = `SETUP` => success `status`
            = `SETUP_SUCCEEDED`.
          type: string
          enum:
            - CREATED
            - PAID
            - EXPIRED
        unique_reference_id:
          description: >-
            Customer-supplied string, uniquely identifying the payment to be
            collected. See “_Handling retries and avoiding duplicate payments_”
            under `POST /payment_links`.
          type: string
          minLength: 1
        updated_at:
          description: Timestamp of the last update to the payment link's record
          type: string
          format: date-time
        url:
          description: >-
            URL to launch the Finverse Link UI flow, for the end-user to select
            a payment method & authorize the payment.
          type: string
    ErrBodyModelV2:
      properties:
        error:
          $ref: '#/components/schemas/FvErrorModelV2'
    IntegrationMetadataResponse:
      properties:
        integration_id:
          type: string
          enum:
            - RAPIDSTOR
        rapidstor_metadata:
          $ref: '#/components/schemas/RapidstorMetadataResponse'
    PaymentLinkCustomizations:
      properties:
        language:
          description: >-
            Desired language selection for Finverse Link UI. If empty or if an
            unsupported language is specified, Finverse Link will display the
            default language. Users can manually override the language selection
            on the 1st Finverse Link screen. Supported languages: `en`
            (default), `vi`, `zh`
          type: string
          enum:
            - en
            - vi
            - zh
            - ko
          example: en
        redirect_uri:
          description: >-
            Required when `ui_mode` = `redirect`. When `ui_mode` = `redirect`,
            the Finverse Link UI will redirect to this uri after success,
            failure or when user exits the UI. Uri must be one of the
            redirect_uri values registered by customer under "API settings" in
            Finverse developer dashboard (dashboard.finverse.com).
          type: string
        ui_mode:
          description: >-
            Specifies the behaviour of the Finverse Link UI upon completion of
            the authorization flow (in both success or error cases). If left
            empty, Finverse Link will default to `standalone` behaviour for both
            the Payment Links and Mandates UI. **Accepted values**: \-
            `redirect`: for when Finverse Link UI is launched as a
            window/webview embedded within the customer's application. Finverse
            will display an Exit ("X") button on each screen and a "Continue"
            button on final success/error screens, each redirecting to the
            specified `redirect_uri`, allowing the user to return to the
            customer's application. \- `standalone`: for when Finverse Link UI
            is launched in a new window/webview without the need to navigate
            back to the customer's application. Finverse will display a "You may
            close this window now" message on final success/error screens,
            guiding the user to manually close the window/webview. \- `iframe`:
            for when Finverse Link UI is launched as an iframe/webview embedded
            within the customer's application. Finverse will display an Exit
            ("X") button on each screen and a "Continue" button on final
            success/error screens, allowing the user to close the iframe/webview
            and return to the customer's application (requires customer's
            application to handle iframe/webview messages). Limitations:
            `iframe` cannot be used for Payment Links which accept credit card
            payment methods (e.g. Stripe). **Recommended value**: `redirect` or
            `standalone`
          type: string
          enum:
            - iframe
            - redirect
            - auto_redirect
            - standalone
          example: redirect
    PaymentResponse:
      required:
        - amount
        - surcharge_amount
        - amount_total_with_surcharge
      properties:
        amount:
          description: Amount of the payment (in minor currency unit)
          type: integer
          example: 100
        amount_total_with_surcharge:
          description: >-
            Total amount of the payment including any transaction fee
            `surcharge_amount` paid by the sender (in minor currency unit). See
            `surcharge_amount` on transaction fee surcharges.
          type: integer
          example: 100
        created_at:
          description: Timestamp when the payment was first created
          type: string
          format: date-time
        currency:
          type: string
          example: HKD
          description: Currency of the payment (e.g. HKD)
        error:
          $ref: '#/components/schemas/FvEmbeddedErrorModel'
          description: >-
            Details on why the payment failed (returned when `status` =
            `FAILED`). Note: this is used to detail any asynchronous e errors
            occuring after payment creation; any synchronous errors (e.g. API
            validation errors, real-time payment errors) will instead be
            returned directly during `POST /payments`.
        fees:
          type: array
          items:
            $ref: '#/components/schemas/Fee'
          description: Details on the fee(s) to be charged
        metadata:
          description: >-
            Customer-supplied attributes in key:value format. E.g.
            `employer_name`: `Apple Inc`
          type: object
          additionalProperties:
            type: string
        payment_details:
          $ref: '#/components/schemas/PaymentDetails2'
          description: Details on the payment
        payment_id:
          description: >-
            Finverse Payment ID for this payment. Always unique. Creating a
            payment with different idempotency keys will result in two payments
            with different IDs.
          type: string
        payment_method:
          $ref: '#/components/schemas/PaymentSnapshotPaymentMethod'
          description: Details on the payment method
        payment_method_id:
          description: (TO BE DEPRECATED) Finverse unique ID for the payment method
          type: string
        recipient:
          $ref: '#/components/schemas/MandateRecipient'
          description: Details on the recipient of the payment
        recipient_account:
          $ref: '#/components/schemas/MandateRecipientAccount'
          description: >-
            Details on the recipient's account for the payment (i.e. the
            Customer App's settlement account at Finverse)
        sender:
          $ref: '#/components/schemas/GetMandateSender'
          description: Details on the sender of the payment
        sender_account:
          $ref: '#/components/schemas/MandateSenderAccount'
          description: >-
            (IN DEVELOPMENT) Details on the Sender's source institution and
            account, which is funding the payment
        status:
          description: >-
            Current status of the payment. Possible values: `CREATED`,
            `AUTHORIZATION_REQUIRED`, `PROCESSING`, `SUBMITTED, EXECUTED`,
            `CANCELLED`, `FAILED`
          type: string
          enum:
            - AUTHORIZATION_REQUIRED
            - AUTHORIZING
            - PROCESSING
            - SUBMITTED
            - EXECUTED
            - FAILED
            - REVOKED
            - CANCELLED
            - CREATED
        surcharge_amount:
          description: >-
            Transaction fee surcharge_amount paid by the sender, if any
            surcharge has been configured (in minor currency unit). Transaction
            fee surcharges are off by default, but can be set for specific
            payment methods, or for custom scenarios (e.g. based on transaction
            amount, payment flow, etc). Contact
            [support@Finverse.com](mailto:support@Finverse.com) to configure
            surcharges.
          type: integer
          example: 100
        type:
          description: >-
            Specified payment type. Possible values: - `CARD`: payment via card
            gateway (e.g. Stripe) \- `MANDATE`: direct debit bank payment \-
            `MANUAL`: manual bank transfer (e.g. FPS, PayNow) \- `SINGLE`: not
            used (reserved for future use)
          type: string
          enum:
            - MANDATE
            - SINGLE
            - CARD
            - MANUAL
            - WALLET
        updated_at:
          description: Timestamp of the last update to the payment's record
          type: string
          format: date-time
    PaymentLinkDetails:
      required:
        - description
        - external_transaction_reference
      properties:
        description:
          type: string
          maxLength: 100
          description: >-
            User-facing description for the payment transaction. SWIFT character
            set includes the following characters: alphanumeric, space, and
            symbols `/ - ? : ( ) . , ' +` Required if `mode` = `PAYMENT`.
        external_transaction_reference:
          description: >-
            User-facing transaction reference for the payment transaction (e.g.
            bill/invoice number). Some payment methods may display this on the
            user's statement. Required if `mode` = `PAYMENT`. SWIFT character
            set includes the following characters: alphanumeric, space, and
            symbols `/ - ? : ( ) . , ' +` We recommend including at least 1
            latin letter in the reference, as some payment methods (e.g. Cards)
            cannot process payments where statement references have zero
            letters.
          type: string
          maxLength: 35
    PaymentMethodResponse:
      properties:
        card:
          $ref: '#/components/schemas/FVCard'
          description: Card object Included only if payment_method_type = `CARD`.
        integration_metadata:
          $ref: '#/components/schemas/PaymentMethodIntegrationMetadataResponse'
        mandate:
          $ref: '#/components/schemas/GetMandateResponse'
          description: >-
            Mandate object. Refer to Mandate object data model in `GET
            /mandates/{mandate_id}`. Included only if payment_method_type =
            `MANDATE`.
        payment_method_id:
          type: string
          description: >-
            Finverse unique ID for this payment method. If the `Sender` has
            `autopay_consent` = `true` , this ID can be used to trigger
            additional payments on-demand (see `POST /`payments).
        payment_method_type:
          type: string
          description: 'Type of payment method. **Possible values**: `CARD`, `MANDATE`.'
    PaymentSetupOptions:
      properties:
        autopay_enrollment_configuration:
          $ref: '#/components/schemas/AutopayEnrollmentConfiguration'
        future_payments:
          description: See `POST /payment_links` for details.
          type: string
          enum:
            - AUTOPAY
            - CLICK_TO_PAY
        mandate_details:
          $ref: '#/components/schemas/MandateDetailsForPaymentLink'
          description: See `POST /payment_links` for details.
        payment_method_types:
          type: array
          items:
            type: string
            enum:
              - MANDATE
              - SINGLE
              - CARD
              - MANUAL
              - WALLET
          x-omitempty: true
          description: See `POST /payment_links` for details.
        recipient_account_filters:
          $ref: '#/components/schemas/RecipientAccountFilters'
          description: See `POST /payment_links` for details.
        recurring_payment_mode:
          description: The recurring payment mode
          type: string
    PaymentLinkSenderResponse:
      properties:
        email:
          type: string
          format: email
        external_user_id:
          description: >-
            Customer App's user ID, representing the end-user making the
            payment.
          type: string
          minLength: 1
        name:
          description: Accountholder name of the sender's account
          type: string
          minLength: 1
          example: Chan Li Pak
        user_id:
          description: A unique identifier generated after creating sender
          type: string
    FvErrorModelV2:
      required:
        - type
        - error_code
        - message
        - details
        - request_id
      properties:
        details:
          type: string
        error_code:
          type: string
          example: CREDENTIALS_INVALID
        message:
          type: string
        request_id:
          description: The request_id provided in the request header
          type: string
        type:
          description: The error type
          type: string
          enum:
            - LINK_ERROR
            - API_ERROR
          example: LINKING_ERROR
    RapidstorMetadataResponse:
      properties:
        account_token:
          type: string
        corp_code:
          type: string
        i_anniv_days:
          type: number
          format: int32
        s_location_code:
          type: string
        tenant_default_currency:
          type: string
        tenant_id:
          type: string
        unit_type_id:
          type: string
    FvEmbeddedErrorModel:
      required:
        - type
        - error_code
        - message
        - details
      properties:
        details:
          type: string
        error_code:
          type: string
          example: CREDENTIALS_INVALID
        message:
          type: string
        type:
          description: The error type
          type: string
          enum:
            - LINK_ERROR
            - API_ERROR
          example: LINKING_ERROR
    Fee:
      required:
        - amount
      properties:
        amount:
          description: Amount of the fee (in minor currency unit)
          type: integer
          example: 100
        currency:
          type: string
          example: HKD
          description: Currency of the fee (e.g. HKD)
        paid_by:
          type: string
          enum:
            - RECIPIENT
            - SENDER
          example: RECIPIENT
          description: >-
            Party who will be charged the fee. Possible values: `RECIPIENT`,
            `SENDER`
        paid_by_account_id:
          description: >-
            Finverse Payment Account ID of the party who will be charged the
            fee. This references the `account_id` of either the
            `recipient_account` or the `sender_account`.
          type: string
          example: The payment account ID
    PaymentDetails2:
      properties:
        collection_entity_name:
          type: string
          description: >-
            Name of the legal entity directly collecting the payment. This name
            may be displayed to users in the Finverse UI and in email
            notifications and in the sender's bank statements. For payments
            directly collected by the merchant (e.g. SG eGIRO payments),
            `collection_entity_name` is typically the merchant's legal entity
            name, configured by Finverse during customer onboarding. Contact
            [support@finverse.com](mailto:support@finverse.com) to configure
            your merchant details. For payments collected through Finverse (e.g.
            HK eDDA payments), `collection_entity_name` will be the same as
            `processor_entity_name`
        description:
          description: >-
            User-facing description for the payment transaction. SWIFT character
            set includes the following characters: alphanumeric, space, and
            symbols `/ - ? : ( ) . , ' +`
          type: string
          maxLength: 100
        external_transaction_reference:
          description: >-
            User-facing transaction reference for the payment transaction. SWIFT
            character set includes the following characters: alphanumeric,
            space, and symbols / - ? : ( ) . , ' +
          type: string
          maxLength: 35
        mandate_id:
          description: >-
            `mandate_id` from Mandates object. Only returned if `type` =
            `MANDATE`.
          type: string
        processor_details:
          $ref: '#/components/schemas/PaymentProcessorDetails'
          description: Additional details on how the payment was processed
        processor_entity_name:
          type: string
          description: >-
            Name of the payment processor (if any) through which payments are
            collected. This name may be displayed to users in the Finverse UI,
            in email notifications and in the sender's bank/card statements. For
            payments directly collected by the merchant (e.g. SG eGIRO payments,
            most card payments), no `processor_entity_name` is returned. For
            payments collected through Finverse (e.g. HK eDDA payments),
            `processor_entity_name` will be Finverse's legal entity name.
        recurring_payment_mode:
          description: >-
            Flag used to identify recurring payment use cases (for which some
            payment methods can be eligible for discounted pricing). Possible
            values: - `FIXED_SCHEDULE`: used for subscriptions (fixed schedule,
            fixed or variable amount) \- `NON_RECURRING`: used for one-off,
            user-initiated payments (like an Uber ride or Amazon shopping order)
            \- `VARIABLE_RECURRING`: used for variable schedule + amount
            recurring contracts (e.g. usage based contracts like Cloud / SaaS
            services, or property rentals with additional adhoc charges for
            value-added services)
          type: string
        references:
          $ref: '#/components/schemas/PaymentDetailsReferences'
          description: >-
            Additional references for the Payment (e.g. transaction IDs
            generated by Finverse or the payment gateway)
        transaction_reference_id:
          description: >-
            (DEPRECATED - replaced by `external_transaction_reference`)
            User-facing transaction reference ID for the payment transaction.
            SWIFT character set includes the following characters: alphanumeric,
            space, and symbols `/ - ? : ( ) . , ' +`
          type: string
    PaymentSnapshotPaymentMethod:
      properties:
        bank_transfer:
          properties:
            bank_transfer_details:
              $ref: '#/components/schemas/BankTransferDetails'
            risk_data:
              $ref: '#/components/schemas/RiskData'
        card:
          properties:
            card_details:
              $ref: '#/components/schemas/FVCardDetails'
        wallet:
          properties:
            risk_data:
              $ref: '#/components/schemas/RiskData'
            wallet_details:
              $ref: '#/components/schemas/FVWalletDetails'
    MandateRecipient:
      required:
        - name
      properties:
        name:
          description: Merchant account name
          type: string
    MandateRecipientAccount:
      required:
        - account_id
        - account_type
      properties:
        account_id:
          description: Merchant account ID assigned by Finverse
          type: string
        account_type:
          description: Type of recipient account.
          type: string
          enum:
            - EXTERNAL_ACCOUNT
            - SETTLEMENT_ACCOUNT
          example: SETTLEMENT_ACCOUNT
    GetMandateSender:
      required:
        - user_id
        - external_user_id
        - user_type
      properties:
        external_user_id:
          description: >-
            Customer App's user ID, representing the end-user making the
            payment.
          type: string
        name:
          type: string
        user_details:
          description: Sender details which will be used for fraud checking.
          type: array
          items:
            $ref: '#/components/schemas/SenderDetail'
        user_id:
          description: A unique identifier generated after creating sender
          type: string
        user_type:
          description: >-
            Type of account held by the Sender at the Institution. Possible
            values are INDIVIDUAL, BUSINESS
          type: string
          enum:
            - INDIVIDUAL
            - BUSINESS
    MandateSenderAccount:
      type: object
      properties:
        account_id:
          description: A unique identifier generated after creating sender account
          type: string
          example: sender_account_id
        account_number:
          $ref: '#/components/schemas/RecipientAccountNumber'
          description: Bank account number details, including account number in plaintext
        account_number_masked:
          description: Masked Account number of the sender’s account
          type: string
        account_type:
          description: Type of sender account.
          type: string
          enum:
            - EXTERNAL_ACCOUNT
          example: EXTERNAL_ACCOUNT
        accountholder_name:
          description: Tokenized accountholder name of the sender's account
          type: string
          example: 01EP4A1MZDHKETZFRPF0K62S6S
        accountholder_name_plaintext:
          description: Accountholder name in plaintext.
          type: string
          example: Chan Li Pak
          nullable: true
        bank_code:
          type: string
        institution_id:
          description: Finverse Institution ID for the sender’s institution.
          type: string
          example: hsbc-hk
        institution_name:
          description: Institution Name for the sender’s institution.
          type: string
          example: HSBC
        metadata:
          description: >-
            Additional attributes of the sender account in key:value format
            (e.g. sender_id: 1234). It supports up to 10 key:value pairs,
            whereas the key and value supports up to 50 and 1000 characters
            respectively.
          type: object
          additionalProperties:
            type: string
        user_id:
          description: >-
            A unique identifier generated after creating sender (Finverse
            Payment User ID)
          type: string
          example: 01GY6H0JA7BS8EVGY56NSHFX2E
    FVCard:
      properties:
        card_details:
          $ref: '#/components/schemas/FVCardDetails'
          description: Additional details on the card
        created_at:
          description: Time when the card object was first created
          type: string
          format: date-time
        error:
          $ref: '#/components/schemas/FvEmbeddedErrorModel'
        recipient_account:
          $ref: '#/components/schemas/MandateRecipientAccount'
          description: Finverse ID for the account receiving the card payment.
        risk_data:
          $ref: '#/components/schemas/RiskData'
        status:
          description: >-
            Current status of the card. Possible values: PROCESSING, SUCCEEDED,
            CANCELLED, FAILED
          type: string
          enum:
            - UNKNOWN
            - CREATED
            - SUCCEEDED
            - CANCELLED
            - FAILED
        updated_at:
          description: Timestamp of the last update to the card object
          type: string
          format: date-time
    PaymentMethodIntegrationMetadataResponse:
      properties:
        adyen_metadata:
          type: object
          properties:
            auth_code:
              type: string
            network_transaction_reference:
              type: string
            payment_method_id:
              type: string
            psp_reference:
              type: string
            recurring_processing_model:
              type: string
          nullable: true
        cybersource_metadata:
          type: object
          properties:
            payment_token:
              type: string
          nullable: true
        gocardless_metadata:
          type: object
          properties:
            authorization_source:
              description: The source of the mandate authorization
              type: string
            funds_settlement:
              description: How GoCardless handles funds settlement
              type: string
            last_action:
              description: The last action taken on the mandate
              type: string
            mandate_id:
              description: The GoCardless mandate ID
              type: string
            next_possible_charge_date:
              description: The next possible charge date, in ISO format (YYYY-MM-DD)
              type: string
              format: date
              nullable: true
            payments_require_approval:
              description: Whether payments require approval
              type: boolean
              nullable: true
            reference:
              description: The GoCardless reference
              type: string
            scheme:
              description: The bank payment scheme
              type: string
            status:
              description: The GoCardless mandate status
              type: string
            verified_at:
              description: >-
                The timestamp when the mandate was verified, in ISO format
                (YYYY-MM-DDTHH:MM:SS.SSSZ)
              type: string
              format: date-time
              nullable: true
          nullable: true
        integration_id:
          type: string
        stripe_metadata:
          type: object
          properties:
            customer:
              type: object
              properties:
                id:
                  type: string
            payment_method:
              type: object
              properties:
                id:
                  type: string
          nullable: true
    GetMandateResponse:
      required:
        - updated_at
        - mandate_id
        - status
        - recipient
        - sender
        - mandate_details
      properties:
        created_at:
          description: Timestamp when the mandate was first created
          type: string
          format: date-time
        error:
          $ref: '#/components/schemas/FvEmbeddedErrorModel'
          description: >-
            Details on why the mandate failed (returned when `status` =
            `FAILED`). Note: this is used to detail any asynchronous e errors
            occuring after mandate creation; any synchronous errors (e.g. API
            validation errors) will instead be returned directly during `POST
            /mandates`.
        fees:
          type: array
          items:
            $ref: '#/components/schemas/Fee'
          description: Details on the fee(s) to be charged
        mandate_details:
          $ref: '#/components/schemas/MandateDetailsResponse'
          description: Details on the mandate
        mandate_id:
          description: >-
            Finverse Mandate ID for this mandate. Always unique. Creating a
            mandate with different idempotency keys will result in two mandates
            with different IDs.
          type: string
        metadata:
          description: >-
            Customer-supplied attributes in key:value format. E.g.
            `employer_name`: `Apple Inc`
          type: object
          additionalProperties:
            type: string
        payment_method_id:
          description: >-
            Finverse Payment Method ID for this mandate, used to create payments
            using the mandate (see `POST /`payments). Always unique. Creating a
            mandate with different idempotency keys will result in two mandates
            with different IDs.
          type: string
        recipient:
          $ref: '#/components/schemas/MandateRecipient'
          description: Details on the recipient of the payment
        recipient_account:
          $ref: '#/components/schemas/MandateRecipientAccount'
          description: >-
            Details on the recipient's account for the payment (i.e. the
            Customer App's settlement account at Finverse)
        sender:
          $ref: '#/components/schemas/GetMandateSender'
          description: Details on the sender of the payment
        sender_account:
          $ref: '#/components/schemas/MandateSenderAccount'
          description: >-
            Details on the sender's source institution and account, which is
            funding the payment
        status:
          description: >-
            Current status of the mandate. Possible values:
            `AUTHORIZATION_REQUIRED`, `PROCESSING`, `READY_TO_SUBMIT`,
            `SUBMITTED`, `SUCCEEDED`, `CANCELLED`, `CLOSED`, `FAILED` Note:
            `CLOSED` occurs when a draft Mandate is created by a Finverse
            Payment Link (with status `AUTHORIZATION_REQUIRED`), and the user
            then drops-off or creates a new Payment Method or Mandate. In these
            cases, Finverse closes the draft Mandate in order to associate a new
            Payment Method / Mandate with the same Payment Link.
          type: string
          enum:
            - AUTHORIZATION_REQUIRED
            - AUTHORIZING
            - PROCESSING
            - SUBMITTED
            - SUCCEEDED
            - FAILED
            - REVOKED
        updated_at:
          description: Timestamp of the last update to the mandate's record
          type: string
          format: date-time
    AutopayEnrollmentConfiguration:
      required:
        - display_enrollment_screen
      properties:
        display_enrollment_screen:
          description: >-
            Toggles the autopay enrollment screen on/off in Finverse Link.
            Default behaviour: `true` If `true`: autopay enrollment screen will
            be shown to users to ask users whether they consent to autopay.
          type: boolean
        enrollment_prefill_value:
          description: >-
            Prefills the default user selection on the autopay enrollment
            screen. **Default behaviour:** `YES` **Accepted values**: \- `YES`:
            autopay enrollment screen will prefill the "YES" option (to
            encourage opt-in). User will have to manually select "NO" to opt-out
            of autopay. \- `NO`: autopay enrollment screen will prefill the "NO"
            option. User will have to manually select "YES" to opt-in to
            autopay.
          type: string
          enum:
            - 'YES'
            - 'NO'
    MandateDetailsForPaymentLink:
      properties:
        description:
          description: >-
            End-user facing description of the mandate (used in notifications,
            and in payments if no description is provided)
          type: string
        end_date:
          description: YYYY-MM-DD, must be later than the date of creation.
          type: string
          format: date
          nullable: true
        start_date:
          description: >-
            YYYY-MM-DD, must be later than or the same as the date of creation.
            If unspecified, default to the date of creation.
          type: string
          format: date
          nullable: true
        transaction_limits:
          $ref: '#/components/schemas/TransactionLimitsResponse'
    RecipientAccountFilters:
      required:
        - business_unit
      properties:
        business_unit:
          type: string
          minLength: 1
          description: >-
            Business unit identifier/name the recipient account is associated
            with. Contact [support@finverse.com](mailto:support@finverse.com) to
            configure your recipient accounts and business unit names. Note:
            required if no other recipient_account_filter is passed.
    PaymentProcessorDetails:
      properties:
        auth_code:
          type: string
          description: Authorization code returned by the payment gateway
        processor_id:
          type: string
          description: >-
            ID of the payment gateway which processed the payment. Possible
            values: - `ADYEN`
        processor_reference:
          type: string
          description: Transaction reference returned by the payment gateway
        result:
          $ref: '#/components/schemas/PaymentProcessorResult'
          description: Additional details on the payment processing result
        scheme:
          description: Scheme like becs, bacs, ach, etc. (applicable to Gocardless for now)
          type: string
        virtual_account_bank_code:
          description: >-
            Bank code for the virtual account without a BK prefix (e.g. KCP
            manual virtual account payments).
          type: string
        virtual_account_number:
          description: >-
            Virtual account number issued by the processor (e.g. KCP manual
            virtual account payments).
          type: string
    PaymentDetailsReferences:
      properties:
        bank_transaction_reference:
          type: string
          description: Unique bank reference ID for the payment.
        dda_reference:
          type: string
          description: >-
            (Direct debit mandate payments only) Unique reference ID for the
            Direct Debit Authorization registered with the user's bank, used to
            authorized the payment. The user's bank may quote this reference in
            notifications to the user, and in the user's bank statements.
        finverse_transaction_reference:
          type: string
          description: >-
            Finverse-generated unique transaction ID for the payment. This value
            may be generated and passed to 3rd party payment gateways when using
            the Finverse `payment_id` is not possible or desirable (e.g. when
            the transaction reference is user-facing, making a more
            user-friendly transaction reference preferable).
    BankTransferDetails:
      properties:
        transfer_type:
          description: The transfer type
          type: string
          example: PayNow
    RiskData:
      properties:
        processor_risk_data:
          $ref: '#/components/schemas/ProcessorRiskData'
    FVCardDetails:
      properties:
        acquirer_authorization_reference:
          description: The acquirer authorization reference
          type: string
          example: '524506894419'
        brand:
          description: >-
            Card brand. Common values: American Express, Diners Club, JCB,
            Mastercard, UnionPay, Visa.
          type: string
          example: VISA
        brand_product_name:
          description: The brand product name
          type: string
          example: visacommercialpremiumcredit
        card_number_alias:
          description: >-
            Unique fingerprint for the card number, if provided by the card
            payment gateway. The card number alias can be used to check whether
            the card number is the same (for example across multiple users).
            Unlike the card `fingerprint`, the card number alias will change if
            the card is reissued with a new number (e.g. upon card expiry). See
            also: `fingerprint` field.
          type: string
          example: F046886807590403
        collection_entity_name:
          type: string
          description: >-
            Name of the legal entity directly collecting the payment. This name
            may be displayed to users in the Finverse UI and in email
            notifications and in the sender's card statements. For card
            payments, `collection_entity_name` is typically the merchant's legal
            entity name, configured by Finverse during customer onboarding.
            Contact [support@finverse.com](mailto:support@finverse.com) to
            configure your merchant details.
        country:
          description: Card country of issuance (e.g. "SG")
          type: string
          example: HK
        expiry_month:
          description: Card expiry month (e.g. 3 = March)
          type: integer
          example: 7
        expiry_year:
          description: 4-digit card expiry year (e.g. 2025)
          type: integer
          example: 2028
        fingerprint:
          type: string
          example: V0010013822052427221044754993
          description: >-
            Unique fingerprint for the card account, if provided by the card
            payment gateway. The card fingerprint remains the same even when a
            card expires and a new card is issued with a new card number. The
            fingerprint can be used to check whether the card is the same (for
            example across multiple users). See also: `card_number_alias` field.
        finverse_authorization_reference:
          type: string
          description: >-
            Finverse-generated unique ID for the payment method authorization
            setup. This value may be generated and passed to 3rd party payment
            gateways when using the Finverse `payment_id` is not possible or
            desirable (e.g. when the reference is user-facing, making a more
            user-friendly reference preferable).
        funding:
          description: >-
            Card funding type. Possible values: `CREDIT`, `DEBIT`, `PREPAID`,
            `UNKNOWN`
          type: string
          enum:
            - UNKNOWN
            - CREDIT
            - DEBIT
            - PREPAID
        is_commercial:
          description: Whether the card is a commercial card
          type: boolean
          example: true
          nullable: true
        last4:
          description: Last 4 digits of the card number
          type: string
          example: '1234'
        processor_details:
          $ref: '#/components/schemas/FVCardProcessorDetails'
          description: >-
            Additional details on how the payment method authorization was
            processed
        processor_entity_name:
          type: string
          description: >-
            Name of the payment processor (if any) through which payments are
            collected. This name may be displayed to users in the Finverse UI,
            in email notifications and in the sender's bank/card statements. For
            payments directly collected by the merchant (e.g. SG eGIRO payments,
            most card payments), no `processor_entity_name` is returned. For
            payments collected through Finverse (e.g. HK eDDA payments),
            `processor_entity_name` will be Finverse's legal entity name.
        recurring_payment_mode:
          description: >-
            Flag used to identify whether the payment method specifically has
            been setup for recurring payment use cases (for which some payment
            methods can be eligible for discounted pricing). Possible values: -
            `FIXED_SCHEDULE`: used for subscriptions (fixed schedule, fixed or
            variable amount) \- `NON_RECURRING`: used for one-off,
            user-initiated payments (like an Uber ride or Amazon shopping order)
            \- `VARIABLE_RECURRING`: used for variable schedule + amount
            recurring contracts (e.g. usage based contracts like Cloud / SaaS
            services, or property rentals with additional adhoc charges for
            value-added services)
          type: string
    FVWalletDetails:
      properties:
        brand:
          description: The wallet brand
          type: string
          example: Alipay
        brand_product_name:
          description: The brand product name
          type: string
          example: alipay_hk
        country:
          description: The issuer country
          type: string
          example: HK
    SenderDetail:
      properties:
        details_type:
          description: >-
            Type of the user identity information submitted. Possible values:
            `HK_ID`, `PASSPORT`, `HK_BUSINESS_REGISTRATION`,
            `HK_CERTIFICATE_OF_INCORPORATION`, `ACCOUNTHOLDER_NAME`
          type: string
          enum:
            - HK_ID
            - PASSPORT
            - HK_BUSINESS_REGISTRATION
            - HK_CERTIFICATE_OF_INCORPORATION
        values:
          description: >-
            Value(s) of the user identity information submitted. Min 1 value
            required, max 10 values. Values in responses are tokenized by
            Finverse.
          type: array
          maxItems: 10
          items:
            type: string
    RecipientAccountNumber:
      type: object
      required:
        - type
        - number
      properties:
        number:
          description: >-
            Account number. Account numbers in responses are tokenized by
            Finverse.
          type: string
          maxLength: 100
          minLength: 1
        number_plaintext:
          description: Account number in plaintext
          type: string
          maxLength: 100
          minLength: 1
          nullable: true
        type:
          description: 'Type of account number format. Possible values: `IBAN`, `LOCAL`'
          type: string
          enum:
            - LOCAL
            - IBAN
    MandateDetailsResponse:
      required:
        - currency
      properties:
        collection_entity_name:
          type: string
          description: >-
            Name of the legal entity directly collecting the payment. This name
            may be displayed to users in the Finverse UI and in email
            notifications and in the sender's bank statements. For direct debit
            payments directly collected by the merchant (e.g. SG eGIRO
            payments), `collection_entity_name` is typically the merchant's
            legal entity name, configured by Finverse during customer
            onboarding. Contact
            [support@finverse.com](mailto:support@finverse.com) to configure
            your merchant details. For direct debit payments collected through
            Finverse (e.g. HK eDDA payments), `collection_entity_name` will be
            the same as `processor_entity_name`
        currency:
          description: Currency of the mandate (e.g. HKD)
          type: string
        dda_reference:
          description: >-
            Unique reference ID for the Direct Debit Authorization registered
            with the user's bank. The user's bank may quote this reference in
            notifications to the user, and in direct debit payment records on
            the user's bank statements.
          type: string
        description:
          description: User-facing description for the mandate
          type: string
        end_date:
          description: >-
            Expiration date of the mandate, e.g. `2022-12-31`. Payment requests
            will be allowed up to this date (inclusive). All date inputs assume
            UTC times (e.g. if `end_date` = `2022-12-31`, then a payment will be
            allowed until 2022-12-31 at 23:59:59 UTC). `end_date` must be equal
            to or greater than `start_date` (in UTC).
          type: string
          format: date
          nullable: true
        mandate_bank_reference:
          description: >-
            Bank-generated reference for the mandate, usually shown to senders
            on their bank notifications or statements. Only returned once
            mandate has been processed successfully by the sender's bank (i.e.
            mandate `status`\= `SUCCESSFUL`).
          type: string
        payment_schedule:
          $ref: '#/components/schemas/PaymentSchedule'
          description: RESERVED FOR FUTURE USE - Specifies scheduled auto-payments
        processor_entity_name:
          type: string
          description: >-
            Name of the payment processor (if any) through which the payment is
            collected. This name may be displayed to users in the Finverse UI,
            in email notifications and in the sender's bank statements. For
            direct debit payments directly collected by the merchant (e.g. SG
            eGIRO payments), no `processor_entity_name` is returned. For direct
            debit payments collected through Finverse (e.g. HK eDDA payments),
            `processor_entity_name` will be Finverse's legal entity name.
        start_date:
          description: >-
            Start date of the mandate, e.g. `2022-06-01`. Payment requests will
            be allowed from this date onwards (inclusive). All date inputs
            assume UTC times (e.g. if `start_date` = `2022-06-01`, then a
            payment will be allowed starting from 2022-06-01 at 00:00:00 UTC).
            `start_date` must be equal to or greater than today's date (in UTC).
          type: string
          format: date
          nullable: true
        transaction_limits:
          $ref: '#/components/schemas/TransactionLimitsResponse'
          description: Specifies custom limits per payment transaction
    TransactionLimitsResponse:
      properties:
        max_period_amount:
          description: >-
            Maximum cumulative amount (in minor currency unit) of payment
            transactions (for the specified `period` unit)
          type: integer
          minimum: 1
        max_period_count:
          description: >-
            Maximum number of payment transactions (for the specified `period`
            unit)
          type: integer
          minimum: 1
        max_transaction_amount:
          description: >-
            Maximum amount per single payment transaction, set by your Customer
            App (in minor currency units). Note: to avoid your Customer App
            triggering over-limit payments, Finverse will block any `POST
            /payments` requests exceeding the `max_transaction_amount` Banks may
            separately apply their own per transaction limit (see
            `max_transaction_amount_set_by_payer_initial` below)
          type: integer
          minimum: 1
        max_transaction_amount_set_by_payer_initial:
          description: >-
            Maximum amount per single payment transaction, optionally set by the
            end-user at the time of direct debit mandate creation, e.g. for
            eGIRO in Singapore (in minor currency units). Note: Finverse will
            attempt to submit `POST /payments` requests to banks even when the
            payment amount exceeds this limit, however you should expect the
            end-user's bank will reject over-limit payemnt requests, unless the
            user directly updates their limit through their bank (e.g. through
            their bank's internet banking portal > eGIRO management page).
            Finverse separately applies its own per transaction limit (see
            `max_transaction_limit` above)
          type: integer
          nullable: true
        period:
          description: Returned if `max_period_amount` or `max_period_count` are set.
          type: string
          enum:
            - DAILY
            - WEEKLY
            - MONTHLY
            - QUARTERLY
            - YEARLY
          nullable: true
    PaymentProcessorResult:
      properties:
        decline_code:
          description: Payment processor's decline code (e.g. "2")
          type: string
        decline_reason:
          description: >-
            Decline reason returned by the payment gateway (if payment was
            declined)
          type: string
        last_action:
          description: >-
            Last action taken by the payment processor (e.g. "created",
            "captured", "failed", etc.)
          type: string
        result_code:
          description: Payment result code returned by the payment gateway
          type: string
        status:
          description: >-
            Status of the payment reported by processor (e.g. "authorized",
            "captured", "failed", etc.)
          type: string
    ProcessorRiskData:
      properties:
        browser_type:
          description: The browser type
          type: string
          example: Chrome
        device_type:
          description: The device type
          type: string
          example: Desktop
        shopper_country:
          description: The shopper country
          type: string
          example: HK
        shopper_ip:
          description: The shopper IP address
          type: string
          example: 127.0.0.1
        shopper_locale:
          description: The shopper locale
          type: string
          example: en-HK
    FVCardProcessorDetails:
      properties:
        auth_code:
          type: string
          description: Authorization code returned by the payment gateway
        network_transaction_reference:
          description: The network transaction reference
          type: string
        processor_id:
          type: string
          description: >-
            ID of the payment gateway which processed the payment method
            authorization. Possible values: - `ADYEN`
        processor_reference:
          type: string
          description: Transaction reference returned by the payment gateway
        token_id:
          type: string
          description: >-
            Token ID returned by the payment gateway (for tokenized payment
            methods)
    PaymentSchedule:
      required:
        - amount
        - frequency
      properties:
        amount:
          description: Amount of the scheduled payment in major currency
          type: integer
          example: 100
        frequency:
          description: >-
            Frequency of the scheduled payment. Possible values: `DAILY`,
            `WEEKLY`, `MONTHLY`
          type: string
          enum:
            - DAILY
            - WEEKLY
            - MONTHLY
            - QUARTERLY
            - YEARLY
  securitySchemes:
    Oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://finverse-dev.us.auth0.com/oauth/token
          scopes:
            account: Account
            balance: Balance
            credit: Credit
            institution: Institution
            investment: Investment
            link: Link
            test: Test
            transaction: Transaction

````