#sytzew-creditnotes
1 messages · Page 1 of 1 (latest)
Hi there!
When listing credit notes we don't ofter many option to filter the results: https://stripe.com/docs/api/credit_notes/list
As you can see there's no created. You could use starting_after, but note that this isn't a timestamp, but an object ID. This is usually used for paginating results.
One option is to list all credit notes for a specific customer, and then do the filtering on the creation date on your end.
Hmm yeah, using the 'starting_after' will only give me the results after that specific credit?
There's also no way to change the sort order (asc/desc) right?
Hmm yeah, using the 'starting_after' will only give me the results after that specific credit?
Yes you pass a credit note ID, and it will return the credit notes that are listed after that specific credit note. Like I said this is mainly used for pagination.
There's also no way to change the sort order (asc/desc) right?
Unfortunately no.
What exactly are you trying to retreive?
We're basically a middlemen that take data from platforms like Stripe and sync it to a ERP software. The idea being that we syncronise all the credits notes from the customer, but obviously don't want to constantly get the entire list of credit notes, only the ones we have not already synced to the ERP software.
But this is a Stripe account basis, not per customer.
For other stuff like invoices you therefore pass the created filter to only get the stuff we don't already have, based on the created date we have saved.
You could listen to the webhook event credit_note.created to be notified every time a new created note is created https://stripe.com/docs/api/events/types#event_types-credit_note.created
That could work, I'll look into it. Thanks for the help Soma!
Note that there are also the events credit_note.updated and credit_note.voided if you want to keep track of everything.