#charisma2761
1 messages ยท Page 1 of 1 (latest)
Hello ๐
Do you have an example checkout session ID handy where items were bought with 100% off code?
I have it but from test mode, is that okay?
yup thats fine
Here promo_1O4pG1HT8rqbhhjQC7f9bUlZ
that's the promo code, I meant the checkout sessions
That the id that is sent to the webhook when I use the 100% promo code
"id":"evt_1O2HhKHT8rqbhhjQ2bYqt26t",
"object":"event",
"api_version":"2022-08-01",
"created":1697566134,
"data":{
"object":{
"id":"promo_1O2HYyHT8rqbhhjQwAW4RHHD",
"object":"promotion_code",
"active":true,
"code":"Chris11",
"coupon":{
"id":"qVXGhGRA",
"object":"coupon",
"amount_off":null,
"created":1696515928,
"currency":null,
"duration":"forever",
"duration_in_months":null,
"livemode":false,
"max_redemptions":10,
"metadata":{
},
"name":"QA - All 100% Off No Min",
"percent_off":100,
"redeem_by":null,
"times_redeemed":4,
"valid":true
},
"created":1697565616,
"customer":null,
"expires_at":null,
"livemode":false,
"max_redemptions":null,
"metadata":{
},
"restrictions":{
"first_time_transaction":false,
"minimum_amount":null,
"minimum_amount_currency":null
},
"times_redeemed":1
},
"previous_attributes":{
"times_redeemed":0
}
},
"livemode":false,
"pending_webhooks":2,
"request":{
"id":"req_aJ8YdtVAix2dEq",
"idempotency_key":"e94bcd08-1557-4e10-9f5a-fbd1c45d19cb"
},
"type":"promotion_code.updated"
}```
This is the json sent to the webhook
but that's for promotion code update (when it gets redeemed I think)
What are you seeing when you use this endpoint?
https://stripe.com/docs/api/checkout/sessions/line_items
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
We were usually getting the checkout session id from the event (same structure as above) being event.data.object.id and then retrieve the line items from that session id, but its not same thing for no-cost orders
you're looking at the wrong event
you're looking at promotion_code.updated event
you should be looking at checkout.sessions.completed instead
Does that apply even when it is a no-cost order?
I mean, are no-cost orders treated as checkout sessions?
Ooh thank you, retrying and will let you know