Is there anyway we can still retrieve the cart after payment? It seems I can't retrieve the details.

Solved

Is there anyway we can still retrieve the cart after payment? It seems I can't retrieve the details.

brodwen
Shopify Partner
2 0 0

When I query the cart by cart Id, it always returns null. How can I check the payment? Can we retrieve the order from the cart's checkout URL?

query checkoutURL {
  cart(id: "CART_ID_HERE") {
    checkoutUrl
  }
}

this returns null:

{
  "data": {
    "cart": null
  }
}
Accepted Solution (1)

ShopifyDevSup
Shopify Staff
1453 238 509

This is an accepted solution.

Hey @brodwen , Shopify automatically deletes the cart when the customer completes their checkout, so that would explain the response you are getting.   

 

Once checkout is complete the order is created so from there you can query the customer.orders connection in the storefront API to get the details of the order, or the order endpoint in the admin API. 

 

Hope that helps clarify the reason for receiving the Null response. 

 

- Kyle G. 

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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

View solution in original post

Reply 1 (1)

ShopifyDevSup
Shopify Staff
1453 238 509

This is an accepted solution.

Hey @brodwen , Shopify automatically deletes the cart when the customer completes their checkout, so that would explain the response you are getting.   

 

Once checkout is complete the order is created so from there you can query the customer.orders connection in the storefront API to get the details of the order, or the order endpoint in the admin API. 

 

Hope that helps clarify the reason for receiving the Null response. 

 

- Kyle G. 

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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