Skip to main content
PATCH
/
api
/
v2.0
/
recurring
/
plans
/
{id}
Update Plan
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
}
'
{
  "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
  }
}

Authorizations

Authorization
string
header
required

JWT issued by POST /api/v1.1/access-token/b2b. Send Authorization: Bearer <token>.

X-PARTNER-ID
string
header
required

Merchant API key (Credential.api_key). Required on every request.

Path Parameters

id
string<uuid>
required

Body

application/json

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.

name
string

New plan name.

Maximum string length: 255
Example:

"Monthly Pro Subscription (Updated)"

merchant_reff_no
string | null

New merchant reference number.

Maximum string length: 255
Example:

"REF-0002"

amount
number

New per-cycle charge in IDR. Mutually exclusive with items when upgrading.

Required range: x >= 0
Example:

200000

items
object[]

New itemized pricing. Mutually exclusive with amount when upgrading.

Minimum array length: 1
metadata
object

Free-form metadata to merge onto the plan.

prorated_charge_mode
enum<string> | null

How the proration charge is determined when upgrading. Defaults to auto.

Available options:
auto,
manual
Example:

"auto"

prorated_charge_amount
number | null

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.

Required range: x >= 0
Example:

50000

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.

response_code
string
required

SingaPay custom business response code.

Example:

"SP000"

response_message
string
required

Human-readable label paired with response_code.

Example:

"Successfully"

data
object
required

data object shape from SubscriptionPlanResource (success responses).