Adds a new product line item to an existing subscription contract. Can add either recurring products that will appear in each order or one-time products that appear only in the next order.
Key Features:
Pricing Policy Application: The system applies discounts based on the store’s discount carry-forward setting:
One-Time Products:
Products added with isOneTimeProduct=true will:
Duplicate Product Handling: When adding a product that already exists in the subscription:
Price Calculation:
Authentication: Requires valid X-API-Key header
curl --request PUT \
--url https://subscription-admin.appstle.com/api/external/v2/subscription-contracts-add-line-item \
--header 'X-API-Key: <x-api-key>'{
"id": "gid://shopify/SubscriptionContract/123456789",
"status": "ACTIVE",
"nextBillingDate": "2024-03-01T00:00:00Z",
"customer": {
"id": "gid://shopify/Customer/987654321",
"email": "customer@example.com",
"firstName": "John",
"lastName": "Doe"
},
"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",
"currentPrice": {
"amount": "29.99",
"currencyCode": "USD"
},
"sellingPlanId": "gid://shopify/SellingPlan/123456",
"sellingPlanName": "Deliver every month"
}
},
{
"node": {
"id": "gid://shopify/SubscriptionLine/222222",
"quantity": 1,
"variantId": "gid://shopify/ProductVariant/98765432101",
"currentPrice": {
"amount": "19.99",
"currencyCode": "USD"
},
"customAttributes": [
{
"key": "_one_time_product",
"value": "true"
}
]
}
}
]
}
}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 product to. Provide the numeric ID without the gid:// prefix
^[0-9]+$API Key (Deprecated - Use X-API-Key header instead)
Quantity of product to add. Must be a positive integer
1 <= x <= 999Shopify variant ID of the product to add. Can be provided as numeric ID or with gid:// prefix
^([0-9]+|gid://shopify/ProductVariant/[0-9]+)$When true, product will only be included in the next order and automatically removed after fulfillment. When false, product will be included in all future orders until manually removed or subscription ends. One-time products are useful for samples, gifts, or limited-time additions
Product 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-item \
--header 'X-API-Key: <x-api-key>'{
"id": "gid://shopify/SubscriptionContract/123456789",
"status": "ACTIVE",
"nextBillingDate": "2024-03-01T00:00:00Z",
"customer": {
"id": "gid://shopify/Customer/987654321",
"email": "customer@example.com",
"firstName": "John",
"lastName": "Doe"
},
"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",
"currentPrice": {
"amount": "29.99",
"currencyCode": "USD"
},
"sellingPlanId": "gid://shopify/SellingPlan/123456",
"sellingPlanName": "Deliver every month"
}
},
{
"node": {
"id": "gid://shopify/SubscriptionLine/222222",
"quantity": 1,
"variantId": "gid://shopify/ProductVariant/98765432101",
"currentPrice": {
"amount": "19.99",
"currencyCode": "USD"
},
"customAttributes": [
{
"key": "_one_time_product",
"value": "true"
}
]
}
}
]
}
}