v1

latestOpenAPI 3.1.02026-07-2631427.2 KB

Create a Refund

Refund the funds from a Charge to the Payment Method.

Creating a Refund will refund a Charge that has previously been created. Funds will be returned to the Payment Method that was originally charged.

You can optionally refund only part of a charge. You can do so multiple times, until the entire charge has been refunded.

post/v1/refunds

Request body

chargestring required

The identifier of the charge to refund.

amount_to_refundstring

Amount intended to be refunded from the Charge in minor units.Can refund only up to the remaining, unrefunded amount of the Charge.

The field is optional and if not provided will default to the entire Charge.

referencestring

A unique string to reference the Refund. Can be used to reconcile the object with your internal systems.

metadataMetadata

Example request

{
  "amount_to_refund": "10000"
}

Response

Example response

idstring

Unique identifier for Refund object.

resourcestring

String representing the resource type.

amountinteger

Amount, in minor units.

amount_human_readablestring

Amount in human readable format.

chargestring

ID of the Charge that was refunded.

createdstring

Time at which the resource was created. ISO String format.

currencystring

Three-letter ISO currency code, in lowercase.

customerstring

ID of the customer this Refund is for if one exists.

customer_reference_idstring

A unique identifier for your customer, This is a customer ID that identifies the customer that the Refund belongs to that was supplied at creation of the Charge.

metadataobject

Set of key-value pairs that were attached to the resource at creation.

referencestring

A unique string to reference the Refund that was entered while creating the resource. Can be used to reconcile the object with your internal systems.

status'succeeded' | 'failed' | 'pending'

Status of the refund.

Example response

{
  "id": "rfnd_179937907841176576",
  "resource": "refund",
  "amount": 10000,
  "amount_human_readable": "100.00",
  "charge": "chrg_146231656762572800",
  "created": "2022-09-07T13:40:41.751Z",
  "currency": "usd",
  "customer": "cust_199440887619523584",
  "customer_reference_id": "69727f0f-8865-4d20-8f63-4ff4fafdacd8",
  "metadata": {},
  "reference": null,
  "status": "succeeded"
}
All 3 operations