#billymeetssloth-promotioncode
1 messages · Page 1 of 1 (latest)
So we meet again!
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
req_YLJ43fnjzKm2Fm
Yeah found it! Thanks
req_B0AQlpmAeCecwP is the req_id for the successful call to create the promotion code
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I think it suppose to be the ID of the promotion code
not the code value itself
oh really?
The ID of a promotion code to apply to this Session.
So you would want to pass in promo_1Jmr9mISszN5RTl1LDkFRrvl
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