Billing Events
A billing has four statuses, and they change according to actions from the bills or the order.
Waiting payment
In the case of waiting_payment, it occurs when a billing is created and is awaiting the customer to pay the first installment.
Active
It happens when the first installment is paid or in cases of database import, they are already marked as active.
Finished
It occurs when all the bills in the billing are marked as paid.
Canceled
Is the only one where the action can come from either the order or the bill. In cases of cancellation without a refund, the order is canceled, and then we cancel the billing and the unpaid bills. In cases of cancellation with a refund, the billing is canceled after the payment refund is completed, check the cancelation_reason field for more details.