Ir al contenido

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.

POST
/test-helpers/fundings
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.

Media typeapplication/json
object
amountUsd
required

USD que cambiaste, en centavos

integer
>= 1
amountBs
required

Bs que recibiste en tu cuenta, en céntimos

integer
>= 1
reference
required

Tu comprobante; también la clave de idempotencia

string
>= 3 characters <= 120 characters
sellRate

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).

string
/^(?!0+(\.0+)?$)\d{1,9}(\.\d{1,8})?$/
Example
{
"amountUsd": 100000,
"amountBs": 100000000,
"reference": "cambio-0001"
}

El fondeo aprobado y tu inventario después

Media typeapplication/json
object
id
string format: uuid
tenantId
string format: uuid
status
string
Allowed values: approved
amountUsd

Centavos de USD

string
amountBs

Céntimos de Bs

string
rate

Bs por USD de este fondeo

string
averageRate

Bs por USD de tu inventario tras este fondeo

string
nullable
reference
string
recordedBy
string
approvedBy
string
resolvedAt
string format: date-time
nullable
createdAt
string format: date-time
position
object
balanceBs

Céntimos de Bs que quedan

string
costUsd

Lo que te costaron en USD

string
averageRate
string
nullable
volumeFeeBps
integer
nullable
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)