#B33fb0n3-promotion-code
1 messages ยท Page 1 of 1 (latest)
The Promotion Code is contained within the Discount object: https://stripe.com/docs/api/discounts/object#discount_object-promotion_code
So, you can just get the ID from there, or expand it if you need more than the ID from it
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
can I somehow use this id "di_estimated_1LAeJbI..." and pass it with the other promotionapiid to the order to apply both discounts?
You should be able to pass the Discount ID and/or the Coupon ID to add more discounts to an order: https://stripe.com/docs/api/orders_v2/update#update_order_v2-line_items-discounts.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
nah I can't. Look at this request please: req_1HUB7lmdX5zd7t
Ahhhh, I see okay
Are you able to add 2 promotion codes in your use-case instead of mixing coupons and promotion codes?
no. I just getting the order object and update the order object to proceed the checkout. So I can just work with what the order object me give's.
The best case that can happen is, when I get somehow the promocodeapiid. Cause if I add an promotion code I need to provide this. So if the customer enters the readable code for example "FORFREE" than I gonna fetch the promotioncodeapiid and pass it into the update order.
think I got it... give me a second to confirm this..
ok now I get the already added promocodeapiid. How can I add now both? I tried this: req_QnvfBrAobfXH3E
but it does not work?
Hello ๐
Taking over for two-shoes as they need to step away soon
Give me a moment to catch up and I'll respond as soon as I can
ah okii, sure.
Take your time ๐
thanks for waiting. As far as I know we only support one promotion code to be applied per order.
let me reconfirm that
ah I just asked that: #985780697467854850 message
Ah interesting! Let me take a look to see if we changed this recently
sure
Can you try passing in discounts as an array?
[promotion_code: 'AAAA'],
[promotion_code: 'BBB'],
[coupon: 'co_12'],
]```
sure, just a second...
not like this?
discounts: [
{promotion_code: 'AAAA'},
{promotion_code: 'BBB'},
{coupon: 'co_12'},
]
```?
Let's try both ๐ I haven't tested this personally
ur code is not executable with javascript ๐
lol yeah makes sense
Does your snippet work as an array of objects?
It worked like this: req_Awrxhu0xI8xui8
but it calculated the discount wrong I think ๐ค
one is with -20% and one with -10%
So -30%
1100 * 0,7 = 770. Stripe get 792
nice, atleast the code works ๐
Or do I calculate wrong?
yup ๐ I think it's going 20% of 1100 and then 10% of remaining amount