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

query {
subscription(publicId: "sub123") {
publicId
every
everyPeriod
quantity
price
live
startDate
created
product {
name
externalProductId
sku
imageUrl
}
}
}

Get subscription for account management

Full subscription details for editing customer, shipping, and payment

query {
subscription(publicId: "sub123") {
publicId
every
everyPeriod
quantity
price
live
cancelled
cancelReason
startDate
currencyCode
customer {
merchantUserId
firstName
lastName
email
phoneNumber
}
shippingAddress {
publicId
firstName
lastName
address
address2
city
stateProvinceCode
zipPostalCode
countryCode
phone
}
payment {
publicId
ccType
ccNumberEnding
ccExpDate
ccHolder
paymentMethod
}
product {
name
externalProductId
sku
price
imageUrl
}
}
}

Get bundle subscription components

Retrieve a subscription’s bundle components with product details

query {
subscription(publicId: "sub123") {
publicId
every
everyPeriod
quantity
price
live
product {
name
externalProductId
}
components {
publicId
quantity
product {
name
externalProductId
sku
price
}
}
}
}