Add multiple products to subscription
Adds multiple product line items to an existing subscription contract in a single request. This batch operation is more efficient than making multiple individual requests and ensures all products are added with consistent processing.
Key Features:
- Batch addition of multiple products in one API call
- All products are added as recurring items (not one-time)
- Automatic quantity defaulting (0 or null becomes 1)
- Sequential processing with full validation for each item
- Returns final subscription state after all additions
- Same pricing and discount logic as single-item endpoint
Processing Behavior:
- Products are added sequentially, not in parallel
- If any product fails, previous additions remain
- Each product goes through full validation
- Existing product handling follows store settings
- Activity logs created for each product added
Duplicate Product Handling: If a product already exists in the subscription:
- With ‘updateExistingQuantityOnAddProduct’ enabled: Updates quantity
- Without setting: Adds as new line item
- Setting applies to all products in the batch
Pricing and Discounts: Each product receives:
- Appropriate selling plan assignment
- Discount carry-forward based on store settings
- Currency and country-specific pricing
- Fulfillment frequency multiplier application
Build-a-Box Validation:
- Applied if any product has _bb_id attribute
- Validates total quantity after all additions
- May fail entire batch if limits exceeded
Post-Processing: After all products are added:
- Build-a-Box discounts recalculated once
- Product discounts synchronized
- Single email notification sent
- Shipping price updated once
Important Notes:
- Maximum recommended batch size: 10-20 products
- Larger batches may timeout
- All products become recurring items
- Use single-item endpoint for one-time products
Authentication: Requires valid X-API-Key header
Headers
API Key for authentication
Query Parameters
Subscription contract ID to add products to. Provide the numeric ID without the gid:// prefix
x >= 1API Key (Deprecated - Use X-API-Key header instead)
Body
Map of variant IDs to quantities. Keys are variant IDs (numeric only, no gid:// prefix), values are quantities to add. Null or 0 quantities default to 1.
The body is of type string.
Response
Products successfully added to subscription
SUCCEEDED, FAILED, $UNKNOWN ACTIVE, PAUSED, CANCELLED, EXPIRED, FAILED, $UNKNOWN