Set your selling rate
POST/treasury/sell-rateProbar
La llamada la hace tu navegador, contra el servidor que elijas arriba. Si la documentación no está servida desde el mismo origen que la API, el navegador puede bloquear la respuesta por CORS: en ese caso abre estas páginas desde la propia API (/docs) o usa el curl de arriba.
const url = 'http://localhost:3000/v1/treasury/sell-rate';const options = { method: 'POST', headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'}, body: '{"asset":"USDT","rate":"1010.50"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3000/v1/treasury/sell-rate \ --header 'Content-Type: application/json' \ --header 'x-api-key: <x-api-key>' \ --data '{ "asset": "USDT", "rate": "1010.50" }'Scope quotes:write. Only if you pay out from your own account. The rate at which you sell USDT (or USD, USDC) to your customers, in bolívares per 1 unit. From then on your quotes with conversion use this one, with no spread from us and no per-payment fee, until you set another. Setting a rate here also ends any earlier-funding tranches. Set it every day: if it isn’t today’s it still applies, but isToday comes back false.
Without a rate set, quoting in that asset returns 422 sell_rate_missing.
Authorizations
Sección titulada «Authorizations»Request Bodyrequired
Sección titulada «Request Bodyrequired»object
Bs por 1 unidad, decimal con punto y hasta 8 decimales
Example
1010.50Responses
Sección titulada «Responses»Tasa fijada; rige desde ahora
object
Bs por 1 unidad
false si se fijó otro día (hora de Venezuela)
Only if bolivars from an earlier funding are still sold at their earlier rate. Your next quotes use these first (oldest first) and then rate. Absent when there are none.
object
Bolivar cents not sold yet nor held by an open quote
Example
{ "asset": "USDT", "rate": "1010.50000000", "earlierTranches": [ { "rate": "1000.00000000", "availableBs": "5000000" } ]}Error con código estable
object
object
Contexto estructurado del error cuando lo hay: qué límite se superó y de cuánto, qué campo es inválido, cuánto saldo había. No aparece en errores internos.
object
Código ESTABLE. Programa contra esto.
Example
{ "error": { "type": "invalid_request_error", "code": "insufficient_balance", "request_id": "req_8a0312ba896772bc441134cd" }}sell_rate_managed_by_platform: in this account Bolívar Connect sets your selling rate when it accepts each funding, so it cannot be changed through the API. Only if it was agreed with you; otherwise this endpoint works as above. insufficient_scope: the key lacks quotes:write.
object
object
Contexto estructurado del error cuando lo hay: qué límite se superó y de cuánto, qué campo es inválido, cuánto saldo había. No aparece en errores internos.
object
Código ESTABLE. Programa contra esto.
Example
{ "error": { "type": "invalid_request_error", "code": "insufficient_balance", "request_id": "req_8a0312ba896772bc441134cd" }}