[

Integrate autoconversion rules

]

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.

  1. Have an ACTIVE account before you start — a rule cannot attach to an account still provisioning.

  2. Decide the purpose code with whoever owns compliance. It is reported on every conversion the rule runs, not just the first.

  3. Read the agent's flag on the missing delete operation and take it to support before you design a rule-replacement flow.

TALK TO OUR TEAM

Ready to transform your business with stablecoins?

Discover how our infrastructure can seamlessly integrate stablecoins into your financial operations quickly, securely, and efficiently.

©2026. All rights reserved.

LUMX SOCIEDADE PRESTADORA DE SERVIÇOS DE ATIVOS VIRTUAIS LTDA., a private legal entity, enrolled with the CNPJ/MF under No. 42.887.120/0001-00 ("Lumx"), acts as a virtual asset service provider and is in the process of adapting to the regulatory regime for Virtual Asset Service Provider Companies (SPSAV), pursuant to Central Bank of Brazil (BCB) Resolution No. 520/2025, currently being subject to the transition regime set forth in Article 88 thereof.


Lumx US OP LLC ("Lumx") is a financial technology and payments infrastructure company. Lumx US OP LLC is a Money Service Business (MSB) registered with the Financial Crimes Enforcement Network (FinCEN) (MSB #31000316459619). Lumx is not a state-licensed money transmitter and does not, in its own capacity, engage in the provision of regulated money transmission services. All such regulated activities are conducted exclusively through, and under the licenses of, duly authorized financial-institution partners.


Lumx is not a bank, financial institution, payment institution, or custodian of client funds. Certain services made available through the Platform may be provided by duly authorized and regulated third-party partners, in accordance with applicable laws and regulations.

Please refer to Lumx’s Terms of Use and Privacy Notice for further information regarding the conditions governing the use of the Platform and the processing of your personal data.