The Update Plan request enables you to change any of the following settings for an existing plan:
- Plan name
- Plan status (ACTIVE/INACTIVE)
- Initial charge amount
- Number of days in the trial period
- Charge on switch setting
- Grace period
- Maximum number of charges
Important
- The recurring charge amount, currency and frequency cannot be modified. However, they must be included in the request and contain the same values as the existing plan. Therefore you may wish to first retrieve the plan and then modify the retrieved plan values.
- Trials and initial charges cannot be added to existing plans. If a trial or initial charge already exists in the plan, its values can be modified.
For more information about working with subscriptions, see the Subscriptions tutorial.
Request Content
plan
container required, contains the following properties (see plan):
name
string required
recurring-charge-amount
decimal required
currency
string required
charge-frequency
string required
trial-period-days
integer optional
initial-charge-amount
decimal optional
charge-on-plan-switch
boolean optional
max-number-of-charges
integer optional
grace-period-days
integer optional
status
string optional
Response Details
If successful, the response HTTP status code is 200 OK.
The response body contains the plan resource.
Examples
Request Examples
curl -v -X PUT https://sandbox.bluesnap.com/services/2/recurring/plans/2111111 \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<plan xmlns="http://ws.plimus.com">
<name>Gold Plan</name>
<recurring-charge-amount>19.00</recurring-charge-amount>
<currency>USD</currency>
<charge-frequency>MONTHLY</charge-frequency>
<trial-period-days>7</trial-period-days>
<initial-charge-amount>30</initial-charge-amount>
</plan>'
Response Examples
HTTP/ 1.1 200 OK
<plan xmlns="http://ws.plimus.com">
<plan-id>2111111</plan-id>
<name>Gold Plan</name>
<recurring-charge-amount>19.00</recurring-charge-amount>
<currency>USD</currency>
<charge-frequency>MONTHLY</charge-frequency>
<trial-period-days>7</trial-period-days>
<initial-charge-amount>30</initial-charge-amount>
<charge-on-plan-switch>true</charge-on-plan-switch>
<max-number-of-charges>12</max-number-of-charges>
<grace-period-days>10</grace-period-days>
<status>ACTIVE</status>
</plan>
Example Description
This example shows an Update Plan Request with new values being sent for the trial-period-days
and initial-charge-amount
fields. Note that the recurring-charge-amount
, currency
and charge-frequency
fields must also be sent with the same values as the existing plan.
Back to Top
API Explorer
To test out a call, in the plan-id
field, enter the ID of an existing plan. In the Body Content field, paste in the XML portion of the request and then click Try it!
Important
- The recurring charge amount, currency and frequency cannot be modified. However, they must be included in the request and contain the same values as the existing plan. Therefore you may wish to first retrieve the plan and then modify the retrieved plan values.
- Trials and initial charges cannot be added to existing plans. If a trial or initial charge already exists in the plan, its values can be modified.