#ulrikeskygate
1 messages · Page 1 of 1 (latest)
Hi
Could you please share an Invoice Id ?
But, you need to make another API call
Is there a more elegant way than calling the products API for each one?
Did you tried the invoiceitem API and expanding price.product field ?
This API in particular
That would also need a second API call.
I'm currently calling the invoices API to create a list for the user in our frontend. I was hoping I could retreive all the needed information in one fell swoop. If need be I can make a second call and maybe cache the result somewhere on our end.
The lines list items do have a metadata property. Since it seems to not be the product's metadata, is there a way to provide values for this property during creation of the checkout session's line items?
That would also need a second API call.
Yes you need to make another API call for this usecase
The lines list items do have a metadata property. Since it seems to not be the products metadata, is there a way to provide values for this property during creation of the checkout session's line items?
You can add invoice metadata when creating a Checkout:
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-invoice_creation-invoice_data-metadata
I'm aware, and I added other metadata there. I could add a list of product metadata here, but it seems a bit hacky. How do I get data into this array during the CheckoutSession creation:
I assume, since we use the hosted Checkout currently and payment should be instant without an amount due, changing the invoices after the fact to add metadata will be blocked, no?
I think I'll just add the second API call. Should be fine. Stripe does not charge for API calls other than the Tax calculation API, right?
I assume, since we use the hosted Checkout currently and payment should be instant without an amount due, changing the invoices after the fact to add metadata will be blocked, no?
I think you can still update the metadata of each invoiceItems, I inivte you to do a quick test
https://stripe.com/docs/api/invoiceitems/update#update_invoiceitem-metadata
I think I'll just add the second API call. Should be fine. Stripe does not charge for API calls other than the Tax calculation API, right?
No, there'll be no cost for API calls
That would be nice. I'll test and post the results here a little later. Thank you for your help! 🙂