Error Responses

Error Types

The Loyalty API can return the following types of errors:

ErrorStatus codeDescription
BadRequest400Returned for any type of either mal-formatted or incorrect request or Json, for example an unrecognized value of a 'state' column.
Business400Returned if the request and Json payload are valid per say, but the particular action can't be carried out, for example due to a specific Entity configuration or state. Does not apply to GET operations.
DimensionFilter403The Entity identifier specified in the URL is not accessible for the Dimensions specified. Either review the Dimensions (dim parameter), or bypass the filter check using the bypassDimensionFilter=true request parameter.
FilterAccess403A script expression, such as a runIfExpression prevents the POST from being carried out.
Internal500An unexpected internal exception. Contact SPIKA to help investigate.
InvalidEntity400An Entity id or Entity Lookup Id, normally specified in the url, is invalid, doesn't exist, is of the wrong type, or has the wrong state.
InvalidMember400A Member Id or Member Lookup Id specified in the url or payload body is invalid, doesn't exist or the Member has been deleted.
MoreThanOneRow404More than one row matches the criteria when exactly one row is needed. This could be the case when for example looking up a Member based on email address but there happens to be more than one Member with the same email. In such a case the lookup must be made on one of the other Member identifiers.
NotYetImplemented501This error shouldn't ever be returned. Contact SPIKA if you get this error.
RowAlreadyExists409If trying to save a new record but it already exists. For example saving an Order with the same external order number as an existing Order.
RowNotFound404Requesting a row that doesn't exist, either because the query parameters were wrong, or because it hasn't been saved yet.

More error types may be added in the future.

JSON Response

The format of the error response is as follows:

{
  "status": "The Http status code",
  "error": "A standardised error code (see above)",
  "message": "A descriptive error Message",
  "id": "The invalid identifier, for example the requested member Id",
  "space": "my-space",
  "timestamp": "UTC time with timezone",
  "debugTrace": "An internal stacktrace. Usualy turned off"
}

Note that more error attributes may be added in the future.