Fund your test own account
POST/test-helpers/fundingsProbar
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/test-helpers/fundings';const options = { method: 'POST', headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'}, body: '{"amountUsd":100000,"amountBs":100000000,"reference":"cambio-0001"}'};
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/test-helpers/fundings \ --header 'Content-Type: application/json' \ --header 'x-api-key: <x-api-key>' \ --data '{ "amountUsd": 100000, "amountBs": 100000000, "reference": "cambio-0001" }'Scope payments:write; without it, 403 insufficient_scope. Otherwise, the same conditions as /test-helpers/seed, and only with an own account (funding.model: own_account in GET /tenant/capabilities); if not, 409 test_account_without_simulated_custody.
It simulates the USD-to-Bs exchange you make in your own account in production and our team records and approves: here it is approved at once (approvedBy: test-helpers:simulated), raises your inventory (GET /treasury/inventory) and goes into the weighted average cost each payment is valued at. Idempotent by reference: repeating it with the same amounts returns the same funding; with other amounts, 409 funding_reference_reused. None of this is real money.
Authorizations
Sección titulada «Authorizations»Request Bodyrequired
Sección titulada «Request Bodyrequired»object
USD que cambiaste, en centavos
Bs que recibiste en tu cuenta, en céntimos
Tu comprobante; también la clave de idempotencia
Optional, greater than 0. Bs per 1 USDT agreed for this funding: once approved it becomes your USDT selling rate, as an accepted funding does in production, and the bolivars you already had keep selling at the earlier rate (earlierTranches in GET /treasury/sell-rate, rate_breakdown in your quotes).
Example
{ "amountUsd": 100000, "amountBs": 100000000, "reference": "cambio-0001"}Responses
Sección titulada «Responses»El fondeo aprobado y tu inventario después
object
Centavos de USD
Céntimos de Bs
Bs por USD de este fondeo
Bs por USD de tu inventario tras este fondeo
object
Céntimos de Bs que quedan
Lo que te costaron en USD
Example
{ "status": "approved"}Montos o referencia inválidos
test_account_required (la key no es sk_test_ de una cuenta de pruebas) o insufficient_scope (la key no tiene payments:write)
No existe en este entorno
test_account_without_simulated_custody (tu cuenta de pruebas no tiene cuenta propia) o funding_reference_reused (esa referencia ya está anotada con otros montos)