#sara-engineering_api
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/1288516743265914971
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
You cna use either here. Creating a refund does not create a new charge, it updates amount_refunded on the existing charge https://docs.stripe.com/api/charges/object#charge_object-amount_refunded
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Actually I am not seeing a way to see a refund on the invoice itself. You should be able to use either the PaymentIntent or Charge here
So I have to keep fetching to recalculate all the records just in case a refund happens?
If you are doing this by listing existing charges yes. The main alternative would be to keep a running tally on your side by listening to webhook events for successful charges and refunds
Which approach would you recommend?
What is the period after a payment where a refund on a charge can happen? Is there one?
That depends on payment method, I am having trouble finding info on that from our docs but if you reach out to our support team about the PMs you use they should be able to find more info. https://support.stripe.com/?contact=true
I think you are right that using charges is the way to go here. amount_captured - amount_refunded should give you the overall amount that the customer paid to you https://docs.stripe.com/api/charges/list#list_charges-customer
Okay perfect. Thank you. So I'll ask support if there is a limit.to when a charge can be updated. I don't want to keep fetching all charges, we have over 400k
If you are just looking for the number, we do have reports that you can run in your dashboard and I have a feeling at least one of them should be able to get this number for you. Unfortunately I am less familiar with our reports as well but support should know about those too
Are they available via api?
You can start report runs via the API though I am not sure what report type would be helpful to you here https://docs.stripe.com/api/reporting/report_run?lang=curl