Tradesync
Browse API reference
API reference

Response format

Last updated

Responses use a JSON envelope. The HTTP status is also included in the body as status.

Response fields

Field Type Description
result string success, multi, fail, or error
status integer HTTP status code
code string Machine-readable code on failed and error responses
message string Description of the code on failed and error responses
data object or array Resource, resource list, bulk results, or failure details; an empty array when no data is returned
meta object Pagination metadata on list responses; a sibling of data

Results

Value Description
success HTTP 200; the request succeeded
multi HTTP 207; inspect each item in data for its own result
fail A client or request failure; inspect code and message
error A system or maintenance error; inspect code and message

For trading-command creation, success confirms that the command was created. Inspect the command's status, result, or events to determine whether it executed.

Successful response

Example for an endpoint that returns no resource data:

{
    "result": "success",
    "status": 200,
    "data": []
}

Resource endpoints document their data objects inline. List responses return a data array and the metadata described in Pagination.

Failed response

{
    "result": "fail",
    "status": 404,
    "code": "not_found",
    "message": "The resource does not exist.",
    "data": []
}

Error response

{
    "result": "error",
    "status": 500,
    "code": "error",
    "message": "System error occurred, please retry.",
    "data": []
}

See Common response codes for shared errors. Endpoint pages list their additional error codes.