curl. By the end you will have created a customer record, placed an order, generated a PIX QR Code, and confirmed the transaction status — the same four operations that power every CertoPay integration, regardless of language or framework.
Prerequisites
- A CertoPay seller account
- Your
sk_live_API key (see Step 1 below) curlavailable in your terminal
Get Your API Key
Log in to the CertoPay Seller Dashboard and navigate to Settings → API Keys. Your active key is displayed with a masked suffix. If you have never generated a key, click Create Key — the full secret is shown only once, so copy it immediately and store it in a secure location such as a secrets manager or environment variable.
Create a Customer
A customer represents the buyer. Creating a customer record first lets you associate multiple orders and transactions with the same person over time. You need to supply the buyer’s full name, email address, Brazilian CPF (11-digit tax ID), and phone number.Expected response —
Buyer’s full name.
Buyer’s email address.
Buyer’s CPF — 11 digits, numbers only.
Buyer’s phone number in Brazilian format, e.g.
(11) 99999-9999.201 CreatedUUID of the newly created customer. Save this — you will use it in the next step.
The customer’s full name as stored.
The customer’s email address as stored.
If a customer with the same CPF already exists in your account, the API returns the existing record rather than creating a duplicate.
Create an Order
An order binds a customer to a specific purchase amount. Amounts must be expressed in centavos (integer). For example, R$297,00 becomes Expected response —
29700. The order does not trigger any payment on its own — it simply establishes intent and is used as the target when you call the payment gateway in the next step.The
id of the customer created in Step 2.Total order value in centavos (e.g.
29700 = R$297,00).201 CreatedUUID of the order. Pass this as
orderId in the payment gateway call.Confirmed order amount in centavos.
Initial order status — always
PENDING at creation.ISO 8601 timestamp of when the order was created.
Process a PIX Payment
With an order in hand, call the payment gateway to generate a PIX QR Code. CertoPay returns an EMV string (the raw PIX payload) and a Expected response —
qrCodeUrl you can render as an image for the buyer to scan. The QR Code expires after 1 hour by default.Include an Idempotency-Key header — a UUID v4 you generate — so the request can be safely retried without creating duplicate charges.UUID of the order created in Step 3.
Payment method. Use
PIX for this quickstart. Other valid values: BOLETO, CREDIT_CARD.Payment amount in centavos. Must match the order amount.
Buyer’s CPF (11 digits).
Buyer’s mobile phone number, e.g.
(11) 99999-9999.Buyer’s address object. Required fields:
postal_code, street, number, neighborhood, city, state.201 CreatedUUID of the transaction. Save this immediately — it is required to poll status and issue refunds.
Transaction status.
PENDING means the QR Code has been generated and is awaiting buyer payment.The raw PIX EMV/Copia e Cola string. Display this as a text field so the buyer can copy and paste it into their banking app.
URL of the rendered QR Code image. Embed this in your checkout page.
ISO 8601 timestamp after which the QR Code is no longer valid.
Check the Transaction Status
After presenting the QR Code to the buyer, you can retrieve the current transaction status at any time by calling the Transactions endpoint with the Expected response —
transactionId you saved in Step 4. In production, prefer webhooks over polling — CertoPay will POST to your endpoint the moment status changes to PAID.200 OKThe transaction UUID.
The UUID of the parent order.
Payment method used —
PIX, BOLETO, or CREDIT_CARD.Transaction amount in centavos.
Current transaction status. See the status lifecycle table for all possible values.
For production integrations, set up a webhook endpoint so CertoPay pushes status updates to your server in real time. Polling the transactions endpoint works for development and testing, but webhooks are more reliable and efficient for production use.
What’s Next?
You’ve completed a full PIX payment flow. From here you can explore the other payment methods and production-readiness features.PIX Payments
Deep-dive into PIX: expiry configuration, dynamic vs. static QR Codes, and refunds.
Boleto Payments
Issue boletos with custom due dates and handle delayed settlement.
Credit Card
Authorize, capture, and refund card payments with installment support.
Webhooks
Receive real-time payment confirmations on your server endpoint.