# Error Handling

All successful requests to the API return an HTTP 200 or 201. In case of errors, the API returns a JSON response containing the error code and details about the error:

```json
{
  "errors": [
    {
      "error-description": "Price Group cannot be null or empty",
      "error": "Price group must contain an id"
    }
  ]
}
```

The format of the error description varies between error codes.

The following combinations of error codes are returned from the API:

<table><thead><tr><th width="112">HTTP</th><th>Description</th><th>Handling</th></tr></thead><tbody><tr><td>400</td><td>Invalid input provided. See details.</td><td>Check that the input sent is correct.</td></tr><tr><td>401</td><td>Incorrect Client ID and/or Client Secret in HTTP header or Access Token invalid.</td><td></td></tr><tr><td>403</td><td>The authentication token does not have access to this endpoint.</td><td></td></tr><tr><td>404</td><td>A resource with the supplied ID was not found in the current store.</td><td>Try with an existing resource.</td></tr><tr><td>500</td><td>Unknown error.</td><td>Not retryable.</td></tr><tr><td>504</td><td>Gateway time out.</td><td>Call can be retried.</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev.ucommerce.net/readme/headless/error-handling.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
