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.

GraphQL Order Checkout ID Replacement

GraphQL Order Checkout ID Replacement

janklima
Tourist
7 0 4

Hey guys,

 

I am in a bit of a jam here. I am pulling orders from Shopify GraphQL and processing them a bit later. In REST Api on GET to orders.json you can get checkout_id value. Its a checkout associated with the completed order.

 

I can't find anything like that in GraphQL Orders (nor anywhere else). Am I doing something wrong?

 

Please let me know... Thanks!

Replies 8 (8)

janklima
Tourist
7 0 4

Basically - when I call order with REST I get this:

"browser_ip": "something",
"buyer_accepts_marketing": true,
"cancel_reason": null,
"cancelled_at": null,
"cart_token": null,
"checkout_id": important_id_here,
"checkout_token": "some_token_here",
"client_details": {}

And the associated checkout_id is what I need to somehow acquire in GraphQL.

_JCC_
Shopify Staff
200 27 56

Hey @janklima ,

Happy to help you out with this. 

As you've already discovered the checkout id field is not an exposed field when performing order queries in GraphQL. If you don't mind me asking, what is the checkout id field being used for? Knowing what it's being used for could help in suggestion of a possible alternative, and also help in any communication I have with internal teams.

Look forward to hearing back from you.

Regards,

John

John C | 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

janklima
Tourist
7 0 4

Hi _JCC_,

 

thanks a lot for responding 😉 Its pretty simple - I need the number thats in checkout ID because our accounting software is pairing payments from bank based on this number. So I need to somehow get the checkout ID that was associated with this order...

 

Please let me know if its possible. Thank you!

_JCC_
Shopify Staff
200 27 56

Hey @janklima ,

Thanks for the quick response. I suspected this might be for reconciliation purposes. Does the accounting software have the authorization code? The authorization code is exposed on the transaction list of an order query in GraphQL.

 

query {
  order(id:"gid://shopify/Order/someordernumber"){
    id    
    transactions{
      id
      authorizationCode,
      status
      kind
      accountNumber
      gateway      
      amountSet{
        shopMoney{
          amount
        }
      }
    }
  }
}

 

 If the authorization code can't be used to pair these payments let me know.

Regards,

John

John C | 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

janklima
Tourist
7 0 4

Thank you I will check on monday and let you know. authorizationCode is returning a different number so I will have to check with our accounting guys. Thanks a lot for helping out!

_JCC_
Shopify Staff
200 27 56

@janklima 

Yes, the authorization code will definitely be different. I'll wait to hear what you confirm from your accounting team before taking this any further. Have a good weekend.

Regards,

John

John C | 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

DC-Andreas
Shopify Partner
4 0 3

Hi @_JCC_ ,

We also have the same problem.
Several of our customers have already asked if we can provide the checkout ID for reconciliation purpose.

Are the any plans to add this field to the GraphQL API?

Thank you,
Andreas

Jyothi1
Visitor
1 0 0

@janklima wrote:

Basically - when I call order with REST I get this:

"browser_ip": "something",
"buyer_accepts_marketing": true,
"cancel_reason": null,
"cancelled_at": null,
"cart_token": null,
"checkout_id": important_id_here,
"checkout_token": "some_token_here",
"client_details": {}

And the associated checkout_id is what I need to somehow acquire in GraphQL.



Hi @_JCC_, I am new to Shopify app development... I have been trying to get cart value through graphql and create a banner that shows how much they need to purchase to get free shipping order .. can anyone please suggest on how to get the cart value?