Skip to main content

Response Structure

Success response

Single Object Response Structure

Used for endpoints that return a single object, like /order/place and /user/profile.

{
"status": "success",
"data": {
"key1": "value1",
"key2": "value2",
...
}
}

Multiple Object Response Structure

Used for endpoints that return a multiple object, like /user/get-funds-and-margin

{
"status": "success",
"data": [
{
"key1": "value1",
"key2": "value2",
...
},
{
"key1": "value1",
"key2": "value2",
...
}
]
}

Properties:

PropertyDescription
statusA string indicating the outcome of the request. Typically success for successful operations.
dataSingle An object holding the response content with various key-value pairs.
Multiple An array containing the main content of the response. Each element of the array is an object with various key-value pairs.

Error response

{
"status": "error",
"errors": [
{
"error_code": "string",
"message": "string",
"property_path": null,
"invalid_value": null
}
]
}

Properties:

PropertyDescription
statusA string indicating the outcome of the request. In this context, the term error represents a failure in the operation.
errorsAn array containing the main content of the error response.
error_codeA specific error. Refer to the "Error Code" section for explanations.
messageDescriptive error message.
property_pathIndicates which part of the request triggered the error. It can be null.
invalid_valueShows the value causing the error. It can be null.

The camelCase fields (errorCode, propertyPath, and invalidValue) are deprecated and will be removed in future versions. Use the snake_case versions for consistency.