Update product line item quantity in subscription
Updates the quantity of a specific product line item within a subscription contract. This comprehensive operation handles quantity validation, discount recalculation, and special Build-a-Box constraints.
Full behavior, validation rules, and side effects
Key Features:
- Updates quantity for future orders only
- Validates minimum/maximum quantities for line items
- Special handling for Build-a-Box subscriptions
- Automatic discount recalculation
- Shipping price updates
- Activity log tracking with old/new values
Build-a-Box (BAB) Validation: For Build-a-Box subscriptions:
- Enforces total minimum/maximum item counts
- Only counts recurring products (excludes one-time and free items)
- Validates across all BAB items in the subscription
- Can be bypassed with ‘allowToAddProductQuantityMinMaxReached’ permission
Line Item Validation: Individual products may have:
- Minimum quantity requirements (min_quantity attribute)
- Maximum quantity limits (max_quantity attribute)
- These are enforced separately from BAB constraints
Post-Update Actions:
- Activity Logging: Records quantity change with old/new values
- BAB Discount Sync: Recalculates Build-a-Box volume discounts
- Product Discount Sync: Updates product-specific discounts
- Shipping Price Update: Recalculates shipping based on new quantity
Discount Recalculation:
- Build-a-Box discounts adjust based on total quantity tiers
- May remove old discount codes and apply new ones
- Handles ‘subscription contract has changed’ retry scenarios
Important Notes:
- Line ID must be the full GraphQL ID format
- Quantity must be positive (minimum 1)
- Changes apply to all future orders
- Past or in-progress orders are not affected
Authentication: Requires valid X-API-Key header
Documentation Index
Fetch the complete documentation index at: https://appstleinc-aeca3e0a.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Headers
API Key for authentication
Query Parameters
Subscription contract ID to update. Provide the numeric ID without the gid:// prefix
x >= 1API Key (Deprecated - Use X-API-Key header instead)
New quantity for the line item. Must be a positive integer
1 <= x <= 9999Line item ID to update. Must be the full GraphQL ID including the gid:// prefix
Response
Product line item quantity updated successfully
ACTIVE, PAUSED, CANCELLED, EXPIRED, FAILED, $UNKNOWN SUCCEEDED, FAILED, $UNKNOWN