> For the complete documentation index, see [llms.txt](https://developer.convergegate.com/legacy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.convergegate.com/legacy/refund-a-checkout-session.md).

# Refund a Checkout Session

## Arguments <a href="#arguments" id="arguments"></a>

| Field       | Type   | Required | Description                                                                                                                                        |
| ----------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| session\_id | string | yes      | The ID of the Checkout Session                                                                                                                     |
| amount      | int    | no       | The amount to refund, in the smallest currency unit (e.g., cents). If omitted, the entire checkout session amount will be refunded.                |
| reason      | string | no       | The reason of the refund is either “requested\_by\_customer”, “duplicated”, or “fraudulent”.                                                       |
| metadata    | hash   | no       | A set of key-value pairs attached to a payout object. It can be useful for storing additional information about the payout in a structured format. |

<mark style="color:yellow;">**`POST`**</mark> `https://{provided url}/v1/refunds`

{% tabs %}
{% tab title="CURL" %}

<pre><code>curl https://{provided url}/v1/refunds \
  -u sk_test_BQokikJOvBiI2HlWgH4olfQ2: \
  -d amount=1000 \
  -d session_id=AW-kLcRRC5P8U68CYe0kVA \
<strong>  -d reason=requested_by_customer \
</strong></code></pre>

{% endtab %}
{% endtabs %}

The above command returns JSON structured like this:

```json
{
	"id": "kLcRRC5P8U68CYe0kVA",
	"amount": 1000,
	"status": "pending",
	"reason": "requested_by_customer",
	"created_at": 1534255857,
	"livemode": false
}
```
