---
title: "Refund Deposit"
method: POST
path: "/movements/refund/"
tags: ["Accounts"]
---

# Refund Deposit

`POST /movements/refund/`

## Request

- Base URL: `https://app2test.infiniaweb.com/infinia_api/v1/accounts`
- URL: `https://app2test.infiniaweb.com/infinia_api/v1/accounts/movements/refund/`
- Auth: HTTP basic

Create a refund for a deposit. Only deposit movements with `operation_type = CREDIT` are eligible. 

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 deposit with `amount = 101` (see the `Create Deposit` endpoint for details).

To refund a Payin, use the `Create Refund` endpoint from Payins.

## Headers

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

## Request body

- RefundMovementRequest
  - `movement_id` integer, required: Movement 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

- DepositRefundResponseWrapper
  - `status` 'success'
  - `data` DepositRefundResponse, 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
    - `movement_id` integer, required: Movement ID that was refunded

## Other responses

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

---

[API](https://skmtc.dev/infiniaweb/apis/accounts.md) - [All operations](https://skmtc.dev/infiniaweb/apis/accounts/llms.txt) - [OpenAPI document](https://skmtc.dev/infiniaweb/apis/accounts/revisions/2faae77050e4?raw)
