#billymeetssloth-promotioncode

1 messages · Page 1 of 1 (latest)

dawn yew
heavy flower
#

So we meet again!

dawn yew
#

thread here!

#

👋

heavy flower
#

lol

#

ok

#

so here is what i get, btw I LOVE that i can click a customer, click on logs and see the failures

#

so freaking useful for debugging

#

ok so, that call above, results in a 200

#

{
"id": "promo_1Jmr9mISszN5RTl1LDkFRrvl",
"object": "promotion_code",
"active": true,
"code": "PURCHASEONSIGNUP",
"coupon": {
"id": "purchase-on-sign-up",
"object": "coupon",
"amount_off": null,
"created": 1633209604,
"currency": null,
"duration": "forever",
"duration_in_months": null,
"livemode": false,
"max_redemptions": null,
"metadata": {
},
"name": "Purchase On Sign up",
"percent_off": 30,
"redeem_by": null,
"times_redeemed": 0,
"valid": true
},
"created": 1634783846,
"customer": "cus_KRkfihlYIOB4Yl",
"expires_at": 1634956646,
"livemode": false,
"max_redemptions": null,
"metadata": {
},
"restrictions": {
"first_time_transaction": false,
"minimum_amount": null,
"minimum_amount_currency": null
},
"times_redeemed": 0
}

#

code is "code": "PURCHASEONSIGNUP",

#

I imagine im doing something really really dumb

dawn yew
#

Let me TAL

#

take a look

#

can you give me the request id in text

#

nevermind

heavy flower
#

req_YLJ43fnjzKm2Fm

dawn yew
#

Yeah found it! Thanks

heavy flower
#

req_B0AQlpmAeCecwP is the req_id for the successful call to create the promotion code

dawn yew
#

I think it suppose to be the ID of the promotion code

#

not the code value itself

heavy flower
#

oh really?

dawn yew
#

The ID of a promotion code to apply to this Session.

#

So you would want to pass in promo_1Jmr9mISszN5RTl1LDkFRrvl

heavy flower
#

well that totally makes sense since the promotion is a composite key of the customer id and code

#

i was wondering how stripe knew that and figured you were doing it on the back end

#

ok, so then, since i only have the promotion code on the front end, i will probably need to query for it first

#

all good, i can do that

#

ok, let me go try writing that