DonutworkHelp Center
Api ReferenceOrganizzazione
Documentazione Donutwork

Company

Manage and retrieve organizational metadata and module configurations.

Company

The Company API allows you to retrieve metadata about your own organization and lookup public data for third-party companies using VAT identifiers.


Get Company Profile

Retrieve the core configuration and identification attributes for your company profile. This includes your unique internal identifier and official registered name.

GET
/2026-02-01/company.json
Required permissioncompany:read

Path, query, and header parameters

No path, query, or additional header parameters.

Responses

Company profile retrieved successfully.

{
  "id": "668ea32f5485467fd7149f48",
  "name": "Acme Corp"
}

Request examples

curl --request GET 'https://api.hub.donutwork.com/2026-02-01/company.json' \
  --header 'Authorization: Bearer YOUR_API_KEY'
const response = await fetch('https://api.hub.donutwork.com/2026-02-01/company.json', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer ' + process.env.DONUTWORK_API_KEY,
  },
});
const requestId = response.headers.get('x-request-id');
if (!response.ok) {
  const error = await response.text();
  throw new Error(`${response.status} ${error} [${requestId}]`);
}
const contentType = response.headers.get('content-type') ?? '';
const data = response.status === 204 ? null
  : contentType.includes('application/json') ? await response.json()
  : await response.text();
$request = curl_init('https://api.hub.donutwork.com/2026-02-01/company.json');
curl_setopt_array($request, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('DONUTWORK_API_KEY'),
    ],
]);
$response = curl_exec($request);
if ($response === false) {
    $error = curl_error($request);
    curl_close($request);
    throw new RuntimeException($error);
}
$status = curl_getinfo($request, CURLINFO_RESPONSE_CODE);
$contentType = (string) curl_getinfo($request, CURLINFO_CONTENT_TYPE);
curl_close($request);
if ($status >= 400) { throw new RuntimeException($response); }
$data = $status === 204 ? null
    : (str_contains($contentType, 'application/json')
        ? json_decode($response, true, flags: JSON_THROW_ON_ERROR) : $response);

Replace uppercase placeholders and sample values with your own data and company resource IDs. Keep the API key on a trusted server. Reuse an idempotency key only for the same logical request and payload.


List Active Modules

Discover and monitor the status of functional modules enabled for your organization. Each module represents a specific capability (e.g., Recurring Payments, Email Gateway) along with its configuration and activation state.

GET
/2026-02-01/company/modules.json
Required permissioncompany_modules:read

Path, query, and header parameters

No path, query, or additional header parameters.

Responses

List of organizational modules.

[
  {
    "id": "recurring-payments",
    "description": "Automated subscription billing and payment orchestration.",
    "price": 0,
    "active": true
  },
  {
    "id": "email-gateway",
    "description": "Transactional email delivery via unified REST interface.",
    "price": 0,
    "active": true
  },
  {
    "id": "geoip",
    "description": "IPv4 geolocation and regional metadata resolution.",
    "price": 0,
    "active": true
  }
]

Request examples

curl --request GET 'https://api.hub.donutwork.com/2026-02-01/company/modules.json' \
  --header 'Authorization: Bearer YOUR_API_KEY'
const response = await fetch('https://api.hub.donutwork.com/2026-02-01/company/modules.json', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer ' + process.env.DONUTWORK_API_KEY,
  },
});
const requestId = response.headers.get('x-request-id');
if (!response.ok) {
  const error = await response.text();
  throw new Error(`${response.status} ${error} [${requestId}]`);
}
const contentType = response.headers.get('content-type') ?? '';
const data = response.status === 204 ? null
  : contentType.includes('application/json') ? await response.json()
  : await response.text();
$request = curl_init('https://api.hub.donutwork.com/2026-02-01/company/modules.json');
curl_setopt_array($request, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('DONUTWORK_API_KEY'),
    ],
]);
$response = curl_exec($request);
if ($response === false) {
    $error = curl_error($request);
    curl_close($request);
    throw new RuntimeException($error);
}
$status = curl_getinfo($request, CURLINFO_RESPONSE_CODE);
$contentType = (string) curl_getinfo($request, CURLINFO_CONTENT_TYPE);
curl_close($request);
if ($status >= 400) { throw new RuntimeException($response); }
$data = $status === 204 ? null
    : (str_contains($contentType, 'application/json')
        ? json_decode($response, true, flags: JSON_THROW_ON_ERROR) : $response);

Replace uppercase placeholders and sample values with your own data and company resource IDs. Keep the API key on a trusted server. Reuse an idempotency key only for the same logical request and payload.


Company Intelligence Stats

Retrieve the company intelligence snapshot used by operational dashboards. This endpoint returns KPI data, usage widgets, revenue chart aggregates, and metadata for the current company context.

GET
/2026-02-01/company/stats/intelligence.json
Required permissioncompany_stats:read

Path, query, and header parameters

No path, query, or additional header parameters.

Responses

Company intelligence payload retrieved.

{
  "kpi": {
    "mrr_growth": {
      "raw_percent": 12.3,
      "display_label": "12.30%"
    },
    "total_customers": 120,
    "active_subscriptions": 93
  },
  "usage": {
    "banner": {
      "show": false,
      "status": null,
      "upgrade_url": null
    },
    "widgets": []
  },
  "recent_activity": [],
  "revenue_chart": {
    "graph": [],
    "stats": {
      "one_shot": 0,
      "subscriptions": 0,
      "total": 0
    }
  },
  "revenue_insights": {
    "visible": false,
    "net_revenue": 0,
    "tax_total": 0,
    "discounts_total": 0,
    "services": [],
    "top_services": []
  },
  "meta": {
    "company_id": "668ea32f5485467fd7149f48",
    "year": 2026,
    "month": 4,
    "generated_at": "2026-04-15T10:00:00+00:00"
  }
}

Request examples

curl --request GET 'https://api.hub.donutwork.com/2026-02-01/company/stats/intelligence.json' \
  --header 'Authorization: Bearer YOUR_API_KEY'
const response = await fetch('https://api.hub.donutwork.com/2026-02-01/company/stats/intelligence.json', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer ' + process.env.DONUTWORK_API_KEY,
  },
});
const requestId = response.headers.get('x-request-id');
if (!response.ok) {
  const error = await response.text();
  throw new Error(`${response.status} ${error} [${requestId}]`);
}
const contentType = response.headers.get('content-type') ?? '';
const data = response.status === 204 ? null
  : contentType.includes('application/json') ? await response.json()
  : await response.text();
$request = curl_init('https://api.hub.donutwork.com/2026-02-01/company/stats/intelligence.json');
curl_setopt_array($request, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('DONUTWORK_API_KEY'),
    ],
]);
$response = curl_exec($request);
if ($response === false) {
    $error = curl_error($request);
    curl_close($request);
    throw new RuntimeException($error);
}
$status = curl_getinfo($request, CURLINFO_RESPONSE_CODE);
$contentType = (string) curl_getinfo($request, CURLINFO_CONTENT_TYPE);
curl_close($request);
if ($status >= 400) { throw new RuntimeException($response); }
$data = $status === 204 ? null
    : (str_contains($contentType, 'application/json')
        ? json_decode($response, true, flags: JSON_THROW_ON_ERROR) : $response);

Replace uppercase placeholders and sample values with your own data and company resource IDs. Keep the API key on a trusted server. Reuse an idempotency key only for the same logical request and payload.


Lookup Registered Company (Open Data)

Retrieve public business information for a company using its VAT number. This is particularly useful for automating KYC (Know Your Customer) workflows and ensuring data accuracy during customer onboarding.

GET
/2026-02-01/company/{vatNumber}.json
Required permissioncompanies_open_data:read

Path, query, and header parameters

vatNumberstring· pathRequired
The VAT registration number of the target company.

Responses

Public company data found.

{
  "vatNumber": "IT12345678901",
  "name": "Example Solutions S.r.l.",
  "address": "Corso Vittorio Emanuele II, 1, 00186 Roma RM, Italy",
  "vies_interrogation": {
    "valid": true
  }
}

No data available for the specified VAT number.

{
  "error": "Company not found"
}

Request examples

curl --request GET 'https://api.hub.donutwork.com/2026-02-01/company/VATNUMBER.json' \
  --header 'Authorization: Bearer YOUR_API_KEY'
const response = await fetch('https://api.hub.donutwork.com/2026-02-01/company/VATNUMBER.json', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer ' + process.env.DONUTWORK_API_KEY,
  },
});
const requestId = response.headers.get('x-request-id');
if (!response.ok) {
  const error = await response.text();
  throw new Error(`${response.status} ${error} [${requestId}]`);
}
const contentType = response.headers.get('content-type') ?? '';
const data = response.status === 204 ? null
  : contentType.includes('application/json') ? await response.json()
  : await response.text();
$request = curl_init('https://api.hub.donutwork.com/2026-02-01/company/VATNUMBER.json');
curl_setopt_array($request, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('DONUTWORK_API_KEY'),
    ],
]);
$response = curl_exec($request);
if ($response === false) {
    $error = curl_error($request);
    curl_close($request);
    throw new RuntimeException($error);
}
$status = curl_getinfo($request, CURLINFO_RESPONSE_CODE);
$contentType = (string) curl_getinfo($request, CURLINFO_CONTENT_TYPE);
curl_close($request);
if ($status >= 400) { throw new RuntimeException($response); }
$data = $status === 204 ? null
    : (str_contains($contentType, 'application/json')
        ? json_decode($response, true, flags: JSON_THROW_ON_ERROR) : $response);

Replace uppercase placeholders and sample values with your own data and company resource IDs. Keep the API key on a trusted server. Reuse an idempotency key only for the same logical request and payload.

On this page