Skip to content

PIX Refund

Initiates a refund (total or partial) of a received PIX transaction.

Endpoint

POST /api/external/pix/refund

Headers

HeaderTypeRequiredDescription
AuthorizationStringYesApiKey {client_id}:{client_secret}
Content-TypeStringYesapplication/json
hmacStringYesHMAC-SHA512 signature of the body (learn more)
Idempotency-KeyStringNoUnique key to prevent duplicate processing (max 256 chars)

Request Body

FieldTypeRequiredDescriptionExample
original_transaction_idStringYesID of the original received PIX transaction"7popu57v6us7p6pcicgq12345"
amountIntegerNoAmount to refund in centavos. If omitted, refunds the full amount.3000 (R$ 30.00)
reasonStringYesBACEN refund code (see table below)"MD06"

Accepted aliases

The following fields are also accepted as aliases for original_transaction_id: original_e2e_id, transaction_id, end_to_end_id.

Monetary values

The request amount is in centavos (R$ 30.00 = 3000). The response amount is in base units (R$ 30.00 = 300000). Never use floating point.

Partial refund

For partial refunds, provide an amount less than the original value. The total of all refunds for a single transaction cannot exceed the original amount received.

Refund Codes

CodeDescription
MD06Refund by agreement between parties
BE08Fraud
AM09Incorrect amount
SL02Settlement error
RR04Unrecognized transaction

Example

bash
BODY='{"original_transaction_id":"7popu57v6us7p6pcicgq12345","amount":3000,"reason":"MD06"}'
HMAC=$(echo -n "$BODY" | openssl dgst -sha512 -hmac "$CLIENT_SECRET" | awk '{print $2}')

curl -X POST https://api.owem.com.br/api/external/pix/refund \
  -H "Authorization: ApiKey $CLIENT_ID:$CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -H "hmac: $HMAC" \
  -d "$BODY"

Success Response (200)

json
{
  "worked": true,
  "refund_id": "PIXRET20260307a1b2c3d4e5f6",
  "transaction_id": "7popu57v6us7p6pcicgq12345",
  "amount": 300000,
  "status": "processing"
}
FieldTypeDescription
workedBooleantrue indicates operation success
refund_idStringUnique refund identifier
transaction_idStringOriginal transaction ID
amountIntegerRefund amount in base units (/ 10,000 for BRL). 300000 = R$ 30.00
statusStringInitial status: processing

Error Response (404)

json
{
  "worked": false,
  "detail": "Transacao original nao encontrada"
}

Error Response (422)

json
{
  "worked": false,
  "detail": "Saldo insuficiente para devolucao"
}

Error Response (422) -- Amount exceeded

json
{
  "worked": false,
  "detail": "Valor da devolucao excede o valor original da transacao"
}

Refund deadline

Refunds with code MD06 (agreement) can be made up to 90 days after receipt. Fraud refunds (BE08) follow the MED deadlines defined by BACEN.

Owem Pay Instituição de Pagamento — ISPB 37839059