Skip to main content
Invoices are the billing record in Retempo. Each invoice captures the amount a subscriber owes for a given billing period, links that amount to a specific service and payment plan, and tracks the settlement that eventually closes it out. When a settlement is confirmed onchain, Retempo automatically flips the invoice to PAID — you never need to mark it manually.
Invoices cannot be created with a status of PAID. An invoice is marked PAID only after a real settlement is confirmed onchain via Arc. Attempting to create an invoice with status: "PAID" will return an error.

Creating an invoice

To create an invoice, send a POST request to /api/v1/invoices. You must supply a serviceId, paymentPlanId, userId (the subscriber being billed), and an amount. The currency defaults to USDC if omitted, and status defaults to DRAFT. Use dueAt to set a payment deadline and subscriptionId to attach the invoice to an active subscription cycle.
A successful response returns the full invoice object along with embedded relations for the service, payment plan, user, settlements, subscription, and usage events:

Invoice statuses

An invoice moves through the following statuses during its lifetime:

Fetching invoice status

To check the current status of an invoice and see any settlements that have been applied, send a GET request with the invoice ID:
Pay attention to the settlements array in the response — each entry represents an onchain settlement attempt against this invoice. Once a settlement reaches CONFIRMED, the invoice status will be PAID.