Subscription Proration with Discount Cancellation on Update

Subscription Proration with Discount Cancellation on Update

1 0 0

I have one app which includes Silver/Gold subscription with monthly and annually

if user is in annual plan, then the discount will applied to customer,

for example:

Planmonthlyannually(with discount)


there is one scenario:

If the user is in Silver-annually, and after 6 months using the Silver-annually, he wants to go to Gold-monthly, so the discount which was given to customer must be cancelled, and based on some unused months which he has, he can buy Gold monthly: so based on the following:

he paid 144$  for one year,

his discount must be cancelled( so the price will be 17$/monthly) because of new subscription (Gold-monthly):

for all first 6 months: 17 * 6 = 102, so now user will be credited 144-102 = 42$ based on our custom proration,

now based on 42$, he can register (42/49) * 30 = 25 days for Gold-monthly,


I wan to know, how I can handle it in my code? 

because in the I checked that we dont have update on subscription, so I need to cancel, and then I create the new subscription?


or instead of cancelling the subscription, I need to use the shopify contract create/update ( )?


if there is one example in code, I will be thankful,




Reply 1 (1)

Shopify Staff (Retired)
31 4 5

Hi @miladghale 


Are you referring to an AppSubscription or a SubscriptionContract? The provided links were for 2 different APIs.

To learn more visit the Shopify Help Center or the Community Blog.