Subscriptions

Arguments

  • after String
    Cursor to paginate forward from.
  • before String
    Cursor to paginate backward from.
  • customer String
    Filter by customer ID.
  • first Int
    Return the first N results.
  • last Int
    Return the last N results.
  • live Boolean
    Filter by subscription status. Requires a customer scope (customer auth or customer argument).

Return type: SubscriptionConnection

  • edges [SubscriptionEdge!]! Non-null Show fields
    SubscriptionEdge fields
    • cursor String! Non-null
    • node SubscriptionType! Non-null Show fields
      SubscriptionType fields
      • 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
  • pageInfo PageInfo! Non-null Show fields
    PageInfo fields
    • endCursor String
      When paginating forwards, the cursor to continue.
    • hasNextPage Boolean! Non-null
      When paginating forwards, are there more items?
    • hasPreviousPage Boolean! Non-null
      When paginating backwards, are there more items?
    • startCursor String
      When paginating backwards, the cursor to continue.

Retrieve all subscriptions for a customer with product info

query {
  subscriptions(customer: "cust123", first: 25) {
    edges {
      node {
        publicId
        every
        everyPeriod
        quantity
        price
        live
        startDate
        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 { subscriptions(customer: \"cust123\", first: 25) { edges { node { publicId every everyPeriod quantity price live startDate product { name externalProductId sku imageUrl } } } } }"}'
const query = `
query {
  subscriptions(customer: "cust123", first: 25) {
    edges {
      node {
        publicId
        every
        everyPeriod
        quantity
        price
        live
        startDate
        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 {
  subscriptions(customer: "cust123", first: 25) {
    edges {
      node {
        publicId
        every
        everyPeriod
        quantity
        price
        live
        startDate
        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()

Page through a customer's subscriptions using cursor-based pagination

query {
  subscriptions(customer: "cust123", first: 10, after: "cursor123") {
    edges {
      cursor
      node {
        publicId
        every
        everyPeriod
        quantity
        price
        live
        startDate
      }
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
  }
}
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 { subscriptions(customer: \"cust123\", first: 10, after: \"cursor123\") { edges { cursor node { publicId every everyPeriod quantity price live startDate } } pageInfo { hasNextPage hasPreviousPage startCursor endCursor } } }"}'
const query = `
query {
  subscriptions(customer: "cust123", first: 10, after: "cursor123") {
    edges {
      cursor
      node {
        publicId
        every
        everyPeriod
        quantity
        price
        live
        startDate
      }
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
  }
}
`;

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 {
  subscriptions(customer: "cust123", first: 10, after: "cursor123") {
    edges {
      cursor
      node {
        publicId
        every
        everyPeriod
        quantity
        price
        live
        startDate
      }
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
  }
}
"""

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()

Subscriptions with shipping address and payment info

query {
  subscriptions(customer: "cust123", first: 25) {
    edges {
      node {
        publicId
        every
        everyPeriod
        quantity
        price
        live
        cancelled
        shippingAddress {
          firstName
          lastName
          address
          city
          stateProvinceCode
          zipPostalCode
        }
        payment {
          ccType
          ccNumberEnding
          paymentMethod
        }
        product {
          name
          externalProductId
          sku
        }
      }
    }
  }
}
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 { subscriptions(customer: \"cust123\", first: 25) { edges { node { publicId every everyPeriod quantity price live cancelled shippingAddress { firstName lastName address city stateProvinceCode zipPostalCode } payment { ccType ccNumberEnding paymentMethod } product { name externalProductId sku } } } } }"}'
const query = `
query {
  subscriptions(customer: "cust123", first: 25) {
    edges {
      node {
        publicId
        every
        everyPeriod
        quantity
        price
        live
        cancelled
        shippingAddress {
          firstName
          lastName
          address
          city
          stateProvinceCode
          zipPostalCode
        }
        payment {
          ccType
          ccNumberEnding
          paymentMethod
        }
        product {
          name
          externalProductId
          sku
        }
      }
    }
  }
}
`;

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 {
  subscriptions(customer: "cust123", first: 25) {
    edges {
      node {
        publicId
        every
        everyPeriod
        quantity
        price
        live
        cancelled
        shippingAddress {
          firstName
          lastName
          address
          city
          stateProvinceCode
          zipPostalCode
        }
        payment {
          ccType
          ccNumberEnding
          paymentMethod
        }
        product {
          name
          externalProductId
          sku
        }
      }
    }
  }
}
"""

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()

Subscriptions with prepaid context for tracking remaining orders

query {
  subscriptions(customer: "cust123", first: 25) {
    edges {
      node {
        publicId
        every
        everyPeriod
        quantity
        price
        live
        product {
          name
          externalProductId
          sku
        }
        prepaidSubscriptionContext {
          prepaidOrdersRemaining
          prepaidOrdersPerBilling
          renewalBehavior
          lastRenewalRevenue
          prepaidOriginMerchantOrderId
        }
      }
    }
  }
}
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 { subscriptions(customer: \"cust123\", first: 25) { edges { node { publicId every everyPeriod quantity price live product { name externalProductId sku } prepaidSubscriptionContext { prepaidOrdersRemaining prepaidOrdersPerBilling renewalBehavior lastRenewalRevenue prepaidOriginMerchantOrderId } } } } }"}'
const query = `
query {
  subscriptions(customer: "cust123", first: 25) {
    edges {
      node {
        publicId
        every
        everyPeriod
        quantity
        price
        live
        product {
          name
          externalProductId
          sku
        }
        prepaidSubscriptionContext {
          prepaidOrdersRemaining
          prepaidOrdersPerBilling
          renewalBehavior
          lastRenewalRevenue
          prepaidOriginMerchantOrderId
        }
      }
    }
  }
}
`;

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 {
  subscriptions(customer: "cust123", first: 25) {
    edges {
      node {
        publicId
        every
        everyPeriod
        quantity
        price
        live
        product {
          name
          externalProductId
          sku
        }
        prepaidSubscriptionContext {
          prepaidOrdersRemaining
          prepaidOrdersPerBilling
          renewalBehavior
          lastRenewalRevenue
          prepaidOriginMerchantOrderId
        }
      }
    }
  }
}
"""

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()