Refunds

A refund returns part or all of a succeeded payment to the card or bank account it charged. The refunds and disputes guide covers refund statuses and refunding from the dashboard.

The Refund object

Name
object
Type
"refund",
Description
The object's type.
Name
id
Type
string,
Description
Unique identifier for the object.
Name
live
Type
boolean,
Description
true if the object is live, or false if it's in a sandbox.
Name
created_at
Type
integer,
Description
When the object was created, in milliseconds since the Unix epoch.
Name
amount
Type
integer,
Description
The amount refunded, in cents.
Name
failed_reason
Type
string or null,
Description
Why a failed refund failed.
Name
fees
Type
object,
Description
The fees on the refund, in cents. Each is null until it's known.
Properties
Name
payment
Type
string or Payment,
Description
Expandable. The refunded payment.
Name
status
Type
enum,
Description
The status of the refund.
Properties

The Refund object

{
  "object": "refund",
  "id": "re_3UgC74NSEMIWiFK5s3tZ82",
  "live": true,
  "created_at": 1750000000000,
  "amount": 1000,
  "fees": {
    "interchange": 28,
    "platform": 13,
    "total": 41
  },
  "failed_reason": null,
  "payment": "pay_lUY2g0TuPzN9qi4couahd3",
  "status": "succeeded"
}

Get a refund

Retrieve a refund by its ID.

Required parameters

Name
id
Type
string,
Description
The ID of the refund to retrieve.

Optional parameters

Name
expand
Type
object,
Description
Related objects to expand in the response.
Properties

Returns

Returns the refund object.

Retrieve a refund

const refund = await bias.refunds.get("id");

Response example

{
  "object": "refund",
  "id": "re_3UgC74NSEMIWiFK5s3tZ82",
  "live": true,
  "created_at": 1750000000000,
  "amount": 1000,
  "fees": {
    "interchange": 28,
    "platform": 13,
    "total": 41
  },
  "failed_reason": null,
  "payment": "pay_lUY2g0TuPzN9qi4couahd3",
  "status": "succeeded"
}

List all refunds

Retrieve a paginated list of refunds.

Optional parameters

Name
expand
Type
object,
Description
Related objects to expand in the response.
Properties
Name
ending_before
Type
string,
Description
The ID of the object to list before, for pagination.
Name
starting_after
Type
string,
Description
The ID of the object to list after, for pagination.
Name
limit
Type
integer, at least 1, at most 1000, default is 50
Description
The maximum number of objects to return, from 1 to 1000. Defaults to 50.
Name
filters
Type
object, object, or object,
Description
Filters for the list, combined with and and or.
Properties

Returns

Returns a list of refund objects.

List all refunds

const refund = await bias.refunds.list();

Response example

{
  "object": "list",
  "items": [
    {
      "object": "refund",
      "id": "re_3UgC74NSEMIWiFK5s3tZ82",
      "live": true,
      "created_at": 1750000000000,
      "amount": 1000,
      "fees": {
        "interchange": 28,
        "platform": 13,
        "total": 41
      },
      "failed_reason": null,
      "payment": "pay_lUY2g0TuPzN9qi4couahd3",
      "status": "succeeded"
    }
  ],
  "has_more": true
}

Create a refund

A payment can be refunded more than once, up to its amount_received.

A payment with an open or lost chargeback, or a returned bank debit, can’t be refunded.

Required parameters

Name
payment
Type
string,
Description
The succeeded payment to refund.

Optional parameters

Name
expand
Type
object,
Description
Related objects to expand in the response.
Properties
Name
amount
Type
integer,
Description
The amount to refund, in cents, up to what's left to refund. Defaults to all of it.

Returns

Returns the refund object.

Create a refund

const refund = await bias.refunds.create();

Response example

{
  "object": "refund",
  "id": "re_3UgC74NSEMIWiFK5s3tZ82",
  "live": true,
  "created_at": 1750000000000,
  "amount": 1000,
  "fees": {
    "interchange": 28,
    "platform": 13,
    "total": 41
  },
  "failed_reason": null,
  "payment": "pay_lUY2g0TuPzN9qi4couahd3",
  "status": "succeeded"
}