Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: Shopify - Storefront Api return order as null

Shopify - Storefront Api return order as null

Unknown_Dev
Shopify Partner
9 0 1

I've tried to get order detail by checkout id using a storefront access token. but it returns null. I got the proper response when I call the admin API. I've checked the access scope for that token, it has all the required scope. Kindly help me to fix this issue. 


Sample query and response below : 
query:

{node(
    id: "CHECKOUT_ID_HERE"
  ) {
    ... on Checkout {
       id
      createdAt
      completedAt
      order {
       id
      }
  }
}
}

Response :

{
    "data": {
        "node": {
            "id": "CHECKOUT_ID_HERE",
            "createdAt": "2022-10-20T09:33:08Z",
            "orderStatusUrl": null,
            "completedAt": null,
            "order": null,
        }
    }
}



Replies 4 (4)

dogowner
Shopify Partner
59 5 8

I'm having same issue.   I contacted Shopify support on Saturday and still haven't heard anything back. 

 

Some other reports:

 

https://community.shopify.com/c/shopify-discussions/checkout-is-completle-but-order-return-null/td-p...

 

https://github.com/Shopify/js-buy-sdk/issues/917

 

https://github.com/Shopify/js-buy-sdk/issues/917

dogowner
Shopify Partner
59 5 8

@Unknown_Dev This is now working for me.  The storefront api suddenly returns the correct completedAt values.  Is it working for you now?

Unknown_Dev
Shopify Partner
9 0 1

@dogowner Yes. it's working fine now. thanks for the update

monDeang
Shopify Partner
3 0 1

I am having the same issue. Checkout was successfully completed but the order, completedAt and transaction objects are null.

{"data":{"checkoutCompleteWithTokenizedPaymentV3":{"checkout":{"order":null,"createdAt":"2023-07-14T18:23:04Z","completedAt":null,"orderStatusUrl":null,"email...

No errors and order were successfully created. I tried versions 2022-07, 2022-10 and 2023-07.

 

Any help is truly appreciated.

Thanks!