End-to-end integrations
Integrate autoconversion rules
A copy-paste prompt for a standing fiat-to-stablecoin rule on a Lumx account — one setup call, no per-deposit API call, tested in sandbox.
// PROMPT
{ "type": "INDIVIDUAL", "name": "William Default", "taxId": "100.100.100-01", "birthDate": "1990-01-01" }
You are a senior backend engineer setting up Lumx autoconversion — a standing rule that converts fiat deposits to stablecoin as they land, with no per-transaction call.
Ground truth. Read both before writing any code and follow them over any prior knowledge:
1. https://docs.lumx.io/guides/autoconversion-rules — the rule lifecycle, the per-currency deposit details and the sandbox simulator. Also read https://docs.lumx.io/llms.txt for the rest of the documentation.
2. https://lumx-docs-public-prod.s3.us-east-1.amazonaws.com/api-production.yaml — the OpenAPI 3.1 spec, for the request body and the sourceDepositInfo shape.
Work against sandbox at https://api-sandbox.lumx.io with a server-side key sent as "Authorization: Bearer <key>".
1. Find the target account with GET /accounts?customerId={id}. The rule attaches to an account, and the account's currency decides the source currency — you do not send it.
2. Create the rule with POST /autoconversion-rules, sending accountId, targetCurrency, purpose and name, plus blockchain and partnerFeeId when you need them.
3. Store sourceDepositInfo from the response and render it per rail: brCode for PIX, clabe plus reference for SPEI, accountNumber with routingNumber or bic for USD. Re-read it with GET /autoconversion-rules/{id} rather than caching it in your own database.
4. Enforce the two documented limits in your own UI before calling: each deposit must be worth at least 50 USD in the account's currency, and a customer can hold only one active USD rule. A second USD rule returns 409 AUTOCONVERSION_RULE_ALREADY_EXISTS.
5. Track conversions through the onramp.* webhook events — each matched deposit runs as an on-ramp transaction, from onramp.transferring_fiat to onramp.success.
6. Prove the loop in sandbox with POST /autoconversion-rules/simulate-deposit, passing accountId, amount, and the rule's depositIdentifier or reference as "reference". For a USD rule, omit reference. The response is matchedRule.
Constraints:
- Rules convert fiat to stablecoin only. The prose marks the reverse direction as coming; do not build against it.
- The guide tells you to delete a rule to replace a USD one, but the spec exposes no delete operation. Do not guess a method or a path — flag it and ask.
- The simulator is sandbox-only and returns 404 in production. Keep it out of any shared code path.
- Do not state a rate limit while listing rules with GET /autoconversion-rules. None is published. Handle 429 TOO_MANY_REQUESTS with exponential backoff.
Deliverables:
- A rule setup function and a renderer for sourceDepositInfo covering PIX, SPEI and USD.
- A webhook handler that ties each converted deposit back to its rule.
- A sandbox test that simulates a matching and a non-matching deposit and asserts matchedRule.
Have an ACTIVE account before you start — a rule cannot attach to an account still provisioning.
Decide the purpose code with whoever owns compliance. It is reported on every conversion the rule runs, not just the first.
Read the agent's flag on the missing delete operation and take it to support before you design a rule-replacement flow.
Discover how our infrastructure can seamlessly integrate stablecoins into your financial operations quickly, securely, and efficiently.

