Skip to content

Subscription Update Flows Triggered In Incorrect Order #146

@Santhosh-Hanabi

Description

@Santhosh-Hanabi
  • I am calling updateSubscription and updateSubscriptionItem method when the user upgrading subscription
  • Sometimes it is correctly triggered in correct order and proration charges calculated correctly
  • Sometimes Order will be incorrect
  • Assume i have Product A with Variant A and Variant B. I need to update my plan from variant A to variant B with some additional quantity. i passed variant B id and quantity and calling the methods in correct order.
    i will add my code below
  const updateSubscriptionPayload: UpdateSubscription = {
          invoiceImmediately: true,
          variantId: parseInt(variantId),
        };
  const { error } = await updateSubscription(
          subscriptionId,
          updateSubscriptionPayload,
        );
 const { error } = await updateSubscriptionItem(subscriptionItemId, {
          invoiceImmediately: true,
          quantity: quantity,
        });

  ,
  • But it updates variant A with quantity and later changed to variant B with one quantity

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions