Skip to main content

创建成本中心

接口​

POST https://api.verifik.co/v2/cost-centers

在账户上创建一个成本中心。管理成本中心不消耗积分。

请求头​

名称值
Content-Typeapplication/json
AuthorizationBearer <token>

请求体参数​

name​

类型: string
必填: 是

显示名称,最多 120 个字符。

code​

类型: string
必填: 是

将在 x-cost-center 中发送的值。字母、数字、.、- 和 _,最多 60 个字符。每个账户唯一。

country​

类型: string
必填: 是

ISO-2 国家代码,例如 ES。

active​

类型: boolean
必填: 否

默认为 true。

请求示例​

curl -X POST "https://api.verifik.co/v2/cost-centers" \
-H "Authorization: Bearer $VERIFIK_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"西班牙运营","code":"SPAIN-OPS","country":"ES"}'

响应示例​

{
"data": {
"_id": "6acfbdda92451bac5d0a7ebe",
"client": "69c2b824295cd7d276e478ad",
"name": "西班牙运营",
"code": "SPAIN-OPS",
"country": "ES",
"active": true,
"createdAt": "2026-10-14T17:37:30.469Z",
"updatedAt": "2026-10-14T17:37:30.469Z"
}
}

data 是新的成本中心对象。

错误响应​

账户上已存在的代码:

{
"message": "cost_center_code_taken",
"code": "Conflict"
}

缺少或无效的字段,例如 name、code 或 country:

{
"message": "\"name\" is required",
"code": "MissingParameter"
}