#geoffdgeorge-2-coupons

1 messages · Page 1 of 1 (latest)

misty heraldBOT
subtle plaza
#

Can you give the 2 example API requests used to redeem the promo code twice?

#

geoffdgeorge-2-coupons

light trout
#

req_YKGxGE5KlhrcoJ
req_O989HyvplRKS9M

subtle plaza
#

These are requests that use 2 different Customers and 2 different Subscriptions

light trout
#

Yes, it's two different subscriptions that were discounted using the same promotion code. The user is the same. They just created two accounts with two different emails.

But if a promotion code is set for 0/1 redemptions, why was this person able to finalize invoices for the discounted amount for two separate subscriptions?

#

For both, code AQSWM4UX was used to get the discount tied to the mktg_student coupon.

subtle plaza
#

I think that's because both the Subscriptions are trialing and the Coupon hasn't technically been used yet. I would expect that the coupon would apply to whichever Subscription is done trialing first.

light trout
#

Both have completed trialing, though. The trials for both ended and their invoices were finalized on Jan. 29.

subtle plaza
#

Ah, apologies, I got my views mixed up. Let me dig a bit more

amber owl
#

Hello! I'm taking over and catching up...

#

As mentioned above the requests you provided are for two different Customers and two different Subscriptions, and your discount is configured to allow for two distinct Customers with separate Subscriptions to use this code.

light trout
#

The coupon for the discount does not have maximum redemptions, but each promotion code tied to the coupon is set with a maximum redemption of 1.

#

The requests are for two different customers and two different subscriptions that were able to use the same promotion code with a maximum redemption of 1.

amber owl
#

Let me take a closer look, hang on...

#

I'm not sure I understand what you mean. In req_YKGxGE5KlhrcoJ you set coupon to a Coupon with no max_redemptions (as you said) and that created the discount. There is no Promotion Code involved here, so I'm not sure how the maximum redemption on a Promotion Code that wasn't used applies?

light trout
#

I see now that the promotion code isn't being submitted in the phases portion of the subscription schedule POST call, but I also don't see a place for it to be submitted. Is there a way to apply a single-use promotion code to the posting of a new subscription schedule?

amber owl
#

Promotion Codes are designed to be customer-facing, they're not something you apply in the API. They're something your customer would type into Stripe Checkout, for example.

light trout
#

Fair, but they do have a redemption maximum you can set, so I'm trying to figure out if there's a way to prevent a user from using the same promotion code twice. Say, during a trial period, as in the example.

amber owl
#

Not without using actual customer-facing Promotion Codes or handling that logic on your side, no.

light trout
#

So to go further, they are customer-facing promotion codes. The user gets a promotion code from the outset and goes through the flow with that promotion code as a parameter, or if it's not set as a parameter, they type it in at a certain point in the flow to see the discounted price. But that promotion code is not redeemed when that happens. When and how is a promotion code redeemed?

#

Essentially, we have to make a call to update the promotion code ourselves, you're saying, to update its active status.

#

Or maybe we don't want to update active status. Looking at the docs here.

amber owl
#

Those are Stripe's user-facing Promotion Codes for use in payment flows like Stripe Checkout.

#

As far as I can tell you are not using those at all.

#

Specifically you're using a Coupon without max_redemptions set, your code is telling us to apply the Coupon, so that's what we're doing.

light trout
#

Yes, I'm looking at both. We have created single-use promotion codes for the coupon we're looking at in this example, but what I'm learning from this conversation is that, at the moment, virtually all those promotion codes are doing for us is returning the discounted price. The promotion code is submitted, a look-up is made on our back end for the affiliated coupon, and a discount is applied.

If our offer codes do indeed have single-use redemptions on them, though, which I see in the Stripe UI they do (they're listed within the specific coupon UI as promotion codes with 0/1 redemptions), I'm trying to go about determining how we can ensure those codes do get redeemed when they're used.

amber owl
#

I don't think you can because it doesn't sound like you're using a surface that allows Promotion Codes to be used. Are you using the Payment Element? Something else?

light trout
#

The payment element, yes.

amber owl
#

Yeah, the Payment Element is not compatible with Promotion Codes, so you can't really use them at all.