> For the complete documentation index, see [llms.txt](https://developer.esw.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.esw.com/returns-api/grp-returns-api/error-handling/api-specific-error-codes.md).

# API Specific Error Codes

The following table lists the unique error responses for both versions of the Returns API.

### GetReturn

| Code | Message                              | Description                                                 |
| ---- | ------------------------------------ | ----------------------------------------------------------- |
| 0    | RequestDoesNotContainAllRequiredInfo | A required field is missing.                                |
| 2    | ReturnOrderNotFound                  | The system could not find the return order in the database. |

### UpdateReturn

| Code | Message                                            | Description                                                                      |
| ---- | -------------------------------------------------- | -------------------------------------------------------------------------------- |
| 0    | RequestDoesNotContainAllRequiredInfo               | A required field is missing.                                                     |
| 1    | ReturnOrderNotFound                                | The system could not find the return order in the database.                      |
| 2    | ReturnOrderNotUpdatedReturnIsAlreadyOnHold         | The return order is on hold.                                                     |
| 3    | ReturnOrderNotUpdatedReturnOrderWasNotOnHold       | The return order is not on hold.                                                 |
| 4    | ReturnOrderNotUpdatedOrderArticlesDoNotMatch       | The order articles in the request do not match the articles in the return order. |
| 5    | ReturnOrderNotUpdatedReturnHasAlreadyBeenProcessed | The return has already been processed.                                           |
| 7    | ReturnOrderNotUpdatedReturnHasAlreadyHadActivity   | The return order had an activity, for example, the status was changed.           |
| 8    | ReturnOrderNotUpdatedReturnHasAlreadyBeenCancelled | The return order is already cancelled.                                           |

### CreateReturn

| Code | Message                                             | Description                                                                                               |
| ---- | --------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| 0    | RequestDoesNotContainAllRequiredInfo                | A required field is missing.                                                                              |
| 1    | OrderNotFound                                       | The system could not find the order in the database.                                                      |
| 2    | ReturnOrderNotCreatedCancelOrderIsNotAllowed        | The return order could not be created because the order cancellation is not allowed.                      |
| 3    | ReturnOrderNotCreatedCancelOrderIsNotValidForReturn | The return order could not be created because the matching order articles are not available for a return. |
| 6    | ReturnOrderNotCreatedLabelFailed                    | The return label could not be generated.                                                                  |

### UndeliverableReturns

| Code | Message                                           | Description                                    |
| ---- | ------------------------------------------------- | ---------------------------------------------- |
| 0    | RequestDoesNotContainAllRequiredInfo              | A required field is missing.                   |
| 1    | PackageNotFound                                   | The system is unable to find the package.      |
| 2    | PackageItemHasAlreadyBeenProcessedAsUndeliverable | An undeliverable return order already exists.  |
| 3    | AtleastOnePackageItemHasAlreadyBeenReturned       | The order articles have already been returned. |


---

# 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 dynamically by asking a question.

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

```
GET https://developer.esw.com/returns-api/grp-returns-api/error-handling/api-specific-error-codes.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
