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

# Create Refund

`POST /v3/refunds`

Allows for the creation of a full or partial refund for a previously completed deposit.
- For credit card deposits, the refund is processed to the same card, requiring only deposit identification.
- For other payment methods, beneficiary bank account details are necessary.
- Multiple partial refunds can be issued for a single deposit, provided the total refunded amount does not exceed the original deposit amount.

## Headers

- `Content-Type` string, required
- `X-Date` string, date-time, required
- `X-Login` string, required
- `Authorization` string, required
- `X-Idempotency-Key` string

## Request body

- RefundRequest
  - `deposit_id` integer, required — Directa24 `deposit_id`. It is obtained when creating the deposit. Must be a valid `deposit_id` of a completed deposit.
  - `invoice_id` string, required — The `invoice_id` you sent while creating the deposit or the `merchant_invoice_id` auto-generated by Directa24. Must be a valid `invoice_id` of a completed deposit.
  - `amount` number, double — Amount to refund. Positive, up to 2 decimal places. Must be equal to or smaller than the deposit amount. If not sent, a full refund is assumed.
  - `bank_account` BankAccount
    - `bank_code` string — The code of the bank.
    - `account` string — The user's bank account number.
    - `branch` string — The bank branch number.
    - `account_type` string — The type of bank account.
  - `comments` string — Optional comments about the refund.
  - `notification_url` string, uri — Valid HTTPS URL (URI) used to send asynchronous notifications about the refund's status changes.

## Response `200`

Refund request accepted and processing initiated, or completed synchronously (for some credit card refunds). The response structure might be more detailed for synchronously processed credit card refunds.

- RefundSuccessResponse
  - `refund_id` string — Unique ID for the created refund. This might be an integer or a string depending on the refund method.
  - `deposit_id` integer — Directa24 `deposit_id`. Returned for synchronously processed credit card refunds.
  - `merchant_invoice_id` string — The `merchant_invoice_id`. Returned for synchronously processed credit card refunds.
  - `refund_info` RefundInfo — Detailed information about the refund, often provided for synchronous credit card refund processing.
    - `type` string — Type of refund processed.
    - `result` 'SUCCESS' | 'IN_PROGRESS' | 'REJECTED' — The outcome of the refund attempt.
    - `reason` string — A textual explanation if the refund is not 'SUCCESS' (e.g., for 'REJECTED' or 'IN_PROGRESS' states).
    - `reason_code` string — A codified reason for the refund status, if applicable.
    - `payment_method` string — Code for the payment method used (e.g., 'AE' for American Express).
    - `payment_method_name` string — Full name of the payment method.
    - `amount` number, double — The amount of the refund.
    - `currency` string — The currency of the refund amount (e.g., 'MXN').
    - `created_at` string — Timestamp indicating when the refund was created or processed by the provider, in 'YYYY-MM-DD HH:mm:ss' format.

## Other responses

- `400` — Error in the request, such as invalid amount or missing bank account information.
- `401` — Unauthorized access. Indicates an issue with authentication credentials (X-Login, X-Date, Authorization).
- `404` — Resource not found, typically meaning the specified deposit_id or invoice_id does not correspond to an existing deposit.

---

[API](https://skmtc.dev/d24/apis/docs-d24-com.md) · [All operations](https://skmtc.dev/d24/apis/docs-d24-com/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/d24/docs-d24-com/revisions/fb0e2ddec198/schema)
