#amoomoo

1 messages · Page 1 of 1 (latest)

deep hingeBOT
rigid jay
#

i can add much more info if needed 🙂

surreal wasp
rigid jay
#

req_dri3JLnIoo35rj

#

do u see how "subscription_items" has a susbcription? And that price id is on a recurring price too.

#

i'm very confused cat_dizzy

surreal wasp
#

Ahhh, okay. I think what's happening is the Stripe API thinks you're applying the coupon to the Invoice, instead of the Subscription.

From our docs (https://stripe.com/docs/api/invoices/upcoming#upcoming_invoice-coupon) on the Upcoming Invoice API:

The code of the coupon to apply. If subscription or subscription_items is provided, the invoice returned will preview updating or creating a subscription with that coupon. Otherwise, it will preview applying that coupon to the customer for the next upcoming invoice from among the customer’s subscriptions. The invoice can be previewed without a coupon by passing this value as an empty string.

rigid jay
#

what's the object structure here to apply to the sub then?

surreal wasp
#

You applied a discount instead of a coupon which (also from our docs) means: "This only works for coupons directly applied to the invoice."

rigid jay
#

also, that makes total sense