Error Types
The Loyalty API can return the following types of errors:
| Error | Status code | Description |
|---|---|---|
| BadRequest | 400 | Returned for any type of either mal-formatted or incorrect request or Json, for example an unrecognized value of a 'state' column. |
| Business | 400 | Returned 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. |
| DimensionFilter | 403 | The 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. |
| FilterAccess | 403 | A script expression, such as a runIfExpression prevents the POST from being carried out. |
| Internal | 500 | An unexpected internal exception. Contact SPIKA to help investigate. |
| InvalidEntity | 400 | An 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. |
| InvalidMember | 400 | A Member Id or Member Lookup Id specified in the url or payload body is invalid, doesn't exist or the Member has been deleted. |
| MoreThanOneRow | 404 | More 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. |
| NotYetImplemented | 501 | This error shouldn't ever be returned. Contact SPIKA if you get this error. |
| RowAlreadyExists | 409 | If 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. |
| RowNotFound | 404 | Requesting 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.
