Create a new invoice
Creates a new invoice from a potential invoice. A potential invoice represents billable items (tasks, products, subscriptions, express quotations) that are ready to be invoiced.
How invoice creation works:
- First, retrieve available potential invoices using GET /billing/potential-invoices
- Review and customize the potential invoice details if needed (adjust billing periods, skip tasks, add manual positions)
- Create the invoice using this endpoint with the potential invoice ID
- The system automatically:
- Generates a sequential invoice number in the format:
{ORG}{PRJ}-{YY}{MM}-{NNN} - Calculates all amounts, taxes, and fees
- Marks tasks, subscriptions, and express quotations as billed
- Updates project billing status
- Handles interim payments
- Generates a sequential invoice number in the format:
What happens after creation:
- The invoice is created in status “New” (not yet sent)
- All billable items included in the invoice are marked as billed
- The invoice appears in the “New” invoices grid
- You can then send the invoice using the invoice sending endpoints
Potential Invoice ID Format:
The potentialInvoiceId follows the format: {type}::{projectId}::{dateFrom}::{dateTo}
- Type: One of Mixed, Subscription, TimeBased, ExpressQuotation, SingleProject, InterimPayment
- ProjectId: UUID of the project
- DateFrom/DateTo: Dates in YYYY-MM-DD format
Example:
SingleProject::0e9d033a-ab41-4212-8637-66c4e3b01fe2::2025-10-01::2025-10-31
What is returned:
- Invoice ID (UUID) - Use this to reference the invoice in other endpoints
- Invoice number - The official sequential invoice number for accounting
POST
/billing/invoicesAuthorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:writeor
AuthorizationBearer token (JWT) · headerrequiredQuery parameters
fieldsToReturnstringComma-separated list of top-level response fields to return. Overrides the endpoint compact default unless responseShape=full is used.
responseShapestringAdvanced override. Omit for the endpoint compact default. Use full only when you need the complete endpoint response, including nested fields that are not selectable with fieldsToReturn.
Allowed:
compactfullHeader parameters
LT-Response-ShapestringAdvanced override. Set to full only when you need the complete endpoint response, including nested fields that are not selectable with fieldsToReturn.
Allowed:
fullRequest body
requiredapplication/jsonPotential invoice identifier to create invoice from
potentialInvoiceIdstringrequiredPotential invoice identifier in the format: `{type}::{projectId}::{dateFrom}::{dateTo}`. The type can be one of: Mixed, Subscription, TimeBased, ExpressQuotation, SingleProject, InterimPayment. Dates must be in YYYY-MM-DD format. Example: `SingleProject::0e9d033a-ab41-4212-8637-66c4e3b01fe2::2025-10-01::2025-10-31`. To get available potential invoices, use the GET /billing/potential-invoices endpoint.
Responses
200Invoice created successfully
idstringrequiredUnique identifier (UUID) of the created invoice
numberstringrequiredInvoice number in the format: `{ORG}{PRJ}-{YY}{MM}-{NNN}`. This is the official sequential invoice number used for accounting and customer communication.
400Invalid potential invoice ID or validation errors
401Unauthorized - Invalid or missing authentication token
403Forbidden - Insufficient API scopes or permissions
Request
curl -X POST "https://leadtime.app/api/public/billing/invoices" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"potentialInvoiceId": "SingleProject::0e9d033a-ab41-4212-8637-66c4e3b01fe2::2025-10-01::2025-10-31"
}'const response = await fetch("https://leadtime.app/api/public/billing/invoices", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"potentialInvoiceId": "SingleProject::0e9d033a-ab41-4212-8637-66c4e3b01fe2::2025-10-01::2025-10-31"
})
});import requests
response = requests.post(
"https://leadtime.app/api/public/billing/invoices",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
json={
"potentialInvoiceId": "SingleProject::0e9d033a-ab41-4212-8637-66c4e3b01fe2::2025-10-01::2025-10-31"
},
)Response
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"number": "ACME01-2510-001"
}Invalid potential invoice ID or validation errors
Unauthorized - Invalid or missing authentication token
Forbidden - Insufficient API scopes or permissions