#shaneCC-remove-promotion

1 messages · Page 1 of 1 (latest)

visual tiger
#

Good question. Will look in to this in a moment. How are you updating the subscription?

scenic silo
#

I run a subscriptions.update call to add the new price, then I run a subscriptionItems.del on the original sub item

wide wraith
#

Hello! So you mean the Promotion Code is still showing up in the discount property of the Subscription?

scenic silo
#

yep! active and discounting still

wide wraith
#

Meaning it's discounting a Product it's not configured to? Can you give me a Subscription ID where this is happening?

scenic silo
#

for sure!

#

Sub ID: sub_1JrmwrBCGMlcADBTyIMbdPot

Original Price ID (promo allowed)
price_1GuI5zBCGMlcADBTPmxo46na

New Price ID (promo not allowed)
price_1GuI5zBCGMlcADBTnkZPaSnb

wide wraith
#

Taking a look, hang on...

scenic silo
#

You will see a lot of events on this sub as well. I am using this sub to work out some bugs

#

You know... I am actually seeing that the next invoice is for the full price of the new product. So maybe it's not still in affect but still showing details about it

wide wraith
#

I'm seeing the discount still present, but the actual amount being taken off on the next Invoice is zero.

scenic silo
wide wraith
#

Yep.

scenic silo
#

haha!

#

ya ok cool

wide wraith
#

The discount is still on the Subscription, but it will only apply to the Products you set it to apply to. Removing a Price belonging to one of those Products doesn't remove the discount from the Subscription. That way the discount still works if you switch back to a Product where the discount applies.

scenic silo
#

ok I see

#

So the only issue for me is that because it doesn't drop from the sub, the webhook includes the discount line item still even tho that product is no longer in there. So our platform is showing incorrect information because it thinks that coupon is applied still

#

Do you have any suggestions for overcoming this?

wide wraith
#

Yes, but question: what behavior do you want? Do you want the discount to remain on the Subscription so it works if you switch back to a Product it applies to, or do you want to remove it from the Subscription entirely?

scenic silo
#

I would prefer it being removed entirely since the customer will be required to entire the coupon again anyways

wide wraith
#

I think you can remove it by updating the Subscription with promotion_code set to an empty string ('').

#

Will you try that and let me know if it works as expected?

scenic silo
#

yep!

#

one sec

#

That did it!