{"_id":"5c6c2407b8d4b2000e72da07","category":{"_id":"5c6c2407b8d4b2000e72d989","version":"5c6c2407b8d4b2000e72da25","project":"57336fd5a6a9c40e00e13a0b","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-07-27T10:22:06.636Z","from_sync":false,"order":8,"slug":"subscriptions","title":"Subscriptions"},"project":"57336fd5a6a9c40e00e13a0b","parentDoc":null,"user":"560d5913af97231900938124","version":{"_id":"5c6c2407b8d4b2000e72da25","project":"57336fd5a6a9c40e00e13a0b","__v":0,"forked_from":"5beec5a5f95d82011c6f3714","createdAt":"2018-04-24T15:24:22.608Z","releaseDate":"2018-04-24T15:24:22.608Z","categories":["5c6c2407b8d4b2000e72d981","5c6c2407b8d4b2000e72d982","5c6c2407b8d4b2000e72d983","5c6c2407b8d4b2000e72d984","5c6c2407b8d4b2000e72d985","5c6c2407b8d4b2000e72d986","5c6c2407b8d4b2000e72d987","5c6c2407b8d4b2000e72d988","5c6c2407b8d4b2000e72d989","5c6c2407b8d4b2000e72d98a","5c6c2407b8d4b2000e72d98b","5c6c2407b8d4b2000e72d98c","5c6c2407b8d4b2000e72d98d","5c6c2407b8d4b2000e72d98e","5c6c2407b8d4b2000e72d98f","5c6c2407b8d4b2000e72d990"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"Main","version_clean":"8976.0.0-XML","version":"8976-XML"},"githubsync":"","__v":2,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-07-27T19:44:29.397Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"language":"text","code":""}]},"settings":"","examples":{"codes":[]},"method":"put","auth":"optional","params":[{"_id":"579b519f862755190043381f","ref":"","in":"path","required":true,"desc":"BlueSnap identifier for the plan.","default":"","type":"int","name":"plan-id"}],"url":"/recurring/plans/:plan-id"},"isReference":false,"order":2,"body":"The Update Plan request enables you to change any of the following settings for an existing plan:\n * Plan name\n * Plan status (ACTIVE/INACTIVE)\n * Initial charge amount\n * Number of days in the trial period\n * Charge on switch setting\n * Grace period\n * Maximum number of charges\n[block:callout]\n{\n \"type\": \"info\",\n \"body\": \"* 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.**\\n* 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.\",\n \"title\": \"Important\"\n}\n[/block]\nFor more information about working with subscriptions, see the [Subscriptions tutorial](doc:subscription-management#section-tutorial-subscriptions).\n\n<a class=\"btn btn-success\" href=\"#section-api-explorer\" role=\"button\">Try it in the API Explorer</a>\n\n###Request Content\n`plan` *container* &nbsp;&nbsp;&nbsp;<span style=\"color:#F37500\">**required**</span>, contains the following properties (see [plan](doc:plan)):\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`name` *string* &nbsp;&nbsp;&nbsp;<span style=\"color:#F37500\">**required**</span>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`recurring-charge-amount` *decimal* &nbsp;&nbsp;&nbsp;<span style=\"color:#F37500\">**required**</span>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`currency` *string* &nbsp;&nbsp;&nbsp;<span style=\"color:#F37500\">**required**</span>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`charge-frequency` *string* &nbsp;&nbsp;&nbsp;<span style=\"color:#F37500\">**required**</span>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`trial-period-days` *integer* &nbsp;&nbsp;&nbsp;optional\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`initial-charge-amount` *decimal* &nbsp;&nbsp;optional\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`charge-on-plan-switch` *boolean* &nbsp;&nbsp;&nbsp;optional\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`max-number-of-charges` *integer* &nbsp;&nbsp;&nbsp;optional\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`grace-period-days` *integer* &nbsp;&nbsp;&nbsp;optional\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`status` *string* &nbsp;&nbsp;&nbsp;optional\n\n###Response Details\nIf successful, the response HTTP status code is 200 OK.\nThe response body contains the [plan](doc:plan) resource.\n\n<hr>\n\n##Examples\n\n###Request Examples\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"curl -v -X PUT https://sandbox.bluesnap.com/services/2/recurring/plans/2111111 \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<plan xmlns=\\\"http://ws.plimus.com\\\">\\n <name>Gold Plan</name>\\n <recurring-charge-amount>19.00</recurring-charge-amount>\\n <currency>USD</currency>\\n <charge-frequency>MONTHLY</charge-frequency>\\n <trial-period-days>7</trial-period-days>\\n <initial-charge-amount>30</initial-charge-amount>\\n</plan>'\",\n \"language\": \"curl\",\n \"name\": \"Update Plan Request\"\n }\n ],\n \"sidebar\": true\n}\n[/block]\n###Response Examples\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"HTTP/ 1.1 200 OK\\n\\n<plan xmlns=\\\"http://ws.plimus.com\\\">\\n <plan-id>2111111</plan-id>\\n <name>Gold Plan</name>\\n <recurring-charge-amount>19.00</recurring-charge-amount>\\n <currency>USD</currency>\\n <charge-frequency>MONTHLY</charge-frequency>\\n <trial-period-days>7</trial-period-days>\\n <initial-charge-amount>30</initial-charge-amount>\\n <charge-on-plan-switch>true</charge-on-plan-switch>\\n <max-number-of-charges>12</max-number-of-charges>\\n <grace-period-days>10</grace-period-days>\\n <status>ACTIVE</status>\\n</plan>\",\n \"language\": \"xml\",\n \"name\": \"Update Plan Response: 200 OK\"\n }\n ],\n \"sidebar\": true\n}\n[/block]\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>\n\n<hr>\n\n##Example Description\n\nThis 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.\n\n<br>\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>\n\n<hr>\n\n##API Explorer\nTo 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!**\n\n[block:callout]\n{\n \"type\": \"info\",\n \"body\": \"* 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.**\\n* 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.\",\n \"title\": \"Important\"\n}\n[/block]","excerpt":"","slug":"update-plan","type":"endpoint","title":"Update Plan"}

putUpdate Plan

Definition

Parameters

Path Params

Documentation

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.

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.

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.