Cancel a payment link
curl --request POST \
--url https://api.sbx.moduluslabs.io/ecom/v1/payment-links/{id}/cancel \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"reason": "Customer requested cancellation"
}
'import requests
url = "https://api.sbx.moduluslabs.io/ecom/v1/payment-links/{id}/cancel"
payload = { "reason": "Customer requested cancellation" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: 'Customer requested cancellation'})
};
fetch('https://api.sbx.moduluslabs.io/ecom/v1/payment-links/{id}/cancel', 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.sbx.moduluslabs.io/ecom/v1/payment-links/{id}/cancel",
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([
'reason' => 'Customer requested cancellation'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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.sbx.moduluslabs.io/ecom/v1/payment-links/{id}/cancel"
payload := strings.NewReader("{\n \"reason\": \"Customer requested cancellation\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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.sbx.moduluslabs.io/ecom/v1/payment-links/{id}/cancel")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"Customer requested cancellation\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.sbx.moduluslabs.io/ecom/v1/payment-links/{id}/cancel");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-API-Key", "<api-key>");
request.AddJsonBody("{\n \"reason\": \"Customer requested cancellation\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"type": "ONE_TIME",
"merchant_branch_reference_number": "SH-ANG-001",
"currency": "PHP",
"amount": 150000,
"line_items": [
{
"sku": "PROD-001",
"name": "Wireless Earbuds",
"unit_price": 75000,
"quantity": 2,
"metadata": {}
}
],
"description": "Order for wireless earbuds",
"status": "ACTIVE",
"expires_at": "2026-07-18T00:00:00Z",
"url": "https://pay.sbx.moduluslabs.io/550e8400-e29b-41d4-a716-446655440000",
"max_uses": 10,
"successful_payment_count": 3,
"metadata": {},
"created_at": "2026-06-18T10:30:00Z",
"updated_at": "2026-06-18T14:22:00Z",
"cancelled_at": "2023-11-07T05:31:56Z",
"cancellation_reason": "<string>",
"order_reference": "ORD-2026-0618-001",
"redirect_urls": {
"success": "https://merchant.com/payment/success",
"declined": "https://merchant.com/payment/declined",
"expired": "https://merchant.com/payment/expired"
}
}Payment Links
Cancel Payment Link
Permanently cancel an active payment link by ID
POST
/
payment-links
/
{id}
/
cancel
Cancel a payment link
curl --request POST \
--url https://api.sbx.moduluslabs.io/ecom/v1/payment-links/{id}/cancel \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"reason": "Customer requested cancellation"
}
'import requests
url = "https://api.sbx.moduluslabs.io/ecom/v1/payment-links/{id}/cancel"
payload = { "reason": "Customer requested cancellation" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: 'Customer requested cancellation'})
};
fetch('https://api.sbx.moduluslabs.io/ecom/v1/payment-links/{id}/cancel', 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.sbx.moduluslabs.io/ecom/v1/payment-links/{id}/cancel",
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([
'reason' => 'Customer requested cancellation'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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.sbx.moduluslabs.io/ecom/v1/payment-links/{id}/cancel"
payload := strings.NewReader("{\n \"reason\": \"Customer requested cancellation\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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.sbx.moduluslabs.io/ecom/v1/payment-links/{id}/cancel")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"Customer requested cancellation\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.sbx.moduluslabs.io/ecom/v1/payment-links/{id}/cancel");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-API-Key", "<api-key>");
request.AddJsonBody("{\n \"reason\": \"Customer requested cancellation\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"type": "ONE_TIME",
"merchant_branch_reference_number": "SH-ANG-001",
"currency": "PHP",
"amount": 150000,
"line_items": [
{
"sku": "PROD-001",
"name": "Wireless Earbuds",
"unit_price": 75000,
"quantity": 2,
"metadata": {}
}
],
"description": "Order for wireless earbuds",
"status": "ACTIVE",
"expires_at": "2026-07-18T00:00:00Z",
"url": "https://pay.sbx.moduluslabs.io/550e8400-e29b-41d4-a716-446655440000",
"max_uses": 10,
"successful_payment_count": 3,
"metadata": {},
"created_at": "2026-06-18T10:30:00Z",
"updated_at": "2026-06-18T14:22:00Z",
"cancelled_at": "2023-11-07T05:31:56Z",
"cancellation_reason": "<string>",
"order_reference": "ORD-2026-0618-001",
"redirect_urls": {
"success": "https://merchant.com/payment/success",
"declined": "https://merchant.com/payment/declined",
"expired": "https://merchant.com/payment/expired"
}
}Cancellation is permanent. Cancelled links cannot be reactivated - create a new link to accept payments again. Only
ACTIVE links can be cancelled.status: "CANCELLED", cancelled_at populated, and cancellation_reason if a reason was provided.Authorizations
Headers
Body
application/json
Response
The cancelled payment link
The payment link object returned by all endpoints.
Was this page helpful?