DRAFT for invoices you are not yet ready to collect on, or OPEN to immediately signal that payment is due. Retempo marks an invoice as PAID only after a confirmed settlement is recorded against it.
Request Body
The ID of the service this invoice belongs to.
The ID of the payment plan associated with this invoice. The plan must belong to the specified service.
The ID of the existing Retempo user being billed.
The amount to bill, as a decimal string (e.g.
"49.000000") or number. Must be a non-negative value.The currency for the invoice. Defaults to
USDC if omitted.The initial status of the invoice. Accepted values:
DRAFT, OPEN, VOID, EXPIRED. Defaults to DRAFT. You cannot set this to PAID on creation — doing so returns a 400 error.An ISO 8601 datetime string specifying when payment is due. If omitted, no due date is set.
The ID of a subscription to associate with this invoice. Optional — use when the invoice is tied to an ongoing subscription. The subscription must belong to the same service and user.
Response
A successful request returns HTTP201 Created with the new invoice object and all related records.
The newly created invoice with all related records included.
201 — Invoice created
Example Request
Error Codes
| Status | Message | Condition |
|---|---|---|
400 Bad Request | serviceId is required. | serviceId was omitted. |
400 Bad Request | paymentPlanId is required. | paymentPlanId was omitted. |
400 Bad Request | userId is required. | userId was omitted. |
400 Bad Request | amount is required. | amount was omitted. |
400 Bad Request | Invoices cannot be created as PAID without a real payment event. | status was set to PAID. |
400 Bad Request | status must be one of: DRAFT, OPEN, PAID, VOID, EXPIRED. | An unrecognized status value was provided. |
404 Not Found | Payment plan was not found for the service. | The plan does not exist or does not belong to the specified service. |
404 Not Found | Referenced database record was not found. | The userId was not found. |
404 Not Found | Subscription was not found for the service and user. | The subscriptionId does not belong to the specified service and user. |