{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/invoicedataextraction-com/json-schema/invoicedataextraction-com-extraction-cancelled-schema.json",
  "title": "ExtractionCancelled",
  "description": "No output is produced; `credits_deducted` covers the work done before the extraction stopped.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/invoicedataextraction-com-openapi.json#/components/schemas/ExtractionCancelled",
  "type": "object",
  "required": [
    "success",
    "status",
    "extraction_id",
    "credits_deducted",
    "cancellation_reason",
    "credits_balance",
    "credits_reserved"
  ],
  "properties": {
    "success": {
      "type": "boolean",
      "const": true
    },
    "status": {
      "type": "string",
      "const": "cancelled"
    },
    "extraction_id": {
      "type": "string",
      "format": "uuid"
    },
    "credits_deducted": {
      "type": [
        "integer",
        "null"
      ]
    },
    "cancellation_reason": {
      "$ref": "#/$defs/CancellationReason"
    },
    "credits_balance": {
      "type": "integer"
    },
    "credits_reserved": {
      "type": "integer"
    }
  },
  "$defs": {
    "CancellationReason": {
      "type": "string",
      "enum": [
        "user",
        "unanswered",
        "answers_rejected"
      ],
      "description": "`user`: cancelled from the dashboard or with `cancelExtraction`. `unanswered`: a question was not answered by `answer_by`. `answers_rejected`: three answers were refused."
    }
  }
}