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.

Attributes

Name Type Description
object string

The string link.

id object_id

The link identifier matching /link(_test)?_[0-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

Amount for link in smallest currency unit.

charges list
created_at datetime

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

currency currency

Currency for link as three-letter ISO 4217 code.

deleted boolean

Whether link is deleted.

deleted_at datetime

UTC datetime of the deletion of the link in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).

description string

Link description.

multiple boolean

Whether link is able to be used more than once.

payment_uri string

URI of link for use by payer.

title string

Link title.

used boolean

Whether single-use link (multiple=false) was used.

used_at datetime

UTC datetime of the usage of the link in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ). Single-use links only.

Example

  • JSON Response

List links

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

Returns a list of links belonging to your account.

Request Parameters

Name Type Description
from datetime

(optional, default: 1970-01-01T00:00:00Z) Earliest UTC datetime for returned records in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).

limit integer

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

offset integer

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

order string

(optional, default: chronological) Order of records returned. One of chronological (earliest to latest) or reverse_chronological (latest to earliest).

to datetime

(optional, default: current UTC datetime) Latest UTC datetime for returned records in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).

Example

  • List all links

Create a link

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

Creates and returns a new link.

Request Parameters

Name Type Description
amount integer

(required) Amount for link in smallest currency unit.

currency currency

(required) Currency for link as three-letter ISO 4217 code.

description string

(required) Link description.

title string

(required) Link title.

multiple boolean

(optional) Whether link is able to be used more than once. Default: false.

Example

  • Create a single-use link

  • Create a multiple-use link

Retrieve a link

- GET https://api.omise.co/links/{id}

Returns the link matching :id.

Example

  • Retrieve a link

Destroy a link

- DELETE https://api.omise.co/links/{id}

Destroys the link matching :id.

Example

  • Destroy a link

  • JSON Response

- GET https://api.omise.co/links/{id}/charges

Returns a list of charges associated with a link.

Request Parameters

Name Type Description
from datetime

(optional, default: 1970-01-01T00:00:00Z) Earliest UTC datetime for returned records in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).

limit integer

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

offset integer

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

order string

(optional, default: chronological) Order of records returned. One of chronological (earliest to latest) or reverse_chronological (latest to earliest).

to datetime

(optional, default: current UTC datetime) Latest UTC datetime for returned records in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).

Example

  • List link charges