Create a new subscription contract
Headers
API Key
Query Parameters
API Key (Deprecated)
Body
Request object for creating a new subscription contract
Number of intervals between billings
x >= 11
Billing frequency interval type
DAY, WEEK, MONTH, YEAR, $UNKNOWN, DAY, WEEK, MONTH, YEAR "MONTH"
Shopify customer ID (numeric ID without gid prefix)
"987654321"
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
Date when the next billing/order will occur
"2024-02-01T00:00:00Z"
Initial status of the subscription contract
ACTIVE, PAUSED, CANCELLED, EXPIRED, FAILED, $UNKNOWN, ACTIVE, PAUSED, CANCELLED, EXPIRED, FAILED "ACTIVE"
Allow customer to change delivery address in customer portal
false
Allow delivery price to be overridden
false
If true, creates subscription without payment method. Status will be set to PAUSED unless skipPaymentCreateUnpaidOrder is also true.
false
Currency code for the subscription (ISO 4217). If not provided, uses store default currency
"USD"
Custom attributes to attach to the subscription contract
[
{
"key": "subscription_type",
"value": "premium"
},
{
"key": "gift_message",
"value": "Happy Birthday!"
}
]Delivery address line 2
"Apt 4B"
Delivery address first name
"John"
Number of intervals between deliveries. If not specified, uses billing interval count
x >= 11
Delivery frequency interval type. If not specified, uses billing interval
DAY, WEEK, MONTH, YEAR, $UNKNOWN, DAY, WEEK, MONTH, YEAR "MONTH"
Delivery address last name
"Doe"
Delivery phone number
"+1234567890"
Fixed delivery price amount in store currency
5.99
Delivery address province/state code (ISO 3166-2)
"NY"
Delivery address postal/zip code
"10001"
Maximum number of billing cycles. Null for unlimited
x >= 112
Minimum number of billing cycles required before cancellation is allowed
x >= 13
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, 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
Response
Subscription contract successfully created
SUCCEEDED, FAILED, $UNKNOWN ACTIVE, PAUSED, CANCELLED, EXPIRED, FAILED, $UNKNOWN