curl --request PATCH \
--url https://sandbox-payment-b2b.singapay.id/api/v2.0/recurring/plans/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-PARTNER-ID: <api-key>' \
--data '
{
"name": "Monthly Pro Subscription (Updated)",
"merchant_reff_no": "REF-0002",
"amount": 200000,
"items": [
{
"item_name": "Pro Plan License",
"quantity": 1,
"unit_price": 50000,
"item_type": "subscription"
}
],
"metadata": {
"description": "Upgraded to Pro+ tier"
},
"prorated_charge_mode": "auto",
"prorated_charge_amount": 50000
}
'import requests
url = "https://sandbox-payment-b2b.singapay.id/api/v2.0/recurring/plans/{id}"
payload = {
"name": "Monthly Pro Subscription (Updated)",
"merchant_reff_no": "REF-0002",
"amount": 200000,
"items": [
{
"item_name": "Pro Plan License",
"quantity": 1,
"unit_price": 50000,
"item_type": "subscription"
}
],
"metadata": { "description": "Upgraded to Pro+ tier" },
"prorated_charge_mode": "auto",
"prorated_charge_amount": 50000
}
headers = {
"Authorization": "Bearer <token>",
"X-PARTNER-ID": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'X-PARTNER-ID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Monthly Pro Subscription (Updated)',
merchant_reff_no: 'REF-0002',
amount: 200000,
items: [
{
item_name: 'Pro Plan License',
quantity: 1,
unit_price: 50000,
item_type: 'subscription'
}
],
metadata: {description: 'Upgraded to Pro+ tier'},
prorated_charge_mode: 'auto',
prorated_charge_amount: 50000
})
};
fetch('https://sandbox-payment-b2b.singapay.id/api/v2.0/recurring/plans/{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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Monthly Pro Subscription (Updated)',
'merchant_reff_no' => 'REF-0002',
'amount' => 200000,
'items' => [
[
'item_name' => 'Pro Plan License',
'quantity' => 1,
'unit_price' => 50000,
'item_type' => 'subscription'
]
],
'metadata' => [
'description' => 'Upgraded to Pro+ tier'
],
'prorated_charge_mode' => 'auto',
'prorated_charge_amount' => 50000
]),
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/{id}"
payload := strings.NewReader("{\n \"name\": \"Monthly Pro Subscription (Updated)\",\n \"merchant_reff_no\": \"REF-0002\",\n \"amount\": 200000,\n \"items\": [\n {\n \"item_name\": \"Pro Plan License\",\n \"quantity\": 1,\n \"unit_price\": 50000,\n \"item_type\": \"subscription\"\n }\n ],\n \"metadata\": {\n \"description\": \"Upgraded to Pro+ tier\"\n },\n \"prorated_charge_mode\": \"auto\",\n \"prorated_charge_amount\": 50000\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://sandbox-payment-b2b.singapay.id/api/v2.0/recurring/plans/{id}")
.header("Authorization", "Bearer <token>")
.header("X-PARTNER-ID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Monthly Pro Subscription (Updated)\",\n \"merchant_reff_no\": \"REF-0002\",\n \"amount\": 200000,\n \"items\": [\n {\n \"item_name\": \"Pro Plan License\",\n \"quantity\": 1,\n \"unit_price\": 50000,\n \"item_type\": \"subscription\"\n }\n ],\n \"metadata\": {\n \"description\": \"Upgraded to Pro+ tier\"\n },\n \"prorated_charge_mode\": \"auto\",\n \"prorated_charge_amount\": 50000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-payment-b2b.singapay.id/api/v2.0/recurring/plans/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-PARTNER-ID"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Monthly Pro Subscription (Updated)\",\n \"merchant_reff_no\": \"REF-0002\",\n \"amount\": 200000,\n \"items\": [\n {\n \"item_name\": \"Pro Plan License\",\n \"quantity\": 1,\n \"unit_price\": 50000,\n \"item_type\": \"subscription\"\n }\n ],\n \"metadata\": {\n \"description\": \"Upgraded to Pro+ tier\"\n },\n \"prorated_charge_mode\": \"auto\",\n \"prorated_charge_amount\": 50000\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": "SP013",
"response_message": "Unauthorized"
}{
"response_code": "SP100",
"response_message": "Subscription Plan Not Found"
}{
"response_code": "SP102",
"response_message": "Plan Cannot Be Updated In Current State",
"data": null
}Update Plan
Patches a subscription plan in place, or upgrades/downgrades it to a new plan when amount or items change.
curl --request PATCH \
--url https://sandbox-payment-b2b.singapay.id/api/v2.0/recurring/plans/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-PARTNER-ID: <api-key>' \
--data '
{
"name": "Monthly Pro Subscription (Updated)",
"merchant_reff_no": "REF-0002",
"amount": 200000,
"items": [
{
"item_name": "Pro Plan License",
"quantity": 1,
"unit_price": 50000,
"item_type": "subscription"
}
],
"metadata": {
"description": "Upgraded to Pro+ tier"
},
"prorated_charge_mode": "auto",
"prorated_charge_amount": 50000
}
'import requests
url = "https://sandbox-payment-b2b.singapay.id/api/v2.0/recurring/plans/{id}"
payload = {
"name": "Monthly Pro Subscription (Updated)",
"merchant_reff_no": "REF-0002",
"amount": 200000,
"items": [
{
"item_name": "Pro Plan License",
"quantity": 1,
"unit_price": 50000,
"item_type": "subscription"
}
],
"metadata": { "description": "Upgraded to Pro+ tier" },
"prorated_charge_mode": "auto",
"prorated_charge_amount": 50000
}
headers = {
"Authorization": "Bearer <token>",
"X-PARTNER-ID": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'X-PARTNER-ID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Monthly Pro Subscription (Updated)',
merchant_reff_no: 'REF-0002',
amount: 200000,
items: [
{
item_name: 'Pro Plan License',
quantity: 1,
unit_price: 50000,
item_type: 'subscription'
}
],
metadata: {description: 'Upgraded to Pro+ tier'},
prorated_charge_mode: 'auto',
prorated_charge_amount: 50000
})
};
fetch('https://sandbox-payment-b2b.singapay.id/api/v2.0/recurring/plans/{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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Monthly Pro Subscription (Updated)',
'merchant_reff_no' => 'REF-0002',
'amount' => 200000,
'items' => [
[
'item_name' => 'Pro Plan License',
'quantity' => 1,
'unit_price' => 50000,
'item_type' => 'subscription'
]
],
'metadata' => [
'description' => 'Upgraded to Pro+ tier'
],
'prorated_charge_mode' => 'auto',
'prorated_charge_amount' => 50000
]),
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/{id}"
payload := strings.NewReader("{\n \"name\": \"Monthly Pro Subscription (Updated)\",\n \"merchant_reff_no\": \"REF-0002\",\n \"amount\": 200000,\n \"items\": [\n {\n \"item_name\": \"Pro Plan License\",\n \"quantity\": 1,\n \"unit_price\": 50000,\n \"item_type\": \"subscription\"\n }\n ],\n \"metadata\": {\n \"description\": \"Upgraded to Pro+ tier\"\n },\n \"prorated_charge_mode\": \"auto\",\n \"prorated_charge_amount\": 50000\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://sandbox-payment-b2b.singapay.id/api/v2.0/recurring/plans/{id}")
.header("Authorization", "Bearer <token>")
.header("X-PARTNER-ID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Monthly Pro Subscription (Updated)\",\n \"merchant_reff_no\": \"REF-0002\",\n \"amount\": 200000,\n \"items\": [\n {\n \"item_name\": \"Pro Plan License\",\n \"quantity\": 1,\n \"unit_price\": 50000,\n \"item_type\": \"subscription\"\n }\n ],\n \"metadata\": {\n \"description\": \"Upgraded to Pro+ tier\"\n },\n \"prorated_charge_mode\": \"auto\",\n \"prorated_charge_amount\": 50000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-payment-b2b.singapay.id/api/v2.0/recurring/plans/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-PARTNER-ID"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Monthly Pro Subscription (Updated)\",\n \"merchant_reff_no\": \"REF-0002\",\n \"amount\": 200000,\n \"items\": [\n {\n \"item_name\": \"Pro Plan License\",\n \"quantity\": 1,\n \"unit_price\": 50000,\n \"item_type\": \"subscription\"\n }\n ],\n \"metadata\": {\n \"description\": \"Upgraded to Pro+ tier\"\n },\n \"prorated_charge_mode\": \"auto\",\n \"prorated_charge_amount\": 50000\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": "SP013",
"response_message": "Unauthorized"
}{
"response_code": "SP100",
"response_message": "Subscription Plan Not Found"
}{
"response_code": "SP102",
"response_message": "Plan Cannot Be Updated In Current State",
"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
Payload for UpdateSubscriptionPlanRequest. If amount or items is present, the service runs upgrade/downgrade (new plan, proration). Otherwise only cosmetic fields (name, merchant_reff_no, metadata) are patched on the existing plan.
New plan name.
255"Monthly Pro Subscription (Updated)"
New merchant reference number.
255"REF-0002"
New per-cycle charge in IDR. Mutually exclusive with items when upgrading.
x >= 0200000
New itemized pricing. Mutually exclusive with amount when upgrading.
1Show child attributes
Show child attributes
Free-form metadata to merge onto the plan.
Show child attributes
Show child attributes
How the proration charge is determined when upgrading. Defaults to auto.
auto, manual "auto"
When prorated_charge_mode is manual; use 0 to skip immediate proration charge. If positive, must meet the same IDR 10,000 card minimum as create/upgrade amounts.
x >= 050000
Response
SP000 Successfully — data is RecurringPlanData (includes upgrade when amount/items changed).
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.
