curl --request POST \
--url https://api-pacb-uat.eximpe.com/pg/payment-links/{link_id}/deactivate/ \
--header 'X-API-Version: <api-key>' \
--header 'X-Client-ID: <api-key>' \
--header 'X-Client-Secret: <api-key>' \
--header 'X-Merchant-ID: <api-key>'import requests
url = "https://api-pacb-uat.eximpe.com/pg/payment-links/{link_id}/deactivate/"
headers = {
"X-Client-ID": "<api-key>",
"X-Client-Secret": "<api-key>",
"X-Merchant-ID": "<api-key>",
"X-API-Version": "<api-key>"
}
response = requests.post(url, 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>'
}
};
fetch('https://api-pacb-uat.eximpe.com/pg/payment-links/{link_id}/deactivate/', 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/{link_id}/deactivate/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api-pacb-uat.eximpe.com/pg/payment-links/{link_id}/deactivate/"
req, _ := http.NewRequest("POST", url, nil)
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>")
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/{link_id}/deactivate/")
.header("X-Client-ID", "<api-key>")
.header("X-Client-Secret", "<api-key>")
.header("X-Merchant-ID", "<api-key>")
.header("X-API-Version", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-pacb-uat.eximpe.com/pg/payment-links/{link_id}/deactivate/")
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>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Payment Link deactivated successfully",
"data": {}
}Deactivate Payment Link
Close an active payment link so it takes no further payment. A deactivated link reads expired.
curl --request POST \
--url https://api-pacb-uat.eximpe.com/pg/payment-links/{link_id}/deactivate/ \
--header 'X-API-Version: <api-key>' \
--header 'X-Client-ID: <api-key>' \
--header 'X-Client-Secret: <api-key>' \
--header 'X-Merchant-ID: <api-key>'import requests
url = "https://api-pacb-uat.eximpe.com/pg/payment-links/{link_id}/deactivate/"
headers = {
"X-Client-ID": "<api-key>",
"X-Client-Secret": "<api-key>",
"X-Merchant-ID": "<api-key>",
"X-API-Version": "<api-key>"
}
response = requests.post(url, 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>'
}
};
fetch('https://api-pacb-uat.eximpe.com/pg/payment-links/{link_id}/deactivate/', 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/{link_id}/deactivate/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api-pacb-uat.eximpe.com/pg/payment-links/{link_id}/deactivate/"
req, _ := http.NewRequest("POST", url, nil)
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>")
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/{link_id}/deactivate/")
.header("X-Client-ID", "<api-key>")
.header("X-Client-Secret", "<api-key>")
.header("X-Merchant-ID", "<api-key>")
.header("X-API-Version", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-pacb-uat.eximpe.com/pg/payment-links/{link_id}/deactivate/")
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>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Payment Link deactivated successfully",
"data": {}
}Overview
Closes an active payment link so the buyer can no longer pay through it. The call takes no body, and a successful one returns an emptydata:
{
"success": true,
"message": "Payment Link deactivated successfully",
"data": {}
}
Path Parameters
link_id: The link’s ID from Create Payment Link, e.g.PR4829301756. Thepayment_idit returned is the same value.
X-Merchant-ID naming the sub-merchant the link belongs to, as on Create Payment Link.What deactivation does
- The link reads
expired. There is no separate deactivated status: deactivating setsexpiry_dateto the moment of the call, so Retrieve Payment Link and List Payment Links report it asexpired, with that moment as itsexpiry_date. - It cannot be undone. To collect again, create a new link with a new
reference_id. - A payment already underway can still land. If the buyer was mid-payment when you deactivated, check the link afterwards:
paidoutranksexpired, so a link whose payment went through readspaid.
When it is refused
Only anactive link can be deactivated. A link that is already paid, expired (deactivated links included) or failed is refused with a 400, so deactivating a link twice fails the second time:
{
"success": false,
"error": {
"code": "ERR_ORDER_002",
"message": "Validation error",
"details": {
"payment": "Payment Link cannot be deactivated"
}
}
}
Errors
| Status | error.code | When | details |
|---|---|---|---|
400 | ERR_ORDER_002 | The link is not active | {"payment": "Payment Link cannot be deactivated"} |
401 | ERR_AUTH_000, ERR_AUTH_001 | Credentials are missing or wrong, or a PSP left out X-Merchant-ID | {"authentication": "X-Merchant-ID header is required for this endpoint."} |
403 | — | Payment links are not enabled on your account | Not the standard envelope: {"detail": "You do not have permission to perform this action."} |
403 | ERR_SERVICE_ERROR_000 | Your account is not configured to collect through payment links | e.g. {"payment_gateway": "Payment gateway not configured"} |
429 | ERR_RATE_LIMIT_EXCEEDED | The payment network is rate limiting requests | Retry after the Retry-After header, when it is sent |
502 | ERR_GATEWAY_UNAVAILABLE, ERR_PAYMENT_003 | The payment network could not be reached, or returned an error | Retry shortly |
500 | ERR_SERVICE_ERROR_000 | Anything unexpected | {"error": "An unexpected error occurred. Please try again later"} |
Authorizations
Client Application ID - Your unique application identifier used to authenticate API requests. You can find your Client ID in the Developer Settings section of the merchant dashboard.
Client Secret Key - Your secret key used alongside the Client ID for secure authentication. Keep this confidential and never expose it in client-side code. Available in the Developer Settings section of the merchant dashboard.
Merchant Identifier - The unique ID for the merchant account. This is required for PSP (Payment Service Provider) merchants who manage multiple merchant accounts. You can find merchant IDs in the Merchant Management section of the dashboard.
API Version - Specifies which version of the API to use (e.g., '1.X.X', '2.X.X', or '3.X.X'). This header allows you to control which API version your integration uses. Default version information is available in the Developer Settings.
Path Parameters
The link's link_id, as returned by Create Payment Link (PR followed by 10 digits). The payment_id Create Payment Link returns is the same value.
"PR4829301756"