Refund API

The Refund API allows you to create and retrieve refunds. A refund operates on a given charge which must meet certain requirements in order to be refundable.

Attribute

Name Type Description
object string

The string refund.

id object_id

The REFUND_ID matching /rfnd(_test)?_[1-9a-z]+/.

location string

API path to retrieve the current refund object.

amount integer

The amount expressed as a positive integer in the smallest unit for a given currency (e.g. 100 satangs equals THB 1). See supported currencies by country for maximum and minimum.

charge object_id

The CHARGE_ID associated with this refund.

created datetime

The UTC datetime of the creation of the refund in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).

currency string

The currency expressed as its lower-cased international 3-letter code defined by the ISO 4217 standard (see supported currencies by country).

metadata Object

Custom metadata (e.g. {"customer-id": 42}) for refund.

transaction object_id

The TRANSACTION_ID associated with this refund.

voided boolean

Whether the refund has been voided.

Example

  • Json Response

List all refunds

- GET https://api.omise.co/refunds

Returns a list of all refund objects belonging to your account.

Request Parameter

Name Type Description
offset integer

(optional, default: 0) The offset of the first record returned (i.e. how many records to skip from the beginning).

limit integer

(optional, default: 20, maximum: 100) The number of records returned.

from datetime

(optional, default: 1970-01-01T00:00:00Z) The earliest UTC date and time for returned records in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).

to datetime

(optional, default: current UTC datetime) The latest UTC date and time for returned records in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).

order string

(optional, default: chronological) The order of the list returned. Either chronological (earliest to latest) or reverse_chronological (latest to earliest).

Example

  • List all refunds

List all refunds of a particular charge

- GET https://api.omise.co/charges/CHARGE_ID/refunds

Returns a list of refund objects that belong to the charge.

Request Parameter

Name Type Description
offset integer

(optional, default: 0) The offset of the first record returned (i.e. how many records to skip from the beginning).

limit integer

(optional, default: 20, maximum: 100) The number of records returned.

from datetime

(optional, default: 1970-01-01T00:00:00Z) The earliest UTC date and time for returned records in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).

to datetime

(optional, default: current UTC datetime) The latest UTC date and time for returned records in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).

order string

(optional, default: chronological) The order of the list returned. Either chronological (earliest to latest) or reverse_chronological (latest to earliest).

Example

  • List all refunds of a particular charge

Create a refund

- POST https://api.omise.co/charges/CHARGE_ID/refunds

Returns a new refund object.

Request Parameter

Name Type Description
amount integer

The amount in the smallest subunits of the currency used. So for thb (Thai Baht) you will need to pass the amount in satangs. #Maxmum and Minimum amount by supported currencies

void boolean

(optional, default: false) The boolean flag to only process void and suppress the normal refund if unsuccessfully void.

metadata Object

(optional) Custom metadata (e.g. {"customer-id": 42}) for refund.

Example

  • Create a refund

Retrieve a refund

- GET https://api.omise.co/charges/CHARGE_ID/refunds/REFUND_ID

Returns an existing refund object.

Example

  • Retrieve a refund