# Refund a deposit

This service enables you to issue and view refunds for completed payments.

* For **card deposits**: The original charge is reversed, returning funds to the cardholder.
* For **alternative payment methods**: The customer receives a refund via a bank transfer.

Please note, a processing fee may apply to refunds.

***

> For technical details please visit the API Reference <a href="https://app.gitbook.com/s/VNE8t2FopKfzgQzTjlBb/deposits-api/manage-refunds/create-refund" class="button primary" data-icon="pencil">Create refunds</a>&#x20;

### Card deposits

{% tabs %}
{% tab title="Example request" %}

#### Total refund

```json
curl -L \
  --request POST \
  --url 'https://api-stg.directa24.com/v3/refunds' \
  --header 'Content-Type: application/json' \
  --header 'X-Date: 2025-07-25T13:13:08.220Z' \
  --header 'X-Login: text' \
  --header 'Authorization: text' \
  --data '{
    "deposit_id": 300533647,
    "invoice_id": "newIUnit45328732",
    "comments": "Test refund",
    "notification_url": "https://merchant.com/webhooks/d24/refunds"
  }'
```

#### Partial refund

<pre class="language-json"><code class="lang-json">curl -L \
  --request POST \
  --url 'https://api-stg.directa24.com/v3/refunds' \
  --header 'Content-Type: application/json' \
  --header 'X-Date: 2025-07-25T13:13:08.220Z' \
  --header 'X-Login: text' \
  --header 'Authorization: text' \
  --data '{
    "deposit_id": 300533647,
    "invoice_id": "newIUnit45328732",
<strong>    "amount": 50,
</strong>    "comments": "Test refund",
    "notification_url": "https://merchant.com/webhooks/d24/refunds"
  }'
</code></pre>

{% endtab %}

{% tab title="Example response" %}

#### Synchronous response

```json
{
  "refund_id": "80000001",
  "deposit_id": 300533647,
  "merchant_invoice_id": "newIUnit45328732",
  "refund_info": {
    "type": "CREDIT_CARD",
    "result": "SUCCESS",
    "payment_method": "AE",
    "payment_method_name": "American Express",
    "amount": 505.95,
    "currency": "MXN",
    "created_at": "2021-02-05 22:10:45"
  }
}
```

#### Asynchronous response

In case of receiving **`IN_PROGRESS`** status for a card deposit refund, we will notify to the **`notification_url`** when the refund status change. \
Afterwards you should perform an additional Refund status check

> For more information please visit the API Reference <a href="https://app.gitbook.com/s/VNE8t2FopKfzgQzTjlBb/deposits-api/manage-refunds/get-refund-status" class="button primary" data-icon="magnifying-glass">Get refund status</a>

```json
{
  "refund_id": "80000001",
  "deposit_id": 300533647,
  "merchant_invoice_id": "newIUnit45328732",
  "refund_info": {
    "type": "CREDIT_CARD",
    "result": "IN_PROGRESS",
    "reason": "Check refund status or await its notification",
    "payment_method": "AE",
    "payment_method_name": "American Express",
    "amount": 505.95,
    "currency": "MXN",
    "created_at": "2021-02-05 22:10:45"
  }
}
```

{% endtab %}
{% endtabs %}

### Alternative payment methods

{% tabs %}
{% tab title="Example request" %}

```sh
curl -L \
  --request POST \
  --url 'https://api-stg.directa24.com/v3/refunds' \
  --header 'Content-Type: application/json' \
  --header 'X-Date: 2025-07-25T13:13:08.220Z' \
  --header 'X-Login: text' \
  --header 'Authorization: text' \
  --data '{
    "deposit_id": 300533646,
    "invoice_id": "newIUnit45328731",
    "amount": 100,
    "bank_account": {
      "beneficiary": "Carlos Ramirez",
      "bank_code": "1",
      "branch": "9283",
      "account_number": "18293435",
      "account_type": "SAVING"
    },
    "comments": "Test refund over v3",
    "notification_url": "https://webhook.site/url"
  }'
```

{% endtab %}

{% tab title="Example response" %}

```json
{
  "refund_id": "80000001"
}
```

{% endtab %}
{% endtabs %}

***

### Refund status

Each time that a refund changes its status we will send a webhook notification

<pre class="language-json" data-title="Example refund webhook notification"><code class="lang-json">{
<strong>    "refund_id": 80000001
</strong>}
</code></pre>

Then, you will know that you should retrieve the status of the refund

{% tabs %}
{% tab title="Example request" %}

<pre class="language-sh"><code class="lang-sh">curl -L \
<strong>  --url 'https://api-stg.directa24.com/v3/refunds/80000001' \
</strong>  --header 'Content-Type: text' \
  --header 'X-Date: 2023-05-27T10:30:00Z' \
  --header 'X-Login: your-x-login-key' \
  --header 'Authorization: D24-HMAC-SHA256 SignedHeaders=x-date;x-login, Signature=your_signature_hash' \
  --header 'Accept: */*'
</code></pre>

{% endtab %}

{% tab title="Example response" %}

```json
{
  "deposit_id": 80000001,
  "merchant_invoice_id": "newIUnit45328732",
  "status": "COMPLETED",
  "amount": 505.95
}
```

{% endtab %}
{% endtabs %}

> For technical details regarding refunds status retrieval, please visit the **API Reference** <a href="https://app.gitbook.com/s/VNE8t2FopKfzgQzTjlBb/deposits-api/manage-refunds/get-refund-status" class="button primary" data-icon="magnifying-glass">Get refund status</a>
