#vartularena
1 messages ยท Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- vartularena, 41 minutes ago, 8 messages
can you share with me the CheckoutSession creation request and the PromoCode creation request?
@stiff bramble ^^
The promocode was created manually here: https://dashboard.stripe.com/test/coupons/yB1mHqAp
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
can you share the creation request, looks like req_123
I can't open your Dashboard link
and also pls share creation request of CheckoutSession
The checkout session request was this:
return await this._createSession(
data,
{
line_items: [
{
price: data.retrieveCardPriceId,
quantity: data.numCards
},
{
price_data: {
currency: 'usd',
product_data: {
name: 'Insurance fee'
},
unit_amount: data.insuranceFeeCents
},
quantity: 1
},
{
price_data: {
currency: 'usd',
product_data: {
name: 'Return shipping fee'
},
unit_amount: data.returnShippingFeeCents
},
quantity: 1
}
],
allow_promotion_codes: true
},
3 * 60 //3 minutes
)
I don't have the request body. This the code though, so these were the lineItems sent
sorry, the request ID, not the raw body of the request
https://dashboard.stripe.com/logs get it from here
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Got it. 2min I will create a new request and get that as there have been multiple requests since the original one
Here is the session reqid:
req_yFvBhD9j9cU695
These are all on dev, so look at the test logs
and the promo code / coupon creation??
The promo code is not created using the api. Which request amongst these do you want the id for?
The promocode was created using the UI
the Dashboard created promo code will also have a request ID! it also makes an API request ๐
Yeah I understand that. Got it you want me to look for the request when that promo code was created using the UI
Let me try to search for that
ah it was this? https://dashboard.stripe.com/logs/req_oW6eq4A5rGwj9m
oh sorry, my bad
This promocode was in dev.
forgot the filter I had was not for test mode
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
is yB1mHqAp right?
ok got it, my colleague helped me understand something
so the key part here is that you have the Coupon in https://dashboard.stripe.com/test/logs/req_lJavR4i1qpTedA only applying to Product prod_MHv7PDzt8BLVLZ
that's a problem because in your Checkout Session, you're creating one Price which is based on the Product above but for Insurance and Shipping , you're creating new Products inline using product_data so the Coupon / PromoCode will not apply to those.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
the fix here is:
1/ Create your Insurance and Shipping Price off a fixed Product
2/ Pass those 2 product IDs also in the Coupon creation in the applies_to.product array
Create your Insurance and Shipping Price off a fixed Product
The product will not have a fixed price though. Is that ok?
yes that is OK and test that out pls in test mode to validate
with stripe checkout you have to give a price id (for the product) - not the product id, right?
how can we set the price as a variable for a product, with stripe checkout? (the price of a product varies with each request)
@left turret can you confirm about the above? Because the way we are creating the request right now for checkout we only pass a price id
see this? in here you're passing product_data which "in line" creates a new Product.
you can pass a product: prod_123 instead, see https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data-product
Perfect, thanks. We l try that now and let you know.
๐