Does Shopify recalculate Functions discounts on recurring subscription orders?

Hello,

We recently received a request from a merchant who wanted to create a discount based on the number of orders a customer had placed. Customers who had placed at least a specific number of orders would receive a special discount.

The following was possible using the Shopify Functions API:

  • Creating a discount based on Customer.numberOfOrders
  • Setting appliesOnSubscription and recurringCycleLimit

However, it seems that when a recurring order comes in, the discount is not recalculated for the new order.

Example:

  • Merchant offers a discount to customers who have ordered at least twice
  • A customer who has ordered once places a subscription order
  • The merchant expects that, though the first payment wouldn’t be discounted (since the customer has not yet ordered twice), the recurring payments would be discounted.
  • What actually happens: Neither the first payment nor the recurring payments receives any discounts.

It seems that the discount is only calculated at the time of the first order.

This led to the merchant uninstalling, so we’re not sure whether they were able to find an alternative solution.

This leads to my questions:

  1. Can Shopify Functions discounts be recalculated automatically on recurring orders?
  2. If so, how can we enable this functionality?

Thanks,
Tobe

Hi Tobe,

Not currently - the mental model on this seems to be that a buyer agrees to the terms of the contract based on what they see in the first order, so whatever discounts they got on that first order which are marked as appliesOnSubscription should carry forward up to the recurringCycleLimit number of times.

A subscription app that wants to do what you’re describing would need to use subscriptionContractUpdate to modify the contract terms after each order. I’ll let the team know that they might want to update the docs about subscription contracts to make this clearer.

Cheers,
Jonathan

1 Like

Thank you for the clarification!