コストセンターを作成する
エンドポイント
POST https://api.verifik.co/v2/cost-centers
アカウントにコストセンターを作成します。管理ではクレジットを消費しません。
ヘッダー
| 名前 | 値 |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
ボディパラメータ
name
型: string
必須: はい
表示名。120 文字まで。
code
型: string
必須: はい
x-cost-center に送る値。文字、数字、.、-、_。60 文字まで。アカウントごとに一意。
country
型: string
必須: はい
ISO-2 の国コード。例: ES。
active
型: boolean
必須: いいえ
既定は true。
リクエスト例
- cURL
- Node.js
- Python
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"}'
const axios = require("axios");
const config = {
method: "post",
url: "https://api.verifik.co/v2/cost-centers",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
},
data: {
name: "スペイン運用",
code: "SPAIN-OPS",
country: "ES"
}
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
import os
import requests
response = requests.post(
"https://api.verifik.co/v2/cost-centers",
headers={
"Authorization": f"Bearer {os.environ['VERIFIK_TOKEN']}",
"Content-Type": "application/json",
},
json={"name": "スペイン運用", "code": "SPAIN-OPS", "country": "ES"},
)
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_code_taken",
"code": "Conflict"
}
name、code、country のように欠けている、または無効なフィールド:
{
"message": "\"name\" is required",
"code": "MissingParameter"
}