Subscriptions
Read the customer's subscriptions, and change their quantity, bundle, and survey answers.
Every method here needs a signed-in customer, and reads or writes only that customer's subscriptions.
A subscription has a plan, a quantity, and a list of items: the subscription
line itself plus any add-ons. Change the whole subscription with update,
updateBundle and updatePreferences; change one line with the Item methods.
Most methods take a params.expand list, and every method takes a final
headers object; see
Expand parameters and
Currency.
Gets a page of the customer's subscriptions.
Method parameters
paramsRequiredSubscriptionsListParamsWhich subscriptions to return. The argument is required by position, so pass an empty object for the defaults.
headersoptionalRequestHeadersExtra request headers.
ReturnsPromise<SubscriptionsListResponse>
One page of subscriptions.
List the active subscriptions
Loads one subscription.
Method parameters
subscriptionIdRequirednumberID of the subscription.
paramsoptionalSubscriptionsResourceParamsExtra data to include.
expandoptionalstring[]Relations to include.
headersoptionalRequestHeadersExtra request headers.
ReturnsPromise<Subscription>
The subscription.
Load a subscription
Changes the quantity or the metadata of a subscription. Quantity changes need
shop.settings.subscriptionQuantitySelector.
Method parameters
subscriptionIdRequirednumberID of the subscription.
payloadRequiredSubscriptionUpdatePayloadThe change to make.
paramsoptionalSubscriptionsResourceParamsExtra data to include in the response.
expandoptionalstring[]Relations to include.
headersoptionalRequestHeadersExtra request headers.
ReturnsPromise<Subscription>
The subscription, with the change applied.
Change the quantity
Write a metafield value
Rewrites the survey answers of a subscription. Send every answer you want to
keep: the call replaces the whole set. This method takes no params argument.
Method parameters
subscriptionIdRequirednumberID of the subscription.
payloadRequiredSubscriptionPreferencesPayloadThe new answers.
headersoptionalRequestHeadersExtra request headers.
ReturnsPromise<Subscription>
The subscription, with the new answers.
Answer the survey again
Rewrites the bundle contents and the bundle preferences of a subscription. Send
the whole list of items: the call replaces what was there. This method takes no
params argument.
Method parameters
subscriptionIdRequirednumberID of the subscription.
payloadRequiredSubscriptionBundlePayloadThe new bundle.
headersoptionalRequestHeadersExtra request headers.
ReturnsPromise<Subscription>
The subscription, with the new bundle.
Swap the bundle contents
Loads one item of a subscription: the subscription line itself, or an add-on.
Method parameters
subscriptionIdRequirednumberID of the subscription.
itemIdRequirednumberID of the item, from subscription.items[].id.
paramsoptionalSubscriptionsResourceParamsExtra data to include.
expandoptionalstring[]Relations to include.
headersoptionalRequestHeadersExtra request headers.
ReturnsPromise<SubscriptionItem>
The item.
Load one item
Changes the quantity or the metadata of one subscription item.
Method parameters
subscriptionIdRequirednumberID of the subscription.
itemIdRequirednumberID of the item.
payloadRequiredSubscriptionUpdatePayloadThe change to make.
paramsoptionalSubscriptionsResourceParamsExtra data to include in the response.
expandoptionalstring[]Relations to include.
headersoptionalRequestHeadersExtra request headers.
ReturnsPromise<SubscriptionItem>
The item, with the change applied.
Change the quantity of an add-on
Rewrites the bundle contents of one subscription item. Unlike updateBundle,
this call carries no quantity, and bundle is required.
Method parameters
subscriptionIdRequirednumberID of the subscription.
itemIdRequirednumberID of the item.
payloadRequiredSubscriptionItemBundleUpdatePayloadThe new bundle for the item.
paramsoptionalSubscriptionsResourceParamsExtra data to include in the response.
expandoptionalstring[]Relations to include.
headersoptionalRequestHeadersExtra request headers.
ReturnsPromise<SubscriptionItem>
The item, with the new bundle.
Swap the contents of one bundle item
Rewrites the survey answers of one subscription item. This method takes no
params argument.
Method parameters
subscriptionIdRequirednumberID of the subscription.
itemIdRequirednumberID of the item.
payloadRequiredSubscriptionPreferencesPayloadThe new answers.
headersoptionalRequestHeadersExtra request headers.
ReturnsPromise<SubscriptionItem>
The item, with the new answers.
Answer the survey for one item