subscription

Fetch a single subscription by its public ID
View as Markdown

The subscription query returns SubscriptionType.

Arguments

ArgumentTypeRequiredDescription
publicIdString!YesThe globally unique ID of the subscription.

Return type: SubscriptionType

FieldTypeRequired
cancelReasonStringNo
cancelReasonCodeCancelReasonTypeNo
cancelledDateTimeNo
components[ComponentType!]No
createdDateTimeNo
currencyCodeStringNo
customerCustomerTypeNo
everyIntNo
everyPeriodIntNo
externalIdStringNo
extraDataStringNo
freeTrialSubscriptionContextFreeTrialSubscriptionContextTypeNo
frequencyDaysIntNo
grantees[GranteeType!]!Yes
idID!Yes
liveBoolean!Yes
merchantOrderIdStringNo
merchantPublicIdString!Yes
offerPublicIdStringNo
paymentPaymentTypeNo
prepaidSubscriptionContextPrepaidSubscriptionContextTypeNo
priceDecimalNo
productProductTypeNo
publicIdStringNo
quantityInt!Yes
queuedActions[QueuedActionType!]No
reminderDaysIntNo
sessionIdString!Yes
shippingAddressAddressTypeNo
startDateDate!Yes
subscriptionTypeStringNo
updatedDateTimeNo

Examples

Get subscription overview

Basic subscription info with product details

1query {
2 subscription(publicId: "sub123") {
3 publicId
4 every
5 everyPeriod
6 quantity
7 price
8 live
9 startDate
10 created
11 product {
12 name
13 externalProductId
14 sku
15 imageUrl
16 }
17 }
18}

Get subscription for account management

Full subscription details for editing customer, shipping, and payment

1query {
2 subscription(publicId: "sub123") {
3 publicId
4 every
5 everyPeriod
6 quantity
7 price
8 live
9 cancelled
10 cancelReason
11 startDate
12 currencyCode
13 customer {
14 merchantUserId
15 firstName
16 lastName
17 email
18 phoneNumber
19 }
20 shippingAddress {
21 publicId
22 firstName
23 lastName
24 address
25 address2
26 city
27 stateProvinceCode
28 zipPostalCode
29 countryCode
30 phone
31 }
32 payment {
33 publicId
34 ccType
35 ccNumberEnding
36 ccExpDate
37 ccHolder
38 paymentMethod
39 }
40 product {
41 name
42 externalProductId
43 sku
44 price
45 imageUrl
46 }
47 }
48}

Get bundle subscription components

Retrieve a subscription’s bundle components with product details

1query {
2 subscription(publicId: "sub123") {
3 publicId
4 every
5 everyPeriod
6 quantity
7 price
8 live
9 product {
10 name
11 externalProductId
12 }
13 components {
14 publicId
15 quantity
16 product {
17 name
18 externalProductId
19 sku
20 price
21 }
22 }
23 }
24}