d
Topic
Alex B Shopify Employee
Posts:
34
Last edited 6 months ago

Errors returned in REST are now full messages This post is outdated

Hey all!

As Shopify continues to move towards parity for our REST and GraphQL Admin APIs, we'll be improving the error messages returned in REST responses.
Errors will now be full messages, which matches what we currently return in GraphQL.

For example:

Before:
errors['title'] = ["can't be blank"]
After: 
errors['title'] = ["Title can't be blank"]

As full messages, api clients won't have to worry about concatenating attribute names themselves, as Shopify will provide this in the returned message.

What this means for you as a partner:
If you have any apps that display the errors messages to merchants or customers, you should ensure that the new text is rendered correctly. (ex: attribute name is not prefixed twice)
Although we do not recommend parsing the error message itself for any code logic in your apps (use http status codes instead), if your apps currently implements this behavior, you will need to ensure that they handle the new text appropriately.