Back to All

Updating add-ons in a subscription using the API

I am trying to update the add-on counts in an existing subscription using the API.

I am using this API enpoint

PUT: https://public.billsby.com/api/v1/rest/core/{{companyDomain}}/subscriptions/{{subscriptionUniqueId}}/plan

and this payload:

{
"planChangeType": 1,
"planId": {{planId}},
"cycleId": {{cycleId}},
"addOns": [
{
"addOnId": {{addonId}},
"quantity": 12
}
],
"issueRefund": false
}

I get a 400 'Bad Request' response with this message:

{
"errorCode": "Subscription_Change_Subscription_Plan_Billing_Error",
"errorMessage": "Subscription_Not_Found"
}

I have double checked the subscriptionUniqueId is correct, and also tried using the subscriptionId instead, but still get the same error.

Some advice on updating add-on quantities via the API would be appreciated.

Thanks