[BUG] Subscriptions with deleted products get inconsistent INSUFFICIENT_INVENTORY billing failures

[BUG] Subscriptions with deleted products get inconsistent INSUFFICIENT_INVENTORY billing failures

Brian_S
Shopify Partner
170 21 43

As of API version 2024-07 with the new behavior of failing billing attempts with the `INSUFFICIENT_INVENTORY` error code there's a pretty big bug: 

 

If you create a subscription contract with one line, then delete the variant on that line, then try to create a billing attempt the attempt fails with the `INSUFFICIENT_INVENTORY` error code. 

 

BUT if you create a subscription contract with two lines, then delete the variant from only one of those lines, then try to create a billing attempt it succeeds and an order is created with two lines (the deleted and non-deleted variant). 

 

This is very easy to replicate using the steps mentioned above.  Here are a couple subscription IDs and billing attempt IDs that you can view to see this issue:

 

Subscription with one line, who's variant has been deleted and the failed billing attempt with the `INSUFFICIENT_INVENTORY` error code:

gid://shopify/SubscriptionContract/23059956014

gid://shopify/SubscriptionBillingAttempt/48885793070

 

Subscription with two lines, one of which has a deleted variant (same as the first subscription's line) and one non-deleted variant and the successful billing attempt:

gid://shopify/SubscriptionContract/23059988782

gid://shopify/SubscriptionBillingAttempt/48885596462

 

 

This is a pretty big problem since the change in 2024-07 to respect inventory. It's causing a lot of billings to not go through. This didn't used to be a problem for deleted variants. And since the variant is deleted, there's no way for the merchant to increase the inventory. 

 

I'm really realllly hoping that the bug is that deleted variants shouldn't trigger this error because merchants very frequently delete variants even when they don't think they are deleting variants.  If a merchant creates a product but doesn't add options to the product and then sells it on subscriptions with the default variant (merchants don't even know that there is a default variant). Then if they add options even if they're only going to have a single variant that they want to add more context to, Shopify deletes the default variant which puts all the existing subscriptions in this situation where they'll never be able to bill again (unless the subscription has non-deleted products too). There are many situations like this where a merchant is deleting variants and not realizing it.. and merchants often delete variants without giving it much though even though they've sold subscriptions to it. 

 

I'm hoping somebody can identify this as a bug in the 2024-07 version and fix it quickly as its impacting all merchants on all subscription apps. 

 

Thanks in advance!

Brian Singer
CTO & Cofounder of Subscription Service - Awtomic
Replies 0 (0)