Skip to content
Leadtime
English
Esc
navigateopen⌘Jpreview

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:

  1. First, retrieve available potential invoices using GET /billing/potential-invoices
  2. Review and customize the potential invoice details if needed (adjust billing periods, skip tasks, add manual positions)
  3. Create the invoice using this endpoint with the potential invoice ID
  4. 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

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/invoices
Authorization
AuthorizationOAuth2 access token · headerrequired
Scopes:api:write
or
AuthorizationBearer token (JWT) · headerrequired
Query parameters
fieldsToReturnstring
Comma-separated list of top-level response fields to return. Overrides the endpoint compact default unless responseShape=full is used.
responseShapestring
Advanced 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:compactfull
Header parameters
LT-Response-Shapestring
Advanced override. Set to full only when you need the complete endpoint response, including nested fields that are not selectable with fieldsToReturn.
Allowed:full
Request body
requiredapplication/json
Potential invoice identifier to create invoice from
potentialInvoiceIdstringrequired
Potential 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
idstringrequired
Unique identifier (UUID) of the created invoice
numberstringrequired
Invoice 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"
}'
Response
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "number": "ACME01-2510-001"
}