#cloutfroggo
1 messages ยท Page 1 of 1 (latest)
I want to use the receipt number on the email sent to the customer, I am using the stripe checkout that sends the email for me.
I found the receipt_number on charge but can't find how to search for a charge using this field.
https://stripe.com/docs/api/charges/object#charge_object-receipt_number
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
if you're generating an Invoice after the checkout session then you can use the Search Invoice API with the receipt_number
https://stripe.com/docs/search#query-fields-for-invoices
When I search with the following code I get zero results. The receipt is in test mode and the code is using the test api key. I am not generating the invoices myself, stripe sends the receipt for me. Should I be generating them manually for this to work?
// id = "1517-7232";
let result = await stripe.invoices.search({
query: `receipt_number:"${id}"`,
});
would you mind sharing the checkout session ID?
cs_test_b15eJyRKwahniOpDZd9tZgMXu1QNBJEcNvIqkkE0Qg0PmJwyOwlzohiT3C
taking a look please bear with me
ok so first you need to enable this https://stripe.com/docs/receipts?payment-ui=checkout#paid-invoices
on your checkout session
Thank you, this works perfectly ๐