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 '
{
  "transaction_id": 123,
  "amount_in_cents": 123,
  "external_reference_id": "<string>",
  "message_to_payer": "<string>"
}
'
{
  "created_at": "2023-11-07T05:31:56Z",
  "details": {
    "amount_in_cents": 123,
    "message_to_payer": "<string>"
  },
  "id": 123,
  "status": "awaiting_approval",
  "transaction_id": 123,
  "updated_at": "2023-11-07T05:31:56Z",
  "beneficiary": {
    "pix_key": "<string>",
    "name": "<string>",
    "tax_id": "<string>",
    "account_type": "checking_account"
  },
  "cancelled_at": "2023-11-07T05:31:56Z",
  "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
amount_in_cents
integer<int64> | null
external_reference_id
string | null
message_to_payer
string | null

Response

Refund request created successfully and will be processed asynchronously

created_at
string<date-time>
required
details
object
required
id
integer<int64>
required
status
enum<string>
required
Available options:
awaiting_approval,
pending,
processing,
success,
cancelled,
failed
transaction_id
integer<int64>
required
updated_at
string<date-time>
required
beneficiary
PIX Key · object
cancelled_at
string<date-time> | null
external_reference_id
string | null