Invoices are listed out of numerical order for immediate subscription changes where a charge and a credit invoice are generated in the same second. This is by design, and you will see this same order in both the Recurly Admin Console and the List Invoices API return.
Here is the sequence of events that causes this:
-
When an immediate subscription change occurs, Recurly generates a charge and a credit invoice in the same second. The credit invoice will have a lower number, and the charge invoice will have a higher number.
-
This is done so that the credit can be applied to the charge as part of a single, atomic transaction.
-
Both the credit and charge invoices are held in a processing state. If the payment for the charge invoice fails, both invoices are rolled back and the subscription change does not take place.
-
Once the charge invoice is paid, it gets persisted first as part of applying the payment, and then the credit invoice is saved. This is why they appear out of numerical sequence.
Comments
0 comments
Please sign in to leave a comment.