Skip to main content

Charges

Charges are the base object for both PIX and card payment flows authenticated by the merchant.

Main endpoint

POST /v1/charges creates either a PIX or card charge. The payload uses amount_cents, payment_method and a customer object.

curl -X POST https://api.sandbox.mupag.com.br/v1/charges \
-H "Authorization: Bearer sk_test_your_server_key" \
-H "Idempotency-Key: 11111111-2222-3333-4444-555555555555" \
-H "Content-Type: application/json" \
-d '{"amount_cents":1590,"payment_method":"pix","customer":{"name":"Ana Silva","email":"ana@example.com","tax_id":"12345678909"}}'

Expected response

For PIX you receive charge_id, status, pix_emv_code, pix_qr_code_base64 and expires_at. For card flows, rely on webhooks and follow-up reads for the final state.

Safe operation

  • Generate one Idempotency-Key per business attempt.
  • Reuse the same customer_id when the buyer already exists.
  • Do not deliver goods or access from the synchronous response alone; wait for the correct event.

Did this page unblock the next step?

Feedback stays inside the docs flow and should never include customer or card data.