Skip to main content
POST
/
v1
/
refunds
Create Refund
curl --request POST \
  --url https://conta-public-api.kiwify.com/v1/refunds \
  --header 'Content-Type: application/json' \
  --header 'X-PoP-Challenge: <api-key>' \
  --header 'X-PoP-Format: <api-key>' \
  --header 'X-PoP-Signature: <api-key>' \
  --header 'x-access-id: <api-key>' \
  --data '
{
  "amount_in_cents": 15000,
  "external_reference_id": "refund-001",
  "message_to_payer": "Devolução parcial",
  "transaction_id": 123456789
}
'
{
  "created_at": "2026-05-28T14:30:00Z",
  "details": {
    "amount_in_cents": 123,
    "message_to_payer": "<string>"
  },
  "id": 123,
  "transaction_id": 123,
  "updated_at": "2026-05-28T14:30:00Z",
  "beneficiary": {
    "pix_key": "<string>",
    "resolved_account_number": "<string>",
    "resolved_branch": "<string>",
    "resolved_ispb": "<string>",
    "name": "<string>",
    "tax_id": "<string>"
  },
  "cancelled_at": "2026-05-28T14:30:00Z",
  "external_reference_id": "<string>"
}

Authorizations

x-access-id
string
header
required

UUID of the service account (e.g., 550e8400-e29b-41d4-a716-446655440000)

X-PoP-Challenge
string
header
required

Unix timestamp in milliseconds (e.g., 1704636800000). Must be within 5 minutes of server time.

X-PoP-Format
string
header
required

Must be 'service-account' for service account authentication

X-PoP-Signature
string
header
required

EdDSA signature of the request in base64 format. Signs: uri:method:body:timestamp

Headers

X-Idempotency-Key
string | null

Optional idempotency key for safe retries. When provided, requests with the same key and payload return the same result. Without this header, duplicate external_reference_id values will fail with 400 Bad Request.

Body

application/json
transaction_id
integer<int64>
required

Identifier of the original PIX transaction to refund.

Example:

123456789

amount_in_cents
integer<int64> | null

Refund amount in centavos. Optional — if omitted, defaults to 0 and is determined during async processing.

Required range: x >= 1
Example:

15000

external_reference_id
string | null

Client-provided unique reference for this refund within the account (1–127 characters).

Example:

"refund-001"

message_to_payer
string | null

Message sent to the original payer (1–255 characters).

Example:

"Devolução parcial"

Response

Refund request created successfully and will be processed asynchronously

created_at
string<date-time>
required

Refund creation timestamp (UTC, RFC 3339).

Example:

"2026-05-28T14:30:00Z"

details
object
required

Refund amount and payer message.

id
integer<int64>
required

Refund identifier.

status
enum<string>
required

Current refund status.

Available options:
awaiting_approval,
pending,
processing,
success,
cancelled,
failed
transaction_id
integer<int64>
required

Original transaction identifier.

updated_at
string<date-time>
required

Last update timestamp (UTC, RFC 3339).

Example:

"2026-05-28T14:30:00Z"

beneficiary
Chave Pix · object

Beneficiary details, populated after processing.

cancelled_at
string<date-time> | null

Cancellation timestamp (UTC, RFC 3339), if cancelled.

Example:

"2026-05-28T14:30:00Z"

external_reference_id
string | null

Client-provided reference identifier.