Currency exchange

Create a quote

This endpoint generates an FX rate for a particular currency pair.


When this service is called, it returns a quote_id, which uniquely identifies the quoted foreign exchange (FX) rate, including any applicable fees and taxes. This quote_id can be used in subsequent requests to create Payouts, as long as it remains within the quote's validity period.

There are three possible ways to create a quote ID configuration:

  • Request with no amount specified
  • Request specifying the source amount
  • Request specifying the destination amount
<br />

Configuration required: to use the Quote API, please contact your Technical Account Manager or email us at integrations@dlocal.com to request setup.

⚠️ IMPORTANT: Quote-to-Payout Currency Contract

The amount type you specify when creating the quote determines which currency and amount you MUST use in the subsequent payout request.

Rules:

  1. Quote created with source_amount:
  • Payout MUST use: currency = source_currency and amount = source_amount
  • Example: Quote with source_amount=100, source_currency=USD → Payout with currency=USD, amount=100
  1. Quote created with destination_amount:
  • Payout MUST use: currency = destination_currency and amount = destination_amount
  • Example: Quote with destination_amount=392.72, destination_currency=MYR → Payout with currency=MYR, amount=392.72
  1. Quote created with no amount:
  • Payout can use either source_currency or destination_currency
  • The exchange rate will be applied accordingly

Common Error:

❌ Error Code 109: QUOTE_ID_AND_PAYOUT_TARGET_CURRENCY_MISMATCH

This error occurs when:

  • You create a quote with source_amount but send the payout with destination_currency
  • You create a quote with destination_amount but send the payout with source_currency

Example of incorrect usage:

// Step 1: Create quote with source_amount
POST /payouts/v3/quote
{
"country": "MY",
"source_currency": "USD",
"destination_currency": "MYR",
"source_amount": 100
}
// Response
{
"id": "cos9d7UH1J07FbJPh5HZ98gzebpHytFsTlfr",
"details": {
  "source_amount": 100,
  "source_currency": "USD",
  "destination_amount": 392.72,
  "destination_currency": "MYR"
}
}
// Step 2: Create payout (INCORRECT - will fail with error 109)  
POST /payouts/v3
{
"quote_id": "cos9d7UH1J07FbJPh5HZ98gzebpHytFsTlfr",
"currency": "MYR",      // ❌ WRONG - should be USD
"amount": 392.72        // ❌ WRONG - should be 100
}

Correct usage:

// Step 2: Create payout (CORRECT)
POST /payouts/v3
{
"quote_id": "cos9d7UH1J07FbJPh5HZ98gzebpHytFsTlfr",
"currency": "USD",      // ✅ Matches source_currency
"amount": 100           // ✅ Matches source_amount
}


post/payouts/v3/quote

Request

  • Base URL
    https://api.dlocal.com
  • URL
    https://api.dlocal.com/payouts/v3/quote
  • Auth
    API key in header X-Date and API key in header X-Version and API key in header Authorization

Request body

countrystring required

Country code of the destination. ISO-3166 country code ISO-3166 country code.

source_currencystring

Currency code for the source amount. ISO-4217 currency code.

destination_currencystring required

Currency code for the destination amount. ISO-4217 currency code.

source_amountnumber float

Payout source amount expressed in the currency indicated in source_currency. When creating a payout, specify the exact same amount specified in this parameter.

destination_amountnumber float

Payout destination amount expressed in the currency indicated in destination_currency. When creating a payout, specify the exact same amount specified in this parameter.

Example request

{
  "country": "CO",
  "source_currency": "USD",
  "destination_currency": "COP",
  "source_amount": 100,
  "destination_amount": 419439.11
}

Response

Quote created

status_codestring int

Quote generation status code.

statusstring

Quote generation status description.

status_detailstring

Quote generation status detail.

idstring

Unique ID generated for the quoted FX rate.

created_datestring date-time

Creation date and time for the quoted FX rate.

expiration_datestring date-time

Expiration date and time for the quoted FX rate.

Example response

{
  "status_code": "200",
  "status": "CREATED",
  "status_detail": "Quote created successfully",
  "id": "60sYJU1pTCPB3vJoOFG0XCBox9SdMJbznxb0",
  "created_date": "2023-09-05T17:21:29.000+0000",
  "expiration_date": "2023-09-06T17:21:29.000+0000",
  "details": {
    "country": "CO",
    "source_amount": 100,
    "source_currency": "USD",
    "destination_amount": 419439.11,
    "destination_currency": "COP",
    "exchange_rate": 4194.3911,
    "exchange_rate_official": 4214.6213,
    "country_markup_percentage": 0.48,
    "exchange_rate_spread": 20.2301
  },
  "fees": {
    "amount": 1.6,
    "currency": "USD"
  },
  "taxes": {
    "amount": 0.09,
    "currency": "USD"
  },
  "debit": {
    "amount": 101.69,
    "currency": "USD"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.