#sandeep-kumar_best-practices
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1438505264901783633
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there!
with Basil/Clover, you can still get the invoice of a Charge, but it requires an extra API call to this endpoint: https://docs.stripe.com/api/invoice-payment/list
For charges with invoice=null which don't have any linked invoice, we use to skip them in our existing logic, but with basil/clover update we can't distinguish b/w charge with invoice and without invoice mapping.
If the charge has invoice=null, we can't fetch invoice_payments as we don't have invoice ID
if you use the endpoint I shared with a specific PaymentIntent ID (that you can find on the Charge object), then it will return the related Invoice (if there is one).
but we will endup making N+1 queries, and it could leads to slow sync for merchants with large dataset (with millions of invoices and charges)
agreed. another option would be for you to add metadata to PaymentIntent/Charges when you create the Invoice. This way you can more easily tell them appart.
Also are you sure we can fetch the invoice_payments with payment_intent_id. I can't see it in the parameter list. Also checked with CLI
As we are syncing historical data for our merchants, we can't add meta for existing data. ๐
here's where you can set the PaymentInent ID: https://docs.stripe.com/api/invoice-payment/list#list_invoice_payments-payment-payment_intent
As we are syncing historical data for our merchants, we can't add meta for existing data. ๐
the last option is to not use Basil/Clover when retrieving Charges, to get access to theinvoiceproperty.