---
search:
  tags:
    - billing
    - POST
seo:
  description: >-
    What does this do? Sets a… Reference for the POST
    /billing/potential-invoices/{id}/subscriptions/{itemId}/quantity endpoint in
    the Leadtime Public API API.
sidebar:
  badge: POST
  label: Change subscription quantity in potential invoice
title: Change subscription quantity in potential invoice
type: openapi-operation
---
**What does this do?**
Sets a custom quantity for a subscription billing row in a potential invoice. For per-unit pricing subscriptions, this allows you to adjust how many units are billed, which may differ from the default quantity calculated by the system.

**When to use:**
- To adjust the quantity for per-unit pricing subscriptions before finalizing the invoice
- To bill a different number of units than the default calculated amount
- To correct billing quantities based on actual usage or customer agreements
- To clear a custom quantity and revert to the default calculated quantity

**How it works:**
- Updates the subscription quantity stored in the potential invoice metadata
- The quantity is used to calculate the total charge (quantity × unit price)
- Setting value to null or omitting it clears the custom quantity and reverts to default
- The quantity must be a non-negative integer
- Only affects the current potential invoice; does not modify the subscription billing configuration

**Subscription requirements:**
- Subscription billing ID (itemId) must exist in the potential invoice
- Use the billingId field from subscription billing rows
- Only per-unit pricing subscriptions (payment type: perUnit) typically use quantities
- Fixed monthly fees and one-time charges may not use quantities

**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-changequantity" />
