Links API

The Links API allows you to create and retrieve payment request website links. Generated links can be shared on any platform and can be set to be used once or multiple times.

Attribute

Name Type Description
object string

The string link.

id object_id

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

livemode boolean

Whether this is a live (true) or test (false) link.

location string

API path to retrieve the current link 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.

charges list

A list of charge objects.

created datetime

The UTC datetime of the creation of the link 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).

deleted boolean

Whether the link is deleted.

description string

The human-readable description of the link.

multiple boolean

Whether the link is able to be used more than once.

payment_uri string

URI of payment page where the customer enters card details.

title string

The link title.

used boolean

Whether the link was used.

Example

  • Json Response

List all links

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

Returns a list of all link 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 links

Create a link

- POST https://api.omise.co/links

Returns a new link object.

Request Parameter

Name Type Description
amount integer

(required) The amount in the smallest subunits of the currency used. For thb (Thai Baht) you'll need to pass the amount in satangs. #Maximum and Minimum amount by supported currencies

currency string

(required) The currency in which you want the charge to be done.

title string

(required) A custom title for the link.

description string

(required) A custom description for the link.

multiple boolean

(optional, default: false) Whether or not you want the link to be used multiple times.

Example

  • Create a link for one time use

  • Create a link for multiple time use

Retrieve a link

- GET https://api.omise.co/links/LINK_ID

Returns an existing link object.

Example

  • Retrieve a link

Destroy a link

- DELETE https://api.omise.co/links/LINK_ID

Destroys/disables the link which matches LINK_ID.

Example

  • Destroy a link