Response & Errors

The Treatar API returns responses in a consistent JSON format for all endpoints.

Standard Response Structure

Every response contains the following fields:

Field
Type
Description

status

boolean

Indicates whether the request was successful

message

string

Human-readable description of the result

data

object / array / null

The response payload

Successful Response

{
  "status": true,
  "message": "Sale added successfully",
  "data": {}
}

Failed Response

{
  "status": false,
  "message": "Invalid request parameters",
  "data": null
}

HTTP Status Codes

Status Code
Description

200

Request completed successfully

400

Bad request (validation error or missing parameters)

401

Unauthorized (missing or invalid API key)

403

Forbidden (subscription expired or insufficient permissions)

429

Too many requests (rate limit exceeded)

Last updated