Update a Subscription Plan
/ps/api/v1/public/plans/{plan_id}Updates an existing subscription plan. Existing subscriptions under this plan will remain unaffected. The changes will apply only to new subscriptions created under this plan.
Bearer token. Get token →Path Parameters
| Field | Details |
|---|---|
plan_idstringrequired | Unique identifier for the subscription plan. |
Header Parameters
| Field | Details |
|---|---|
Request-Timestampstringdate-time | ISO 8601 UTC timestamp of the request. Used for idempotency and audit. |
Request-IDstring | Use a global unique identifier [GUID] for the request. Constraints Minimum length: 1 characterMaximum length: 50 characters |
Request Bodyrequired
| Field | Details |
|---|---|
plan_namestring | Subscription plan name. |
plan_descriptionstring | Corresponding description for a plan. |
amountobject2 nested fields | This is the recurring mandate amount, that would be charged for each frequency. For instance 200 every month. This field is not needed if the mandate frequency is AS |
max_limit_amountobject2 nested fields | This is the recurring mandate amount, that would be charged for each frequency. For instance 200 every month. This field is not needed if the mandate frequency is AS |
trial_period_in_daysinteger | Duration of the trial period in days. |
end_datestringdate-time | The ISO 8601 UTC Timestamp when the subscription plan expires. |
merchant_metadataobject | Key-value pairs for additional information. Max 10 pairs, 256 chars each. Constraints Maximum properties: 10 Additional properties: string · Maximum length: 256 characters |
Response
| Field | Details |
|---|---|
plan_idstring | Unique identifier for the subscription plan in the Pine Labs database. |
statusstring | Status of the plan.
Allowed values: ACTIVEINACTIVECREATED |
plan_namestring | Subscription plan name. |
plan_descriptionstring | Corresponding description for a plan. |
frequencystring | Frequency of recurring transactions for this particular plan. Allowed values: DayWeekMonthYearBi-MonthlyQuarterlyHalf-YearlyASOTNot Applicable |
amountobject2 nested fields | This is the recurring mandate amount, that would be charged for each frequency. For instance 200 every month. This field is not needed if the mandate frequency is AS |
valueintegerrequired | Amount in the smallest currency unit (paisa for INR). Minimum ₹1 (100), maximum ₹10 lakh (100000000). Constraints Minimum value: 100Maximum value: 100000000 |
currencystringrequired | Three-letter ISO 4217 currency code. Constraints Default value: INR |
max_limit_amountobject2 nested fields | This is the recurring mandate amount, that would be charged for each frequency. For instance 200 every month. This field is not needed if the mandate frequency is AS |
trial_period_in_daysinteger | Duration of the trial period in days. |
start_datestringdate-time | The ISO 8601 UTC Timestamp when the subscription plan is active. |
end_datestringdate-time | The ISO 8601 UTC Timestamp when the subscription plan expires. |
merchant_metadataobject | Key-value pairs for additional information. Max 10 pairs, 256 chars each. Constraints Maximum properties: 10 Additional properties: string · Maximum length: 256 characters |
merchant_plan_referencestring | Unique identifier of the merchant plan reference. Constraints Minimum length: 1 characterMaximum length: 50 characters |
created_atstringdate-timenullable | ISO 8601 UTC Timestamp when the create plan request was received. |
modified_atstringdate-timenullable | ISO 8601 UTC Timestamp when the plan was last updated. |
initial_debit_amountobject2 nested fields | This is the recurring mandate amount, that would be charged for each frequency. For instance 200 every month. This field is not needed if the mandate frequency is AS |
auto_debit_otstring | Indicates whether auto-debit is enabled for one-time payments. |
Status Codes
200 | Plan updated successfully. |
400 | The request was malformed or missing required fields. |
curl --request PATCH \
--url https://pluraluat.v2.pinepg.in/ps/api/v1/public/plans/v1-plan-4405071524-aa-qlAtAf \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--header 'Request-ID: a1b2c3d4-e5f6-7890-abcd-ef1234567890' \
--header 'Request-Timestamp: 2024-10-01T10:30:00Z' \
--data '{
"plan_name": "Monthly Plan Updated",
"plan_description": "Updated plan description",
"amount": {
"value": 1000,
"currency": "INR"
},
"max_limit_amount": {
"value": 1000,
"currency": "INR"
},
"trial_period_in_days": 1,
"end_date": "2026-10-21T12:02:28Z",
"merchant_metadata": {
"key1": "DD"
}
}'{
"plan_id": "v1-plan-4405071524-aa-qlAtAf",
"status": "ACTIVE",
"plan_name": "Monthly Plan",
"plan_description": "Diwali dhammaka plan intended to attract customers on diwali time",
"frequency": "Day",
"amount": {
"value": 100,
"currency": "INR"
},
"max_limit_amount": {
"value": 100,
"currency": "INR"
},
"trial_period_in_days": 1,
"start_date": "2022-02-01T17:32:28Z",
"end_date": "2022-10-21T17:32:28Z",
"merchant_metadata": {
"key1": "DD",
"key2": "XOF"
},
"merchant_plan_reference": "1234567890",
"created_at": "2022-10-21T17:32:28Z",
"modified_at": "2022-10-21T17:32:28Z"
}