Hi,
I try to use fetch shipping from customer api in Customer acct CheckoutUI as follows:
fetch(“shopify://customer-account/api/2024-10/graphql.json”,
{
method: ‘POST’,
headers: {
‘Content-Type’: ‘application/json’,
},
body: JSON.stringify(
{
query: { order(id:"${order.id}") { nodes { shippingLine { handle title } } }
}
),
})
.then((response) => response.json())
.then(data=>{
console.log(‘data:’,data)
})
I rcvd the Shipping Line data with all shipping methods such as ‘Standard Shipping and Standard Shipping’. Both shipping rate are defined in different Shipping profile.
Is there a possibility to include in Shipping profiles with rate info or return as array?
btw, I know there is no issue to do it under Shopifyplus..
You’ve got the original price available on the shipping line. Would that work?
What are you looking to display to the customer?
yes i know, but that’s not I’m looking for. I need the rate name and the shipping profile title that it belongs to. thks
Hey @pl-mytest1_Admin
- are you looking at the Customer Account API? Just wanted to make sure I was looking at the right dos on our end. If so, at the moment, it’s not possible to pull the shipping rate’s name through the customer account API itself.
You could get that information through an Order query within the Admin API though: ShippingLine - GraphQL Admin
You’d be looking for the shippingRateHandle
object. If needed, you could combine the two APIs (Admin/Customer Account API) to get all that info. Definitely a little trickier than grabbing it all in one place, but it is feasible for sure.
Hope this helps a bit - let me know if I can clarify anything on my end here or if you’d like me to put through a feature request - happy to do that!
Hi Allan, i try not to use Admin graphql from checkout to proxy-fetch from my app server as it may be slow. even if i do it, i received some error from shippingRateHandle with – with one rate amount. Same error with customer account api. If order is from one shipping profile, it works ok.
anyway, i manage to figure out another way of doing it..
btw, will be good to request a feature update. thks..