#Max--

1 messages · Page 1 of 1 (latest)

fast lynxBOT
sharp oracle
pastel beacon
#

Is it possible to get the discount code name?

sharp oracle
pastel beacon
#

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?

sharp oracle
pastel beacon
#

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?

sharp oracle
#

What's your expand array look like?

pastel beacon
#

{
"amount_discount": 12900,
"amount_shipping": 0,
"amount_tax": 10555
}

sharp oracle
#

I mean what value do you specify in the expand param of your retrieval request?

pastel beacon
#

I tried with:

  • total_details.breakdown.discounts.discount
  • total_details.breakdown.discounts
  • total_details

But all of them show the same

sharp oracle
#

It should be just total_details.breakdown

pastel beacon
#

Same results with total_details.breakdown

sharp oracle
#

No, I don't see total_details.breakdown in your expand array,

#

the array has only customer, payment_intent and line_items

pastel beacon
#

Here's the last one: req_KAS1LCn5uT5QTl

sharp oracle
#

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?

pastel beacon
#

I actually appear with "total_details.breakdown
". Sorry about it, I was just looking at the response but not the object