Update Subscription

Definition

https://sandbox.bluesnap.com/services/2/subscriptions/:subscription-id


Documentation

The Update Subscription request enables you to update the settings of an existing subscription in your account.

📘

Notes

Changing the payment source

If you wish to change the payment source associated with the subscription:

  1. Make sure the payment details are saved to the shopper. If not, update the shopper with the new details.
  2. Update the subscription to specify the new payment source.

Changing the quantity
If you use the quantity parameter, you must include underlying-sku-id as well. If you want to change the quantity of the current plan, enter the current underlying-sku-id. If you want to change the plan and quantity, enter new values for both.

Request Content

subscription    required, contains the following properties (see subscription):
     status string    optional
     cancellation-reason string    optional
     underlying-sku-id long    optional
     underlying-sku-name string    optional
     shopper-id long    optional
     credit-card container    optional (see credit-card)
     paypal string    optional
     paypal-subscription container    optional (see paypal-subscription)
     override-recurring-charge container    optional (see override-recurring-charge)
     coupon string    optional
     next-charge-date date    optional
     quantity integer    optional value must be greater than zero.
     auto-renew boolean    optional

Response Details

If successful, the response HTTP status code is 204 No Content.
For details about possible errors, see: General Errors, Payment & Processor Errors, and Fraud Errors.


Examples

Request Examples

curl -v -X PUT https://sandbox.bluesnap.com/services/2/subscriptions/39469016 \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<subscription xmlns="http://ws.plimus.com">
  <subscription-id>39469016</subscription-id>
  <status>C</status>
</subscription>'
curl -v -X PUT https://sandbox.bluesnap.com/services/2/subscriptions/5741000 \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<subscription xmlns="http://ws.plimus.com">
  <override-recurring-charge>
    <currency>USD</currency>
    <amount>111.99</amount>
  </override-recurring-charge>
</subscription>'
curl -v -X PUT https://sandbox.bluesnap.com/services/2/subscriptions/39469016 \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<subscription xmlns="http://ws.plimus.com">
  <next-charge-date>15-Sep-18</next-charge-date>
</subscription>'
curl -v -X PUT https://sandbox.bluesnap.com/services/2/subscriptions/39469016 \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<subscription xmlns="http://ws.plimus.com">
  <credit-card>
    <card-last-four-digits>0126</card-last-four-digits>
    <card-type>VISA</card-type>
  </credit-card>
</subscription>'
curl -v -X PUT https://sandbox.bluesnap.com/services/2/subscriptions/39469016 \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<subscription xmlns="http://ws.plimus.com">
  <subscription-id>39469016</subscription-id>
  <status>A</status>
  <coupon>100off</coupon>
  <shopper-id>19505364</shopper-id>
</subscription>'
curl -v -X PUT https://sandbox.bluesnap.com/services/2/subscriptions/39469016 \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<subscription xmlns="http://ws.plimus.com">
  <subscription-id>39469016</subscription-id>
  <auto-renew>true</auto-renew>
</subscription>'
curl -v -X PUT https://sandbox.bluesnap.com/services/2/subscriptions/39469016 \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<subscription xmlns="http://ws.plimus.com">
  <subscription-id>39469016</subscription-id>
  <status>A</status>
  <underlying-sku-id>2181034</underlying-sku-id>
  <shopper-id>19505364</shopper-id>
</subscription>'
curl -v -X PUT https://sandbox.bluesnap.com/services/2/subscriptions/39469016 \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<subscription xmlns="http://ws.plimus.com">
  <subscription-id>39469016</subscription-id>
  <underlying-sku-id>1234522</underlying-sku-id>
  <quantity>2</quantity>
</subscription>'
curl -v -X PUT https://sandbox.bluesnap.com/services/2/subscriptions/39599906 \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<subscription xmlns="http://ws.plimus.com">
  <underlying-sku-name>new name</underlying-sku-name>
</subscription>'

Response Example

HTTP/ 1.1 204 No Content

Example Descriptions

Update Subscription: status

The example above shows how to cancel or activate a subscription by setting the relevant value in the status field. Values are:

  • A: Active
  • C: Cancelled

Update Subscription: override recurring price

The example shows how to change the recurring price for a subscription, using the override-recurring-charge parameter. This will change the price that is charged each time for this specific subscription but will not affect the price of the associated SKU (contract).

Update Subscription: change next charge date

This example shows how to change the date of the next recurring charge by entering a date in the next-charge-date parameter. All future charge dates will also be recalculated based on the next charge date. For example, if your subscription was charged on the 1st of each month, but you change the next charge date to be on the 15th of September, then it will be charged on the 15th of the month going forward.

Update Subscription: change credit card

The example above shows how to change the credit card used for the recurring subscription charges by sending the card type and the last four digits of the card to be charged going forward. To do this, the new credit card first has to be added to the shopper using the Update Shopper request.

Update Subscription: add coupon

The example above shows how to apply a coupon to a subscription by sending the coupon code in the request. The coupon discount will applied based on the terms of the coupon.

Update Subscription: auto-renew

The example above shows how to turn auto-renew on for a subscription by setting the auto-renew parameter value to true.

Update Subscription: switch SKU (contract)

The example above shows how to change the SKU (contract) that is associated with a subscription by setting the value in the underlying-sku-id. You might use this, for example, if you would like to move a subscription from a silver plan to a gold plan. The pricing will be charged according to the new SKU.

Update Subscription: change quantity

The example above shows how to change the number of subscriptions to which the shopper is subscribed.

Update Subscription: change SKU (contract) name

The example above shows how to change the SKU (contract) name that is associated with a subscription by setting the value in the underlying-sku-name.


Back to Top
Language
Credentials
:
Click Try It! to start a request and see the response here!