Refunds
Refund objects allow you to refund part or all of a settled payment. Funds are refunded to the credit or debit card that was initially charged.
The Refund object
- Name
object
- Type
- "refund",
- Description
- Literal representing the object’s type.
- Name
id
- Type
- string,
- Description
- Unique identifier for the object.
- Name
live
- Type
- boolean,
- Description
- Has the value
true
if the object exists in a production environment or the valuefalse
if the object exists in a sandbox environment.
- Name
created_at
- Type
- integer,
- Description
- Time at which the object was created. Measured in milliseconds since the Unix epoch.
- Name
amount
- Type
- integer,
- Description
- The amount refunded.
- Name
failed_reason
- Type
- string or null,
- Description
- If
status
isfailed
, contains a message explaining why the refund failed.
- Name
payment
- Type
- string or Payment,
- Description
- Expandable. The payment being refunded.
- Child properties
- Name
status
- Type
- enum,
- Description
- The status of the refund.
- Array item properties
The Refund object
Get a refund
Retrieve a refund by its ID.
Optional parameters
- Name
expand
- Type
- empty object,
- Description
- Optional object that allows you to expand certain ID fields to include related resources.
- Child properties
Returns
Returns the refund object.
Retrieve a refund
Response example
List all refunds
Retrieve a paginated list of refunds.
Optional parameters
- Name
expand
- Type
- empty object,
- Description
- Optional object that allows you to expand certain ID fields to include related resources.
- Child properties
- Name
ending_before
- Type
- string,
- Description
- A cursor for use in pagination.
ending_before
is an object ID that results will end before. Used to move backward through the list.
- Name
starting_after
- Type
- string,
- Description
- A cursor for use in pagination.
starting_after
is an object ID that results will start after. Used to move forward through the list.
- Name
limit
- Type
- number, at least 1, at most 1000, default is 50
- Description
- Maximum number of objects to return.
- Name
filters
- Type
- ,
- Description
- Filters to apply to the list. Combine multiple conditions with
and
andor
. - Child properties
Returns
Returns a list of refund objects.
List all refunds
Response example
Create a refund
Issue a refund for a succeeded
payment. Multiple refunds can be issued against a single payment, provided there are sufficient funds available.
Required parameters
- Name
payment
- Type
- string,
- Description
- The payment to refund. Must have a status of
succeeded
.
Optional parameters
- Name
amount
- Type
- integer,
- Description
- The amount to refund. Defaults to the full amount of the payment if omitted. Must be less than or equal to the payment’s
amount_refunded
subtracted from the payment’samount_received
.
Returns
Returns the refund object.