GraphQL Query for track order status in Shopify Android app

New Member
3 0 0

Hi,

I am new in GraphQL and Shopify also. My requirement is track order status using shopify iOS SDK and i am unable to find any solution to track order status.

In latest release note for Buy3 SDK I see we can getch details . Can some one please help me to create that query.

https://github.com/Shopify/mobile-buy-sdk-android/releases/tag/3.2.4 

I am able to get user's order list using this query
 

{
  customer(customerAccessToken: token) {
    orders(first: 20) {
      edges {
        node {
          id
          orderNumber
          totalPrice
          currencyCode
          customerLocale
          customerUrl
          email
          phone
          processedAt
          subtotalPrice
          totalRefunded
          totalShippingPrice
          totalTax
          shippingAddress {
            address1
            address2
            city
            company
            country
            countryCode
            firstName
            formatted
            formattedArea
            lastName
            latitude
            longitude
            name
            phone
            province
            provinceCode
            zip
          }
        }
      }
    }
  }
}

Thanks,

Seshu

0 Likes
Shopify Partner
1838 173 558
query {
  order(id: <ORDER_GID>) {
    closed
    cancelledAt
    displayFulfillmentStatus
    displayFinancialStatus
  }
}

Where displayFulfillmentStatus enum items are documented here and displayFinancialStatus enum items are documented here. An order status can be open or closed or cancelled (see REST Admin API) but there is no specific field for that

  • closed == false > OPEN
  • closed == true > CLOSED
  • cancelledAt != null > CANCELLED

Not sure what you define as an order status - open / closed / cancelled or financial status or fulfillment status or a combination of any of these?

Hope this helps!

I turn coffee in to code - since 1998
0 Likes
New Member
3 0 0

Hi Karl,

Thanks for quick reponse and support.

We are looking for below mentions issue details.

https://github.com/Shopify/mobile-buy-sdk-android/issues/588 

Our requirement is need to show Order status like, Order Placed, Packed ,In Tranit and delivered date statges.

We are planing to implement this in Mobile using SHopify Mobile Buy SDK . Can you help here.

Thanks,

 

0 Likes
Shopify Partner
1838 173 558

That kind of state isn't directly available via any Shopify API as far as I am aware of. Shipment tracking is carrier service dependent and the request / response formats are extremely fragmented. Which is why there are dozens of vendors offering unified shipment handling and tracking some of which also offer apps for Shopify - which I'd suggest you explore.

If you only require a simple integration with say 1 or few carrier services, you could also do this yourself. The simplest, naive implementation would be by fetching the order fulfillment tracking data

query {
  order(id: "gid://shopify/Order/<ORDER_GID>") {
    name
    fulfillments(first: 25) {
      trackingInfo {
        company
        number
        url
      }
    }
  }
}

Which would return the tracking number and company entered during fulfillment of an order. Based on that (possibly even url if need be) you can poll the tracking endpoint, parse the response and display a shipment status in your app.

I turn coffee in to code - since 1998
0 Likes
New Member
3 0 0

Can you please help me to use Mobile SDK to fetchting this information.

I'm using below obile SDK version in my App.

https://github.com/Shopify/mobile-buy-sdk-android/releases/tag/3.2.4 

 

0 Likes
Shopify Partner
1838 173 558

Nope, sorry.

I can tell you though that no amount of coding will implement it using Storefront API or Mobile Buy SDK for Android or XYZ because the ability to retrieve shipment tracking details doesn't exist in that API or SDK respectively - which is why I said, you will need to create your own.

Best wishes.

I turn coffee in to code - since 1998
0 Likes
New Member
1 0 0

Hi Team ,
Any update on the above . We see that the shipment_status is returned in Rest API and not Graphql API ?

 

0 Likes