How to Retrieve Subscription Details for Orders Using Shopify REST API

Hello,

I’m importing orders for a store that sells products including subscription beauty products. I need to retrieve the subscription details for these orders using the Shopify REST API.

Could someone please guide me on how to access subscription information for orders through the REST API? Are there specific endpoints or fields I should be aware of for fetching these details?

Thank you in advance for your help!

Hi - this may be easier to achieve with the GraphQL API rather than the REST API. There is a subscriptionContract query on the GraphQL API which you could use to get info about a subscription contract that is associated with an order, it could look something like this:

query GetSubscriptionContractDetails {
  subscriptionContract(id: "gid://shopify/SubscriptionContract/1234567890") {
    id
    nextBillingDate
    status
    deliveryPolicy {
      interval
      intervalCount
    }
    customer {
      id
      email
      displayName
    }
    lines(first: 50, reverse: true) {
      edges {
        node {
          productId
          currentPrice {
            amount
            currencyCode
          }
          quantity
          title
          variantTitle
        }
      }
    }
    orders(first: 1, reverse: true) {
      edges {
        node {
          id
        }
      }
    }
  }
}

Appreciate your response.

I want the subscription details using REST API only. Is there any Shopify REST API available to get this details?

Thanks