#riptired
1 messages · Page 1 of 1 (latest)
Hi, can you reword this please? You want to share a promo code that has $0 discount?
Yeah
I want to build a promo code that applies to a customers second order
so I want to allow them to enter a code that applies a 0% discount to their first order (or some kind of referral code) so that i can send them the actual promo code for their second order
i.e. Customer hears about product in youtube video. Youtube video has a promo code "VIDEO10" for $10 off your second order of $50 or more. Now when a customer makes their first order, they should enter code VIDEO10 to be eligible for the promo. VIDEO10 gives the customer no discount on the first order but makes them eligible for a promo on their second order
I see, I do not think that is possible to create a coupon with $0, https://stripe.com/docs/api/coupons/create as it expected a positive integer. As a work around, given that you use Stripe Checkout, you can use custom fields: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-custom_fields. Here, they can pass in the code and you can look at that to create the coupon for the second order.
Happy to help!
Just to be sure
this custom field data will also show up in the checkout session completed event right
I believe so, let me test this
Just confirmed, I do see the following on my checkout.session.completed event.
"custom_fields": []
Sure!
can you provide an example of how to use the customFields type in js?
I do not understand the question, when you create the Checkout Session, you'd pass this array of hashes: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-custom_fields
Yeah i am doing that but it doesn't show up in my checkout session
this is what my array of hashes looks like
custom_fields: [{
key: 'company',
label : {type : 'custom', custom: 'company name'},
type: 'text'
}],
can you share your request id with me please?
I just copy pasted your code to my environment and it's working fine:
I changed the key
Copy/ paste of the code you shared
@timber axle if you share your request id, I can further look
yeah, testing
Great!
Figured it out