Subscription

Arguments

  • publicId String! Required
    The globally unique ID of the subscription.

Return type: SubscriptionType

  • cancelReason String
  • cancelReasonCode CancelReasonType Show fields
    CancelReasonType fields
    • code Int! Non-null
    • reason String! Non-null
  • cancelled DateTime
  • components [ComponentType!] Show fields
    ComponentType fields
    • product ProductType Show fields
      ProductType fields
      • autoshipByDefault Boolean! Non-null
      • autoshipEnabled Boolean! Non-null
      • created DateTime
      • detailUrl String
      • discontinued Boolean! Non-null
      • every Int
      • everyPeriod Int
      • externalProductId String! Non-null
      • extraData String
      • groups [ProductGroupType!]! Non-null Show fields
        ProductGroupType fields
        • groupType String! Non-null
        • name String! Non-null
      • imageUrl String
      • lastUpdate DateTime
      • live Boolean! Non-null
      • name String
      • prepaidEligible Boolean! Non-null
      • price Decimal! Non-null
      • productType String! Non-null
      • sku String! Non-null
    • publicId String! Non-null
    • quantity Int
  • created DateTime
  • currencyCode String
  • customer CustomerType Show fields
    CustomerType fields
    • created DateTime! Non-null
    • email String
    • extraData String
    • firstName String
    • lastName String
    • lastUpdated DateTime! Non-null
    • live Boolean! Non-null
    • locale Int
    • merchantUserId String
    • phoneNumber String
    • phoneType Int
    • priceCode String
  • every Int
  • everyPeriod Int
  • externalId String
  • extraData String
  • freeTrialSubscriptionContext FreeTrialSubscriptionContextType Show fields
    FreeTrialSubscriptionContextType fields
    • conversionItem String
    • days Int! Non-null
    • expiration DateTime! Non-null
    • isInFreeTrial Boolean! Non-null
    • product ProductType Show fields
      ProductType fields
      • autoshipByDefault Boolean! Non-null
      • autoshipEnabled Boolean! Non-null
      • created DateTime
      • detailUrl String
      • discontinued Boolean! Non-null
      • every Int
      • everyPeriod Int
      • externalProductId String! Non-null
      • extraData String
      • groups [ProductGroupType!]! Non-null Show fields
        ProductGroupType fields
        • groupType String! Non-null
        • name String! Non-null
      • imageUrl String
      • lastUpdate DateTime
      • live Boolean! Non-null
      • name String
      • prepaidEligible Boolean! Non-null
      • price Decimal! Non-null
      • productType String! Non-null
      • sku String! Non-null
  • frequencyDays Int
  • grantees [GranteeType!]! Non-null Show fields
    GranteeType fields
    • externalId String! Non-null
    • name String! Non-null
  • id ID! Non-null
    The Globally Unique ID of this object
  • live Boolean! Non-null
  • merchantOrderId String
  • merchantPublicId String! Non-null
  • offerPublicId String
  • payment PaymentType Show fields
    PaymentType fields
    • billingAddress AddressType Show fields
      AddressType fields
      • address String! Non-null
      • address2 String
      • city String! Non-null
      • companyName String
      • countryCode String! Non-null
      • created DateTime! Non-null
      • fax String
      • firstName String! Non-null
      • label String
      • lastName String! Non-null
      • live Boolean! Non-null
      • phone String
      • priceCode String
      • publicId String
      • stateProvinceCode String! Non-null
      • tokenId String
      • zipPostalCode String! Non-null
    • ccExpDate String
    • ccHolder String
    • ccNumberEnding String
    • ccType Int
    • created DateTime! Non-null
    • cycle Int
    • cycleStatus Int
    • label String
    • lastUpdated DateTime! Non-null
    • live Boolean! Non-null
    • paymentMethod Int
    • publicId String
    • tokenId String
  • prepaidSubscriptionContext PrepaidSubscriptionContextType Show fields
    PrepaidSubscriptionContextType fields
    • lastRenewalRevenue Decimal! Non-null
    • prepaidOrdersPerBilling Int! Non-null
    • prepaidOrdersRemaining Int! Non-null
    • prepaidOriginMerchantOrderId String
    • renewalBehavior String! Non-null
  • price Decimal
  • product ProductType Show fields
    ProductType fields
    • autoshipByDefault Boolean! Non-null
    • autoshipEnabled Boolean! Non-null
    • created DateTime
    • detailUrl String
    • discontinued Boolean! Non-null
    • every Int
    • everyPeriod Int
    • externalProductId String! Non-null
    • extraData String
    • groups [ProductGroupType!]! Non-null Show fields
      ProductGroupType fields
      • groupType String! Non-null
      • name String! Non-null
    • imageUrl String
    • lastUpdate DateTime
    • live Boolean! Non-null
    • name String
    • prepaidEligible Boolean! Non-null
    • price Decimal! Non-null
    • productType String! Non-null
    • sku String! Non-null
  • publicId String
  • quantity Int! Non-null
  • queuedActions [QueuedActionType!] Show fields
    QueuedActionType fields
    • date DateTime
    • index Int! Non-null
    • ordinal Int! Non-null
    • publicId String! Non-null
    • skip Boolean! Non-null
  • reminderDays Int
  • sessionId String! Non-null
  • shippingAddress AddressType Show fields
    AddressType fields
    • address String! Non-null
    • address2 String
    • city String! Non-null
    • companyName String
    • countryCode String! Non-null
    • created DateTime! Non-null
    • fax String
    • firstName String! Non-null
    • label String
    • lastName String! Non-null
    • live Boolean! Non-null
    • phone String
    • priceCode String
    • publicId String
    • stateProvinceCode String! Non-null
    • tokenId String
    • zipPostalCode String! Non-null
  • startDate Date! Non-null
  • subscriptionType String
  • updated DateTime

Basic subscription info with product details

query {
  subscription(publicId: "sub123") {
    publicId
    every
    everyPeriod
    quantity
    price
    live
    startDate
    created
    product {
      name
      externalProductId
      sku
      imageUrl
    }
  }
}
curl -X POST https://restapi.ordergroove.com/graphql/2026-01/ \
  -H "X-API-KEY: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{"query": "query { subscription(publicId: \"sub123\") { publicId every everyPeriod quantity price live startDate created product { name externalProductId sku imageUrl } } }"}'
const query = `
query {
  subscription(publicId: "sub123") {
    publicId
    every
    everyPeriod
    quantity
    price
    live
    startDate
    created
    product {
      name
      externalProductId
      sku
      imageUrl
    }
  }
}
`;

const response = await fetch(
  "https://restapi.ordergroove.com/graphql/2026-01/",
  {
    method: "POST",
    headers: {
      "X-API-KEY: <your-api-key>",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ query }),
  }
);

const data = await response.json();
import requests

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

response = requests.post(
    "https://restapi.ordergroove.com/graphql/2026-01/",
    headers={
        "X-API-KEY: <your-api-key>",
        "Content-Type": "application/json",
    },
    json={"query": query},
)

data = response.json()

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
    }
  }
}
curl -X POST https://restapi.ordergroove.com/graphql/2026-01/ \
  -H "X-API-KEY: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{"query": "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 } } }"}'
const query = `
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
    }
  }
}
`;

const response = await fetch(
  "https://restapi.ordergroove.com/graphql/2026-01/",
  {
    method: "POST",
    headers: {
      "X-API-KEY: <your-api-key>",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ query }),
  }
);

const data = await response.json();
import requests

query = """
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
    }
  }
}
"""

response = requests.post(
    "https://restapi.ordergroove.com/graphql/2026-01/",
    headers={
        "X-API-KEY: <your-api-key>",
        "Content-Type": "application/json",
    },
    json={"query": query},
)

data = response.json()

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
      }
    }
  }
}
curl -X POST https://restapi.ordergroove.com/graphql/2026-01/ \
  -H "X-API-KEY: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{"query": "query { subscription(publicId: \"sub123\") { publicId every everyPeriod quantity price live product { name externalProductId } components { publicId quantity product { name externalProductId sku price } } } }"}'
const query = `
query {
  subscription(publicId: "sub123") {
    publicId
    every
    everyPeriod
    quantity
    price
    live
    product {
      name
      externalProductId
    }
    components {
      publicId
      quantity
      product {
        name
        externalProductId
        sku
        price
      }
    }
  }
}
`;

const response = await fetch(
  "https://restapi.ordergroove.com/graphql/2026-01/",
  {
    method: "POST",
    headers: {
      "X-API-KEY: <your-api-key>",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ query }),
  }
);

const data = await response.json();
import requests

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

response = requests.post(
    "https://restapi.ordergroove.com/graphql/2026-01/",
    headers={
        "X-API-KEY: <your-api-key>",
        "Content-Type": "application/json",
    },
    json={"query": query},
)

data = response.json()