查询一个成本中心
接口
GET https://api.verifik.co/v2/cost-centers/{id}
返回账户上的一个成本中心,包括代码、国家和是否启用。
请求头
| 名称 | 值 |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
路径参数
id
类型: string
必填: 是
创建时返回的成本中心 id。
请求示例
- cURL
- Node.js
- Python
curl "https://api.verifik.co/v2/cost-centers/6acfbdda92451bac5d0a7ebe" \
-H "Authorization: Bearer $VERIFIK_TOKEN"
const axios = require("axios");
const config = {
method: "get",
url: "https://api.verifik.co/v2/cost-centers/6acfbdda92451bac5d0a7ebe",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
}
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
import os
import requests
response = requests.get(
"https://api.verifik.co/v2/cost-centers/6acfbdda92451bac5d0a7ebe",
headers={"Authorization": f"Bearer {os.environ['VERIFIK_TOKEN']}"},
)
print(response.json())
响应示例
- 200 OK
{
"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_not_found",
"code": "NotFound"
}