Usage Examples
This page provides practical examples of how to interact with the CorpX API using cURL, in the logical order of a typical integration.
Environment Variables
Configure these variables before running the examples:
1. Authentication
The first step is to obtain an OAuth2 access token using your client credentials.
Successful response:
Store the token for use in subsequent calls:
2. Check Balance
Check the available and locked balance of your account in real time.
Response:
3. Generate Dynamic QR Code (Receiving)
Generate a dynamic QR Code to receive a PIX payment for a specific amount.
4. Generate Static QR Code
Static QR Codes do not expire and are ideal for permanent display.
5. Check QR Code Status
Check whether the previously generated QR Code has been paid or is still pending.
6. PIX Out (Transfer via Key)
Send a PIX to a third-party key (outbound transfer).
Need to send PIX without a PIX key? If you only have the recipient’s bank details (ISPB, branch and account number), use the dedicated endpoint
POST /v1/accounts/{accountId}/pix/out/bank-account. See the v1.27.0 changelog for details.
6.1 PIX to CPF
6.2 PIX to Email
6.3 PIX to Phone
6.4 PIX to Random Key (EVP)
Values for keyType:
Successful response:
Values for status:
6.5 Check Transfer Status
Check the status of a transfer using the E2E ID:
Response:
Query parameters:
Note: At least one of the parameters
endToEndIdoridentifieris required.
7. Pay QR Code (PIX Out via EMV)
Pay a PIX QR Code using the EMV string (copy and paste). Prefer the
async flow (/pix/out/qr-code/async). Sync (/pix/out/qr-code) is
deprecated (Sunset 2026-11-21).
7.1 Pay QR Code asynchronously (recommended, immediate 202)
202 response with status: "ACCEPTED". Final outcome arrives via webhook
(pix.out.completed / failed / timeout) or lookup by identifier.
7.2 [DEPRECATED] Pay QR Code synchronously
Returns Deprecation / Sunset / Link headers. Migrate to /qr-code/async.
8. Request Refund
Refund a previously received PIX (full refund only — amount must equal the original value).
Response:
Values for refund status:
9. List Recent Transactions (Statement)
Retrieve the recent transaction history of the account.
Query parameters:
10. Manage PIX Keys
10.1 List PIX Keys
10.2 Register a New PIX Key
POST /v1/accounts/{accountId}/pix/keys with email or phone responds 202 and the facade sends the code. Confirm it with POST .../pix/keys/verify. A delivery failure is 503 otp_send_failed.
Values for keyType on registration:
10.3 Register a Random Key (EVP)
For random keys, omit the pixKey field:
10.4 Delete a PIX Key
11. Query MEDs (Special Return Mechanism)
List the disputes filed against the account. The list is built from the
pix.med.opened / pix.med.updated webhooks — without subscribing to them it
stays empty. See Disputes (MED).
Parameters:
There is no status filter: the API does not expose dispute status. The
settlement bank has no infraction-report lookup, so the current state is not
verifiable — what the API shows is answered (whether you responded) and the
deadline.
11.1 Attach evidence
Three steps, and all of them before answering — an attachment added after the
answer does not make it into the defense (409 conflict).
Limits: 5 MB per file, 6 MB and 10 files per dispute, and only
PDF/JPEG/PNG/WebP/TXT/CSV. Every file goes through antivirus and sanitization
before it counts as evidence (scanStatus).
11.2 Respond to a MED
The account holder has 48h from the opening (clientAnswerDeadline) to
state their case. The answer is sent once: a second call gets
409 conflict.
Values for result:
The response is 202. It records your defense and forwards it, with the
attachments, to the team that conducts the dispute — nothing is sent to the
settlement bank by this call and no status changes. There is no decision route:
refunding or refusing the disputed PIX is not done by this API.
12. Internal Transfer
Transfer funds between accounts in the same bank (no cost, instant).
Common Error Handling
Insufficient Balance
Invalid PIX Key
Idempotency Conflict
Best Practices
- Always use Idempotency-Key on POST/PUT/PATCH operations to avoid duplicates
- Store the
endToEndIdof transactions for tracking and refunds - Implement retry with exponential backoff for 5xx errors
- Validate the balance before outbound operations for better UX
- Configure webhooks to receive real-time notifications
For more details about each endpoint, see the API Reference or the Integration Guide.