---
title: "Create Refund"
method: POST
path: "/v1/refunds"
tags: ["PIX Refunds"]
---

# Create Refund

`POST /v1/refunds`

Creates a refund request for a PIX transaction. The transaction_id must be provided in the request body. The refund will be processed asynchronously - validation and execution are performed by a worker process. If amount_in_cents is not provided, it defaults to 0 and will be determined during processing.

## Headers

- `X-Idempotency-Key` string, nullable

## Request body

- CreateRefundRequest
  - `amount_in_cents` integer, nullable — Refund amount in centavos. Optional — if omitted, defaults to 0 and is determined during async processing.
  - `external_reference_id` string, nullable — Client-provided unique reference for this refund within the account (1–127 characters).
  - `message_to_payer` string, nullable — Message sent to the original payer (1–255 characters).
  - `transaction_id` integer, required — Identifier of the original PIX transaction to refund.

## Response `201`

Refund request created successfully and will be processed asynchronously

- RefundResponse
  - `beneficiary` union
    - object
      - `pix_key` string, required
      - `resolved_account_number` string, nullable
      - `resolved_account_type` 'checking_account' | 'savings_account' | 'payment_account' | 'other_account' — Account types allowed in the Public API. checking_account, savings_account, payment_account, and other_account are supported.
      - `resolved_branch` string, nullable
      - `resolved_ispb` string, nullable
      - `name` string, nullable
      - `tax_id` string, nullable
    - object
      - `account_number` string, required
      - `account_type` 'checking_account' | 'savings_account' | 'payment_account' | 'other_account' — Account types allowed in the Public API. checking_account, savings_account, payment_account, and other_account are supported.
      - `branch_code` string, required
      - `ispb` string, required
      - `resolved_account_number` string, nullable
      - `resolved_account_type` 'checking_account' | 'savings_account' | 'payment_account' | 'other_account' — Account types allowed in the Public API. checking_account, savings_account, payment_account, and other_account are supported.
      - `resolved_branch` string, nullable
      - `resolved_ispb` string, nullable
      - `name` string, nullable
      - `tax_id` string, nullable
  - `cancelled_at` string, date-time, nullable — Cancellation timestamp (UTC, RFC 3339), if cancelled.
  - `created_at` string, date-time, required — Refund creation timestamp (UTC, RFC 3339).
  - `details` RefundDetails, required
    - `amount_in_cents` integer, required — Refund amount in centavos.
    - `message_to_payer` string, nullable — Message sent to the original payer.
  - `external_reference_id` string, nullable — Client-provided reference identifier.
  - `id` integer, required — Refund identifier.
  - `status` 'awaiting_approval' | 'pending' | 'processing' | 'success' | 'cancelled' | 'failed', required
  - `transaction_id` integer, required — Original transaction identifier.
  - `updated_at` string, date-time, required — Last update timestamp (UTC, RFC 3339).

## Other responses

- `400` — Invalid request. Error codes: INVALID_REQUEST (field validation in error.details), DUPLICATE_EXTERNAL_REFERENCE_ID, VALIDATION_ERROR
- `401` — Authentication failed
- `403` — Access denied
- `409` — Idempotency conflict — same X-Idempotency-Key with different payload. Error code: IDEMPOTENCY_CONFLICT
- `500` — Internal server error

---

[API](https://skmtc.net/kiwify/apis/conta-digital-api.md) · [All operations](https://skmtc.net/kiwify/apis/conta-digital-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kiwify/conta-digital-api/revisions/5e009b25c245/schema)
