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

# Instant Swap

> Create a quote and execute the trade in a single request — no need to call `Create Quote` then `Accept Quote` separately. The swap is executed at the best available rate at the time of the request. Provide either `amount` (the amount you are selling) or `amountToReceive` (the amount you want to receive), but not both.



## OpenAPI

````yaml /api-reference/openapi.json post /trades/swap
openapi: 3.0.0
info:
  title: Obiex API
  version: 1.0.0
  description: >-
    Welcome to the Obiex API Documentation, your guide to building amazing
    payment experiences with our powerful APIs.


    Start by reviewing the overview of each folder to understand how the APIs
    function and interact. This will help you get the most out of our platform
    and easily integrate its features into your applications.
servers:
  - url: https://api.obiex.finance/v1
security: []
paths:
  /trades/swap:
    post:
      tags:
        - Trades
      summary: Instant Swap
      description: >-
        Create a quote and execute the trade in a single request — no need to
        call `Create Quote` then `Accept Quote` separately. The swap is executed
        at the best available rate at the time of the request. Provide either
        `amount` (the amount you are selling) or `amountToReceive` (the amount
        you want to receive), but not both.
      parameters:
        - name: X-API-KEY
          in: header
          required: false
          deprecated: false
          schema: {}
        - name: X-API-TIMESTAMP
          in: header
          required: false
          deprecated: false
          schema: {}
        - name: X-API-SIGNATURE
          in: header
          required: false
          deprecated: false
          schema: {}
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - sourceId
                - targetId
              properties:
                sourceId:
                  type: string
                  description: >-
                    Currency code (e.g. `USDT`) or UUID of the currency you are
                    selling
                targetId:
                  type: string
                  description: >-
                    Currency code (e.g. `NGNX`) or UUID of the currency you want
                    to receive
                amount:
                  type: number
                  description: >-
                    Amount of `sourceId` currency to sell. Mutually exclusive
                    with `amountToReceive`.
                amountToReceive:
                  type: number
                  description: >-
                    Exact amount of `targetId` currency you want to receive.
                    Mutually exclusive with `amount`.
                side:
                  type: string
                  enum:
                    - SELL
                    - BUY
                  default: SELL
                  description: Order side. Defaults to `SELL`.
            examples:
              Sell USDT for NGNX:
                summary: Sell a fixed amount of USDT
                value:
                  sourceId: USDT
                  targetId: NGNX
                  amount: 10
                  side: SELL
              Receive exact NGNX amount:
                summary: Specify how much NGNX you want to receive
                value:
                  sourceId: USDT
                  targetId: NGNX
                  amountToReceive: 14260
                  side: SELL
      responses:
        '200':
          description: Trade executed successfully
          content:
            application/json:
              schema:
                type: object
              example:
                message: Ok
                data:
                  id: 024a29e9-ab89-46c5-bac1-64ba292946da
                  createdAt: '2026-03-27T10:25:59.722Z'
                  updatedAt: '2026-03-27T10:25:59.722Z'
                  active: true
                  reference: c1774607154115
                  rate: 1426
                  side: SELL
                  amount: 10
                  amountReceived: 14260
                  sourceDollarRate: 0.99
                  targetDollarRate: 0.0007
                  userId: 51xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
                  pairId: 3bd8ace6-dc63-49a8-b91a-46131dfdf0f2
                  dollarValue: 9.9
                  pair:
                    id: 3bd8ace6-dc63-49a8-b91a-46131dfdf0f2
                    sourceId: 55456608-8c9f-499d-99b4-15ceafef3212
                    targetId: de3423cb-e81c-464f-8bb4-d9da15a37e8b
                    source:
                      id: 55456608-8c9f-499d-99b4-15ceafef3212
                      name: Tether
                      code: USDT
                    target:
                      id: de3423cb-e81c-464f-8bb4-d9da15a37e8b
                      name: Naira
                      code: NGNX
        '400':
          description: >-
            Bad request — insufficient balance, trading not enabled, or pair not
            available
          content:
            application/json:
              schema:
                type: object
              example:
                message: Insufficient balance
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````