Developer guide
API reference
Browse documentation

Quote USD to VES at the BCV rate

Convert a USD amount to VES using the authoritative BCV rate and a median across available BCV sources.

Request a quote

GET /v1/quote converts a USD amount to VES at the current BCV rate. Pass usdAmount as a query parameter and authenticate with your tenant x-api-key.

curlbash
curl "${API_URL}/v1/quote?usdAmount=25" \
  --header "x-api-key: ${VEXPAY_API_KEY}"
JavaScriptjavascript
const response = await fetch(
  `${process.env.API_URL}/v1/quote?usdAmount=25`,
  { headers: { 'x-api-key': process.env.VEXPAY_API_KEY } }
);

if (!response.ok) throw new Error(`API error: ${response.status}`);
const quote = await response.json();

Response fields

FieldMeaning
bcvRateAuthoritative VEX FX BCV rate used when creating payments
vesAmountusdAmount converted at bcvRate
medianRateMedian of available BCV sources (sources.vexFx and sources.bank when configured)
medianVesAmountusdAmount converted at medianRate
sources.vexFxVEX FX Official BCV rate (same as bcvRate)
sources.bankBank BCV rate when configured, or { error: "BANK_NOT_CONFIGURED" }
fetchedAtISO timestamp when the authoritative rate was fetched
Response shapejson
{
  "usdAmount": 25,
  "bcvRate": 36.5,
  "vesAmount": 912.5,
  "medianRate": 36.55,
  "medianVesAmount": 913.75,
  "source": "bcv",
  "fetchedAt": "2026-07-20T15:00:00.000Z",
  "sources": {
    "vexFx": { "bcvRate": 36.5, "fetchedAt": "2026-07-20T15:00:00.000Z" },
    "bank": { "bcvRate": 36.6, "fechavalor": "2026-07-20", "fetchedAt": "2026-07-20T15:00:00.000Z" }
  }
}

How the median is calculated

  • Successful numeric BCV rates from available sources are collected.
  • One rate → that rate is the median.
  • Two rates → the average of the two (median of an even set).
  • If sources.bank is unavailable, medianRate equals bcvRate.