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

# Get an exchange rate

> This endpoint returns an exchange rate quote between two currencies.



## OpenAPI

````yaml /openapi/api-production.yaml post /exchange-rates
openapi: 3.1.0
info:
  version: 1.0.0
  title: Lumx API
  description: >-
    A cross-border banking API with instant settlements and unmatched liquidity,
    powered by stablecoins.
servers:
  - url: https://api.lumx.io
  - url: https://api-sandbox.lumx.io
security: []
paths:
  /exchange-rates:
    post:
      tags:
        - Exchange Rates
      summary: Get an exchange rate
      description: This endpoint returns an exchange rate quote between two currencies.
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExchangeRateRequest'
      responses:
        '200':
          description: Resource successfully retrieved.
          content:
            application/json:
              examples:
                Floating:
                  $ref: '#/components/examples/ExchangeRateFloatingExample'
                Locked:
                  $ref: '#/components/examples/ExchangeRateLockedExample'
              schema:
                $ref: '#/components/schemas/ExchangeRateResponse'
      security:
        - apiKey: []
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      schema:
        type: string
        format: uuid
      description: >-
        Optional UUID v4 idempotency key. If you resend the same key with a
        different request body, the API returns a 409 error. Cached responses
        include the header `X-Idempotency-Cached: true`. Keys expire after 24
        hours.
  schemas:
    ExchangeRateRequest:
      allOf:
        - oneOf:
            - allOf:
                - type: object
                  description: Exchange rate's type is floating.
                  title: Floating
                - $ref: '#/components/schemas/ExchangeRateFloating'
            - allOf:
                - type: object
                  description: Exchange rate's type is locked.
                  title: Locked
                - $ref: '#/components/schemas/ExchangeRateLocked'
    ExchangeRateResponse:
      allOf:
        - oneOf:
            - allOf:
                - type: object
                  description: Exchange rate's type is floating.
                  title: Floating
                  properties:
                    type:
                      type: string
                      description: Exchange rate type.
                      enum:
                        - FLOATING
                      example: FLOATING
                    rail:
                      type: string
                      enum:
                        - PIX
                        - SWIFT
                        - SEPA
                        - ACH
                        - FEDWIRE
                        - SPEI
                      description: Exchange rate payment rail.
                      example: PIX
                    sourceCurrency:
                      type: string
                      description: Exchange rate source currency.
                      example: BRL
                    sourceAmount:
                      type: string
                      description: Exchange rate source amount.
                      example: '60000.00'
                    targetCurrency:
                      type: string
                      description: Exchange rate target currency.
                      example: USDC
                    targetAmount:
                      type: string
                      description: Exchange rate target amount.
                      example: '10125.727780'
            - allOf:
                - type: object
                  description: Exchange rate's type is locked.
                  title: Locked
                  properties:
                    id:
                      type: string
                      format: uuid
                      description: Exchange rate unique identifier.
                      example: 123e4567-e89b-12d3-a456-426614174000
                    type:
                      type: string
                      description: Exchange rate type.
                      enum:
                        - LOCKED
                      example: LOCKED
                    rail:
                      type: string
                      enum:
                        - PIX
                        - SWIFT
                        - SEPA
                        - ACH
                        - FEDWIRE
                        - SPEI
                      description: Exchange rate payment rail.
                      example: PIX
                    expiresAt:
                      type: string
                      description: Expiration date and time (UTC).
                      example: '2026-05-05T00:00:00Z'
                    sourceCurrency:
                      type: string
                      description: Exchange rate source currency.
                      example: BRL
                    sourceAmount:
                      type: string
                      description: Exchange rate source amount.
                      example: '5925.55'
                    targetCurrency:
                      type: string
                      description: Exchange rate target currency.
                      example: USDC
                    baseTargetAmount:
                      type: string
                      description: Exchange rate target amount.
                      example: '10000.000000'
                    baseExchangeRate:
                      type: string
                      description: Exchange rate base exchange rate.
                      example: '5.9255'
                    fees:
                      type: object
                      description: Exchange rate fees.
                      properties:
                        lumx:
                          type: object
                          description: Lumx fee.
                          properties:
                            rate:
                              type: string
                              description: Lumx fee rate in basis points.
                              example: '10'
                            flatAmount:
                              type: string
                              description: Lumx fee flat amount.
                              example: '1'
                            totalAmount:
                              type: string
                              description: Lumx fee total amount.
                              example: '100'
                            currency:
                              type: string
                              description: Lumx fee currency.
                              example: USDC
                        partner:
                          type: object
                          description: Partner fee.
                          properties:
                            rate:
                              type: string
                              description: Partner fee rate in basis points.
                              example: '10'
                            flatAmount:
                              type: string
                              description: Partner fee flat amount.
                              example: '1'
                            totalAmount:
                              type: string
                              description: Partner fee total amount.
                              example: '100'
                            currency:
                              type: string
                              description: Partner fee currency.
                              example: USDC
                        total:
                          type: object
                          description: Total fee.
                          properties:
                            rate:
                              type: string
                              description: Total fee rate in basis points.
                              example: '10'
                            flatAmount:
                              type: string
                              description: Total fee flat amount.
                              example: '1'
                            totalAmount:
                              type: string
                              description: Total fee total amount.
                              example: '100'
                            currency:
                              type: string
                              description: Total fee currency.
                              example: USDC
                    finalTargetAmount:
                      type: string
                      description: Exchange rate final target amount.
                      example: '10000.000000'
                    finalExchangeRate:
                      type: string
                      description: Exchange rate final exchange rate.
                      example: '5.9255'
        - type: object
          properties:
            rate:
              type: string
              description: The exchange rate between the currencies.
              example: '5.9255'
    ExchangeRateFloating:
      type: object
      properties:
        customerId:
          type: string
          description: Customer's unique identifier.
          format: uuid
          example: 3c90c3cc-0d44-4b50-8888-8dd25736052a
        type:
          type: string
          description: Exchange rate type.
          enum:
            - FLOATING
          example: FLOATING
        rail:
          type: string
          enum:
            - PIX
            - SWIFT
            - SEPA
            - ACH
            - FEDWIRE
            - SPEI
          description: Exchange rate payment rail.
          example: PIX
        sourceCurrency:
          type: string
          enum:
            - BRL
            - USD
            - EUR
            - MXN
            - USDC
            - USDT
          description: Exchange rate source currency.
          example: BRL
        sourceAmount:
          type: string
          description: Exchange rate source amount.
          example: '60000.00'
        targetCurrency:
          type: string
          enum:
            - BRL
            - USD
            - EUR
            - MXN
            - USDC
            - USDT
          description: Exchange rate target currency.
          example: USDC
        blockchain:
          type: string
          enum:
            - ETHEREUM
            - BASE
            - TRON
            - POLYGON
          description: >-
            Target blockchain for the exchange rate calculation. If not
            provided, the project's default blockchain will be used.
          example: POLYGON
        partnerFeeId:
          type: string
          description: Exchange rate partner fee ID.
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174004
      required:
        - customerId
        - type
        - sourceCurrency
        - sourceAmount
        - targetCurrency
        - rail
    ExchangeRateLocked:
      type: object
      properties:
        customerId:
          type: string
          description: Customer's unique identifier.
          format: uuid
          example: 3c90c3cc-0d44-4b50-8888-8dd25736052a
        type:
          type: string
          description: Exchange rate type.
          enum:
            - LOCKED
          example: LOCKED
        rail:
          type: string
          enum:
            - PIX
            - SWIFT
            - SEPA
            - ACH
            - FEDWIRE
            - SPEI
          description: Exchange rate payment rail.
          example: PIX
        sourceCurrency:
          type: string
          enum:
            - BRL
            - USD
            - EUR
            - MXN
            - USDC
            - USDT
          description: Exchange rate source currency.
          example: BRL
        sourceAmount:
          type: string
          description: Exchange rate source amount.
          example: '5925.55'
        targetCurrency:
          type: string
          enum:
            - BRL
            - USD
            - EUR
            - MXN
            - USDC
            - USDT
          description: Exchange rate target currency.
          example: USDC
        targetAmount:
          type: string
          description: Exchange rate target amount.
          example: '10000.000000'
        timelock:
          type: string
          description: Exchange rate time lock. Default is 30s.
          enum:
            - 30s
            - 1m
            - 5m
          example: 30s
        blockchain:
          type: string
          enum:
            - ETHEREUM
            - BASE
            - TRON
            - POLYGON
          description: >-
            Target blockchain for the exchange rate calculation. If not
            provided, the project's default blockchain will be used.
          example: POLYGON
        partnerFeeId:
          type: string
          description: Exchange rate partner fee ID.
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174004
      required:
        - customerId
        - type
        - sourceCurrency
        - targetCurrency
        - rail
  examples:
    ExchangeRateFloatingExample:
      value:
        customerId: 3c90c3cc-0d44-4b50-8888-8dd25736052a
        type: FLOATING
        rail: PIX
        sourceCurrency: BRL
        sourceAmount: '59255.50'
        targetCurrency: USDC
        baseTargetAmount: '10000.000000'
        baseExchangeRate: '5.9255'
        fees:
          lumx:
            rate: '10'
            flatAmount: '1'
            totalAmount: '11'
            currency: USDC
          partner:
            rate: '10'
            flatAmount: '1'
            totalAmount: '11'
            currency: USDC
        finalTargetAmount: '9978.000000'
        finalExchangeRate: '5.9386'
    ExchangeRateLockedExample:
      value:
        customerId: 3c90c3cc-0d44-4b50-8888-8dd25736052a
        id: 123e4567-e89b-12d3-a456-426614174001
        type: LOCKED
        rail: PIX
        sourceCurrency: BRL
        sourceAmount: '59255.50'
        targetCurrency: USDC
        baseTargetAmount: '10000.000000'
        baseExchangeRate: '5.9255'
        fees:
          lumx:
            rate: '10'
            flatAmount: '1'
            totalAmount: '11'
            currency: USDC
          partner:
            rate: '10'
            flatAmount: '1'
            totalAmount: '11'
            currency: USDC
        finalTargetAmount: '9978.000000'
        finalExchangeRate: '5.9386'
        expiresAt: '2026-05-05T00:00:00Z'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: Bearer authentication header on the format `Bearer <API_KEY>`.

````