curl --request POST \
--url https://subscription-admin.appstle.com/api/external/v2/subscription-contract-details/create-subscription-contract \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <x-api-key>' \
--data '
{
"customerId": "987654321",
"status": "ACTIVE",
"nextBillingDate": "2024-02-01T00:00:00Z",
"billingIntervalType": "MONTH",
"billingIntervalCount": 1,
"deliveryAddress1": "123 Main St",
"deliveryCity": "New York",
"deliveryCountryCode": "US",
"lines": [
{
"quantity": 2,
"variantId": "42549172011164",
"productId": "7234567890123",
"sellingPlanId": "gid://shopify/SellingPlan/123456",
"currentPrice": 25.99,
"unitPrice": 29.99,
"customAttributes": [
{
"key": "engraving",
"value": "Happy Birthday"
}
],
"linePricingPolicy": "SELLING_PLAN_PRICING_POLICY",
"pricingPolicy": [
{
"afterCycle": 3,
"discountType": "PERCENTAGE",
"value": 10,
"freeVariantId": 42549172011164,
"freeProductHandle": "free-gift-product",
"repeatingCycle": true,
"repeatingNumberOfCycle": 6,
"preventDuplicationFreeProduct": true
}
]
}
]
}
'{
"id": "gid://shopify/SubscriptionContract/123456789",
"status": "ACTIVE",
"nextBillingDate": "2024-02-01T00:00:00Z",
"billingPolicy": {
"interval": "MONTH",
"intervalCount": 1,
"minCycles": 3,
"maxCycles": 12
},
"deliveryPolicy": {
"interval": "MONTH",
"intervalCount": 1
},
"customer": {
"id": "gid://shopify/Customer/987654321",
"email": "customer@example.com",
"firstName": "John",
"lastName": "Doe"
},
"deliveryPrice": {
"amount": "5.99",
"currencyCode": "USD"
},
"lines": {
"edges": [
{
"node": {
"id": "gid://shopify/SubscriptionLine/111111",
"quantity": 2,
"variantId": "gid://shopify/ProductVariant/42549172011164",
"currentPrice": {
"amount": "25.99",
"currencyCode": "USD"
},
"pricingPolicy": {
"basePrice": {
"amount": "29.99",
"currencyCode": "USD"
}
}
}
}
]
}
}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
API Key (Deprecated)
Request object for creating a new subscription contract
Shopify customer ID (numeric ID without gid prefix)
"987654321"
Initial status of the subscription contract
ACTIVE, PAUSED, CANCELLED, EXPIRED, FAILED, $UNKNOWN, ACTIVE, PAUSED, CANCELLED, EXPIRED, FAILED "ACTIVE"
Date when the next billing/order will occur
"2024-02-01T00:00:00Z"
Billing frequency interval type
DAY, WEEK, MONTH, YEAR, $UNKNOWN, DAY, WEEK, MONTH, YEAR "MONTH"
Number of intervals between billings
x >= 11
Delivery address line 1
"123 Main St"
Delivery address city
"New York"
Delivery address country code (ISO 3166-1 alpha-2)
"US"
Product line items to include in the subscription
Show child attributes
Customer payment method ID. If not provided, the default payment method will be used. Can be null if createWithoutPaymentMethod is true.
"gid://shopify/CustomerPaymentMethod/abc123"
If true, creates subscription without payment method. Status will be set to PAUSED unless skipPaymentCreateUnpaidOrder is also true.
false
If true, billing attempts on this contract will create unpaid orders instead of failing when no payment method is present. Requires createWithoutPaymentMethod=true. Contract will be created as ACTIVE (not PAUSED) so billing can proceed.
false
Maximum number of billing cycles. Null for unlimited
x >= 112
Minimum number of billing cycles required before cancellation is allowed
x >= 13
Delivery frequency interval type. If not specified, uses billing interval
DAY, WEEK, MONTH, YEAR, $UNKNOWN, DAY, WEEK, MONTH, YEAR "MONTH"
Number of intervals between deliveries. If not specified, uses billing interval count
x >= 11
Delivery address first name
"John"
Delivery address last name
"Doe"
Delivery address line 2
"Apt 4B"
Delivery address province/state code (ISO 3166-2)
"NY"
Delivery address postal/zip code
"10001"
Delivery phone number
"+1234567890"
Fixed delivery price amount in store currency
5.99
Currency code for the subscription (ISO 4217). If not provided, uses store default currency
"USD"
Allow customer to change delivery address in customer portal
false
Allow delivery price to be overridden
false
Custom attributes to attach to the subscription contract
Show child attributes
[
{
"key": "subscription_type",
"value": "premium"
},
{
"key": "gift_message",
"value": "Happy Birthday!"
}
]Subscription contract successfully created
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 POST \
--url https://subscription-admin.appstle.com/api/external/v2/subscription-contract-details/create-subscription-contract \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <x-api-key>' \
--data '
{
"customerId": "987654321",
"status": "ACTIVE",
"nextBillingDate": "2024-02-01T00:00:00Z",
"billingIntervalType": "MONTH",
"billingIntervalCount": 1,
"deliveryAddress1": "123 Main St",
"deliveryCity": "New York",
"deliveryCountryCode": "US",
"lines": [
{
"quantity": 2,
"variantId": "42549172011164",
"productId": "7234567890123",
"sellingPlanId": "gid://shopify/SellingPlan/123456",
"currentPrice": 25.99,
"unitPrice": 29.99,
"customAttributes": [
{
"key": "engraving",
"value": "Happy Birthday"
}
],
"linePricingPolicy": "SELLING_PLAN_PRICING_POLICY",
"pricingPolicy": [
{
"afterCycle": 3,
"discountType": "PERCENTAGE",
"value": 10,
"freeVariantId": 42549172011164,
"freeProductHandle": "free-gift-product",
"repeatingCycle": true,
"repeatingNumberOfCycle": 6,
"preventDuplicationFreeProduct": true
}
]
}
]
}
'{
"id": "gid://shopify/SubscriptionContract/123456789",
"status": "ACTIVE",
"nextBillingDate": "2024-02-01T00:00:00Z",
"billingPolicy": {
"interval": "MONTH",
"intervalCount": 1,
"minCycles": 3,
"maxCycles": 12
},
"deliveryPolicy": {
"interval": "MONTH",
"intervalCount": 1
},
"customer": {
"id": "gid://shopify/Customer/987654321",
"email": "customer@example.com",
"firstName": "John",
"lastName": "Doe"
},
"deliveryPrice": {
"amount": "5.99",
"currencyCode": "USD"
},
"lines": {
"edges": [
{
"node": {
"id": "gid://shopify/SubscriptionLine/111111",
"quantity": 2,
"variantId": "gid://shopify/ProductVariant/42549172011164",
"currentPrice": {
"amount": "25.99",
"currencyCode": "USD"
},
"pricingPolicy": {
"basePrice": {
"amount": "29.99",
"currencyCode": "USD"
}
}
}
}
]
}
}