The Update Subscription request enables you to change 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)
Note: If you are using BlueSnap's tax feature, make sure to update the recurringTaxReference
parameter if you update the subscriptions' plan or recurringChargeAmount
.
For more information about working with subscriptions, see the Subscriptions tutorial.
Updating Payment Source
To change the payment source associated with a subscription:
- Make sure the payment details are saved to the shopper. If not, update the vaulted shopper with the details.
- Update the subscription to specify the new payment source.
Please keep in mind that we do not currently support these scenarios when it comes to updating your payment source:
- Updating from a credit card to a wallet (Apple Pay or Google Pay)
- Updating the credit card within your wallet
Switch contract separately from other changes
If you are switching the contract associated with the subscription, we recommend you do this in a separate API call from other changes, such as updating the payment source or overriding the recurring charge amount.
For example if you want to switch a subscription from plan 1 to plan 2 and also override the recurring charge amount for plan 2, we recommend that you first make an Update Subscription call to change the plan. Then make a separate call to override the recurring charge amount.
Request Content
Send a subscription object, with the following:
planId
integer optional (required with quantity
)
paymentSource
object optional (see paymentSource)
overrideRecurringChargeAmount
decimal optional
autoRenew
boolean optional
nextChargeDate
string optional
quantity
integer optional
status
string optional
recurringTaxReference
string optional
Note
If you use the
quantity
parameter, you must includeplanid
as well. If you want to change the quantity on the current plan, enter the currentplanId
. If you want to change the plan and the quantity, enter the new values for both.
Response Details
If successful, the response HTTP status code is 200 OK.
The response contains the subscription object.
Examples
Request Examples
curl -v -X PUT https://sandbox.bluesnap.com/services/2/recurring/subscriptions/8491543 \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{"planId": 2283849}'
curl -v -X PUT https://sandbox.bluesnap.com/services/2/recurring/subscriptions/8491543 \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{"status": "CANCELED"}'
curl -v -X PUT https://sandbox.bluesnap.com/services/2/recurring/subscriptions/8491543 \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{"nextChargeDate": "2017-10-01"}'
curl -v -X PUT https://sandbox.bluesnap.com/services/2/recurring/subscriptions/8491543 \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
"paymentSource":{
"creditCardInfo":{
"creditCard":{
"cardLastFourDigits":"9299",
"cardType":"VISA"
}
}
}
}'
curl -v -X PUT https://sandbox.bluesnap.com/services/2/recurring/subscriptions/8491543 \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
"paymentSource":{
"creditCardInfo":{
"pfToken":"3f62200b744f70a07db549a8c9df11647f4c2442df9cb71a75026d0784fe1668_"
}
}
}
curl -v -X PUT https://sandbox.bluesnap.com/services/2/recurring/subscriptions/8491543 \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
"planId": 2283849,
"quantity": 2
}'
Response Example
{
"nextChargeDate": "2016-08-16",
"quantity": 1,
"charge": {
"amount": 100,
"vaultedShopperId": 21188909,
"chargeInfo": {
"fromDate": "2016-08-02",
"toDate": "2016-08-16",
"chargeType": "INITIAL"
},
"chargeId": 12117877,
"paymentSource": {"creditCardInfo": {"creditCard": {
"expirationYear": 2023,
"cardLastFourDigits": 1111,
"cardSubType": "CREDIT",
"cardType": "VISA",
"expirationMonth": "07"
}}},
"softDescriptor": "BLS*default_descriptor",
"planId": 2283845,
"currency": "USD",
"transactionDate": "2016-08-02",
"subscriptionId": 8492717,
"transactionId": 1012463333
},
"trialPeriodDays": 14,
"paymentSource": {"creditCardInfo": {
"billingContactInfo": {
"firstName": "John",
"lastName": "Doe"
},
"creditCard": {
"expirationYear": 2019,
"cardLastFourDigits": 1111,
"cardSubType": "CREDIT",
"cardCategory": "CLASSIC",
"cardType": "VISA",
"expirationMonth": "07"
}
}},
"softDescriptor": "BLS*default_descriptor",
"recurringChargeAmount": 29.99,
"chargeFrequency": "MONTHLY",
"vaultedShopperId": 21188909,
"payerInfo": {
"firstName": "John",
"lastName": "Doe"
},
"initialChargeAmount": 100,
"autoRenew": true,
"planId": 2283849,
"currency": "USD",
"subscriptionId": 8492717,
"fraudResultInfo": {"deviceDataCollector": "N"},
"status": "ACTIVE"
}
{
"subscriptionId":39598852,
"planId":2205010,
"vaultedShopperId":19641860,
"status":"ACTIVE",
"quantity":1,
"softDescriptor":"BLS*try",
"chargeFrequency":"MONTHLY",
"recurringChargeAmount":1.99,
"currency":"USD",
"autoRenew":true,
"nextChargeDate":"2019-02-28",
"payerInfo":{
"firstName":"PIFirstName",
"lastName":"PILastName",
"email":"[email protected]",
"country":"il",
"address":"PIaddress1",
"address2":"PIaddress2",
"city":"PICity",
"zip":"PIZip"
},
"paymentSource":{
"creditCardInfo":{
"billingContactInfo":{
"firstName":"HpfBiFirstName",
"lastName":"HpfBiLastName",
"address1":"HpfBiAddress1",
"city":"HpfBiCity",
"state":"MA",
"zip":"HpfBiZip",
"country":"us"
},
"creditCard":{
"cardLastFourDigits":"0005",
"cardType":"AMEX",
"cardCategory":"CORPORATE",
"binCategory":"COMMERCIAL",
"cardRegulated":"Y",
"issuingBank":"AMERICAN EXPRESS US (CARS)",
"expirationMonth":"11",
"expirationYear":"2024",
"issuingCountryCode":"US"
}
}
}
}
{
"nextChargeDate": "2016-08-16",
"quantity": 2,
"charge": {
"amount": 100,
"vaultedShopperId": 21188909,
"chargeInfo": {
"fromDate": "2016-08-02",
"toDate": "2016-08-16",
"chargeType": "INITIAL"
},
"chargeId": 12117877,
"paymentSource": {"creditCardInfo": {"creditCard": {
"expirationYear": 2019,
"cardLastFourDigits": 1111,
"cardSubType": "CREDIT",
"cardType": "VISA",
"expirationMonth": "07"
}}},
"softDescriptor": "BLS*default_descriptor",
"planId": 2283845,
"currency": "USD",
"transactionDate": "2016-08-02",
"subscriptionId": 8492717,
"transactionId": 1012463333
},
"trialPeriodDays": 14,
"paymentSource": {"creditCardInfo": {
"billingContactInfo": {
"firstName": "John",
"lastName": "Doe"
},
"creditCard": {
"expirationYear": 2023,
"cardLastFourDigits": 1111,
"cardSubType": "CREDIT",
"cardCategory": "CLASSIC",
"cardType": "VISA",
"expirationMonth": "07"
}
}},
"softDescriptor": "BLS*default_descriptor",
"recurringChargeAmount": 59.98,
"chargeFrequency": "MONTHLY",
"vaultedShopperId": 21188909,
"payerInfo": {
"firstName": "John",
"lastName": "Doe"
},
"initialChargeAmount": 100,
"autoRenew": true,
"planId": 2283849,
"currency": "USD",
"subscriptionId": 8492717,
"fraudResultInfo": {"deviceDataCollector": "N"},
"status": "ACTIVE"
}
Example Descriptions
To update any subscription setting, simply send the relevant field within the request. No other fields are required.
Back to Top
API Explorer
To test out a call, in the subscriptionId
field, enter the ID of an existing subscription (e.g. 8491543). In the Body Content field, paste in the JSON portion of the request and then click Try it!
Tip: Use the JSON code below as a starting point. You can enter different parameters to see how your test scenario would work. The request headers, including authorization, are already built in for you in this test area, so you should not include them here.
{"nextChargeDate": "2017-07-01"}