> For the complete documentation index, see [llms.txt](https://6dot50.gitbook.io/6dot50-apis/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://6dot50.gitbook.io/6dot50-apis/redemptions-api/response-models.md).

# Response Models

### 200 Successful

Successful response models vary per operation and are detailed in the sections that follow.

### 400 Bad Request

Should a call to an operation result in a Bad Request HTTP response code, the following standard model is returned:

```
{
  "statusCode": int,
  "errorCode": "string",
  "message": "string",
  "validationErrors": [
    {
      "index": "string",
      "errorCode": "string",
      "errorMessage": "string",
      "fieldName": "string",
      "fieldValue": "string"
    }
  ]
}
```

<table><thead><tr><th width="214.33333333333331">Field</th><th width="197">Response Type</th><th>Description</th></tr></thead><tbody><tr><td><code>statusCode</code></td><td>int</td><td>The HTTP status code, e.g. 400</td></tr><tr><td><code>errorCode</code></td><td>string</td><td>Identifies the type of error that occurred, e.g. general error, validation error, or an invalid request.</td></tr><tr><td><code>message</code></td><td>string</td><td>A friendly message for the reason of the Bad Request response.</td></tr><tr><td><code>validationErrors</code></td><td>validationError</td><td>One or more Validation Errors, <a href="#validationerror">see ValidationError</a> for more information.</td></tr></tbody></table>

The `errorCode` field identifies the type of error that was raised:

<table><thead><tr><th width="107.33333333333331">Code</th><th width="231">Type</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>General error</td><td>A general server error occurred and cannot process the request. See <code>message</code> field for more information.</td></tr><tr><td>1</td><td>Validation error</td><td>One or more validation errors have occurred. See <code>validationErrors</code> for more information.</td></tr><tr><td>2</td><td>Invalid request</td><td>The payload provided is not valid and cannot be parsed.</td></tr></tbody></table>

#### ValidationError

The following fields are returned per validation error:

<table><thead><tr><th width="210">Field</th><th width="167.33333333333331">Response Type</th><th>Description</th></tr></thead><tbody><tr><td><code>index</code></td><td>string</td><td><strong>If applicable:</strong> numeric increment for each validation error in the array.</td></tr><tr><td><code>errorCode</code></td><td>string</td><td>The type of validation error that occurred. See validation error codes below.</td></tr><tr><td><code>errorMessage</code></td><td>string</td><td>A display message for the validation error.</td></tr><tr><td><code>fieldName</code></td><td>string</td><td>If applicable: The name of the field that caused the validation error.</td></tr><tr><td><code>fieldValue</code></td><td>string</td><td>If applicable: The value of the field that caused the validation error.</td></tr></tbody></table>

If a validation error occurs, a unique code will be supplied which can be used to display a custom message to the user:

<table><thead><tr><th width="122">Code</th><th width="293">Description</th><th data-hidden></th></tr></thead><tbody><tr><td>100</td><td>Required parameter missing</td><td></td></tr><tr><td>106</td><td>Invalid value supplied</td><td></td></tr></tbody></table>

A sample Bad Request response with a `validationError`:

```
{
  "statusCode": 400,
  "errorCode": "1",
  "message": "Validation error",
  "validationErrors": [
    {
      "index": "0",
      "errorCode": "106",
      "errorMessage": "Account ID is invalid (does not exist or not active)",
      "fieldName": "AccountId",
      "fieldValue": "00000000-0000-0000-0000-000000000000"
    }
  ]
}
```

### 401 Unauthorised

A 401 HTTP status code will be returned should an invalid Bearer token be supplied as part of a request’s Header, or if the Bearer token supplied has expired.

### 500 Server Error

A server errors when an unhandled exception is thrown by the Redemptions API. The exception will be returned within the response body.

Please contact 6DOT50 Support with the error.
