Covers all questions related to inventory management, order fulfillment, and shipping.
fun getOrderDetailQuery(orderId: String) = Storefront.query { rootQuery ->
rootQuery.node(ID(orderId)) { nodeQuery ->
nodeQuery.onOrder { orderQuery ->
orderQuery
.name()
.fulfillmentStatus()
.processedAt()
.orderNumber()
.shippingAddress { query ->
query
.name()
.address1()
.address2()
.city()
.province()
.provinceCode()
.country()
.zip()
.phone()
}
.lineItems({ it.first(100) }, {
it.edges {
it.node { liteItemQuery ->
liteItemQuery.title()
liteItemQuery.quantity()
liteItemQuery.originalTotalPrice { query ->
query.amount().currencyCode()
}
liteItemQuery.variant { query ->
query.image { it ->
it.originalSrc()
}
}
}
}
})
.totalPriceV2 { query ->
query.amount().currencyCode()
}
.subtotalPriceV2 { query ->
query.amount().currencyCode()
}
.totalTaxV2 { query ->
query.amount().currencyCode()
}
.totalShippingPriceV2 { query ->
query.amount().currencyCode()
}
}
}
}
Solved! Go to the solution
This is an accepted solution.
Hey @joetreeline,
The Order information available from the Storefront API (docs) is much more limited than the Admin API due to its unauthenticated nature. The Admin API is a better source of the information you're interested in, but you'd need to make calls to the Admin API from a server, not the mobile app though.
Check out these Admin API Order docs: https://shopify.dev/api/admin/graphql/reference/orders/order - there's a currentTotalDiscountsSet, a transactions connection you can get payment details from, a shippingLine connection, and a fulfillment connection (which has an estimatedDeliveryAt property).
CalD | Developer Support @ 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
This is an accepted solution.
Hey @joetreeline,
The Order information available from the Storefront API (docs) is much more limited than the Admin API due to its unauthenticated nature. The Admin API is a better source of the information you're interested in, but you'd need to make calls to the Admin API from a server, not the mobile app though.
Check out these Admin API Order docs: https://shopify.dev/api/admin/graphql/reference/orders/order - there's a currentTotalDiscountsSet, a transactions connection you can get payment details from, a shippingLine connection, and a fulfillment connection (which has an estimatedDeliveryAt property).
CalD | Developer Support @ 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
Thanks for confirming Cal. We will rely on the Admin API for that information.
Thanks
-Joe