跳转至

获取企业所有的成本中心

功能说明

根据企业ID获取企业所有的成本中心

接口地址

HTTP请求方式

  • Method: POST
  • Content-Type: application/x-www-form-urlencoded

参数说明

  • 公有参数

发送请求是必须传入公共参数,详见公共参数

  • 私有参数
参数名称 是否必须 参数类型 长度限制 描述
enterprise_code string [1,20] 企业编号(集团和运营商必填,企业不填)
cost_center_code string [1,50] 成本中心编号
## 请求示例
POST /billing/cost/findByEnterpriseId HTTP/1.1
Host: openapi.guanaitong.tech
Content-Type: application/x-www-form-urlencoded
cache-control: no-cache

access_token=fdd9318db2fdf96f152226231d2b8f49&sign=6fc42a2a0fd3f3fb0602da732272bee406bef5e8&timestamp=1584590939

返回参数说明

参数说明 描述
code 返回码,0代表正确返回
msg 如果错误,返回错误信息。
data 如果没有错误,返回业务数据,此处返回成本中心信息列表List<CostCenterRes>

CostCenterRes对象

字段名 描述
cost_center_id Integer类型,成本中心id
cost_center_name String类型,成本中心名称
cost_center_code String类型,成本中心编号
cost_center_desc String类型,成本中心描述
cost_center_tags List类型,成本中心标签
status Integer类型,状态 1-生效 2-失效

正确返回示例

{
  "code": 0,
  "data": [
    {
      "cost_center_id": 9,
      "cost_center_name": "test-cost-center-new",
      "cost_center_code": "b1234567890",
      "cost_center_desc": "miaoshu",
      "cost_center_tags": ["codea"],
      "status": 1
    },
    {
      "cost_center_id": 10,
      "cost_center_name": "test-cost-center460",
      "cost_center_code": "test-code460",
      "cost_center_desc": "miaoshu",
      "cost_center_tags": ["code_a","code_b"],
      "status": 1
    },
    {
      "cost_center_id": 19,
      "cost_center_name": "我的成本",
      "cost_center_code": "20",
      "cost_center_desc": "miaoshu",
      "cost_center_tags": [],
      "status": 1
    }
  ],
  "msg": "OK"
}

错误返回示例

{
  "code": 1000210001,
  "msg": "timestamp check failed!",
  "data": null
}
回到页面顶部