Update Plan

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.


📘

Send a test request

Go to API Explorer to send a test request to our sandbox environment and receive a response in real time.

Request Content

Send a plan object, with the following:

PropertyTypeRequired
chargeFrequencystringrequired
chargeOnPlanSwitchbooleanoptional
currencystringrequired
gracePeriodDaysintegeroptional
initialChargeAmountdecimaloptional
maxNumberOfChargesintegeroptional
namestringrequired
recurringChargeAmountdecimalrequired
statusstringoptional
trialPeriodDaysintegeroptional

Response Details

If successful, the response HTTP status code is 200 OK.
The response contains the plan object.


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 '
{
    "chargeFrequency": "MONTHLY",
    "trialPeriodDays": 7,
    "initialChargeAmount": 30,
    "name": "Gold Plan",
    "currency": "USD",
    "recurringChargeAmount": 19
}'

Response Examples

{
    "chargeFrequency": "MONTHLY",
    "gracePeriodDays": 10,
    "trialPeriodDays": 7,
    "initialChargeAmount": 30,
    "name": "Gold Plan",
    "planId": 3068869,
    "currency": "USD",
    "maxNumberOfCharges": 12,
    "recurringChargeAmount": 19,
    "chargeOnPlanSwitch": true,
    "status": "ACTIVE"
}

Back to Top


API Explorer

BlueSnap provides a sandbox environment so you can test basic requests with this endpoint. You can view the request in the API Explorer console and its response directly below the console.

The console includes a sample request with predefined parameter values. To send a request with custom values, edit the parameter fields below. As you edit the fields, your custom values display in the request in the console.

Click the Try it! button below the request example when you are ready to send your request.


📘

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.
Language
Credentials
Header
Click Try It! to start a request and see the response here!