{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/beel-es/json-schema/beel-es-company-activation-response-schema.json",
  "title": "CompanyActivationResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/beel-es-companyactivations-api-openapi.yml#/components/schemas/CompanyActivationResponse",
  "allOf": [
    {
      "$ref": "#/$defs/SuccessResponse"
    },
    {
      "type": "object",
      "properties": {
        "data": {
          "$ref": "#/$defs/CompanyActivation"
        }
      }
    }
  ],
  "$defs": {
    "CompanyActivation": {
      "type": "object",
      "required": [
        "company_id",
        "environment",
        "already_active",
        "scheduled_deactivation_cancelled"
      ],
      "properties": {
        "company_id": {
          "type": "string",
          "format": "uuid"
        },
        "environment": {
          "$ref": "#/$defs/Environment"
        },
        "already_active": {
          "type": "boolean",
          "description": "The company was already on in that mode and nothing was written."
        },
        "scheduled_deactivation_cancelled": {
          "type": "boolean",
          "description": "The call removed a pending switch-off. Comes with `already_active: true`, since the activation never stopped being live. Nothing was charged or credited."
        }
      }
    },
    "Environment": {
      "type": "string",
      "description": "Mode a record lives in — its Test/Live twin. It decides where invoices, customers and\nquota are accounted.\n\nFor a company it also decides which AEAT its NIF is registered against: switching a\ncompany on in `PROD` is what registers it with the real AEAT, so `aeat_environment`\nis that same mode and uses this same enum.\n",
      "enum": [
        "TEST",
        "PROD"
      ]
    },
    "ResponseMeta": {
      "type": "object",
      "properties": {
        "timestamp": {
          "type": "string",
          "format": "date-time"
        },
        "request_id": {
          "type": "string"
        }
      }
    },
    "SuccessResponse": {
      "type": "object",
      "description": "The envelope every successful JSON response of the BeeL. API is wrapped in. There are no\nbare resources in v1 and none are planned: the payload always hangs off `data`.\n\n- A **single resource** is an object in `data`.\n- A **collection** hangs off a named key inside `data`, together with its `pagination`,\n  also inside `data` — `data: {invoices: [...], pagination: {...}}`.\n- A collection carries `pagination` unless its operation declares itself a **closed\n  catalogue**: a fixed, bounded list with nothing to page through. The declaration is\n  explicit in the operation; a missing `pagination` is never something to infer.\n- `GET /v1/accounts` pages by cursor (`data: {accounts: [...], next_cursor}`). It is a\n  documented variant of pagination, not another envelope.\n\nPutting the array straight into `data` with `pagination` as its sibling is the shape a v2\nwould adopt; v1 is not being flipped to it.\n",
      "required": [
        "success",
        "data"
      ],
      "properties": {
        "success": {
          "type": "boolean"
        },
        "data": {
          "description": "The payload. An object for a single resource; an object holding the named collection\n(and its `pagination`) for a listing. Never a bare array at this level in v1.\n"
        },
        "meta": {
          "$ref": "#/$defs/ResponseMeta"
        }
      }
    }
  }
}