Links API

Links API สามารถใช้เพื่อสร้างและเรียกข้อมูลรับชำระเงินในรายการที่เป็นการส่งผ่านลิงก์ ลิงก์ที่ระบบสร้างขึ้นสามารถแชร์ให้กับผู้ซื้อได้ผ่านหลากหลายช่องทาง และยังสามารถกำหนดให้เป็นลิงก์แบบใช้งานได้เพียงครั้งเดียวหรือแบบที่สามารถใช้งานได้ไม่จำกัดจำนวนครั้ง

Attribute

Name Type Description
object string

The string link.

id object_id

The LINK_ID 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

List of charge objects.

created datetime

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

currency string

Currency for link as three-letter ISO 4217 code.

deleted boolean

Whether link is deleted.

description string

Description of the link.

multiple boolean

Whether link is able to be used more than once.

payment_uri string

URI of link for use by customer.

title string

Link title.

used boolean

Whether 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) Offset of the first record returned (i.e. how many records to skip from the beginning).

limit integer

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

from datetime

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

to datetime

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

order string

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

Example

  • List all links

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

Returns a list of all charge objects belonging to a link.

Request Parameter

Name Type Description
offset integer

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

limit integer

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

from datetime

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

to datetime

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

order string

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

Example

  • List all charges for a link

Create a link

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

Returns a new link object.

Request Parameter

Name Type Description
amount integer

(required) Amount for link in the smallest currency unit.

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) The human-readable description to attach to 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

  • JSON Response