Cancel Plan
curl --request POST \
--url https://sandbox-payment-b2b.singapay.id/api/v2.0/recurring/plans/cancel/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-PARTNER-ID: <api-key>' \
--data '
{
"reason": "customer_requested"
}
'import requests
url = "https://sandbox-payment-b2b.singapay.id/api/v2.0/recurring/plans/cancel/{id}"
payload = { "reason": "customer_requested" }
headers = {
"Authorization": "Bearer <token>",
"X-PARTNER-ID": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-PARTNER-ID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({reason: 'customer_requested'})
};
fetch('https://sandbox-payment-b2b.singapay.id/api/v2.0/recurring/plans/cancel/{id}', 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://sandbox-payment-b2b.singapay.id/api/v2.0/recurring/plans/cancel/{id}",
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'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-PARTNER-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://sandbox-payment-b2b.singapay.id/api/v2.0/recurring/plans/cancel/{id}"
payload := strings.NewReader("{\n \"reason\": \"customer_requested\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-PARTNER-ID", "<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://sandbox-payment-b2b.singapay.id/api/v2.0/recurring/plans/cancel/{id}")
.header("Authorization", "Bearer <token>")
.header("X-PARTNER-ID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"customer_requested\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-payment-b2b.singapay.id/api/v2.0/recurring/plans/cancel/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-PARTNER-ID"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"customer_requested\"\n}"
response = http.request(request)
puts response.read_body{
"response_code": "SP000",
"response_message": "Successfully",
"data": {
"id": "9f8b6c2e-1a2b-4c3d-8e4f-5a6b7c8d9e0f",
"name": "Monthly Pro Subscription",
"amount": "150000",
"currency": "IDR",
"created_at": "2026-06-09T10:00:00+07:00",
"schedule": {
"interval": 1,
"interval_unit": "month",
"current_interval": 1,
"total_interval": 12,
"start_time": "2026-07-01T00:00:00+07:00",
"previous_payment_at": null,
"next_payment_at": "2026-07-01T00:00:00+07:00"
},
"status": "active",
"payment_type": "credit_card",
"retry_policy": {
"max_attempts": 3,
"interval_days": 1,
"failed_payment_action": "continue_plan"
},
"metadata": {
"description": "Pro plan monthly billing",
"extra": []
},
"subscription_id": "SUB-2026-0001",
"merchant_reff_no": "REF-0001",
"payment_link_url": "https://pay.singapay.id/sub/9f8b6c2e",
"parent_plan_id": null,
"created_from": null
}
}{
"response_code": "SP100",
"response_message": "Subscription Plan Not Found"
}{
"response_code": "SP101",
"response_message": "Plan Already Cancelled",
"data": null
}Subscription (Recurring)
Cancel Plan
Cancels an active subscription plan and stops future billing.
POST
/
api
/
v2.0
/
recurring
/
plans
/
cancel
/
{id}
Cancel Plan
curl --request POST \
--url https://sandbox-payment-b2b.singapay.id/api/v2.0/recurring/plans/cancel/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-PARTNER-ID: <api-key>' \
--data '
{
"reason": "customer_requested"
}
'import requests
url = "https://sandbox-payment-b2b.singapay.id/api/v2.0/recurring/plans/cancel/{id}"
payload = { "reason": "customer_requested" }
headers = {
"Authorization": "Bearer <token>",
"X-PARTNER-ID": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-PARTNER-ID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({reason: 'customer_requested'})
};
fetch('https://sandbox-payment-b2b.singapay.id/api/v2.0/recurring/plans/cancel/{id}', 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://sandbox-payment-b2b.singapay.id/api/v2.0/recurring/plans/cancel/{id}",
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'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-PARTNER-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://sandbox-payment-b2b.singapay.id/api/v2.0/recurring/plans/cancel/{id}"
payload := strings.NewReader("{\n \"reason\": \"customer_requested\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-PARTNER-ID", "<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://sandbox-payment-b2b.singapay.id/api/v2.0/recurring/plans/cancel/{id}")
.header("Authorization", "Bearer <token>")
.header("X-PARTNER-ID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"customer_requested\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-payment-b2b.singapay.id/api/v2.0/recurring/plans/cancel/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-PARTNER-ID"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"customer_requested\"\n}"
response = http.request(request)
puts response.read_body{
"response_code": "SP000",
"response_message": "Successfully",
"data": {
"id": "9f8b6c2e-1a2b-4c3d-8e4f-5a6b7c8d9e0f",
"name": "Monthly Pro Subscription",
"amount": "150000",
"currency": "IDR",
"created_at": "2026-06-09T10:00:00+07:00",
"schedule": {
"interval": 1,
"interval_unit": "month",
"current_interval": 1,
"total_interval": 12,
"start_time": "2026-07-01T00:00:00+07:00",
"previous_payment_at": null,
"next_payment_at": "2026-07-01T00:00:00+07:00"
},
"status": "active",
"payment_type": "credit_card",
"retry_policy": {
"max_attempts": 3,
"interval_days": 1,
"failed_payment_action": "continue_plan"
},
"metadata": {
"description": "Pro plan monthly billing",
"extra": []
},
"subscription_id": "SUB-2026-0001",
"merchant_reff_no": "REF-0001",
"payment_link_url": "https://pay.singapay.id/sub/9f8b6c2e",
"parent_plan_id": null,
"created_from": null
}
}{
"response_code": "SP100",
"response_message": "Subscription Plan Not Found"
}{
"response_code": "SP101",
"response_message": "Plan Already Cancelled",
"data": null
}Authorizations
JWT issued by POST /api/v1.1/access-token/b2b. Send Authorization: Bearer <token>.
Merchant API key (Credential.api_key). Required on every request.
Path Parameters
Body
application/json
Optional body for cancelling a plan.
Cancellation reason. Defaults to merchant_api_cancel when omitted.
Example:
"customer_requested"
Response
SP000 Successflly — plan cancelled (data is RecurringPlanData).
Merchant v2 envelope returned on a successful plan operation (SP000). Used by create (HTTP 201), show, update, and cancel (HTTP 200). The data.upgrade block is present only on an upgrade/downgrade.
⌘I
