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:
Processing Behavior:
Duplicate Product Handling: If a product already exists in the subscription:
Pricing and Discounts: Each product receives:
Build-a-Box Validation:
Post-Processing: After all products are added:
Important Notes:
Authentication: Requires valid X-API-Key header
curl --request PUT \
--url https://subscription-admin.appstle.com/api/external/v2/subscription-contracts-add-line-items \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <x-api-key>' \
--data '
{
"42549172011164": 1,
"42549172043932": 2,
"42549172076700": 1
}
'{
"id": "gid://shopify/SubscriptionContract/123456789",
"status": "ACTIVE",
"nextBillingDate": "2024-04-01T12:00:00Z",
"customer": {
"id": "gid://shopify/Customer/987654321",
"email": "customer@example.com"
},
"billingPolicy": {
"interval": "MONTH",
"intervalCount": 1
},
"deliveryPolicy": {
"interval": "MONTH",
"intervalCount": 1
},
"lines": {
"edges": [
{
"node": {
"id": "gid://shopify/SubscriptionLine/111111",
"quantity": 2,
"variantId": "gid://shopify/ProductVariant/42549172011164",
"title": "Premium Coffee - Dark Roast",
"currentPrice": {
"amount": "59.98",
"currencyCode": "USD"
},
"sellingPlanId": "gid://shopify/SellingPlan/123456",
"sellingPlanName": "Deliver every month"
}
},
{
"node": {
"id": "gid://shopify/SubscriptionLine/222222",
"quantity": 1,
"variantId": "gid://shopify/ProductVariant/42549172043932",
"title": "Organic Tea - Green",
"currentPrice": {
"amount": "24.99",
"currencyCode": "USD"
},
"sellingPlanId": "gid://shopify/SellingPlan/123456",
"sellingPlanName": "Deliver every month"
}
},
{
"node": {
"id": "gid://shopify/SubscriptionLine/333333",
"quantity": 2,
"variantId": "gid://shopify/ProductVariant/42549172076700",
"title": "Coffee Filters - 100 pack",
"currentPrice": {
"amount": "19.98",
"currencyCode": "USD"
},
"sellingPlanId": "gid://shopify/SellingPlan/123456",
"sellingPlanName": "Deliver every month"
}
}
]
},
"discounts": {
"edges": [
{
"node": {
"id": "gid://shopify/SubscriptionManualDiscount/444444",
"title": "BUILD_A_BOX_DISCOUNT_ABC123",
"targetType": "ALL_LINES",
"value": {
"percentage": 20
}
}
}
]
}
}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.
API Key for authentication
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)
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.
Products successfully added to subscription
ACTIVE, PAUSED, CANCELLED, EXPIRED, FAILED, $UNKNOWN Show child attributes
SUCCEEDED, FAILED, $UNKNOWN Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
curl --request PUT \
--url https://subscription-admin.appstle.com/api/external/v2/subscription-contracts-add-line-items \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <x-api-key>' \
--data '
{
"42549172011164": 1,
"42549172043932": 2,
"42549172076700": 1
}
'{
"id": "gid://shopify/SubscriptionContract/123456789",
"status": "ACTIVE",
"nextBillingDate": "2024-04-01T12:00:00Z",
"customer": {
"id": "gid://shopify/Customer/987654321",
"email": "customer@example.com"
},
"billingPolicy": {
"interval": "MONTH",
"intervalCount": 1
},
"deliveryPolicy": {
"interval": "MONTH",
"intervalCount": 1
},
"lines": {
"edges": [
{
"node": {
"id": "gid://shopify/SubscriptionLine/111111",
"quantity": 2,
"variantId": "gid://shopify/ProductVariant/42549172011164",
"title": "Premium Coffee - Dark Roast",
"currentPrice": {
"amount": "59.98",
"currencyCode": "USD"
},
"sellingPlanId": "gid://shopify/SellingPlan/123456",
"sellingPlanName": "Deliver every month"
}
},
{
"node": {
"id": "gid://shopify/SubscriptionLine/222222",
"quantity": 1,
"variantId": "gid://shopify/ProductVariant/42549172043932",
"title": "Organic Tea - Green",
"currentPrice": {
"amount": "24.99",
"currencyCode": "USD"
},
"sellingPlanId": "gid://shopify/SellingPlan/123456",
"sellingPlanName": "Deliver every month"
}
},
{
"node": {
"id": "gid://shopify/SubscriptionLine/333333",
"quantity": 2,
"variantId": "gid://shopify/ProductVariant/42549172076700",
"title": "Coffee Filters - 100 pack",
"currentPrice": {
"amount": "19.98",
"currencyCode": "USD"
},
"sellingPlanId": "gid://shopify/SellingPlan/123456",
"sellingPlanName": "Deliver every month"
}
}
]
},
"discounts": {
"edges": [
{
"node": {
"id": "gid://shopify/SubscriptionManualDiscount/444444",
"title": "BUILD_A_BOX_DISCOUNT_ABC123",
"targetType": "ALL_LINES",
"value": {
"percentage": 20
}
}
}
]
}
}