Discussing APIs and development related to customers, discounts, and order management.
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 subscription
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
}
}
}
}
}
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Appreciate your response.
I want the subscription details using REST API only. Is there any Shopify REST API available to get this details?
Thanks