Update potential invoice settings
What can be updated: This endpoint allows partial updates to potential invoice settings. Only the fields you provide in the request body will be updated; all other fields remain unchanged. This means you can update just one field, multiple fields, or all fields in a single request.
Updatable fields:
- billedFrom: Billed from date (ISO 8601 date string). Sets the start date for the billing period that will appear on the final invoice document. This can differ from the actual service period (periodFrom) if you want to show a different date range on the invoice.
- billedTo: Billed to date (ISO 8601 date string). Sets the end date for the billing period that will appear on the final invoice document. This can differ from the actual service period (periodTo) if you want to show a different date range on the invoice.
- contactId: Contact ID (organization member UUID). Sets the invoice recipient who will receive the invoice when it is sent via email. Set to null to clear the contact and remove the recipient assignment.
How partial updates work:
- If you only provide billedFrom, only that field will be updated
- If you only provide contactId, only that field will be updated
- You can provide any combination of the three fields
- Fields you omit will remain unchanged
Invoice ID Format: The invoice ID follows the format: {type}::{projectId}::{dateFrom}::{dateTo}
- Example: SingleProject::0e9d033a-ab41-4212-8637-66c4e3b01fe2::2025-10-01::2025-10-31
Date format: Dates can be provided in ISO 8601 format:
- Date-only: “2025-10-01” (recommended)
- ISO timestamp: “2025-10-01T00:00.000Z”
Contact validation: When setting a contactId, the system validates that:
- The contact exists and is active
- The contact belongs to the project customer organization
- If the contact is invalid, a NotFoundException is returned
Permission requirements: Requires Invoices.manage permission and access to the project to update potential invoice settings.
PATCH
/billing/potential-invoices/{id}Authorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:writeor
AuthorizationBearer token (JWT) · headerrequiredPath parameters
idstringrequiredPotential invoice ID in format: {type}::{projectId}::{dateFrom}::{dateTo}
Request body
requiredapplication/jsonbilledFromstring<date>Billed from date (ISO 8601 date string, YYYY-MM-DD format). If provided, updates the start date that will appear on the final invoice document. This can differ from the actual service period start date (periodFrom). Omit this field to leave unchanged. Accepts date-only format (e.g., "2025-10-01") or ISO timestamp.
billedTostring<date>Billed to date (ISO 8601 date string, YYYY-MM-DD format). If provided, updates the end date that will appear on the final invoice document. This can differ from the actual service period end date (periodTo). Omit this field to leave unchanged. Accepts date-only format (e.g., "2025-10-31") or ISO timestamp.
contactIdobject | nullContact ID (organization member UUID) who will receive the invoice when it is sent via email. If provided, updates the invoice recipient. Set to null to clear the contact and remove the recipient assignment. Omit this field to leave unchanged. The contact must belong to the project customer organization (validated automatically).
Responses
200Potential invoice updated successfully
successbooleanrequiredOperation success flag
401Unauthorized - Invalid or missing authentication token
403User lacks Invoices.manage permission or project access
404Potential invoice not found
Request
curl -X PATCH "https://leadtime.app/api/public/billing/potential-invoices/SingleProject%3A%3A0e9d033a-ab41-4212-8637-66c4e3b01fe2%3A%3A2025-10-01%3A%3A2025-10-31" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"billedFrom": "2025-10-01",
"billedTo": "2025-10-31",
"contactId": "550e8400-e29b-41d4-a716-446655440000"
}'const response = await fetch("https://leadtime.app/api/public/billing/potential-invoices/SingleProject%3A%3A0e9d033a-ab41-4212-8637-66c4e3b01fe2%3A%3A2025-10-01%3A%3A2025-10-31", {
method: "PATCH",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"billedFrom": "2025-10-01",
"billedTo": "2025-10-31",
"contactId": "550e8400-e29b-41d4-a716-446655440000"
})
});import requests
response = requests.patch(
"https://leadtime.app/api/public/billing/potential-invoices/SingleProject%3A%3A0e9d033a-ab41-4212-8637-66c4e3b01fe2%3A%3A2025-10-01%3A%3A2025-10-31",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
json={
"billedFrom": "2025-10-01",
"billedTo": "2025-10-31",
"contactId": "550e8400-e29b-41d4-a716-446655440000"
},
)Response
{
"success": true
}Unauthorized - Invalid or missing authentication token
User lacks Invoices.manage permission or project access
Potential invoice not found