How to fetch customerUrl with GraphQL Admin API

Solved
Highlighted
Shopify Partner
7 0 0

CustomerUrl is a field containing a unique link to the page with the orderstatus.

 

With the Storefront API you can fetch the customerUrl after you get the customers credentials.

If customers forget their credentials (or checked out as guest), I need the Admin API to get to orderdetails VIa filters on name and emailadres)

I would like to send a customer the unique link to the page with the orderstatus. This field is however nog available in de fieldlist of the order object in ADMIN API.

is there a neat of hackey way to get to this fiels via the Admin API?

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 124

This is an accepted solution.

Hey @Hessel ,

 

You can access this via the REST Admin API by calling a GET request to the Order resource ("GET {store-name}.myshopify.com/admin/api/2020-04/orders/{order_id}.json") and then in the response using the field of "order_status_url"

 

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Highlighted
Shopify Partner
7 0 0

Hi @hassain 

 

thanks man. I will give this a try tomorrow. Any chance you also have directions to this field via Admin GraphQL. Otherwise I need three different ways to access (admin graphql, storefront graphql and Admin rest) to support one usecase  ;-)

 

One small questions so I am able to accept this as a solution. what exactly is the order-id number you are referring to (that I need in the call). I have an id field with the following syntax:

gid://shopify/Order/12345678901234

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 124

Hi @Hessel ,

 

As far as I am aware, order_status_url is only available in the REST Admin API currently. We are working on making the GraphQL Admin API in parity with the REST API, so keep an eye out on our developer change logs to see if this field ever gets added in. 

 

With the REST Admin API, the Order ID is just the number value from the GraphQL Admin API ID. So for your example the Order ID will be 12345678901234, and your call will be "GET {store-name}.myshopify.com/admin/api/2020-04/orders/12345678901234.json"

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

1 Like
Highlighted
Shopify Partner
7 0 0

ok. I will have a sharp lookout for any changes. I love the GraphQL implementation and would like stick to that one. 

0 Likes