Cost Center

Get list of cost centers

  • Endpoint: {SERVER_URL}/api/method/eclectics.api.cost_center.list

  • Method: GET

  • Payload:

{
    "doctype": "Account",
    "fields": ["name", "cost_center_name", "cost_center_number", "disabled", "is_group", "parent_cost_center"],
    "filters": [["company", "=", "Demo Company Ltd"]],
    "start": 0,
    "page_length": 0,
    "order_by": "creation desc"
}
  • Headers

{
    "Authorization": "token <YOUR_TOKEN>"
}

Create Cost Center

  • Endpoint: {SERVER_URL}/api/method/eclectics.api.cost_center.create

  • Method: POST

  • Payload:

{
    "cost_center_name" : "Mombasa",
    "cost_center_number" : null,
    "disabled" : false,
    "is_group" : false,
    "parent_cost_center" : "Demo Company Ltd (Demo) - DCLD"
}
  • Headers

{
   "Authorization": "token <YOUR_TOKEN>"
}

Update Cost Center

  • Endpoint: {SERVER_URL}/api/method/eclectics.api.cost_center.update

  • Method: POST

  • Payload:

{
    "id": "Mombasa - DCLD",
    "cost_center_name" : "Mombasa",
    "cost_center_number" : null,
    "disabled" : false,
    "is_group" : false,
    "parent_cost_center" : "Demo Company Ltd (Demo) - DCLD"
}
  • Headers

{
    "Authorization": "token <YOUR_TOKEN>"
}

Delete Cost Center

  • Endpoint: {SERVER_URL}/api/method/eclectics.api.cost_center.delete

  • Method: DELETE

  • Payload:

{
    "doc_id": "Mombasa - DCLD"
}
  • Headers

{
    "Authorization": "token <YOUR_TOKEN>"
}

Get a single Cost Center

  • Endpoint: {SERVER_URL}/api/method/eclectics.api.cost_center.get

  • Method: GET

  • Payload:

{
    "doc_id": "Mombasa - DCLD"
}
  • Headers

{
    "Authorization": "token <YOUR_TOKEN>"
}