Skip to main content
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.

Base URL

https://v2.certopaybrasil.com/api

Endpoint

POST /payment-gateway/process

Request Headers

X-Api-Key
string
required
Your secret API key. Keep this value server-side and never expose it in client-facing code.
Content-Type
string
required
Must be application/json.
Idempotency-Key
string
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.

Request Body — Common Fields

The following fields are required for all payment methods.
orderId
string
required
Your internal order identifier (UUID recommended). Used to correlate the transaction with your own records.
method
string
required
The payment method to use. Accepted values: "PIX", "BOLETO", "CARD".
amount
integer
required
Charge amount in centavos (Brazilian cents). For example, R$297,00 is represented as 29700.
buyerDoc
string
required
The buyer’s CPF (Cadastro de Pessoas Físicas), digits only. Example: "12345678900".
buyerCellNumber
string
required
The buyer’s mobile phone number in Brazilian format. Example: "(11) 99999-9999".
buyerAddress
object
required
The buyer’s billing address.

Method-Specific Request Body & Examples

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.

Additional Fields

No additional fields are required beyond the common fields above. Set method to "PIX".

Example Request

curl -X POST https://v2.certopaybrasil.com/api/payment-gateway/process \
  -H "X-Api-Key: sk_live_sua_chave_aqui" \
  -H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440001" \
  -H "Content-Type: application/json" \
  -d '{
    "orderId": "uuid-do-pedido",
    "method": "PIX",
    "amount": 29700,
    "buyerDoc": "12345678900",
    "buyerCellNumber": "(11) 99999-9999",
    "buyerAddress": {
      "postal_code": "01310930",
      "street": "Avenida Paulista",
      "number": "100",
      "neighborhood": "Bela Vista",
      "city": "São Paulo",
      "state": "SP"
    }
  }'

Response Fields

transactionId
string
Unique identifier for this transaction. Store this value to query status or issue refunds.
status
string
Initial transaction status. Will be "PENDING" until the PIX payment is confirmed by the buyer.
method
string
Echo of the payment method: "PIX".
amount
integer
Charged amount in centavos.
pix
object
PIX-specific payment details.

Example Response

{
  "transactionId": "uuid-da-transacao",
  "status": "PENDING",
  "method": "PIX",
  "amount": 29700,
  "pix": {
    "emv": "00020126580014br.gov.bcb.pix...",
    "qrCodeUrl": "https://...",
    "expiresAt": "2026-06-26T11:00:00Z"
  }
}
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.

Error Responses

HTTP StatusMeaning
400 Bad RequestMissing or invalid field. Check the errors array in the response body for field-level details.
401 UnauthorizedThe X-Api-Key header is missing or invalid.
409 ConflictA transaction with the same Idempotency-Key was already processed. The original response is returned.
422 Unprocessable EntityThe request was well-formed but the charge was declined by the acquirer.
500 Internal Server ErrorAn 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.