Reorder manual positions in potential invoice
What does this do? Reorders the manual positions in a potential invoice. The positions will appear in the order specified by the items array.
When to use:
- To change the display order of manual positions on the invoice
- To group related positions together
- To organize positions in a logical sequence
How it works:
- Updates the sort order of manual positions stored in the potential invoice metadata
- Only custom manual positions (type: manual) can be reordered
- Project manual positions (from project snapshots) maintain their original order
- The items array should contain all position IDs in the desired order
- Positions not included in the array will be placed at the end
Position requirements:
- All position IDs in the items array must exist in the potential invoice
- Only custom manual positions can be reordered
- The array can include a subset of positions (others will be placed at the end)
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}/manual-positions/sortAuthorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:writeor
AuthorizationBearer token (JWT) · headerrequiredPath parameters
idstringrequiredPotential invoice ID in format: {type}::{projectId}::{dateFrom}::{dateTo}
Request body
requiredapplication/jsonitemsstring[][]requiredArray of manual position IDs in the desired sort order. Only custom manual positions (type: manual) can be reordered.
Responses
200Manual positions reordered 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 POST "https://leadtime.app/api/public/billing/potential-invoices/SingleProject%3A%3A0e9d033a-ab41-4212-8637-66c4e3b01fe2%3A%3A2025-10-01%3A%3A2025-10-31/manual-positions/sort" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"items": [
"550e8400-e29b-41d4-a716-446655440000",
"660e8400-e29b-41d4-a716-446655440001"
]
}'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/manual-positions/sort", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"items": [
"550e8400-e29b-41d4-a716-446655440000",
"660e8400-e29b-41d4-a716-446655440001"
]
})
});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/manual-positions/sort",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
json={
"items": [
"550e8400-e29b-41d4-a716-446655440000",
"660e8400-e29b-41d4-a716-446655440001"
]
},
)Response
{
"success": true
}Unauthorized - Invalid or missing authentication token
User lacks Invoices.manage permission or project access
Potential invoice not found