> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.noyax.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Result codes

> Full list of ResultCode and Errors[].Code values in responses.

Every response contains a 4-digit `ResultCode`. `0000` means success; any other code tells exactly what went wrong. See [Errors](/en/v1/guides/errors) for the response format and how multiple errors are returned.

## Code structure

The first two digits identify the **area** and the last two digits the **error** within that area, so a code tells you at a glance where the error comes from.

| Range  | Area                                                                                                                 |
| ------ | -------------------------------------------------------------------------------------------------------------------- |
| `00xx` | General                                                                                                              |
| `01xx` | Authentication, permissions and daily limit                                                                          |
| `02xx` | Request headers                                                                                                      |
| `05xx` | Definitions (`050x` country, `051x` city, `052x` district, `053x` shipment definition, `054x` currency, `055x` unit) |
| `10xx` | Customer                                                                                                             |
| `11xx` | Address                                                                                                              |
| `12xx` | Telephone                                                                                                            |
| `13xx` | Link                                                                                                                 |
| `14xx` | Representative                                                                                                       |
| `15xx` | Bank account                                                                                                         |
| `16xx` | Group membership                                                                                                     |
| `17xx` | Parameter                                                                                                            |
| `19xx` | Parameter definition                                                                                                 |
| `40xx` | Warehouse                                                                                                            |
| `41xx` | Section                                                                                                              |
| `20xx` | Product                                                                                                              |
| `21xx` | Product group detail                                                                                                 |
| `22xx` | Product parameter                                                                                                    |
| `23xx` | Product price                                                                                                        |
| `24xx` | Product critical stock definition                                                                                    |
| `25xx` | Product parameter definition                                                                                         |

`1xxx` belongs to the customer module. The product, invoice and stock modules will use `2xxx`, `3xxx` and `4xxx` respectively.

<Info>
  The meaning of a published code never changes; new situations get new codes. Integration logic based on codes is therefore safe. If you receive a code you do not recognize, act on the HTTP status code.
</Info>

## General

| Code   | HTTP     | Meaning                                                                        |
| ------ | -------- | ------------------------------------------------------------------------------ |
| `0000` | 200, 201 | Success                                                                        |
| `0001` | 500      | Unexpected server error                                                        |
| `0002` | 400      | Request body could not be read (malformed JSON, wrong field type)              |
| `0003` | 400      | A field exceeds its maximum length (the message names the field and the limit) |

## Authentication, permissions and limits

| Code   | HTTP | Meaning                                                                      |
| ------ | ---- | ---------------------------------------------------------------------------- |
| `0101` | 401  | Token missing or invalid                                                     |
| `0102` | 401  | Token expired, [refresh it](/en/v1/guides/authentication)                    |
| `0103` | 401  | Token is missing API key claims                                              |
| `0110` | 403  | The key lacks the [permission](/en/v1/guides/permissions) for this operation |
| `0120` | 429  | [Daily request limit](/en/v1/guides/rate-limits) exceeded                    |

## Request headers

| Code   | HTTP | Meaning                                              |
| ------ | ---- | ---------------------------------------------------- |
| `0201` | 400  | `X-UserID` not sent                                  |
| `0202` | 400  | `X-UserID` is not an integer greater than 0          |
| `0203` | 400  | `X-CompanyID` not sent                               |
| `0204` | 400  | `X-CompanyID` is not an integer greater than 0       |
| `0205` | 400  | `X-PeriodID` is not an integer greater than 0        |
| `0210` | 400  | User not found or deleted                            |
| `0211` | 400  | Company not found, or the user is not assigned to it |

## Definitions

| Code   | HTTP | Meaning                                                                                                                                |
| ------ | ---- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `0500` | 404  | Country not found                                                                                                                      |
| `0501` | 400  | Country `Name` is required                                                                                                             |
| `0502` | 400  | The country name is already used in the company                                                                                        |
| `0503` | 400  | The country cannot be deleted because it has cities                                                                                    |
| `0510` | 404  | City not found                                                                                                                         |
| `0511` | 400  | City `Name` is required                                                                                                                |
| `0512` | 400  | The city name is already used in the same country                                                                                      |
| `0513` | 400  | `CountryId` is required                                                                                                                |
| `0514` | 400  | Country in `CountryId` not found                                                                                                       |
| `0515` | 400  | The city cannot be deleted because it has districts                                                                                    |
| `0520` | 404  | District not found                                                                                                                     |
| `0521` | 400  | District `Name` is required                                                                                                            |
| `0522` | 400  | The district name is already used in the same city                                                                                     |
| `0523` | 400  | `CityId` is required                                                                                                                   |
| `0524` | 400  | City in `CityId` not found                                                                                                             |
| `0525` | 400  | The district cannot be deleted because it is used in customer addresses                                                                |
| `0530` | 404  | Shipment definition not found                                                                                                          |
| `0531` | 400  | Shipment definition `Code` is required                                                                                                 |
| `0532` | 400  | The shipment code is already used in the company                                                                                       |
| `0533` | 400  | `TransportMode` must be 1 (road), 2 (rail), 3 (maritime) or 4 (air)                                                                    |
| `0534` | 400  | The shipment definition cannot be deleted because it is used by customers                                                              |
| `0535` | 400  | `TransportInfo1` is required (plate, train, vessel or aircraft information)                                                            |
| `0536` | 400  | If any carrier field is filled, all five are required                                                                                  |
| `0537` | 400  | Driver 1 fields (first name, last name, national ID) are required when there is no carrier company                                     |
| `0540` | 404  | Currency not found                                                                                                                     |
| `0541` | 400  | Currency `Name` is required                                                                                                            |
| `0542` | 400  | The currency name is already used in the company                                                                                       |
| `0543` | 400  | Currency `Code` is required                                                                                                            |
| `0544` | 400  | The currency code is already used in the company                                                                                       |
| `0545` | 400  | The default currency cannot be deleted                                                                                                 |
| `0546` | 400  | The currency cannot be deleted because it is used in a record (invoice, order, quote, warehouse slip, cash voucher, bank account, ...) |
| `0550` | 404  | Unit not found                                                                                                                         |
| `0551` | 400  | Unit `Name` is required                                                                                                                |
| `0552` | 400  | The unit name is already used in the company                                                                                           |
| `0553` | 400  | The unit cannot be deleted because it is used as the main unit of a product                                                            |

## Customer

| Code   | HTTP | Meaning                                                                              |
| ------ | ---- | ------------------------------------------------------------------------------------ |
| `1000` | 404  | Customer not found or not visible to the user. Also returned by sub-record endpoints |
| `1001` | 400  | `CustomerCode` is required                                                           |
| `1002` | 400  | `CustomerCode` is already used by another customer in the company                    |
| `1003` | 400  | `CustomerCode` cannot be `"Next"` on update                                          |
| `1004` | 400  | `Name` is required                                                                   |
| `1005` | 400  | `TaxNumber` is required                                                              |
| `1006` | 400  | `TaxNumber` must be 10 (VKN) or 11 (TCKN) digits                                     |
| `1007` | 400  | `DueDays` cannot be less than 0                                                      |
| `1008` | 400  | `DiscountRate` must be between 0 and 100                                             |
| `1009` | 400  | `RiskLimit` cannot be less than 0                                                    |
| `1010` | 400  | `RiskControl` must be 1 or 2 when `RiskLimit` is greater than 0                      |
| `1011` | 400  | `RiskControl` must be 0, 1 or 2                                                      |
| `1012` | 400  | `RiskAction` must be 0, 1 or 2                                                       |
| `1013` | 400  | `MovementType` must be 1, 2 or 3                                                     |
| `1014` | 400  | `EInvoiceScenario` must be 1-9 when `EInvoiceUser` is `true`                         |
| `1015` | 400  | `EInvoiceScenario` must be 0 when `EInvoiceUser` is `false`                          |
| `1016` | 400  | `Note` is required when a `ShowNoteOn*` flag is `true`                               |
| `1017` | 400  | `SharingCodeId` is not one of the user's sharing codes                               |
| `1018` | 400  | Shipment definition in `ShipmentDefinitionId` not found                              |
| `1020` | 400  | Invalid `IdentitySchemes[].SchemeID`                                                 |
| `1021` | 400  | The same `SchemeID` was sent more than once                                          |
| `1022` | 400  | `Value` of an identity scheme is empty                                               |
| `1023` | 400  | `StartDate` is required (customer statement)                                         |
| `1024` | 400  | `EndDate` is required (customer statement)                                           |
| `1025` | 400  | `EndDate` cannot be before `StartDate` (customer statement)                          |

### Customer code generation

Codes that can be returned when `CustomerCode: "Next"` is sent. Details: [Customer code generation](/en/v1/customers/customer-code).

| Code   | HTTP | Meaning                                                  |
| ------ | ---- | -------------------------------------------------------- |
| `1080` | 400  | The company has no customer number series                |
| `1081` | 400  | The series has no parts                                  |
| `1082` | 400  | The series has a part type the API cannot generate       |
| `1083` | 400  | The generated code exceeds the series maximum length     |
| `1084` | 400  | The generated code is already used in the company        |
| `1085` | 400  | No unused code could be generated after several attempts |

## Address

| Code   | HTTP | Meaning                                                                  |
| ------ | ---- | ------------------------------------------------------------------------ |
| `1100` | 404  | Address not found                                                        |
| `1101` | 400  | `Address` is required                                                    |
| `1102` | 400  | `DistrictId` is required                                                 |
| `1103` | 400  | District not found                                                       |
| `1104` | 400  | When several addresses are sent, exactly one must be the invoice address |
| `1105` | 400  | The invoice address cannot be deleted                                    |
| `1106` | 400  | `IsInvoiceAddress` cannot be removed from the invoice address            |

## Telephone

| Code   | HTTP | Meaning                     |
| ------ | ---- | --------------------------- |
| `1200` | 404  | Telephone not found         |
| `1201` | 400  | `Number` is required        |
| `1202` | 400  | `NumberType` must be 1 or 2 |

## Link

| Code   | HTTP | Meaning                                                   |
| ------ | ---- | --------------------------------------------------------- |
| `1300` | 404  | Link not found                                            |
| `1301` | 400  | `Value` is required                                       |
| `1302` | 400  | `LinkType` must be between 0 and 5                        |
| `1303` | 400  | The value of an e-mail link is not a valid e-mail address |

## Representative

| Code   | HTTP | Meaning                               |
| ------ | ---- | ------------------------------------- |
| `1400` | 404  | Representative not found              |
| `1401` | 400  | `FullName` is required                |
| `1402` | 400  | `Email` is not a valid e-mail address |

## Bank account

| Code   | HTTP | Meaning                                                       |
| ------ | ---- | ------------------------------------------------------------- |
| `1500` | 404  | Bank account not found                                        |
| `1501` | 400  | `BankName` is required                                        |
| `1502` | 400  | Send either `Iban`, or `Branch` together with `AccountNumber` |
| `1503` | 400  | `CurrencyId` is required                                      |
| `1504` | 400  | Currency not found                                            |

## Group membership

| Code   | HTTP | Meaning                                               |
| ------ | ---- | ----------------------------------------------------- |
| `1600` | 404  | Group membership not found                            |
| `1601` | 400  | `GroupDetailId` is required                           |
| `1602` | 400  | Group detail not found, or its group is deleted       |
| `1603` | 400  | The customer is already a member of this group detail |
| `1604` | 400  | The same `GroupDetailId` was sent more than once      |
| `1605` | 400  | No detail selected from a mandatory group             |

## Parameter

| Code   | HTTP | Meaning                                                  |
| ------ | ---- | -------------------------------------------------------- |
| `1700` | 404  | Parameter not found                                      |
| `1701` | 400  | `ParameterDefinitionId` is required                      |
| `1702` | 400  | Parameter definition not found                           |
| `1703` | 400  | The customer already has this parameter definition       |
| `1704` | 400  | The same `ParameterDefinitionId` was sent more than once |
| `1705` | 400  | `Value` is required                                      |
| `1706` | 400  | Value of a text parameter is empty                       |
| `1707` | 400  | Value of a yes/no parameter must be `true` or `false`    |
| `1708` | 400  | Value of an integer parameter must be an integer         |
| `1709` | 400  | Value of a decimal parameter must be a number            |
| `1710` | 400  | Value of a date/time parameter must be a valid date      |
| `1711` | 400  | The type of the parameter definition is not supported    |
| `1712` | 400  | `ParameterDefinitionId` cannot be changed                |

## Product

| Code   | HTTP | Meaning                                                                                                               |
| ------ | ---- | --------------------------------------------------------------------------------------------------------------------- |
| `2000` | 404  | Product not found                                                                                                     |
| `2001` | 400  | `Code` is required                                                                                                    |
| `2002` | 400  | The product code is already used in the company                                                                       |
| `2003` | 400  | `Code` cannot be `Next` on update                                                                                     |
| `2004` | 400  | `Name` is required                                                                                                    |
| `2005` | 400  | `UnitId` is required                                                                                                  |
| `2006` | 400  | Unit not found in the company                                                                                         |
| `2007` | 400  | `ProductType` must be 1-5                                                                                             |
| `2008` | 400  | `StockType` must be 1-7                                                                                               |
| `2009` | 400  | VAT rate not found in the company                                                                                     |
| `2010` | 400  | `TransportMode` must be 0-8                                                                                           |
| `2011` | 400  | The group detail does not belong to that group or to the company                                                      |
| `2013` | 400  | The parent of the group detail is not the detail selected in the previous group                                       |
| `2012` | 400  | The product cannot be deleted because it is used in a record (invoice, order, quote, warehouse slip, production, ...) |
| `2014` | 400  | `StockType` cannot be set to 1 (no stock tracking) while the product has critical stock definitions                   |
| `2080` | 400  | The **ÜRÜN** serial number definition does not exist in the company                                                   |
| `2081` | 400  | The **ÜRÜN** serial number has no details                                                                             |
| `2082` | 400  | Unsupported serial number part type (parameter 1/2)                                                                   |
| `2083` | 400  | The generated code exceeds the maximum length of the serial number                                                    |
| `2084` | 400  | The generated product code is already used in the company                                                             |
| `2085` | 400  | The product code could not be generated, try again                                                                    |

## Product group detail

| Code   | HTTP | Meaning                                                                              |
| ------ | ---- | ------------------------------------------------------------------------------------ |
| `2100` | 404  | Product group detail not found                                                       |
| `2101` | 400  | `Name` is required                                                                   |
| `2102` | 400  | The detail name is already used in this group                                        |
| `2103` | 400  | `GroupNumber` must be 1-5                                                            |
| `2104` | 400  | A group 1 detail cannot have a parent                                                |
| `2105` | 400  | `ParentGroupDetailId` must be a detail of the previous group                         |
| `2106` | 400  | The detail cannot be deleted because it is used by a product                         |
| `2107` | 400  | The detail cannot be deleted because it has child details                            |
| `2108` | 400  | `GroupNumber` cannot be changed while the detail has children or is used by products |
| `2109` | 400  | `ParentGroupDetailId` cannot be changed while the detail has child details           |

## Product parameter

| Code   | HTTP | Meaning                                                   |
| ------ | ---- | --------------------------------------------------------- |
| `2200` | 404  | Product parameter not found                               |
| `2201` | 400  | `ParameterDefinitionId` is required                       |
| `2202` | 400  | Parameter definition not found                            |
| `2203` | 400  | This parameter definition is already used by this product |
| `2204` | 400  | `Value` is required                                       |
| `2205` | 400  | The value of a text parameter cannot be empty             |
| `2206` | 400  | The value of a yes/no parameter must be true/false        |
| `2207` | 400  | The value of an integer parameter must be an integer      |
| `2208` | 400  | The value of a decimal parameter must be a number         |
| `2209` | 400  | The value of a date/time parameter must be a valid date   |
| `2210` | 400  | Unsupported parameter type                                |
| `2211` | 400  | `ParameterDefinitionId` cannot be changed                 |

## Product price

| Code   | HTTP | Meaning                                                            |
| ------ | ---- | ------------------------------------------------------------------ |
| `2300` | 404  | Product price not found                                            |
| `2301` | 400  | `PriceType` must be 1 (purchase) or 2 (sales)                      |
| `2302` | 400  | `Price` must be greater than 0                                     |
| `2303` | 400  | `Discount` cannot be negative                                      |
| `2304` | 400  | `Discount` cannot exceed 100 while `IsDiscountPercentage` is true  |
| `2305` | 400  | `StartDate` and `EndDate` are required                             |
| `2306` | 400  | `EndDate` must be after `StartDate`                                |
| `2307` | 400  | `CurrencyId` is required                                           |
| `2308` | 400  | Currency not found in the company                                  |
| `2309` | 400  | `UnitId` is not one of the product's own units (Unit1/Unit2/Unit3) |
| `2310` | 400  | Customer not found in the company                                  |
| `2311` | 400  | Customer group not found in the company                            |
| `2312` | 400  | `CustomerGroupDetailId` is not a detail of `CustomerGroupId`       |
| `2313` | 400  | `CustomerGroupDetailId` cannot be sent without `CustomerGroupId`   |
| `2314` | 400  | `CustomerId` cannot be combined with the group fields              |
| `2315` | 400  | `UnitId` is required                                               |

## Product critical stock definition

| Code   | HTTP | Meaning                                                                                          |
| ------ | ---- | ------------------------------------------------------------------------------------------------ |
| `2400` | 404  | Critical stock definition not found                                                              |
| `2401` | 400  | `WarehouseId` is required                                                                        |
| `2402` | 400  | Warehouse not found in the company                                                               |
| `2403` | 400  | A definition for this product and warehouse already exists                                       |
| `2404` | 400  | `MinStock` cannot be negative                                                                    |
| `2405` | 400  | `MaxStock` cannot be negative                                                                    |
| `2406` | 400  | `MaxStock` cannot be less than `MinStock` when greater than 0                                    |
| `2407` | 400  | `MaxStockControl` must be 0, 1 or 2                                                              |
| `2408` | 400  | `MinStockControl` must be 0, 1 or 2                                                              |
| `2409` | 400  | `NegativeStockControl` must be 0, 1 or 2                                                         |
| `2410` | 400  | A critical stock definition cannot be added for a product with `StockType` 1 (no stock tracking) |

## Warehouse

| Code   | HTTP | Meaning                                                                                                                                      |
| ------ | ---- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `4000` | 404  | Warehouse not found                                                                                                                          |
| `4001` | 400  | Warehouse `Name` is required                                                                                                                 |
| `4002` | 400  | The warehouse name is already used in the company                                                                                            |
| `4003` | 400  | The warehouse cannot be deleted because it has sections                                                                                      |
| `4004` | 400  | The warehouse cannot be deleted because it is used in a record (invoice, order, warehouse slip, stock count, critical stock definition, ...) |

## Section

| Code   | HTTP | Meaning                                                                                         |
| ------ | ---- | ----------------------------------------------------------------------------------------------- |
| `4100` | 404  | Section not found                                                                               |
| `4101` | 400  | Section `Name` is required                                                                      |
| `4102` | 400  | The section name is already used in the warehouse                                               |
| `4103` | 400  | The section cannot be deleted because it is used in a record (warehouse slip, stock count, ...) |

## Parameter definition

| Code   | HTTP | Meaning                                                           |
| ------ | ---- | ----------------------------------------------------------------- |
| `1900` | 404  | Parameter definition not found                                    |
| `1901` | 400  | `Name` is required                                                |
| `1902` | 400  | The definition name is already used in the company                |
| `1903` | 400  | `Type` must be between 0 and 6                                    |
| `1904` | 400  | The definition cannot be deleted because it is used by a customer |

## Product parameter definition

| Code   | HTTP | Meaning                                                          |
| ------ | ---- | ---------------------------------------------------------------- |
| `2500` | 404  | Parameter definition not found                                   |
| `2501` | 400  | `Name` is required                                               |
| `2502` | 400  | The definition name is already used in the company               |
| `2503` | 400  | `Type` must be between 0 and 6                                   |
| `2504` | 400  | The definition cannot be deleted because it is used by a product |
