#Max--
1 messages · Page 1 of 1 (latest)
Hi there, you need to expand the line_items (https://stripe.com/docs/api/checkout/sessions/object?lang=node#checkout_session_object-line_items) when retrieving the checkout session object
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
https://stripe.com/docs/api/expanding_objects?lang=node#expanding_objects this tells you how to expand a response
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Is it possible to get the discount code name?
Yes, you can get it from here https://stripe.com/docs/api/checkout/sessions/object?lang=node#checkout_session_object-total_details-breakdown, you need to expand it as well.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
It doesn't show the name:
total_details: {
amount_discount: 12900,
amount_shipping: 0,
amount_tax: 10555,
},
Is there a way to get the name of the discount code used?
Or maybe I should try with the metadata?
https://stripe.com/docs/api/checkout/sessions/object?lang=node#checkout_session_object-total_details-breakdown-discounts-discount did you see the discounts list?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
The discount object of the list contains the coupon https://stripe.com/docs/api/discounts/object?lang=node#discount_object-coupon
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 tried with: total_details.breakdown.discounts.discount
and total_details.breakdown.discounts
But it only shows me: total_details: {
amount_discount: 12900,
amount_shipping: 0,
amount_tax: 10555,
},
Should I retrieve the discount code separetely?
or should it work to get the discount code object through retrieving the checkout session?
What's your expand array look like?
{
"amount_discount": 12900,
"amount_shipping": 0,
"amount_tax": 10555
}
I mean what value do you specify in the expand param of your retrieval request?
I tried with:
- total_details.breakdown.discounts.discount
- total_details.breakdown.discounts
- total_details
But all of them show the same
It should be just total_details.breakdown
Can you share the request ID (req_xxx)? Here's how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Same results with total_details.breakdown
No, I don't see total_details.breakdown in your expand array,
the array has only customer, payment_intent and line_items
Here's the last one: req_KAS1LCn5uT5QTl
The request param looks OK to me. Stripe doesn't log GET response so I can't see what the response looks like
Do you see total_details.breakdown in the response?
I actually appear with "total_details.breakdown
". Sorry about it, I was just looking at the response but not the object