---
search:
  tags:
    - billing
    - POST
seo:
  description: >-
    What does this do? Reorders the… Reference for the POST
    /billing/potential-invoices/{id}/subscriptions/sort endpoint in the Leadtime
    Public API API.
sidebar:
  badge: POST
  label: Reorder subscriptions in potential invoice
title: Reorder subscriptions in potential invoice
type: openapi-operation
---
**What does this do?**
Reorders the subscription billing rows in a potential invoice. The subscriptions will appear on the invoice in the order specified by the items array.

**When to use:**
- To change the display order of subscription billing rows on the invoice
- To group related subscriptions together
- To organize subscriptions in a logical sequence (e.g., by priority or billing type)

**How it works:**
- Updates the sort order of subscription billing rows stored in the potential invoice metadata
- The items array should contain all subscription billing IDs (billingId) in the desired order
- Subscriptions not included in the array will maintain their original order
- The order affects how subscriptions appear on the final invoice document

**Subscription requirements:**
- All subscription billing IDs in the items array must exist in the potential invoice
- Use the billingId field from subscription billing rows (not the id field)
- The array can include a subset of subscriptions (others will maintain their order)

**Invoice ID Format:**
The invoice ID follows the format: &#123;type&#125;::&#123;projectId&#125;::&#123;dateFrom&#125;::&#123;dateTo&#125;
- Example: SingleProject::0e9d033a-ab41-4212-8637-66c4e3b01fe2::2025-10-01::2025-10-31

**Permission requirements:**
Requires Invoices.manage permission and access to the project.

<Operation source="api-reference" id="potentialinvoicescontroller-savesubscriptionsort" />
