> For the complete documentation index, see [llms.txt](https://openapi-docs.nagaexchange.co.id/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://openapi-docs.nagaexchange.co.id/error-handling.md).

# Error Handling

This page describes the HTTP-level and application-level error responses returned by the NagaExchange API.

***

## HTTP Error Codes

* HTTP `4XX` return codes are used for malformed requests; the issue is on the sender's side.
* HTTP `429` return code is used when breaking a request rate limit.
* HTTP `418` return code is used when an IP has been auto-banned for continuing to send requests after receiving `429` codes.
* HTTP `5XX` return codes are used for internal errors.
* HTTP `504` return code is used when the API successfully sent the message but did not receive a response within the timeout period. It is important to **NOT** treat this as a failed operation — the execution status is **UNKNOWN** and could still have succeeded.
* Any endpoint may return an error. The error payload has the following shape:

```java
{
  "code": -1121,
  "msg": "Invalid symbol."
}
```

***

## Return Code Type

{% hint style="warning" %}
The codes listed below cover basic parameter-verification errors. If a return code you receive is **not** included in the list below, it originates outside the business layer — escalate it to NagaExchange technical staff.

Some of the returned `msg` values have not yet been translated into English. Until that work is complete, use the **Reason** listed below each `msg` to understand the cause of the issue, or contact technical support for guidance.
{% endhint %}

***

### 10XX - General Server or Network issues

{% hint style="info" %}

#### Code:-1000 UNKNOWN

msg: An unknown error occurred while processing the request

Reason: Incorrect symbol name or contract name in the input parameters.
{% endhint %}

{% hint style="info" %}

#### Code:-1001 DISCONNECTED

msg: 内部错误; 无法处理您的请求。 请再试一次

Reason: Internal error; unable to process your request. Please try again.
{% endhint %}

{% hint style="info" %}

#### Code:-1002 UNAUTHORIZED

msg: You are not authorized to execute this request. The request needs to send an API Key, and we recommend appending the X-CH-APIKEY to all request headers

Reason: The X\_CH\_APIKEY required for signature is not added to the header.
{% endhint %}

{% hint style="info" %}

#### Code:-1003 TOO\_MANY\_REQUESTS

msg: 请求过于频繁超过限制

Reason: Requests exceed the limit too frequently.
{% endhint %}

{% hint style="info" %}

#### Code:-1004 NO\_THIS\_COMPANY

msg: 您无权执行此请求 user not exit

Reason: You are not authorized to execute this request — the user does not exist for this company.
{% endhint %}

{% hint style="info" %}

#### Code:-1006 UNEXPECTED\_RESP

msg: 接收到了不符合预设格式的消息，下单状态未知

Reason: An unexpected response was received from the message bus. Execution status unknown — the Open API server encountered an exception while executing the request. Please report this to customer service.
{% endhint %}

{% hint style="info" %}

#### Code:-1007 TIMEOUT

msg: 等待后端服务器响应超时。 发送状态未知； 执行状态未知

Reason: Timeout waiting for response from backend server. Send status unknown; execution status unknown.
{% endhint %}

{% hint style="info" %}

#### Code:-1014 UNKNOWN\_ORDER\_COMPOSITION

msg: 不支持的订单组合

Reason: Unsupported order combination.
{% endhint %}

{% hint style="info" %}

#### Code:-1015 TOO\_MANY\_ORDERS

msg: Too many orders. Please reduce the number of your orders

Reason: The order quantity exceeds the maximum quantity limit
{% endhint %}

{% hint style="info" %}

#### Code:-1016 SERVICE\_SHUTTING\_DOWN

msg: 服务器下线

Reason: This service is no longer available.
{% endhint %}

{% hint style="info" %}

#### Code:-1017 NO\_CONTENT\_TYPE

msg: 我们建议在所有的请求头附加Content-Type, 并设置成application/json

Reason: We recommend attaching Content-Type to all request headers and setting it to application/json
{% endhint %}

{% hint style="info" %}

#### Code:-1020 UNSUPPORTED\_OPERATION

msg: 不支持此操作

Reason: This operation is not supported.
{% endhint %}

{% hint style="info" %}

#### Code:-1021 INVALID\_TIMESTAMP

msg: Invalid timestamp with too large time offset

Reason: The timestamp offset is too large. Timestamp for this request was 1000ms ahead of the server's time. Please check the difference between your local time and server time.
{% endhint %}

{% hint style="info" %}

#### Code:-1022 INVALID\_SIGNATURE

msg: Invalid signature

Reason: Signature verification failed
{% endhint %}

{% hint style="info" %}

#### Code:-1023 UNAUTHORIZED

msg: You are not authorized to execute this request. The request need to send timestamps, and we recommend appending X-CH-TS to all request headers

Reason: The X-CH-TS required for signature is not added to the header.
{% endhint %}

{% hint style="info" %}

#### Code:-1024 UNAUTHORIZED

msg: You are not authorized to execute this request. The request needs to send sign, and we recommend appending X-CH-SIGN to all request headers

Reason: The X-CH-SIGN required for signature is not added to the header.
{% endhint %}

***

### 11XX - Request issues

{% hint style="warning" %}

#### Code:-1100 ILLEGAL\_CHARS

msg: 请求中存在非法字符

Reason: Illegal characters found in a parameter.
{% endhint %}

{% hint style="warning" %}

#### Code:-1101 TOO\_MANY\_PARAMETERS

msg: 发送的参数太多

Reason: Too many parameters sent for this endpoint.
{% endhint %}

{% hint style="warning" %}

#### Code:-1102 MANDATORY\_PARAM\_EMPTY\_OR\_MALFORMED

msg: Forced parameter XXX not sent, empty or incorrect format

Reason: The parameter is null, a required parameter was not provided, or an input parameter has an incorrect format.
{% endhint %}

{% hint style="warning" %}

#### Code:-1103 UNKNOWN\_PARAM

msg: 发送了未知参数

Reason: Each request requires at least one parameter
{% endhint %}

{% hint style="warning" %}

#### Code:-1104 UNREAD\_PARAMETERS

msg: 并非所有发送的参数都被读取

Reason: Not all sent parameters were read — read '%s' parameter(s), but '%s' were sent.
{% endhint %}

{% hint style="warning" %}

#### Code:-1105

msg: The parameter XXX is empty

Reason: The required parameter is empty
{% endhint %}

{% hint style="warning" %}

#### Code:-1106 PARAM\_NOT\_REQUIRED

msg: 不需要发送此参数

Reason: Parameter '%s' sent when not required.
{% endhint %}

{% hint style="warning" %}

#### Code:-1111 BAD\_PRECISION

msg: 精度超过此资产定义的最大值

Reason: Precision is over the maximum defined for this asset.
{% endhint %}

{% hint style="warning" %}

#### Code:-1112

msg: There are no pending orders for trading pairs

Reason: The order that needs to be canceled does not exist
{% endhint %}

{% hint style="warning" %}

#### Code:-1116 INVALID\_ORDER\_TYPE

msg: Invalid order type

Reason: Invalid orderType. In the current version, valid ORDER\_TYPE values are LIMIT or MARKET.
{% endhint %}

{% hint style="warning" %}

#### Code:-1117 INVALID\_SIDE

msg: Invalid buying or selling direction

Reason: Invalid side. Valid ORDER\_SIDE values are BUY or SELL.
{% endhint %}

{% hint style="warning" %}

#### Code:-1121

msg: Invalid contract

Reason: Invalid symbol.
{% endhint %}

{% hint style="warning" %}

#### Code:-1136 ORDER\_QUANTITY\_TOO\_SMALL

msg: 订单数量小于最小值

Reason: Order volume lower than the minimum.
{% endhint %}

{% hint style="warning" %}

#### Code:-1138 ORDER\_PRICE\_WAVE\_EXCEED

msg: The order price is outside the allowable range

Reason: Order price exceeds permissible range.
{% endhint %}

{% hint style="warning" %}

#### Code:-1139 ORDER\_NOT\_SUPPORT\_MARKET

msg: The pair does not support market trading

Reason: This trading pair does not support market trading
{% endhint %}

{% hint style="warning" %}

#### Code:-1145

msg: The order status does not allow for cancellation

Reason: The order cannot be canceled
{% endhint %}

{% hint style="warning" %}

#### Code:-1147 PRICE\_VOLUME\_PRESION\_ERROR

msg: 价格或数量精度超过最大限制

Reason: Order price or quantity exceeds the maximum limit
{% endhint %}

***

### 2XXX - Other issues

{% hint style="info" %}

#### Code:-2013 NO\_SUCH\_ORDER

msg: 订单不存在

Reason: Order does not exist.
{% endhint %}

{% hint style="info" %}

#### Code:-2015

msg: Invalid API key, IP or operation permission

Reason: Signature or IP is incorrect.
{% endhint %}

{% hint style="info" %}

#### Code:-2016

msg: Transactions are frozen

Reason: The user's transaction is frozen
{% endhint %}

{% hint style="info" %}

#### Code:-2017 balance\_not\_enough

msg: 余额不足

Reason: Insufficient balance
{% endhint %}

{% hint style="info" %}

#### Code:-2100

msg: Parameter error

Reason: An incorrect parameter was provided, or the parameter is blocked.
{% endhint %}

{% hint style="info" %}

#### Code:-2200

msg: Illegal IP

Reason: IP is not trusted.
{% endhint %}

{% hint style="info" %}

#### Code:35

msg: 禁止下单(Forbidden to order)

Reason: User transactions may be restricted
{% endhint %}

***

See [Rate Limits](/rate-limits.md) for the request-frequency limits that trigger HTTP `429`/`418` responses, and [FAQ](/faq.md) for common troubleshooting questions.


---

# 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://openapi-docs.nagaexchange.co.id/error-handling.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.
