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

# Create Quote

> Create a new FX quote to be used for a conversion. The returned rate includes UQPAY's markup and reflects the final rate applicable within the quote's validity period.

#### Usage Guidelines

- A quote is required before executing a currency conversion or cross-currency payout.
- The generated quote must be used within its validity period (75 seconds), after which a new quote must be requested if needed.
- Specify both `buy_currency` and `sell_currency`, but define only one of either `buy_amount` or `sell_amount`. The defined amount represents the dealt (fixed) side, while the other amount will be automatically calculated based on UQPAY's exchange rate.
- A quote created with a specific `transaction_type` can only be used for the corresponding operation. Mixing usage is not allowed.
    - conversion quotes must be used with Create Conversion.
    - payout quotes must be used with Create Payout.




## OpenAPI

````yaml /global-account/v1.6/banking.yaml post /v1/conversion/quote
openapi: 3.0.2
info:
  title: Banking API
  version: 0.0.1
  description: >
    UQPAY Banking API provides comprehensive banking and payment solutions for
    global money movement.


    ## Key Features

    - International payments and transfers

    - Multi-currency account management

    - Real-time currency conversion

    - Virtual account services

    - Fund deposit and withdrawal


    ## Authentication

    Use API keys to authenticate your client requests when utilizing UQPAY APIs.

    API keys are unique data strings used to authenticate users and enable
    access to privileged operations.

    Your API key should be kept confidential and secure at all times.


    ## Service Components

    - **Payout**: Create and manage international fund transfers to
    beneficiaries

    - **Payer**: Manage entities making payments and authorizing fund transfers

    - **Beneficiary**: Handle recipient information and bank details

    - **Balance**: View and manage multi-currency account balances

    - **Deposit**: Process incoming fund transfers

    - **Virtual Accounts**: Utilize local bank accounts in foreign currencies

    - **Conversion**: Execute currency exchange at competitive rates


    ## Getting Started

    1. Obtain API credentials

    2. Set up test environment using sandbox URL

    3. Implement authentication

    4. Start with basic operations


    ## Support

    For technical support and integration assistance, contact UQPAY support
    team.
  contact:
    name: UQPAY Support
    url: https://www.uqpay.com/support
    email: banking.tech@uqpay.com
  license:
    name: Proprietary
    url: https://www.uqpay.com/legal/api-terms
  termsOfService: https://www.uqpay.com/legal/terms
  x-api-id: banking-api-v1.6.0
  x-logo:
    url: https://uqpay.com/img/UQPAY_LogoAnimv2.gif
    backgroundColor: '#FFFFFF'
    altText: UQPAY Logo
  x-categories:
    - Banking
    - Payment Processing
    - Foreign Exchange
servers:
  - url: https://api-sandbox.uqpaytech.com/api
    description: Sandbox base URL.
  - url: https://api.uqpay.com/api
    description: Production base URL.
security: []
tags:
  - name: Balances
    description: >-
      View and manage available funds across different currencies in your
      account.
  - name: Transfers
    description: >-
      A wallet transfer resource is used for sending funds directly from your
      UQPAY account to a connected account.
  - name: Deposits
    description: >-
      Deposits are bank transfers made into your UQPAY Global Accounts for
      adding funds or collecting funds from third parties.
  - name: Virtual Accounts
    description: >-
      Virtual Accounts function as local bank accounts in foreign currencies.
      They enable worldwide fund collection with account details that allow you
      to receive funds from various platforms. Virtual Accounts can also be used
      to top up your UQPAY balance.
  - name: Payout
    description: >-
      A Payout resource is created when you send funds to a beneficiary. It
      details the beneficiary, bank details, the amount being paid, its status,
      and other relevant information. You can create the payout using either
      direct beneficiary details or a previously created beneficiary ID.
  - name: Payers
    description: >-
      The payer is the party making the payout and authorizing the transfer of
      funds from their account to the beneficiary's account.
  - name: Beneficiaries
    description: >-
      The beneficiary is the recipient of the funds and is typically the party
      who will ultimately benefit from the payout.
  - name: Conversion
    description: Manage currency conversions and exchange rates for your transactions.
  - name: Exchange Rates
    description: >-
      Retrieve real-time exchange rates for a specified currency pair or all
      available pairs.
  - name: Global Accounts
    description: >-
      ⚠️ WARNING This API version is deprecated. Eventually, a deprecated API
      version becomes unsupported. Global Accounts are foreign currency accounts
      that function as local bank accounts.
  - name: Simulator
    description: Simulate deposit transactions on the sandbox environment.
paths:
  /v1/conversion/quote:
    post:
      tags:
        - Conversion
      summary: Create Quote
      description: >
        Create a new FX quote to be used for a conversion. The returned rate
        includes UQPAY's markup and reflects the final rate applicable within
        the quote's validity period.


        #### Usage Guidelines


        - A quote is required before executing a currency conversion or
        cross-currency payout.

        - The generated quote must be used within its validity period (75
        seconds), after which a new quote must be requested if needed.

        - Specify both `buy_currency` and `sell_currency`, but define only one
        of either `buy_amount` or `sell_amount`. The defined amount represents
        the dealt (fixed) side, while the other amount will be automatically
        calculated based on UQPAY's exchange rate.

        - A quote created with a specific `transaction_type` can only be used
        for the corresponding operation. Mixing usage is not allowed.
            - conversion quotes must be used with Create Conversion.
            - payout quotes must be used with Create Payout.
      operationId: create-quote
      parameters:
        - $ref: '#/components/parameters/XOnBehalfOf'
        - $ref: '#/components/parameters/XIdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateQuoteRequest'
      responses:
        '200':
          description: OK - Successfully retrieved a payout.
          headers:
            x-response-id:
              $ref: '#/components/headers/XResponseId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateQuoteResponse'
                title: CreateQuoteResponse
      security:
        - XAuthToken: []
components:
  parameters:
    XOnBehalfOf:
      in: header
      name: x-on-behalf-of
      schema:
        type: string
      required: false
      description: >
        Specifies the sub-account on whose behalf the request is made. This
        should be set to the `account_id`, which can be retrieved via the [List
        Connected
        Accounts](/account-center/v1.6/api-reference/list-connected-accounts-1).
        If omitted or empty, the request is executed using the master account.

        More information at [Connected
        Accounts](/account-center/v1.6/guide/connected-accounts).
      example: 18523f72-f4de-4f9c-bb8e-ec7d1c4f32be
    XIdempotencyKey:
      in: header
      name: x-idempotency-key
      schema:
        type: string
        format: uuid
      required: true
      description: >-
        A unique identifier (UUID) used to maintain operation idempotency,
        ensuring that repeated executions of the same operation do not result in
        unintended effects or duplication. It helps preserve data consistency in
        the face of network errors, retries, or failures.
      example: 2adesf8e-9d63-44bc-b975-9b6ae3440dde
  schemas:
    CreateQuoteRequest:
      type: object
      required:
        - sell_currency
        - buy_currency
        - conversion_date
      properties:
        sell_currency:
          type: string
          description: >
            The currency being sold.


            For cross-currency payout scenarios, this should be the currency in
            the sender's account.  

            Example: To pay out SGD from a USD account to a beneficiary, set
            `sell_currency = USD`.
          example: USD
        sell_amount:
          type: string
          example: '1000.00'
          description: The amount of sell_currency.
        buy_currency:
          type: string
          description: >
            The currency being bought. 


            For cross-currency payout scenarios, this should be the currency the
            beneficiary will receive.  

            Example: To pay out SGD from a USD account to a beneficiary, set
            `buy_currency = SGD`.
          example: SGD
        buy_amount:
          type: string
          example: '1000.00'
          description: The amount of buy_currency.
        conversion_date:
          type: string
          example: '2024-08-26'
          description: >-
            Specifies the scheduled date when the currency conversion will be
            executed. This should be a valid business day.
        transaction_type:
          type: string
          description: |
            Type of transaction.

            - `conversion`: Default value. Used for currency conversion only.
            - `payout`: Used for cross-currency payouts only.
          enum:
            - conversion
            - payout
    CreateQuoteResponse:
      type: object
      required:
        - buy_amount
        - buy_currency
        - sell_currency
        - sell_amount
        - quote_price
      properties:
        sell_currency:
          type: string
          description: >-
            Currency code
            [ISO_4217](https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes).
          example: USD
        sell_amount:
          type: string
          example: '100'
          description: The amount of sell_currency.
        buy_currency:
          type: string
          description: >-
            Currency code
            [ISO_4217](https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes).
          example: SGD
        buy_amount:
          type: string
          example: '135.02'
          description: The amount of buy_currency.
        quote_price:
          $ref: '#/components/schemas/QuotePrice'
    QuotePrice:
      type: object
      required:
        - currency_pair
        - direct_rate
        - inverse_rate
        - quote_id
        - validity
      properties:
        currency_pair:
          type: string
          example: USDSGD
          description: >-
            The currency pair that the quote is for. The direction of the
            currency pair is per market convention where possible.
        direct_rate:
          type: string
          example: '1.358663'
          description: The exchange rate from sell_currency to buy_currency.
        inverse_rate:
          type: string
          example: '0.736018'
          description: The reciprocal of the direct_rate.
        quote_id:
          type: string
          example: 4e70729d-36dd-4465-80a2-f7282bf46bfa
          description: A unique UUID identifier for the quote.
        validity:
          type: object
          description: Time window during which this quote remains valid.
          required:
            - valid_from
            - valid_to
          properties:
            valid_from:
              type: integer
              example: 1724393057882
              description: The timestamp from when the quote becomes valid.
            valid_to:
              type: integer
              example: 1724393132882
              description: The timestamp indicating the quote's expiration time.
  headers:
    XResponseId:
      description: >-
        Universally unique identifier (UUID v4) for the response. Helpful for
        identifying a request when communicating with UQPAY support.
      schema:
        type: string
        format: uuid
        example: 2adba88e-9d63-44bc-b975-9b6ae3440dde
  securitySchemes:
    XAuthToken:
      type: apiKey
      in: header
      name: x-auth-token
      description: The API token for login provided by UQPay.

````