Tutorials
Isolated endpoints are tools. Tutorials show how to combine them into real flows. Each one comes with ready-to-copy code.
By use case
What each one covers
| Tutorial | Main endpoints | When to follow |
|---|---|---|
| Receive Pix | POST /pix, GET /pix, callback COMPLETED | Online store, gateway, subscription billing. |
| Send Pix | GET /pix/key, POST /withdraw, POST /withdraw/qrcode | Pay supplier, transfer to user, marketplace payout. |
| Internal transfer | POST /internal-transfer, GET /internal-transfer | Move balance between Magen accounts without touching Pix. |
| Reconciliation | GET /user/transactions, POST /user/report | Daily cash closing, audit, BI. |
| Infractions (MED) | GET /user/infractions, POST .../defenses | When you receive a webhook with an open infraction. |
Flows covered
Conventions in the examples
| Item | Convention |
|---|---|
| Token | $TOKEN variable or process.env.MAGEN_TOKEN |
| Base URL | https://api.magen.processamento.com/v1 |
| Content-Type | application/json (required on every call) |
| Amounts | In reais (BRL), never cents |
| Languages | curl, Node.js, Python, Go, PHP |
Get Withdrawal Receipt
Retorna o comprovante da transação como JSON com o campo `base64` (PDF codificado). Decodifique pra exibir ou salvar como `.pdf`.
Receber pagamento Pix
Fluxo completo para receber dinheiro de um cliente via Pix. Você cria a cobrança, exibe o QR Code, processa o callback de COMPLETED e implementa polling como fallback. Código pronto em curl, Node, Python, Go e PHP.