> For the complete documentation index, see [llms.txt](https://docs.pagsmile.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pagsmile.com/reference/remittance-api/business/collection/create-a-refund.md).

# Create a Refund

Initiates an original-route refund for a collection that has already been credited to a merchant account.

This API creates an asynchronous refund request. Use [Query Collections](https://docs.pagsmile.com/remittance-api/business/collection/query-collections) or [Collection Notification](https://docs.pagsmile.com/remittance-api/business/collection/collection-notification) to obtain the final refund result.

**Endpoint**

`POST /remittance/refund/create`

**Sandbox base URL:** `https://rem-api-sandbox.pagsmile.com`\
**Content-Type:** `application/json; charset=UTF-8`

The request uses the standard [Remittance API request envelope](https://docs.pagsmile.com/remittance-api/common). The fields below describe the decrypted `biz_data` object.

{% hint style="info" %}
**Requirement:** `M` = Mandatory, `O` = Optional, and `C` = Conditional. A conditional field is mandatory only when the condition stated in its description applies.
{% endhint %}

{% hint style="warning" %}
Encrypt `biz_data`, encrypt the AES key into `random_key`, and sign the request according to the Common request specification.
{% endhint %}

**Availability and processing rules**

* The merchant account must be active, and its available balance in the refund currency must be sufficient to cover the refund amount.
* The refund must be requested within 90 calendar days of the collection creation time.
* The refund currency is always the same as the original collection currency.
* A collection supports only one refund request. If a partial refund is requested, the remaining amount cannot be refunded through a subsequent request.
* The refund amount must not exceed the amount received for the original collection.
* Pagsmile records the refund reason as `CUSTOMER_INITIATED` for requests created through this API.

**Request body**

**Decrypted `biz_data` fields**

<table><thead><tr><th width="147.10546875">Field</th><th width="87.4296875">Type</th><th width="107.60546875">Requirement</th><th>Description</th></tr></thead><tbody><tr><td><code>collection_id</code></td><td>long</td><td>M</td><td>Pagsmile-assigned unique identifier of the original collection. Obtain this value from <a href="https://docs.pagsmile.com/remittance-api/business/collection/query-collections">Query Collections</a> or a Collection Notification.</td></tr><tr><td><code>refund_amount</code></td><td>string</td><td>O</td><td>Amount to refund, expressed in the original collection currency.<br>Must be greater than zero and must not exceed the amount received for the collection.<br>Before the collection is credited, the full collection amount is always refunded</td></tr><tr><td><code>remark</code></td><td>string</td><td>O</td><td>Partner-provided description or internal reference for the refund request.</td></tr></tbody></table>

**Plaintext `biz_data` example**

{% hint style="info" %}
This example requests a partial refund. Omit `refund_amount` to request a full refund.
{% endhint %}

```json
{
  "collection_id": 100001,
  "refund_amount": "100.00",
  "remark": "Customer requested a refund"
}
```

**Request example**

```bash
curl --request POST \
  --url https://rem-api-sandbox.pagsmile.com/remittance/refund/create \
  --header 'Content-Type: application/json; charset=UTF-8' \
  --data '{
    "partner_id": "<your_partner_id>",
    "app_id": "<your_app_id>",
    "timestamp": "2026-10-13 10:30:00",
    "version": "2.0",
    "language": "en",
    "random_key": "<RSA-encrypted AES key>",
    "request_id": "<globally_unique_request_id>",
    "sign_type": "RSA",
    "biz_data": "<AES-encrypted biz_data>"
  }'
```

{% hint style="info" %}
Use the `partner_id` and `app_id` assigned to your integration. The values above are placeholders.
{% endhint %}

**Response**

{% tabs %}
{% tab title="Success" %}
The `data` field in the response envelope is AES-encrypted. Decrypt `random_key` with your RSA private key, then use the resulting AES key to decrypt `data`. See [Security](https://docs.pagsmile.com/remittance-api/security) for implementation details.

**Encrypted response example**

```json
{
  "code": "10000",
  "msg": "Success",
  "data": "<AES-encrypted response data>",
  "random_key": "<RSA-encrypted AES key>",
  "sign_type": "RSA",
  "app_id": "2017051914172236111"
}
```

**Decrypted `data` example**

```json
{
  "collection_id": 100001,
  "refund_amount": "100.00",
  "refund_currency": "BRL",
  "refund_fee": "",
  "created_at": "2026-10-13 10:30:00",
  "refund_status": 1,
  "remark": "Customer requested a refund"
}
```

{% endtab %}

{% tab title="Invalid signature" %}

```json
{
  "code": "40002",
  "msg": "Business Failed",
  "sub_code": "invalid-signature",
  "sub_msg": "invalid signature"
}
```

{% endtab %}
{% endtabs %}

**Response data fields**

<table><thead><tr><th width="211.4140625">Field</th><th width="106.56640625">Type</th><th width="127.734375">Requirement</th><th>Description</th></tr></thead><tbody><tr><td><code>collection_id</code></td><td>long</td><td>M</td><td>Pagsmile-assigned unique identifier of the original collection.</td></tr><tr><td><code>refund_transaction_id</code></td><td>Long</td><td>O </td><td>Pagsmile-assigned unique identifier of the accounting transaction created for the refund. </td></tr><tr><td><code>refund_amount</code></td><td>string</td><td>M</td><td>Accepted refund amount, expressed in the refund currency. When <code>refund_amount</code> is omitted from the request, this value equals the full amount received for the original collection.<br>Before the collection is credited, the full collection amount is always refunded</td></tr><tr><td><code>refund_currency</code></td><td>string</td><td>M</td><td>Three-letter ISO 4217 code of the refund currency. This value is the same as the original collection currency.</td></tr><tr><td><code>refund_fee</code></td><td>string</td><td>O </td><td>Refund fee charged for the request. </td></tr><tr><td><code>created_at</code></td><td>string</td><td>M</td><td>Date and time when Pagsmile accepted the refund request.<br>Format: <code>yyyy-MM-dd HH:</code>​<code>mm:ss</code>.<br>Timezone: UTC.</td></tr><tr><td><code>refund_status</code></td><td>integer</td><td>M</td><td>Current status of the refund request.<br>Supported values:<br><code>1</code> — Refunding: the request has been accepted and is being processed.<br><code>2</code> — Refunded: the refund completed successfully.<br><code>3</code> — Refund Failed: the refund was rejected or could not be completed.</td></tr><tr><td><code>remark</code></td><td>string</td><td>O</td><td>Partner-provided description or internal reference submitted with the refund request.</td></tr></tbody></table>

{% hint style="info" %}
A successful API response confirms that the refund request was accepted. It does not confirm that the refund has completed. Treat `refund_status = 2` as the successful final state and `refund_status = 3` as the failed final state.
{% endhint %}

**Related APIs**

* [Collection Notification](https://docs.pagsmile.com/remittance-api/business/collection/collection-notification)
* [Query Collections](https://docs.pagsmile.com/remittance-api/business/collection/query-collections)
