Checkout API Error Messages are Vague

jbgrunewald
Shopify Partner
20 1 5

Greetings, 

 

We are a sales channel using the checkout API. Recently we had a scenario, where we attempted to create a checkout with an OOS item and received a 422 HTTP response. The error message in the response just stated that there was invalid input, which wasn't terribly helpful in understanding where we erred. It would be awesome if we could get similar message to other APIs, which could indicate the field that is incorrect. 

 

One way I've thought of to mitigate this is to add each line item to the cart one at a time, and handle errors on our side appropriately. However, this does increase the number of requests to the Shopify backend. Please let me know if there's another preferred way to handle OOS items being added to a checkout. 

 

Thanks!

0 Likes
hassain
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 134

Hey @jbgrunewald ,

 

For Sales Channels, perhaps it might be worth looking into using the GraphQL Storefront API instead for creating the checkout experience? Since it uses GraphQL, the error messaging is different. Also with the Storefront API the rate limiting in on a per customer IP basis, so you do not have to worry about sending too many requests for adding one line item at a time.

 

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
jbgrunewald
Shopify Partner
20 1 5

Thanks, I'll need to take a look at the store front API more closely to make an informed decision. At first glance there may be some blockers to our current setup. We would be grateful if you could pass along the feedback for the checkout API. In the meantime, I'll take a closer look and see if the storefront API might work for our use case.