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 response follows a consistent JSON pattern. Errors look like this:
{
"success": false,
"error": {
"code": "INVALID_AMOUNT",
"message": "Amount must be between R$10 and R$6000",
"field": "amount",
"request_id": "req_019c8b91..."
}
}The fields:
code— technical identifier (use it for programmatic handling)message— description in Portuguese to show to the dev (not the end user)field— name of the problematic field (in validation errors)request_id— unique request ID. Always log it — this is 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 the payment id |
| 400 Bad Request | Malformed JSON body or missing field | Validate JSON, check required fields |
| 401 Unauthorized | Invalid, missing or revoked API Key | Check X-API-Key header and key in My Store |
| 403 Forbidden | Valid key but no permission (rare) | Confirm account is active |
| 404 Not Found | Endpoint or resource (e.g. payment_id) doesn't exist | Check URL and ID |
| 410 Gone | Resource existed but was removed (e.g. long-expired payment) | Don't retry — it won't come back |
| 422 Unprocessable Entity | JSON OK but invalid field value (business rule) | Read error.field and fix |
| 429 Too Many Requests | Rate limit exceeded | Wait (header Retry-After) and reduce frequency |
| 500 Internal Server Error | Unexpected PixGo server error | Retry with exponential backoff; log request_id |
| 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": {
"code": "INVALID_API_KEY",
"message": "API Key not found or revoked"
}
}Common causes:
- You generated a new key (the old one was auto-invalidated)
- Forgot the
X-API-Keyheader - Extra space/newline in the key (mind copy-paste)
- Account was suspended
How to debug: copy the key from My Store 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}'422 — INVALID_AMOUNT / INVALID_FIELD
Amount outside your tier limits, minimum below R$10, or wrong field type.
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
Retry-After: 60
{
"success": false,
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "1000 req/24h limit exceeded on /status endpoint",
"retry_after_seconds": 60
}
}Happens mainly on /payment/{id}/status (1,000/24h cap). Respect Retry-After and consider migrating to webhook.
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: if you're creating a payment, generate a unique identifier (UUID v4) and send via header
Idempotency-Key— on retry, you won't create duplicates - Don't retry in infinite loop: 3-5 attempts is the ceiling. After that, queue for manual retry
- Log everything: timestamp, payload sent, status returned, body, headers — especially
request_id - If persists > 15min: open ticket at pixgo.org/chamados with
request_id+ timestamp + 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), UTC timestamp. - 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)
- JavaScript client with CORS: you can't call the API from the browser — production key can't go to front. 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.
- Wrong timezone in timestamp: PixGo sends in UTC. If you convert to local before comparing signature, it won't match.
- 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 UUID per order.
- Polling
/statusevery 100ms: blows rate limit in seconds. 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
request_id) - 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+timestamp+request_id - Idempotency keys + retry with exponential backoff = robust integration
Related reading: PixGo API v1 — full guide · Recurrence via API · ChatGPT as integration copilot