Error Messages
The standard Commerce Cloud format for REST errors includes the following fields in the response:
-
message
– the error message -
status
– the HTTP status code -
errorCode
– the system error code that uniquely identifies the error
{
"message":"Requiredheaderismissing:x-ccasset-language",
"status":"400",
"errorCode":"82001"
}
Some errors use the multiple-error format instead, which encapsulates one or more errors in an errors array object. Each entry in the array is a separate error, with its own message
, status
, and errorCode
values. In addition, the format includes top-level message
and status
values that apply globally to all of the errors. For example:
{
"message":"Errorwhileretrievingtheproducts",
"errors":[
{
"message":"ProductIdxprod100isinvalidornon-existent.",
"status":"400",
"errorCode":"20031",
},
{
"message":"ProductIdxprod102isinvalidornon-existent.",
"status":"400",
"errorCode":"20031",
}
],
"status":"400"
}