Get Common Data

GET/api/common/{type}

Retrieves common system data based on the specified type. This is a routing method that calls the appropriate helper method.

Headers

FieldTypeDescription
authtoken String Authentication token, generated from admin area

Parameters

FieldTypeDescription
type String Data type. Must be one of: expense_category, payment_mode, tax_data
curl -X GET "https://yoursite.com/api/common/tax_data" \
  -H "authtoken: YOUR_API_TOKEN"

Success-Response (expense_category):

HTTP/1.1 200 OK
[
  {
    "id": "1",
    "name": "cloud server",
    "description": "AWS server"
  }
]

Success-Response (payment_mode):

HTTP/1.1 200 OK
[
  {
    "id": "1",
    "name": "Bank",
    "description": null,
    "show_on_pdf": "0",
    "invoices_only": "0",
    "expenses_only": "0",
    "selected_by_default": "1",
    "active": "1"
  }
]

Success-Response (tax_data):

HTTP/1.1 200 OK
[
  {
    "id": "1",
    "name": "CGST",
    "taxrate": "9.00"
  }
]

Error-Response:

HTTP/1.1 404 Not Found
{
  "status": false,
  "message": "Not valid data"
}

Error-Response:

HTTP/1.1 404 Not Found
{
  "status": false,
  "message": "No data were found"
}
MethodGET
Path/api/common/{type}
GroupCommon
Sincev0.3.0
Defined inmodules/api/controllers/Common.php