Create Payment Link
curl --request POST \
--url https://api-pacb-uat.eximpe.com/pg/payment-links/ \
--header 'Content-Type: application/json' \
--header 'X-API-Version: <api-key>' \
--header 'X-Client-ID: <api-key>' \
--header 'X-Client-Secret: <api-key>' \
--header 'X-Merchant-ID: <api-key>' \
--data '
{
"amount": 123,
"reference_id": "<string>",
"buyer": {
"name": "<string>",
"email": "[email protected]",
"phone": "<string>",
"address": {
"postal_code": "<string>",
"line_1": "<string>",
"line_2": "<string>",
"city": "<string>",
"state": "<string>"
},
"send_sms": false,
"send_email": false
},
"product": {
"name": "<string>",
"description": "<string>",
"hs_code": "<string>",
"hs_code_description": "<string>"
},
"invoice": {
"number": "<string>"
},
"expiry_date": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api-pacb-uat.eximpe.com/pg/payment-links/"
payload = {
"amount": 123,
"reference_id": "<string>",
"buyer": {
"name": "<string>",
"email": "[email protected]",
"phone": "<string>",
"address": {
"postal_code": "<string>",
"line_1": "<string>",
"line_2": "<string>",
"city": "<string>",
"state": "<string>"
},
"send_sms": False,
"send_email": False
},
"product": {
"name": "<string>",
"description": "<string>",
"hs_code": "<string>",
"hs_code_description": "<string>"
},
"invoice": { "number": "<string>" },
"expiry_date": "2023-11-07T05:31:56Z"
}
headers = {
"X-Client-ID": "<api-key>",
"X-Client-Secret": "<api-key>",
"X-Merchant-ID": "<api-key>",
"X-API-Version": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Client-ID': '<api-key>',
'X-Client-Secret': '<api-key>',
'X-Merchant-ID': '<api-key>',
'X-API-Version': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: 123,
reference_id: '<string>',
buyer: {
name: '<string>',
email: '[email protected]',
phone: '<string>',
address: {
postal_code: '<string>',
line_1: '<string>',
line_2: '<string>',
city: '<string>',
state: '<string>'
},
send_sms: false,
send_email: false
},
product: {
name: '<string>',
description: '<string>',
hs_code: '<string>',
hs_code_description: '<string>'
},
invoice: {number: '<string>'},
expiry_date: '2023-11-07T05:31:56Z'
})
};
fetch('https://api-pacb-uat.eximpe.com/pg/payment-links/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-pacb-uat.eximpe.com/pg/payment-links/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 123,
'reference_id' => '<string>',
'buyer' => [
'name' => '<string>',
'email' => '[email protected]',
'phone' => '<string>',
'address' => [
'postal_code' => '<string>',
'line_1' => '<string>',
'line_2' => '<string>',
'city' => '<string>',
'state' => '<string>'
],
'send_sms' => false,
'send_email' => false
],
'product' => [
'name' => '<string>',
'description' => '<string>',
'hs_code' => '<string>',
'hs_code_description' => '<string>'
],
'invoice' => [
'number' => '<string>'
],
'expiry_date' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Version: <api-key>",
"X-Client-ID: <api-key>",
"X-Client-Secret: <api-key>",
"X-Merchant-ID: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-pacb-uat.eximpe.com/pg/payment-links/"
payload := strings.NewReader("{\n \"amount\": 123,\n \"reference_id\": \"<string>\",\n \"buyer\": {\n \"name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"phone\": \"<string>\",\n \"address\": {\n \"postal_code\": \"<string>\",\n \"line_1\": \"<string>\",\n \"line_2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"send_sms\": false,\n \"send_email\": false\n },\n \"product\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"hs_code\": \"<string>\",\n \"hs_code_description\": \"<string>\"\n },\n \"invoice\": {\n \"number\": \"<string>\"\n },\n \"expiry_date\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Client-ID", "<api-key>")
req.Header.Add("X-Client-Secret", "<api-key>")
req.Header.Add("X-Merchant-ID", "<api-key>")
req.Header.Add("X-API-Version", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-pacb-uat.eximpe.com/pg/payment-links/")
.header("X-Client-ID", "<api-key>")
.header("X-Client-Secret", "<api-key>")
.header("X-Merchant-ID", "<api-key>")
.header("X-API-Version", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"reference_id\": \"<string>\",\n \"buyer\": {\n \"name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"phone\": \"<string>\",\n \"address\": {\n \"postal_code\": \"<string>\",\n \"line_1\": \"<string>\",\n \"line_2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"send_sms\": false,\n \"send_email\": false\n },\n \"product\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"hs_code\": \"<string>\",\n \"hs_code_description\": \"<string>\"\n },\n \"invoice\": {\n \"number\": \"<string>\"\n },\n \"expiry_date\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-pacb-uat.eximpe.com/pg/payment-links/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Client-ID"] = '<api-key>'
request["X-Client-Secret"] = '<api-key>'
request["X-Merchant-ID"] = '<api-key>'
request["X-API-Version"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 123,\n \"reference_id\": \"<string>\",\n \"buyer\": {\n \"name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"phone\": \"<string>\",\n \"address\": {\n \"postal_code\": \"<string>\",\n \"line_1\": \"<string>\",\n \"line_2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"send_sms\": false,\n \"send_email\": false\n },\n \"product\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"hs_code\": \"<string>\",\n \"hs_code_description\": \"<string>\"\n },\n \"invoice\": {\n \"number\": \"<string>\"\n },\n \"expiry_date\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": {
"payment_id": "<string>",
"link_id": "<string>",
"payment_link": "<string>",
"amount": "<string>",
"currency": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Payment Links
Create Payment Link
Create a payment link: a URL you send to a buyer to collect one INR payment. It stays open until it is paid, expires, or is deactivated.
POST
/
pg
/
payment-links
/
Create Payment Link
curl --request POST \
--url https://api-pacb-uat.eximpe.com/pg/payment-links/ \
--header 'Content-Type: application/json' \
--header 'X-API-Version: <api-key>' \
--header 'X-Client-ID: <api-key>' \
--header 'X-Client-Secret: <api-key>' \
--header 'X-Merchant-ID: <api-key>' \
--data '
{
"amount": 123,
"reference_id": "<string>",
"buyer": {
"name": "<string>",
"email": "[email protected]",
"phone": "<string>",
"address": {
"postal_code": "<string>",
"line_1": "<string>",
"line_2": "<string>",
"city": "<string>",
"state": "<string>"
},
"send_sms": false,
"send_email": false
},
"product": {
"name": "<string>",
"description": "<string>",
"hs_code": "<string>",
"hs_code_description": "<string>"
},
"invoice": {
"number": "<string>"
},
"expiry_date": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api-pacb-uat.eximpe.com/pg/payment-links/"
payload = {
"amount": 123,
"reference_id": "<string>",
"buyer": {
"name": "<string>",
"email": "[email protected]",
"phone": "<string>",
"address": {
"postal_code": "<string>",
"line_1": "<string>",
"line_2": "<string>",
"city": "<string>",
"state": "<string>"
},
"send_sms": False,
"send_email": False
},
"product": {
"name": "<string>",
"description": "<string>",
"hs_code": "<string>",
"hs_code_description": "<string>"
},
"invoice": { "number": "<string>" },
"expiry_date": "2023-11-07T05:31:56Z"
}
headers = {
"X-Client-ID": "<api-key>",
"X-Client-Secret": "<api-key>",
"X-Merchant-ID": "<api-key>",
"X-API-Version": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Client-ID': '<api-key>',
'X-Client-Secret': '<api-key>',
'X-Merchant-ID': '<api-key>',
'X-API-Version': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: 123,
reference_id: '<string>',
buyer: {
name: '<string>',
email: '[email protected]',
phone: '<string>',
address: {
postal_code: '<string>',
line_1: '<string>',
line_2: '<string>',
city: '<string>',
state: '<string>'
},
send_sms: false,
send_email: false
},
product: {
name: '<string>',
description: '<string>',
hs_code: '<string>',
hs_code_description: '<string>'
},
invoice: {number: '<string>'},
expiry_date: '2023-11-07T05:31:56Z'
})
};
fetch('https://api-pacb-uat.eximpe.com/pg/payment-links/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-pacb-uat.eximpe.com/pg/payment-links/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 123,
'reference_id' => '<string>',
'buyer' => [
'name' => '<string>',
'email' => '[email protected]',
'phone' => '<string>',
'address' => [
'postal_code' => '<string>',
'line_1' => '<string>',
'line_2' => '<string>',
'city' => '<string>',
'state' => '<string>'
],
'send_sms' => false,
'send_email' => false
],
'product' => [
'name' => '<string>',
'description' => '<string>',
'hs_code' => '<string>',
'hs_code_description' => '<string>'
],
'invoice' => [
'number' => '<string>'
],
'expiry_date' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Version: <api-key>",
"X-Client-ID: <api-key>",
"X-Client-Secret: <api-key>",
"X-Merchant-ID: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-pacb-uat.eximpe.com/pg/payment-links/"
payload := strings.NewReader("{\n \"amount\": 123,\n \"reference_id\": \"<string>\",\n \"buyer\": {\n \"name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"phone\": \"<string>\",\n \"address\": {\n \"postal_code\": \"<string>\",\n \"line_1\": \"<string>\",\n \"line_2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"send_sms\": false,\n \"send_email\": false\n },\n \"product\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"hs_code\": \"<string>\",\n \"hs_code_description\": \"<string>\"\n },\n \"invoice\": {\n \"number\": \"<string>\"\n },\n \"expiry_date\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Client-ID", "<api-key>")
req.Header.Add("X-Client-Secret", "<api-key>")
req.Header.Add("X-Merchant-ID", "<api-key>")
req.Header.Add("X-API-Version", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-pacb-uat.eximpe.com/pg/payment-links/")
.header("X-Client-ID", "<api-key>")
.header("X-Client-Secret", "<api-key>")
.header("X-Merchant-ID", "<api-key>")
.header("X-API-Version", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"reference_id\": \"<string>\",\n \"buyer\": {\n \"name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"phone\": \"<string>\",\n \"address\": {\n \"postal_code\": \"<string>\",\n \"line_1\": \"<string>\",\n \"line_2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"send_sms\": false,\n \"send_email\": false\n },\n \"product\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"hs_code\": \"<string>\",\n \"hs_code_description\": \"<string>\"\n },\n \"invoice\": {\n \"number\": \"<string>\"\n },\n \"expiry_date\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-pacb-uat.eximpe.com/pg/payment-links/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Client-ID"] = '<api-key>'
request["X-Client-Secret"] = '<api-key>'
request["X-Merchant-ID"] = '<api-key>'
request["X-API-Version"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 123,\n \"reference_id\": \"<string>\",\n \"buyer\": {\n \"name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"phone\": \"<string>\",\n \"address\": {\n \"postal_code\": \"<string>\",\n \"line_1\": \"<string>\",\n \"line_2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"send_sms\": false,\n \"send_email\": false\n },\n \"product\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"hs_code\": \"<string>\",\n \"hs_code_description\": \"<string>\"\n },\n \"invoice\": {\n \"number\": \"<string>\"\n },\n \"expiry_date\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": {
"payment_id": "<string>",
"link_id": "<string>",
"payment_link": "<string>",
"amount": "<string>",
"currency": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Overview
The Create Payment Link endpoint allows you to generate a unique URL that you can share with your customers to collect payments. This is ideal for businesses that don’t have a full website integration or want to collect payments via chat, email, or SMS.Key Features
- Customizable Expiry: Set how long the link remains valid.
- Buyer Information: Pre-fill buyer details to simplify their checkout experience.
- Product Details: Include what the payment is for.
- Instant Sharing: Get a link that can be shared immediately.
Request Parameters
The request body follows the same structure as the Create Order API, but it’s specifically optimized for generating shareable links.Required Fields
amount: The amount to collect.currency: Currently supportsINR.reference_id: Your internal reference for this payment.buyer: Customer details (name, email, phone, address).product: Details of the item or service.invoice: Invoice number and date.
Optional Fields
expiry_date: When the link should expire (ISO 8601 format). Defaults to 1 year if not provided.
Response
The response carries thepayment_link to share and the link’s link_id, which the other payment link endpoints take. payment_id is the same value: the link and the payment made through it share one ID, and the payment webhooks for it carry that ID as both payment_id and link_id.Authorizations
Body
application/json