Create Plan
Creates a recurring subscription plan and returns the plan details with its payment link.
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.
Body
Payload for CreateSubscriptionPlanRequest. Exactly one of amount or items must be present (mutually exclusive). Per-cycle charge (amount-only or sum of quantity * unit_price) must be at least IDR 10,000 when greater than zero (ChannelType::MIN_CARD_AMOUNT_IDR).
Human-readable plan name.
255"Monthly Pro Subscription"
Full name of the subscribing customer.
191"John Doe"
Customer email address.
191"john.doe@example.com"
Customer contact phone number.
50"081234567890"
Account ULID owned by the authenticated merchant.
50"01K5G4FZZ18DMK0M5QTR8Y9QY9"
Billing schedule that controls how often and how many times the plan charges the customer.
Stored in sub_plans.reference_id; must be unique on that column when provided.
100"SUB-2026-0001"
Optional merchant reference number for reconciliation.
255"REF-0001"
Per-cycle charge in IDR. Use without items for amount-only plans.
x >= 0150000
ISO 4217 currency code. Defaults to IDR.
3"IDR"
Use without amount for itemized plans; per-cycle total = sum of quantity * unit_price.
1Optional merchant-side customer identifier.
100"CUST-001"
Preferred payment instrument for the plan.
credit_card, gopay "credit_card"
URL the customer is redirected to after completing payment setup.
2048"https://merchant.example.com/subscription/return"
Optional retry policy applied to every cycle when a charge fails.
Deprecated — use retry_policy.max_attempts.
1 <= x <= 53
Deprecated — use retry_policy.interval_days.
1 <= x <= 71
Deprecated — use retry_policy.failed_payment_action.
continue_plan, stop_plan "continue_plan"
Charge the first cycle immediately on creation instead of waiting for start_time.
false
Allow the customer to pay bills manually via the payment link.
true
Send subscription notifications (reminders, receipts) to the customer.
true
Free-form metadata stored with the plan.
Response
SP000 Successfully — plan created (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.
