/api/payment-gateway/refund endpoint allows you to reverse a captured transaction either in full or in part. Full refunds return the entire charged amount to the buyer, while partial refunds let you specify an exact amount in centavos — useful for scenarios such as retroactive discounts, cancelled line-items, or pro-rated returns. Refunds can only be issued against transactions in the CAPTURED or PAID state.
Base URL
Endpoint
Request Headers
Your secret API key. Keep this server-side and never expose it in client-facing code.
Must be
application/json.Request Body & Examples
- Full Refund
- Partial Refund
A full refund reverses the entire original charge amount. Omit the
amount field entirely — CertoPay will automatically use the total transaction value.Request Fields
The unique identifier of the transaction to refund. This is the
transactionId returned by POST /api/payment-gateway/process.A human-readable explanation for the refund. Stored for audit purposes and visible in your CertoPay dashboard. Example:
"Customer request".Example Request
Response Fields
The identifier of the refunded transaction.
Updated transaction status. A successful full refund sets this to
"REFUNDED".The original payment method (
"PIX", "BOLETO", or "CARD").The original charged amount in centavos.
The total amount refunded in centavos. For a full refund this equals
amount.The reason string provided in the request, if any.
ISO 8601 timestamp of when the refund was processed.
Example Response
Refund Eligibility by Payment Method
| Method | Full Refund | Partial Refund | Notes |
|---|---|---|---|
| CARD | ✅ | ✅ | Refunds are processed immediately; settlement timeline depends on the buyer’s issuing bank (typically 5–10 business days). |
| PIX | ✅ | ✅ | PIX refunds (devoluções) are processed in real time via the Banco Central do Brasil infrastructure. |
| BOLETO | ✅ | ❌ | Boleto refunds require the buyer’s bank account details to be provided and are processed manually. Contact CertoPay support for boleto refund instructions. |
Error Responses
| HTTP Status | Meaning |
|---|---|
400 Bad Request | A required field is missing or the amount exceeds the refundable balance. |
401 Unauthorized | The X-Api-Key header is missing or invalid. |
404 Not Found | No transaction was found for the provided transactionId. |
409 Conflict | The transaction has already been fully refunded or is in a non-refundable state (e.g. PENDING, DECLINED). |
500 Internal Server Error | An unexpected error occurred on CertoPay’s side. Retry with exponential back-off. |