Definition
https://sandbox.bluesnap.com/services/2/subscriptions/:subscription-id
Using the Update Subscription request, you can update any of the following settings for an existing subscription:
- Plan associated to the subscription
- Payment source
- Override value for the recurring charge amount
- Auto-renew setting (if you set it to false, the subscription expires at the end of the current period)
- Next charge date
- Quantity
- Subscription status (ACTIVE/CANCELED)
Updating the payment source
If you wish to update the payment source associated with the subscription:
- Make sure the payment details are saved to the shopper. If not, update the shopper with the new details.
- Update the subscription to specify the new payment source.
Updating the quantity
If you use the quantity
parameter, you must include underlying-sku-id
as well. If you want to update 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.
Updating currency
This cannot be changed.
Request Content
subscription
required, contains the following ref:subscription)):
Property | Type | Required |
---|---|---|
status | string | optional |
cancellation-reason | string | optional, 50-character limit |
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>
<underlying-sku-id>1234567</underlying-sku-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