Every integration breaks at some point — and when it breaks, you need to understand why before opening a ticket. This guide maps every HTTP code the PixGo API returns, the most common error messages, debug techniques, and how to reproduce bugs clearly.
- 2xx = OK; 4xx = problem in your request; 5xx = problem on PixGo's side
- 4xx errors are usually fixable without a ticket — read the
messagein the response - 5xx errors: retry with exponential backoff; if persists > 15 min, open a ticket
- Before opening a ticket: reproduce with
curl+ log of request/response
Standard error response format
Every API error response follows the same JSON format:
{
"success": false,
"error": "PAYER_DOC_REQUIRED",
"message": "Envie o campo receiver_cpf com o CPF ou CNPJ do pagador (somente números)."
}The fields:
error— stable error code. Branch onerrorin your codemessage— description in Portuguese to show to the dev (not the end user); the text may changeerrors— only onVALIDATION_ERROR: the message for each field with a problem
Always log the payment_id (when there is one), your external_id and the time of the call — that's what support asks for.
Plug PIX charges into your system with an API and webhooks. See the PixGo PIX API.
Create accountFull HTTP code table
| Status | Meaning | What to do |
|---|---|---|
| 200 OK | Success (GET / status) | Process the normal response |
| 201 Created | Payment created successfully | Store data.payment_id |
| 400 Bad Request | Malformed JSON body or missing field | Validate JSON, check required fields |
| 401 Unauthorized | Missing, invalid or disabled API Key (or inactive account) | Check the X-API-Key header and the key on the API Keys page |
| 403 Forbidden | MERCHANT_VERIFICATION_REQUIRED: the account isn't cleared to charge via the API yet | Follow the response's message |
| 404 Not Found | Endpoint or resource (e.g. payment_id) doesn't exist | Check URL and ID |
| 410 Gone | On GET /payment/{id}, the payment is in a final status (expired, canceled or refunded) | The response has success: true and the data — it's not an error and won't change anymore |
| 422 Unprocessable Entity | Payer document missing or rejected (PAYER_DOC_REQUIRED, PAYER_BLOCKED, PAYER_COMPLIANCE_BLOCKED) | Read error and message |
| 429 Too Many Requests | Key's daily quota (RATE_LIMIT_EXCEEDED) or too many charges for the same document (PAYER_RATE_LIMIT) | Wait for the day to roll over or the next hour, and reduce frequency |
| 500 Internal Server Error | Unexpected PixGo server error | Retry with exponential backoff; log external_id and time |
| 502 Bad Gateway | Temporary gateway issue | Retry in a few seconds |
| 503 Service Unavailable | API in maintenance or overload | Wait; check public status if available |
| 504 Gateway Timeout | Backend took too long | Retry with higher timeout |
Most common 4xx errors (and how to fix)
401 — INVALID_API_KEY
{
"success": false,
"error": "INVALID_API_KEY",
"message": "API Key inválida ou inativa"
}Common causes:
- Forgot the
X-API-Keyheader (then the response is401 MISSING_API_KEY) - Extra space/newline in the key (mind copy-paste)
- Account was suspended
How to debug: copy the key from the API Keys page again and test with curl:
curl -X POST https://pixgo.org/api/v1/payment/create \
-H "X-API-Key: pk_current_key" \
-H "Content-Type: application/json" \
-d '{"amount": 10, "receiver_cpf": "12345678909"}'400 — VALIDATION_ERROR / LIMIT_EXCEEDED
VALIDATION_ERROR: amount below R$10 or a field in the wrong format (details in errors). LIMIT_EXCEEDED: amount above your tier's limit (the response includes current_limit).
See your current tier at pixgo.org/depix (tier button opens modal). Details in Per-tier limits.
429 — RATE_LIMIT_EXCEEDED
HTTP/1.1 429 Too Many Requests
{
"success": false,
"error": "RATE_LIMIT_EXCEEDED",
"message": "Limite de 10000 requisições por dia excedido. Atual: 10001"
}RATE_LIMIT_EXCEEDED is the key's daily quota (10,000 requests by default, all endpoints combined); it resets when the day rolls over (Brasília time). There's no Retry-After header. If polling is the problem, move to webhooks. A 429 PAYER_RATE_LIMIT shows up when there are too many charges for the same document in the last hour.
5xx errors — when it's NOT your fault
500/502/503/504 codes indicate problem on PixGo's side. Best practices:
- Implement retry with exponential backoff: attempt 1 → wait 1s → attempt 2 → wait 2s → attempt 3 → 4s → attempt 4 → 8s → give up and mark for manual processing
- Use idempotency: always send the same order
external_id— if you repeat the call within 5 minutes with the same amount, the API returns the same pending charge ("idempotent": true) - Don't retry in infinite loop: 3-5 attempts is the ceiling. After that, queue for manual retry
- Log everything: time, payload sent, status returned, body, headers — especially the
payment_id(when there is one) and theexternal_id - If persists > 15min: open ticket at pixgo.org/chamados with the
external_id+ time + sanitized payload
How to reproduce a bug to open a ticket properly
When you need help, the more info, the faster support fixes. Roadmap:
- Reproduce with
curl: take your stack out (PHP/Node/Python), use rawcurl. If the bug happens incurl, it's the API. If not, it's your code. - Capture the 3 elements: exact
curlcommand (with key masked), full response (status, headers, body), time of the call (Brasília). - Try another network: sometimes it's corporate firewall or messed-up proxy. Test from mobile 4G.
- Verify it's not cache: some proxies and CDNs cache GET. Add
?nocache=<timestamp>just to test. - Check the live docs: pixgo.org/api/v1/docs has the current API state.
Tools that help debug
- Postman / Insomnia: GUI to test API without remembering curl syntax. Saves collections.
- ngrok / Cloudflare Tunnel: tests webhook on your localhost. Creates a public HTTPS tunnel to
localhost:3000. - jq: command-line JSON parser. Kills "let me copy this JSON to a formatter site".
- httpbin.org: public service that echoes what you send. Useful to verify exactly what your HTTP client is sending.
When the problem is yours (and you're blaming the API)
- Calling the API from the browser: the problem isn't CORS, it's the key — it can't go to the front end. Use your backend as intermediary.
- Body modified by middleware: frameworks like Express + body-parser may alter JSON before HMAC signature. Use raw body for validation.
- Altered timestamp:
X-Webhook-Timestampis a number (Unix seconds). Use the value exactly as it came in the header to build the signature — don't convert or format it. - Encoding: PHP file saved in latin1, JSON with special chars → HMAC signature mismatch.
- Retry without idempotency: you generate 2 payments when the first timed out (was 200 OK, just didn't reach back). Use the order's
external_id. - Polling
/statusevery 100ms: blows the key's daily quota. Use webhook.
Public API status
PixGo doesn't have a dedicated status page (like status.pixgo.org) yet. To confirm if an outage is on our side:
- Try accessing pixgo.org/api/v1/docs — if it loads, backend is alive
- Try a
POST /payment/createwith R$10 viacurl— if it returns 201, all OK - Check our Telegram @PixGoOrg — we announce maintenance and incidents there
- If none works, open a ticket anyway — could be real
Practical summary
- 4xx = your problem (usually quick fix by reading the
message) - 5xx = PixGo problem (retry with backoff, log
external_idand time) - 429 = you blew through rate limit (use webhook instead of polling)
- Webhook breaking: check HMAC, encoding, timeout, idempotency
- Before ticket: reproduce with
curl, capture request+response+time+external_id external_id+ retry with backoff = robust integration
Related reading: PixGo API v1 — full guide · Recurrence via API · ChatGPT as integration copilot