Update user plan if subscription starts from next billing cycle.

Shopify Partner
1 0 0

I am building a shopify app and user has option to change plan but i want ReplacementBehaviour : APPLY_ON_NEXT_BILLING_CYCLE as described here https://shopify.dev/docs/api/admin-graphql/2023-07/mutations/appSubscriptionCreate

My subscription is created and i receive the charge id. But when should i hit the charge API and update my database with user new plan. Earlier i was hitting CreateSubscription and then AppSubscription/${charge_id} and updating the plan in database immediately.

But now as subscription will be affected from next billing cycle so do i need to hit the charge API and how and when should i update user current plan in my database.

Replies 0 (0)