Change subscription quantity in potential invoice
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: {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.
/billing/potential-invoices/{id}/subscriptions/{itemId}/quantityAuthorizationOAuth2 access token · headerrequiredapi:writeAuthorizationBearer token (JWT) · headerrequiredidstringrequiredPotential invoice ID in format: {type}::{projectId}::{dateFrom}::{dateTo}
itemIdstring<uuid>requiredSubscription billing ID (billingId UUID) to change quantity for
application/jsonvaluenumber | nullQuantity value for the subscription billing row. For per-unit pricing subscriptions, this sets how many units to bill. Set to null or omit to clear a custom quantity and revert to default. Must be a non-negative integer if provided.
Subscription quantity updated successfully
successbooleanrequiredOperation success flag
Unauthorized - Invalid or missing authentication token
User lacks Invoices.manage permission or project access
Potential invoice or subscription billing not found