Links API
Important Update: As of August 20, 2024, the Link feature on Dashboard v2 is unavailable for new accounts, though existing accounts retain full access. We strongly recommend all users transition to our advanced Payment Links+ APIs, which offer enhanced functionality and represent the future of our payment processing capabilities. Read through our Payment Links+ API guide and embrace the future of seamless transactions today!
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 |
id | string | The link identifier matching |
livemode | boolean | Whether this is a live ( |
location | string | API path to retrieve the current |
amount | integer | Link amount in smallest unit of link currency. |
charges | list | |
created_at | string | UTC datetime of link creation in ISO 8601 format ( |
currency | string | Currency for link as three-letter ISO 4217 code. |
deleted | boolean | Whether link is deleted. |
deleted_at | string | UTC datetime of the deletion of the link in ISO 8601 format ( |
description | string | Link description. |
merchant_name | string | The name of the sub-merchant who created the payment link. Note: This field is applicable only if the merchant uses the Payfac solution. To enroll in Payfac, contact Opn Support |
merchant_uid | string | The ID of the sub-merchant who created the payment link. Note: This field is applicable only if the merchant uses the Payfac solution. To enroll in Payfac, contact Opn Support |
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 ( |
used_at | string | UTC datetime of the usage of the link in ISO 8601 format ( |
Example
-
JSON Response
{ "object": "link", "id": "link_test_no1t4tnemucod0e51mo", "livemode": false, "location": "/links/link_test_no1t4tnemucod0e51mo", "created_at": "2019-07-23T01:19:35Z", "used_at": null, "deleted_at": null, "deleted": false, "amount": 4719, "currency": "THB", "used": false, "multiple": false, "title": "Hot Latte", "description": "A warm cup of coffee", "charges": { "object": "list", "from": "1970-01-01T00:00:00Z", "to": "2019-07-23T01:19:35Z", "offset": 0, "limit": 20, "total": 0, "order": "chronological", "location": "/links/link_test_no1t4tnemucod0e51mo/charges", "data": [ ] }, "payment_uri": "https://link.omise.co/D1660910" }
Create a link
- POST https://api.omise.co/linksCreates and returns a new link.
Request Parameters
Name | Type | Description |
---|---|---|
amount | integer | (required) Link amount in smallest unit of link currency. |
currency | string | (required) Currency for link as three-letter ISO 4217 code. |
description | string | (required) Link description. |
title | string | (required) Link title. |
multiple | boolean | (optional, one of: |
Example
-
Create a multiple-use link
- curl
- php
- node.js
- ruby
- C#
- java
- python
- go
- elixir
curl https://api.omise.co/links \ -u $OMISE_SECRET_KEY: \ -d "amount=10000" \ -d "currency=thb" \ -d "title=Hot Latte" \ -d "description=A warm cup of coffee" \ -d "multiple=true"
<?php $link = OmiseLink::create(array( 'amount' => 99900, 'currency' => 'thb', 'title' => 'Hot Latte', 'description' => 'A warm cup of coffee', 'multiple' => true ));
const omise = require('omise')({ secretKey: 'skey_test_no1t4tnemucod0e51mo', }); const link = await omise.links.create({ amount: 10000, currency: 'thb', title: 'Hot Latte', description: 'A warm cup of coffee', multiple: true, }); console.log(link);
require "omise" Omise.secret_api_key = "skey_test_4xs8breq3htbkj03d2x" link = Omise::Link.create({ amount: 99900, currency: "thb", title: "Hot Latte", description: "A warm cup of coffee", multiple: true, })
var link = await Client.Links.Create(new CreateLinkRequest { Amount = 2000, Currency = "thb", Title = "that shirt.", Description = "that shirt.", Multiple = true, }); Console.WriteLine($"payment link: ({link.Multiple}) {link.PaymentURI}");
Request<Link> request = new Link.CreateRequestBuilder() .amount(100000) .currency("THB") .title("Sale") .description("Thing") .multiple(true) .build(); Link link = client().sendRequest(request); System.out.printf("Link created: %s", link.getId());
import omise omise.api_secret = "skey_test_no1t4tnemucod0e51mo" link = omise.Link.create( amount=100000, currency="thb", title="Hot Latte", description="A warm cup of coffee", multiple=True, )
client, _ := omise.NewClient( "pkey_test_no1t4tnemucod0e51mo", "skey_test_no1t4tnemucod0e51mo", ) result := &omise.Link{} err := client.Do(result, &operations.CreateLink{ Amount: 99900, Currency: "thb", Title: "Hot Latte", Description: "A warm cup of coffee", Multiple: true, }) if err != nil { log.Fatalln(err) } log.Println(result)
Omise.configure(secret_key: "skey_test_4xs8breq3htbkj03d2x") Omise.Link.create( amount: 10000, currency: "thb", title: "Hot Latte", description: "A warm cup of coffee", multiple: true )
-
Create a single-use link
- curl
- php
- node.js
- ruby
- C#
- java
- python
- go
- elixir
curl https://api.omise.co/links \ -u $OMISE_SECRET_KEY: \ -d "amount=10000" \ -d "currency=thb" \ -d "title=Hot Latte" \ -d "description=A warm cup of coffee"
<?php $link = OmiseLink::create(array( 'amount' => 99900, 'currency' => 'thb', 'title' => 'Hot Latte', 'description' => 'A warm cup of coffee' ));
const omise = require('omise')({ secretKey: 'skey_test_no1t4tnemucod0e51mo', }); const link = await omise.links.create({ amount: 10000, currency: 'thb', title: 'Hot Latte', description: 'A warm cup of coffee', }); console.log(link);
require "omise" Omise.secret_api_key = "skey_test_4xs8breq3htbkj03d2x" link = Omise::Link.create({ amount: 99900, currency: "thb", title: "Hot Latte", description: "A warm cup of coffee", })
var link = await Client.Links.Create(new CreateLinkRequest { Amount = 2000, Currency = "thb", Title = "that shirt.", Description = "that shirt.", }); Console.WriteLine($"payment link: {link.PaymentURI}");
Request<Link> request = new Link.CreateRequestBuilder() .amount(100000) .currency("THB") .title("Sale") .description("Thing") .multiple(false) .build(); Link link = client().sendRequest(request); System.out.printf("Link created: %s", link.getId());
import omise omise.api_secret = "skey_test_no1t4tnemucod0e51mo" link = omise.Link.create( amount=100000, currency="thb", title="Hot Latte", description="A warm cup of coffee" )
client, _ := omise.NewClient( "pkey_test_no1t4tnemucod0e51mo", "skey_test_no1t4tnemucod0e51mo", ) result := &omise.Link{} err := client.Do(result, &operations.CreateLink{ Amount: 99900, Currency: "thb", Title: "Hot Latte", Description: "A warm cup of coffee", }) if err != nil { log.Fatalln(err) } log.Println(result)
Omise.configure(secret_key: "skey_test_4xs8breq3htbkj03d2x") Omise.Link.create( amount: 10000, currency: "thb", title: "Hot Latte", description: "A warm cup of coffee" )
Destroy a link
- DELETE https://api.omise.co/links/{id}Destroys the link matching :id
.
Example
-
Destroy a link
- curl
- python
curl https://api.omise.co/links/link_test_5g022xwp823yimkbzdl \ -X DELETE \ -u $OMISE_SECRET_KEY:
import omise omise.api_secret = 'skey_test_4xsjvwfnvb2g0l81sjz' link = omise.Link.retrieve('link_test_5dsoxxan7gxrqihu8rs') link.destroy() link.destroyed # => true
List links
- GET https://api.omise.co/linksReturns a list of links belonging to your account.
Request Parameters
Name | Type | Description |
---|---|---|
from | string | (optional, default: |
limit | integer | (optional, default: |
offset | integer | (optional, default: |
order | string | (optional, default: |
to | string | (optional) Latest UTC datetime for returned records in ISO 8601 format ( |
Example
-
List all links
- curl
- php
- node.js
- ruby
- C#
- java
- python
- go
- elixir
curl https://api.omise.co/links \ -u $OMISE_SECRET_KEY:
<?php $links = OmiseLink::retrieve();
const omise = require('omise')({ secretKey: 'skey_test_no1t4tnemucod0e51mo', }); const link = await omise.links.list(); console.log(link);
require "omise" Omise.secret_api_key = "skey_test_4xs8breq3htbkj03d2x" links = Omise::Link.list
var links = await Client.Links.GetList(order: Ordering.ReverseChronological); Console.WriteLine($"total links: {links.Total}");
Request<ScopedList<Link>> request = new Link.ListRequestBuilder().build(); ScopedList<Link> links = client().sendRequest(request); System.out.printf("Total no. of links: %d", links.getTotal());
import omise omise.api_secret = "skey_test_no1t4tnemucod0e51mo" links = omise.Link.retrieve()
client, _ := omise.NewClient( "pkey_test_no1t4tnemucod0e51mo", "skey_test_no1t4tnemucod0e51mo", ) result := &omise.CardList{} err := client.Do(result, &operations.ListLinks{}) if err != nil { log.Fatalln(err) } log.Println(result)
Omise.configure(secret_key: "skey_test_4xs8breq3htbkj03d2x") Omise.Link.list
Retrieve a link
- GET https://api.omise.co/links/{id}Returns the link matching :id
.
Example
-
Retrieve a link
- curl
- php
- node.js
- ruby
- C#
- java
- python
- go
- elixir
curl https://api.omise.co/links/link_test_5g022xwp823yimkbzdl \ -u $OMISE_SECRET_KEY:
<?php $link = OmiseLink::retrieve('link_test_55s7xparb9djkecqkd4');
const omise = require('omise')({ secretKey: 'skey_test_no1t4tnemucod0e51mo', }); const link = await omise.links.retrieve('link_test_no1t4tnemucod0e51mo'); console.log(link);
require "omise" Omise.secret_api_key = "skey_test_4xs8breq3htbkj03d2x" link = Omise::Link.retrieve("link_test_55s7xparb9djkecqkd4")
var link = await Client.Links.Get("link_test_56bkhnfd97h7eieu0hx"); Console.WriteLine($"link paid?: {link.Used} {link.Charges.FirstOrDefault()?.Id})");
Request<Link> request = new Link.GetRequestBuilder("link_test_6csdepgdsdob7ee47sf").build(); Link link = client().sendRequest(request); System.out.printf("Link retrieved: %s", link.getId());
import omise omise.api_secret = "skey_test_no1t4tnemucod0e51mo" link = omise.Link.retrieve("link_test_no1t4tnemucod0e51mo")
client, _ := omise.NewClient( "pkey_test_no1t4tnemucod0e51mo", "skey_test_no1t4tnemucod0e51mo", ) result := &omise.CardList{} err := client.Do(result, &operations.RetrieveLink{ LinkID: "link_test_no1t4tnemucod0e51mo", }) if err != nil { log.Fatalln(err) } log.Println(result)
Omise.configure(secret_key: "skey_test_4xs8breq3htbkj03d2x") Omise.Link.retrieve("link_test_55s7xparb9djkecqkd4")