Set task billed time
What does this do? Sets the billed time (hours) for a task in a potential invoice. The billed time is the amount of time that will be charged to the customer, which may differ from the actual time spent on the task.
When to use:
- To adjust the billed hours up or down from the actual time spent
- To bill the estimated time instead of actual time
- To correct billing amounts before finalizing the invoice
How it works:
- Updates the task’s billedTime field directly
- The billed time is used to calculate the total charge (billedTime × hourly rate)
- Can be set to any non-negative number
- Setting a different value than spent time will show a difference in the invoice details
Task requirements:
- Task must belong to the potential invoice’s project
- Task must not be already billed (billed: false)
- User must have access to the project
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
Permission requirements: Requires Invoices.manage permission and access to the project.
POST
/billing/potential-invoices/{id}/tasks/{taskId}/billed-timeAuthorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:writeor
AuthorizationBearer token (JWT) · headerrequiredPath parameters
idstringrequiredPotential invoice ID in format: {type}::{projectId}::{dateFrom}::{dateTo}
taskIdstring<uuid>requiredTask ID (UUID) to set billed time for
Request body
requiredapplication/jsonvaluenumberrequiredBilled time in hours. This is the amount of time that will be charged to the customer, which may differ from the actual time spent. Must be a non-negative number.
min 0
Responses
200Task billed time set successfully
successbooleanrequiredOperation success flag
401Unauthorized - Invalid or missing authentication token
403User lacks Invoices.manage permission or project access
404Potential invoice or task not found
Request
curl -X POST "https://leadtime.app/api/public/billing/potential-invoices/SingleProject%3A%3A0e9d033a-ab41-4212-8637-66c4e3b01fe2%3A%3A2025-10-01%3A%3A2025-10-31/tasks/550e8400-e29b-41d4-a716-446655440000/billed-time" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"value": 12.5
}'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/tasks/550e8400-e29b-41d4-a716-446655440000/billed-time", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"value": 12.5
})
});import requests
response = requests.post(
"https://leadtime.app/api/public/billing/potential-invoices/SingleProject%3A%3A0e9d033a-ab41-4212-8637-66c4e3b01fe2%3A%3A2025-10-01%3A%3A2025-10-31/tasks/550e8400-e29b-41d4-a716-446655440000/billed-time",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
json={
"value": 12.5
},
)Response
{
"success": true
}Unauthorized - Invalid or missing authentication token
User lacks Invoices.manage permission or project access
Potential invoice or task not found