> For the complete documentation index, see [llms.txt](https://docs.hos.accessacloud.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hos.accessacloud.com/atreemo-api/get-started/introduction/errors.md).

# Errors

Atreemo HTTP and operation-specific business errors

{% hint style="warning" %}
**Beta, runtime validation pending.** Published error catalogues and cited source paths have been reviewed, but no error was tested against an Atreemo instance. APIM-generated errors are not defined here.
{% endhint %}

**Published** means the public Atreemo guide/collection 1.34.0.0. **Source-verified** citations refer to source commit `ea9cb106e13aa4b9b92c01d090118742b44dd470`. Source is not proof of deployed behaviour.

Atreemo reports errors through:

* HTTP status codes for transport, authentication, permission, routing or action failures; and
* business errors inside a `200` response, using the operation's native response convention.

Always check both layers. See [Response format](file:///8924120/response-format.md).

## HTTP status codes

Customer, HotelBooking, LoyaltyPoint, LoyaltyProgram and SurveyApi folder documentation lists:

| Code  | Published meaning                                                      |
| ----- | ---------------------------------------------------------------------- |
| `200` | Success at the HTTP layer; the body can still report business failure. |
| `401` | Unauthorized: no valid access token provided.                          |
| `403` | Forbidden: caller does not have access to the method.                  |
| `404` | Not Found: invalid parameters or missing API endpoint.                 |
| `500` | Internal Server Error.                                                 |

These 35 operations reference shared `401`, `403`, `404` and `500` responses. Their body shapes are not documented. The other 182 operations have no folder-level HTTP error contract; do not infer that they return only `200` or that absent samples mean empty bodies.

Source demonstrates non-uniform paths:

* LoyaltyPoint method denial returns HTTP `403`; brand denial returns HTTP `200` with `ResponseStatus: false` and code `3`; caught exceptions return `500` (`LoyaltyPoint.cs:47–112,139–214`).
* Translation can return `BadRequest(message)`, while successful output is a translation dictionary (`AtreemoTranslatorController.cs:33–68`).
* Real-time dispatch can return HTTP `200` with `Success: false` and `Message` (`RealTimeTriggerApiController.cs:59–84`).
* `App/RemovePushNotificationToken` can catch an exception and return bodyless `Ok()` (`AppController.cs:441–452`).

Authentication middleware, hosting, resource filters and a future gateway can respond before an action. These examples are not a universal policy.

## Business-error conventions

| Convention                    | Error location                                           |
| ----------------------------- | -------------------------------------------------------- |
| ResponseStatus and Errors     | `Errors` objects with `ErrorCode` and `ErrorDescription` |
| Response and Error            | `Error` string or list, depending on operation           |
| Response and Errors           | `Errors` list of strings                                 |
| Lowercase response and errors | lowercase `errors` list                                  |
| Success and Error             | `Error` property                                         |
| Error only                    | `Error` string                                           |

```json
{
  "ResponseStatus": false,
  "Errors": [
    {
      "ErrorCode": 3,
      "ErrorDescription": "Not authorized to use the brand requested or brand id is missing"
    }
  ]
}
```

This is synthetic. Published numeric catalogues apply only to their folders and must not be converted into HTTP statuses.

### Customer

Applies to 8 Customer operations.

| Code | Description                                                      |
| ---- | ---------------------------------------------------------------- |
| `1`  | Missing mandatory fields                                         |
| `2`  | Internal Error                                                   |
| `3`  | Not authorized to use the brand requested or brand id is missing |
| `4`  | No Data found                                                    |
| `5`  | Maximum records exceeded                                         |
| `6`  | Referrer code already used                                       |
| `7`  | Member number already used                                       |
| `8`  | Invalid selected location id                                     |
| `9`  | Invalid preferred location id                                    |
| `10` | Card token already used                                          |
| `11` | No brand found in this instance                                  |
| `12` | empty input parameter                                            |

### HotelBooking

Applies to 4 HotelBooking operations.

| Code | Description                                  |
| ---- | -------------------------------------------- |
| `1`  | Missing mandatory fields                     |
| `2`  | Internal Error                               |
| `45` | No Supplier found for the user               |
| `46` | HotelBookingRef already exists               |
| `47` | Invalid booking status                       |
| `48` | Missing mandatory fields for rooms parameter |
| `49` | Rooms contains invalid RoomStatus parameter  |
| `50` | No Booking Found With Such Details           |

### LoyaltyPoint

Applies to 2 LoyaltyPoint operations.

| Code | Description                                                      |
| ---- | ---------------------------------------------------------------- |
| `2`  | Internal Error                                                   |
| `3`  | Not authorized to use the brand requested or brand id is missing |
| `4`  | No Data found                                                    |
| `13` | Invalid CtcID                                                    |

### LoyaltyProgram

Applies to `GET /api/LoyaltyProgram/Get`.

| Code | Description                                                      |
| ---- | ---------------------------------------------------------------- |
| `2`  | Internal Error                                                   |
| `3`  | Not authorized to use the brand requested or brand id is missing |
| `26` | Many result returned, please specify a brandID                   |

### SurveyApi

Applies to 20 SurveyApi operations.

| Code | Description                                  |
| ---- | -------------------------------------------- |
| `1`  | Missing mandatory fields                     |
| `2`  | Internal Error                               |
| `12` | empty input parameter                        |
| `13` | Invalid CtcID                                |
| `14` | Invalid SessionID                            |
| `14` | Invalid Question ID                          |
| `16` | Invalid response object                      |
| `17` | Invalid choice id                            |
| `18` | Question should have only one choice choosen |

The published SurveyApi list repeats code `14` with different meanings and omits `15`. Preserve that ambiguity pending owner/runtime confirmation; do not invent a correction.

## Native token errors

The inspected password-grant implementations explicitly include:

| Branch                         | Condition                               | Provider error                                             |
| ------------------------------ | --------------------------------------- | ---------------------------------------------------------- |
| Both implementations           | User lookup/credential validation fails | `invalid_grant`: `The user name or password is incorrect.` |
| `AUTH_IDENTITY` implementation | Matched user is reported locked         | `invalid_grant`: `The user is locked.`                     |

Evidence: `ApplicationOAuthProvider.cs:68–83,169,214–218`. Not every exception is guaranteed to use these results. Effective provider, HTTP response details and lockout threshold remain unverified. See [Authentication](file:///8924120/authentication/README.md).

## Unresolved

* Host-, filter-, middleware- and future gateway-generated status/header/body contracts.
* Exhaustive non-success paths outside the five published folder catalogues.
* Effective token-provider selection, lockout settings and database-dependent error catalogue.
* Runtime meaning of SurveyApi's duplicate code `14`.
* Release1.34-derived contract compatibility with the current non-production Release1.35 environment.

Do not include credentials, tokens or customer payloads in error evidence. See [Testing and support](file:///8924120/testing-and-support.md) and [Paging](broken://pages/fcb8b4932103ca3d407e794073b04fe81184636c).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.hos.accessacloud.com/atreemo-api/get-started/introduction/errors.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
