#loic_87
1 messages ยท Page 1 of 1 (latest)
I dont find any way to get back the information (webhook or api call ) .
What information specifically? What are you trying to do?
hello ! thanks for helping !
I want to know wish product is associated to my coupon ... impossible
Webhook or api call
the only solution is to use metadata... but if we forgot to add this metadata in any moment... it block my workflow in front
What do you mean by 'association'? The product restriction?
They're in the applies_to field on the Coupon: https://stripe.com/docs/api/coupons/object#coupon_object-applies_to
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
But it's not included in the response by default, you need to 'expand' that field: https://stripe.com/docs/api/expanding_objects
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
thank you i read all you answer & doc
ok , but by defaut, if i create from stripe, the expand wont be possible right ? and the information of the applies_to also ?
Yes any 'expandable' fields', like applies_to, are not included in API responses or event payloads by default
They're all flagged as such on the API reference
You can pass expand parameter in your creation request and the creation response will include the field
There was an issue setting up your call.
Raw response for the API
Status code 400
{
"error": {
"message": "This property cannot be expanded (applies_to.products).",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_cOYbsWjjT4anBK?t=1704890735",
"type": "invalid_request_error"
}
}
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
OK ! yes !
find out !
thanks you so much
Just: expand: 'applies_to'
yes thanks you so much understood ! ๐ save my day / week / month / year ๐