Skip to main content

Refund Guide (PIX Refund)

This guide explains how to request a refund for a received PIX payment.

Overview

The PIX refund allows you to fully or partially reverse a received payment. You can request the refund using:

  • E2E (End-to-End ID) - Unique transaction identifier in the PIX system
  • Identifier - Internal charge ID at CorpX

When to Use

  • Duplicate payment - Customer paid twice
  • Order cancellation - Order cancelled after payment
  • Incorrect amount - Customer paid a different amount than expected
  • Operational error - Payment received incorrectly

Deadlines

TypeDeadline
Normal refundUp to 90 days after payment
Fraud refundUp to 90 days after payment
warning

After 90 days, PIX refunds are no longer possible. Use other means.

Request Refund by E2E (End-to-End ID)

The E2E is the unique transaction identifier in the Brazilian PIX system. Format: E{ISPB}{DATE}{SEQUENTIAL}.

Request

curl -X POST "https://api.corpxapi.com/v1/accounts/{accountId}/pix/out/refund" \
-H "Authorization: Bearer {token}" \
-H "X-Tenant-Id: tenant-suaempresa" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: refund-e2e-12345" \
-d '{
"accountId": "{accountId}",
"originalEndToEnd": "E36741675202601281435001234567",
"amount": 150.00,
"currency": "BRL",
"reason": "USER_REQUESTED"
}'

Body Parameters

FieldTypeRequiredDescription
accountIdstringYesUUID of the account that received the original PIX
originalEndToEndstringYesE2E ID of the original transaction to be refunded
amountnumberYesAmount to refund in BRL
currencystringYesAlways BRL
reasonstringYesRefund reason code (see table below)

reason Values

ValueDescription
USER_REQUESTEDRefund requested by user/integrator
FRAUDFraudulent transaction
BANK_ERRORBank/partner processing error
CASHIER_ERRORCashier/operator error
CUSTOMER_REQUESTEnd-customer request

Success Response (202 Accepted)

{
"refundId": "ref-abc123-def456",
"status": "PROCESSING",
"amount": 150.00,
"currency": "BRL"
}
FieldDescription
refundIdInternal refund ID
statusPROCESSING, COMPLETED, REJECTED
amountRefund amount

Partial Refund

You can refund only part of the amount by specifying an amount smaller than the original value:

curl -X POST "https://api.corpxapi.com/v1/accounts/{accountId}/pix/out/refund" \
-H "Authorization: Bearer {token}" \
-H "X-Tenant-Id: tenant-suaempresa" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: refund-partial-12345" \
-d '{
"accountId": "{accountId}",
"originalEndToEnd": "E36741675202601281435001234567",
"amount": 50.00,
"currency": "BRL",
"reason": "CUSTOMER_REQUEST"
}'

Response

{
"refundId": "ref-partial-123",
"status": "PROCESSING",
"amount": 50.00,
"currency": "BRL"
}
info

You can make multiple partial refunds until the total amount of the original transaction is reached.

Possible Statuses

StatusDescription
PROCESSINGRefund in progress
COMPLETEDRefund completed successfully
REJECTEDRefund rejected

Refund Webhook

When the refund is processed, you receive a webhook:

{
"event": "pix.refund.completed",
"timestamp": "2026-01-28T15:00:03Z",
"data": {
"refundId": "ref_abc123xyz789",
"status": "COMPLETED",
"originalEndToEndId": "E36741675202601281435001234567",
"refundEndToEndId": "D36741675202601281500009876543",
"originalValue": 150.00,
"refundedValue": 150.00,
"recipient": {
"name": "John Smith",
"document": "12345678901"
}
}
}

Full Example: Refund Script

#!/bin/bash

# Configuration
API_URL="https://api.corpxapi.com"
TOKEN="your_token_here"
TENANT_ID="tenant-suaempresa"
ACCOUNT_ID="your_account"

# Refund by E2E function
refund_by_e2e() {
local e2e=$1
local amount=$2
local reason=$3

echo "Requesting refund..."
echo "E2E: $e2e"
echo "Amount: R$ $amount"
echo "Reason: $reason"
echo ""

IDEMPOTENCY_KEY="refund-$(date +%s)-$RANDOM"

response=$(curl -s -X POST "$API_URL/v1/accounts/{accountId}/pix/out/refund" \
-H "Authorization: Bearer $TOKEN" \
-H "X-Tenant-Id: $TENANT_ID" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-d "{
\"accountId\": \"$ACCOUNT_ID\",
\"originalEndToEnd\": \"$e2e\",
\"amount\": $amount,
\"currency\": \"BRL\",
\"reason\": \"$reason\"
}")

echo "$response" | jq
}

# Usage
echo "=== PIX REFUND ==="
echo ""
read -p "E2E (End-to-End ID): " e2e
read -p "Amount to refund: " amount
read -p "Reason: " reason

refund_by_e2e "$e2e" "$amount" "$reason"

Where to Find the E2E

The E2E can be found in:

  1. Payment received webhook response
  2. Charge lookup after payment
  3. Account statement (Statement)
  4. Payer's receipt

Example: Extract E2E from Webhook

{
"event": "pix.in.completed",
"data": {
"identifier": "cob_abc123def456",
"endToEndId": "E36741675202601281435001234567", // <-- Use this value
"value": 150.00
}
}

Example: Extract E2E from Charge (QR Code)

curl -X GET "https://api.corpxapi.com/v1/accounts/{accountId}/pix/qr-code?identifier=order-12345" \
-H "Authorization: Bearer {token}" \
-H "X-Tenant-Id: tenant-suaempresa"
{
"statusCode": 200,
"data": {
"identifier": "order-12345",
"status": "PAID",
"endToEndId": "E36741675202601281435001234567" // <-- Use this value
}
}

Common Errors

ErrorCauseSolution
transaction_not_foundE2E or Identifier not foundCheck the identifier
already_refundedTransaction has already been refundedCheck the history
refund_amount_exceededAmount exceeds the available balanceReduce the refund amount
refund_expired90-day deadline exceededUse another reversal method
insufficient_balanceInsufficient balance for refundDeposit funds into the account

Best Practices

  1. Save the E2E of all received transactions
  2. Use Idempotency Key to avoid duplicate refunds
  3. Validate the amount before requesting (cannot exceed the original)
  4. Document the reason for auditing purposes
  5. Configure webhooks to track the status
  6. Keep a history of refunds for reconciliation

Next Steps