The mode must be enabled for your account; otherwise the API returns
FUNDING_MODE_NOT_ENABLED.1. Quote with usage = INVENTORY
Request the quote inPOST /v1/fx/quotes with usage = INVENTORY and exactly one of sourceAmount (USD) or destinationAmount (BRL). The response has two dates: expiresAt is the validity of the quote itself; inventoryExpiresAt is the validity the lot will have if you create it.
POST /v1/fx/quotes · request
Request body
201 · FxQuote
2. Create the lot
CallPOST /v1/inventories with the quoteId. This call is the acceptance: in one operation LB Pay closes rate and volume with you, creates the USDC payment promise and creates the lot, which starts ACTIVE. The quote becomes USED and records the inventoryId. Each call creates a new, independent lot; lots are never aggregated. A lot can exist without any withdrawal.
POST /v1/inventories · request
Request body
201 · Inventory
3. Check balances
GET /v1/inventories/{inventoryId} returns rate, validity and balances. Every balance is shown in BRL and USD. Control is in BRL; USD is calculated at the lot rate.
total = available + reserved + used, always.Lot status
4. Create the withdrawal
Create the withdrawal withfunding.mode = INVENTORY, funding.inventoryId, destinationAmount (the BRL the beneficiary receives) and senderQuote. Do not send quoteId. Amounts and rate come from the lot. LB Pay checks that the lot exists in your account, is within validity and has enough available BRL, applies the usual withdrawal checks and reserves the volume atomically. Another lot is never used automatically.
A violation returns
VALIDATION_ERROR (400), with the field in details.senderQuote holds the data of the FX operation between the MSB and the sender: rate, USD and BRL amounts, quote time and your reference. It is recorded as received and used to formalize the operation. It does not change the remittance amounts or the lot rate. Its structure may receive new fields.
POST /v1/remittances/withdrawals · request
Request body
201 · WithdrawalResponse
422 · ApiError
5. Track and reconcile
inventory.created: lot created.inventory.status_changed:ACTIVE↔DEPLETED, orEXPIRED. In both,data.objectis the Inventory.- Remittances funded by a lot follow the
remittance.*events. - Balance changes without a status change do not send an event. Check the balance in
GET /v1/inventories/{inventoryId}. - List the remittances of a lot with
GET /v1/remittances?inventoryId=. - In an
INVENTORYremittance,quoteIdis null,inventoryIdidentifies the lot andfx.rateis the lot rate.fx.status = CONTRACTEDonly after the execution is confirmed. InREJECTED, the reserved volume returns to the lot.

