POST /api/payment-gateway/process — Process a Payment
POST /api/payment-gateway/process — Unified endpoint to process PIX, Boleto, and Credit Card payments. Always include an Idempotency-Key header.
The /api/payment-gateway/process endpoint is CertoPay’s unified payment entry point. A single request shape handles all three supported payment methods — PIX, Boleto, and Credit Card — differing only in the method field and method-specific parameters. Because payment charges are non-idempotent by nature, always supply an Idempotency-Key header with a unique UUID v4 per charge attempt to prevent duplicate transactions in the event of a network retry.
A unique UUID v4 generated per charge attempt. CertoPay uses this key to deduplicate requests — submitting the same key twice returns the original response without creating a second charge.Strongly recommended for all production requests.
PIX is Brazil’s instant payment rail. A successful request returns a QR code payload (emv) and a hosted QR code image URL that your customer scans to complete payment. PIX transactions have a configurable expiry window.
Poll GET /api/payment-gateway/transaction/{transactionId} or listen for the payment.confirmed webhook event to detect when the PIX payment status transitions from PENDING to PAID.
Boleto Bancário is a widely used Brazilian payment slip that customers can pay at banks, ATMs, lottery kiosks, or via internet banking. A successful request returns a scannable barcode and a PDF download link. Boleto payments have a due date after which the slip expires.
The numeric digitable line (linha digitável) used for manual entry during payment. This is the string customers type in if their scanner cannot read the barcode.
Boleto confirmation typically takes 1–3 business days to be reflected in the transaction status. Do not fulfill orders based solely on the PENDING status — wait for the payment.confirmed webhook or poll the transaction endpoint.
Credit card payments are processed synchronously. A successful charge returns status: "CAPTURED" immediately. You may pass raw card data directly in the request or substitute a cardToken obtained from the Tokenize Card endpoint to avoid handling raw PAN data on your server.
A token returned by POST /api/payment-gateway/tokenize-card. When provided, all raw card* fields above are ignored. Use this to charge returning customers without re-collecting card data.
To charge a returning customer without asking for card details again, first call POST /api/payment-gateway/tokenize-card to save the card, then pass the returned cardToken in place of all card* fields.
Missing or invalid field. Check the errors array in the response body for field-level details.
401 Unauthorized
The X-Api-Key header is missing or invalid.
409 Conflict
A transaction with the same Idempotency-Key was already processed. The original response is returned.
422 Unprocessable Entity
The request was well-formed but the charge was declined by the acquirer.
500 Internal Server Error
An unexpected error occurred on CertoPay’s side. Retry with exponential back-off.
Never log or store raw card numbers (cardNumber, cardSecurityCode) in your application logs or database. Use the Tokenize Card endpoint to handle repeat customers securely.