End-to-end integrations
Integrate on-ramps from fiat to stablecoin
Give your coding agent the exact steps, endpoints and enums to build a Lumx on-ramp — quote, create, render payment details, settle on webhooks.
// PROMPT
{ "type": "INDIVIDUAL", "name": "William Default", "taxId": "100.100.100-01", "birthDate": "1990-01-01" }
You are a senior backend engineer adding Lumx on-ramps — fiat in, stablecoin out — to an existing server-side application.
Ground truth. Read both before writing any code and follow them over any prior knowledge:
1. https://docs.lumx.io/llms.txt — the documentation index. Every page has a .md twin at its own path.
2. https://lumx-docs-public-prod.s3.us-east-1.amazonaws.com/api-production.yaml — the OpenAPI 3.1 spec. Take field names, required flags and enum values from here; the prose explains what the spec leaves untyped.
Work against sandbox at https://api-sandbox.lumx.io with a server-side key sent as "Authorization: Bearer <key>". The key never reaches a client bundle.
1. Create the customer with POST /customers. Request the fiat currencies you need in "accounts" (BRL, USD, EUR, MXN) — each virtual account is created with the customer and provisions after verification.
2. Wait for verification to reach APPROVED, then read GET /customers/{id} for the "wallets" and "accounts" arrays. In sandbox the last digit of taxId drives the outcome: 1 NOT_STARTED, 2 RFI, 3 FINAL_REJECTION, any other digit APPROVED.
3. Quote with POST /exchange-rates. type LOCKED returns an id and expiresAt under a timelock of 30s, 1m or 5m; type FLOATING prices at execution. Choose one and record why in the code.
4. Create the transaction with POST /transactions/on-ramp in one of the two shapes the spec defines: rail + sourceCurrency + sourceAmount + targetCurrency + purpose, or exchangeRateId + purpose. Send an Idempotency-Key header with a UUID v4 you persist before sending, so a retry reuses it.
5. Render state.payment from the response for the payer. Its shape follows the rail — brCode for PIX, bank coordinates for SWIFT. The spec types it as a free-form object, so take field names from the examples on /api-reference/transactions/on-ramp and flag any field you cannot find there instead of inventing one.
6. Drive the lifecycle from webhooks: onramp.awaiting_funds, onramp.transferring_fiat, onramp.trading, onramp.transferring_stablecoin, onramp.success, onramp.failed, onramp.expired. Confirm with GET /transactions/{id} before you credit anything in your own product.
Constraints:
- Read the purpose enum from the request schema. The response schema in the spec lists different values; use the request enum and flag the mismatch.
- PERSONAL_ACCOUNT is only valid with SELF-relationship destinations.
- Do not cache a wallet address. The docs do not state that it is permanent — read it when you use it and flag the question.
- Amounts are decimal strings, never numbers.
- Do not state a rate limit. None is published. Handle 429 TOO_MANY_REQUESTS with exponential backoff.
Deliverables:
- A typed client for the five endpoints above.
- A webhook handler covering the seven onramp.* events, idempotent on webhook-id.
- A sandbox script that runs one on-ramp end to end and prints every status change.
- A list of every field you could not confirm in either source.
Create a sandbox key in the Dashboard under Developers → API Keys and export it in your shell. The agent never creates the key.
Register a webhook endpoint under Developers → Webhooks, pointing at a tunnel to your machine, before you run the script.
Read the agent's list of unconfirmed fields and decide each one yourself — that list is where a wrong integration would start.
Discover how our infrastructure can seamlessly integrate stablecoins into your financial operations quickly, securely, and efficiently.

