---
title: "Refund Payment"
method: POST
path: "/refund/"
tags: ["Payins"]
---

# Refund Payment

`POST /refund/`

Create a refund for a payin. Only completed payins are eligible for refunds. 

A refund may still fail after being initially marked as `SUCCESS`; in such cases, you'll receive a callback with `status = FAILED`. 

To simulate a failed refund in the sandbox, create a payin with `amount = 101` (see the `Create Payment` endpoint for details).

To refund a deposit, use the `Create Refund` endpoint from Accounts.

## Headers

- `x-company-id` integer — ID of a child company for authentication. If not provided, the parent company will be authenticated.

## Request body

- RefundPaymentRequest
  - `payment_id` string, required — Payment ID to refund
  - `idempotency_key` string — A unique key that ensures a request is processed only once. If the same key is sent with multiple requests, the server returns the original response instead of performing the action again.
  - `description` string — Description for the refund. If supported by the rail, this will be forwarded to the end user. Only alphanumeric characters are allowed.
  - `callback_url` string — Callback URL to receive the refund updates

## Response `200`

Successful Response

- RefundPaymentResponse
  - `status` 'success'
  - `data` PayinRefundResponse, required
    - `id` string, required — Refund ID
    - `created_at` string, date-time, required — Creation date of the refund
    - `updated_at` string, date-time — Last update date of the refund
    - `idempotency_key` string — Idempotency key for the refund request, it can also be used as an external identifier
    - `status` 'PENDING' | 'SUCCESS' | 'FAILED', required — Status of the refund
    - `description` string — Description for the refund. If supported by the rail, this will be forwarded to the end user.
    - `debit_movement_id` integer — Debit movement that was originated from the refund
    - `bounce_movement_id` integer — Credit movement that was originated from the refund bounce, if applicable
    - `company` CompanyToIncludeInResponses
      - `id` string, required
      - `name` string, required
    - `voucher_id` string — Voucher ID associated with the refund, if applicable
    - `failure_reason` string — Reason for refund failure, if applicable
    - `payment_id` string — Payment ID that was refunded

## Other responses

- `403` — Forbidden
- `422` — Validation Error
- `500` — Internal Server Error

---

[API](https://skmtc.net/infiniaweb/apis/payins.md) · [All operations](https://skmtc.net/infiniaweb/apis/payins/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/infiniaweb/payins/revisions/3f453785c478/schema)
