Refund a Checkout Session

Arguments

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.

POST https://{provided url}/v1/refunds

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

The above command returns JSON structured like this:

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

Last updated