{
  "revision": "2026-09-17.4",
  "api_base": "https://api.luniumpay.com",
  "openapi": "https://docs.luniumpay.com/openapi.json",
  "manual": "https://docs.luniumpay.com/manual",
  "start_url": "https://luniumpay.com/integrar",
  "flows": {
    "custody": {
      "title": "Receber PIX em custódia",
      "description": "Receba em saldo BRL e escolha moeda, rede e endereço somente no saque. Não exige carteira fixa.",
      "sandbox_supported": true,
      "operations": [
        "GET /keys/me",
        "GET /cashin/limits?payer_tax=CPF_DO_PAGADOR",
        "POST /cashin/charge com destino=saldo",
        "GET /cashin/{cashin_id}/status",
        "GET /saldo?customer_ref=CLIENTE",
        "GET /cashin/catalog",
        "POST /saldo/sacar-cripto"
      ],
      "create_example": {
        "amount_cents": 5000,
        "payer_tax_number": "CPF_REAL_DO_PAGADOR",
        "destino": "saldo",
        "customer_ref": "cliente-42",
        "external_id": "deposito-cliente42-001"
      },
      "completion": "Crédito confirmado: status=paid E settlement_status=sent. Confira disponivel_cents no escopo correto."
    },
    "cashin": {
      "title": "PIX com entrega direta em cripto",
      "description": "Cada cobrança pode indicar sua moeda, rede e carteira. Consulte as rotas e os mínimos vigentes antes de cobrar.",
      "sandbox_supported": true,
      "operations": [
        "GET /cashin/catalog",
        "POST /cashin/preview",
        "GET /cashin/limits?payer_tax=CPF_DO_PAGADOR",
        "POST /cashin/charge com destino=cripto",
        "GET /cashin/{cashin_id}/status"
      ],
      "create_example": {
        "amount_cents": 5000,
        "payer_tax_number": "CPF_REAL_DO_PAGADOR",
        "destino": "cripto",
        "asset": "USDT",
        "chain": "polygon",
        "payout_address": "CARTEIRA_INFORMADA_PELO_CLIENTE",
        "external_id": "compra-cripto-001"
      },
      "completion": "Entrega confirmada: status=paid E settlement_status=sent. paid sozinho não confirma entrega."
    },
    "cashout": {
      "title": "Vender cripto e receber PIX",
      "description": "Cote, confirme o destinatário, aceite e acompanhe a venda. O depósito só acontece depois do aceite.",
      "sandbox_supported": true,
      "operations": [
        "GET /catalog",
        "POST /cash-outs",
        "POST /cash-outs/{cashout_id}/accept",
        "GET /cash-outs/{cashout_id}"
      ],
      "create_example": {
        "asset": "USDT",
        "network": "polygon",
        "amount": "10",
        "pix_key": "sandbox@example.invalid",
        "pix_key_type": "email",
        "external_id": "sandbox-cashout-001"
      },
      "completion": "Cash-out concluído: state=COMPLETED. Em produção, use o destinatário real e os comprovantes retornados."
    },
    "payout": {
      "title": "Pagar PIX com saldo de custódia",
      "description": "Use o saldo disponível da casa ou de uma subconta para enviar PIX, com as taxas efetivas da chave.",
      "sandbox_supported": true,
      "operations": [
        "GET /keys/me",
        "GET /saldo?customer_ref=CLIENTE",
        "POST /payouts",
        "GET /payouts/{payout_id}"
      ],
      "create_example": {
        "amount_cents": 5000,
        "pix_key": "CHAVE_PIX_DO_DESTINATARIO",
        "pix_key_type": "email",
        "customer_ref": "cliente-42",
        "external_id": "saque-pix-cliente42-001"
      },
      "completion": "Payout confirmado: status=sent. Em timeout consulte o ID original antes de repetir."
    }
  },
  "sandbox": {
    "simulates": [
      "PIX charge with non-payable QR and explicit simulated payment",
      "custody BRL credit and held balances",
      "crypto delivery and custody withdrawal for supported snapshot routes",
      "PIX payout from custody",
      "subaccount transfers",
      "cashout quote, accept and state progression",
      "signed webhook outbox, retries and delivery history"
    ],
    "does_not_simulate": [
      "real bank or MEXC execution",
      "current market prices, route availability or production risk ladder",
      "real blockchain confirmations"
    ],
    "safety": "All funds are fictitious. Confirm PIX through POST /sandbox/cashin/{cashin_id}/pay only. Never pay the QR in a bank or deposit crypto. Production requires real providers, permissions and available funds.",
    "guide": "https://docs.luniumpay.com/sandbox",
    "capabilities": "GET /sandbox",
    "scenarios": [
      "success",
      "delayed",
      "held",
      "expired",
      "refunded",
      "failed",
      "payer_mismatch",
      "settlement_failed",
      "settlement_uncertain",
      "route_unavailable",
      "provider_unavailable"
    ],
    "demo_tools": [
      "lunium_start_sandbox_demo",
      "lunium_get_sandbox_demo"
    ],
    "demo_flow_argument": [
      "custody",
      "cashin",
      "cashout",
      "payout"
    ],
    "starter_all": "node sandbox.mjs all OR python3 sandbox.py all"
  },
  "steps": [
    "Choose the business flow; read its current OpenAPI schema and manual.",
    "Run the sandbox demo for the selected flow or execute the starter with all to exercise every journey.",
    "Implement your selected flow in a server-side backend; keep secrets in environment variables.",
    "Implement idempotency, signed webhooks, status reconciliation and route-specific limits.",
    "A human provisions production access and approves the first real transaction."
  ],
  "production_checklist": [
    "GET /keys/me: verify capabilities and applicable limits.",
    "Custody: explicitly send destino=saldo; BRL credit does not require a fixed wallet.",
    "Delivery: use GET /cashin/catalog and the preview; check entregavel, withdrawMin, withdrawFee, minBuyAmount and memo requirements.",
    "Use integer BRL cents and string crypto amounts. In cash-in/withdrawal the network field is chain; in cash-out it is network.",
    "Persist external_id before calling. Reuse the same body and identifier on retry; reconcile uncertain outcomes.",
    "Verify webhook HMAC against raw bytes, reject stale timestamps and deduplicate event_id.",
    "Do not equate paid, accepted or processing with final settlement. Use the final state of each flow.",
    "Production secrets belong in server-side environment variables, never browser code, public repos or chat."
  ],
  "starters": {
    "node": "https://docs.luniumpay.com/starter/sandbox.mjs",
    "python": "https://docs.luniumpay.com/starter/sandbox.py",
    "curl": "https://docs.luniumpay.com/starter/curl.md"
  },
  "kit": "https://docs.luniumpay.com/starter/lunium-starter.zip",
  "chatgpt": {
    "mcp_url": "https://api.luniumpay.com/mcp/onboarding",
    "authentication": "none for the public onboarding endpoint",
    "tools": "Integration plan, public catalog, sandbox demo and opt-in contact. No production account operations.",
    "setup": "In an eligible ChatGPT account/workspace, enable Developer Mode and add the HTTPS MCP URL in the app/plugin connection settings. Availability depends on account and workspace policy.",
    "without_connector": "Paste the integration brief and documentation URL into ChatGPT or your coding agent. Run the generated code in your own backend.",
    "production": "The onboarding connection does not authorize access to production accounts. The full MCP supports host-configured X-API-Key; account linking through ChatGPT OAuth is not implemented.",
    "official_setup": "https://developers.openai.com/plugins/deploy/connect-chatgpt",
    "official_auth": "https://developers.openai.com/plugins/build/auth"
  }
}
