Error Code Reference

Learn about the standard JSON-RPC error codes

HTTP Status Codes

In addition to the standard The Open Network JSON-RPC error codes, TONX API will return the following status codes for HTTP requests:

CodeDescription
200OK -- the request is successfully
400Bad Request -- Your request is invalid. Double-check your JSON-RPC body.
401Unauthorized -- You must authenticate your request with an API key.
403Forbidden -- You've use wrong key to query specific network(using testent key to query mainnet data)
429Too Many Requests -- You've exceeded your concurrent requests capacity.
500internal Server Error -- We're unable to process your request right now. Get in touch with us if you see this.
503Service unavailable -- unable to complete the request due to server issues

JSON-RPC Error Codes

CodePossible Return MessageDescription
-32000Server errorReserved for implementation-defined server errors. See note below.
-32001Data ExpiredData not found. TONX API can query data for limited duration.
-32002The bag of cells format is incorrect or corrupted.The bag of cells format is incorrect or corrupted.
-32003Transaction not found.Please verify that the request parameters are correct and try again.
-32005Limit ExceededRequest limit exceeded.
-32007Invitation code expiredInvitation code expired
-32008Invalid OpcodeOpcode is invalid
-32600Unauthorized Token, etc.Using unauthorized API keys and other cases. See note below.
-32601Method not foundThe method does not exist/is not available.
-32602Invalid parameterInvalid method parameter(s).
-32603Internal errorInternal JSON-RPC error.
-32700Parse errorInvalid JSON was received by the server. An error occurred on the server while parsing the JSON text.
-40011Too Many RequestsYou've exceeded your concurrent requests capacity.
-50001Hex string odd length. Parsing Failed(TONX Lab) Parsing of the hex string failed due to odd length.
-50002Invalid boc(TONX Lab) Boc is invalid
-50003No matching boc encoding format(TONX Lab) Boc encoding format does not match
-50004Hex invalid boc magic header(TONX Lab) Boc magic header hex is invalid
-50005Hex checksum not match(TONX Lab) Hex checksum does not match

📘

NOTE:

-32000 is used for general server errors

"resource not found case"

-32600 is used for many errors about the authentication failed

"Forbidden Access"

"Invalid Request"

"Unauthoized Token"

-32603 is used for several errors

"fallback"

"internal error case"

Example Response

{
    "jsonrpc":"2.0",
    "error":{
        "code":-32000,
        "message": "Interal Error"
    },
    "id":1
}