Skip to main content

Cost Centers

A cost center is a label for part of your business, such as a country operation or a team. Every request your account makes can carry one, and the Usage API can group totals and CSV exports by it. Managing cost centers does not spend credits.

You can also manage them in the client panel under Settings → Cost Centers.

This applies to requests you make after you set it up. Requests already stored keep the cost center they had.

  1. Create the cost center. In the client panel, open Settings → Cost Centers and add one, or call POST /v2/cost-centers. Keep the code, for example SPAIN-OPS.
  2. Choose how later calls get it.
    • On each call: send the header x-cost-center with the code or the id.
    • On every call that uses a token: open Settings → API Key, pick that project, and save a default. The same write is PUT /v2/projects/{id} with { "costCenter": "<id>" }. Send null to clear it.
    • By country: keep exactly one active cost center for that ISO-2 code. A call to /v2/es/... then uses the Spain center, with no header.
  3. Make a normal data call. When you send the header, it wins over the project default and the country rule.
curl "https://api.verifik.co/v2/co/cedula?documentType=CC&documentNumber=123456789" \
-H "Authorization: Bearer $VERIFIK_TOKEN" \
-H "x-cost-center: SPAIN-OPS"
  1. Check the consumption. In the panel, open Settings → Usage Report and group or filter by cost center. The same split is GET /v2/usage?groupBy=costCenter on the Usage API. Requests with no cost center are the empty group.
  2. A later change does not rewrite older requests. Updating the project default, or deactivating a center, only affects calls made after that. History already stamped stays as it was.

How a request gets a cost center​

Verifik checks these in order and uses the first match:

  1. The x-cost-center header. Send the code or the id on any data API request. If the value doesn't match an active cost center on your account, the request fails with 400 before any credits are spent.
  2. The default on the token's project. Set it with PUT /v2/projects/{id} and { "costCenter": "<id>" } (send null to clear it). An id that isn't an active cost center on your account returns 409 with invalid_cost_center.
  3. The endpoint's country. A request to /v2/es/... uses your cost center for ES when you have exactly one active cost center for that country.

When nothing matches, the request has no cost center and appears as null in usage reports.

curl "https://api.verifik.co/v2/co/cedula?documentType=CC&documentNumber=123456789" \
-H "Authorization: Bearer $VERIFIK_TOKEN" \
-H "x-cost-center: SPAIN-OPS"
{
"code": "BadRequest",
"message": "x-cost-center does not match an active cost center on this account"
}

Endpoints​