As the usage data starts flowing in, Togai creates an ongoing invoice for every customer attached to a pricing plan that has usage based components. The invoice gets generated once the billing cycle is completed.
Use this API to fetch an invoice. Here's what a sample request payload looks like :
curl --request GET \
--url https://api.togai.com/invoices/invoice_id \
--header 'accept: application/json'
Use this API to update the payment status of an invoice. Here's what a sample request payload looks like :
curl --request POST \
--url https://api.togai.com/invoices/invoice_id/payments \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"status":"PAID"}'
Through the integration with the payment gateway or accounting software, you can collect the invoice amount and mark the invoices as paid within Togai and complete the billing loop!