Skip to content
Leadtime
English
Esc
navigateopen⌘Jpreview

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/sort
Authorization
AuthorizationOAuth2 access token · headerrequired
Scopes:api:write
or
AuthorizationBearer token (JWT) · headerrequired
Path parameters
idstringrequired
Potential invoice ID in format: {type}::{projectId}::{dateFrom}::{dateTo}
Request body
requiredapplication/json
itemsstring[][]required
Array of manual position IDs in the desired sort order. Only custom manual positions (type: manual) can be reordered.
Responses
200Manual positions reordered successfully
successbooleanrequired
Operation 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"
  ]
}'
Response
{
  "success": true
}