{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/telenor-sverige/json-schema/telenor-sverige-cancellation-response-schema.json",
  "title": "CancellationResponse",
  "x-generated": "2026-10-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/telenor-sverige-fixed-network-order-openapi.yml#/components/schemas/CancellationResponse",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Unique identifier for the cancellation request, used for tracking and reference."
    },
    "orderItemIds": {
      "type": "array",
      "description": "The IDs of the order items for which the cancellation request is being made.",
      "items": {
        "type": "string",
        "format": "uuid"
      }
    },
    "relatedOrderId": {
      "type": "string",
      "format": "uuid",
      "description": "The ID of the related order."
    },
    "state": {
      "type": "string",
      "description": "Current status of the cancellation request, indicating its progress in the workflow.",
      "enum": [
        "NEW",
        "UNDER_REVIEW_BY_TELENOR",
        "REJECTED_BY_TELENOR",
        "REVIEWED_BY_TELENOR",
        "CANCELLATION_CONFIRMED",
        "COMPLETED"
      ]
    },
    "creationDate": {
      "type": "string",
      "description": "The date and time when the cancellation request was created."
    },
    "cost": {
      "type": "string",
      "description": "What it will cost the customer to cancel the order item. This is set by Telenor."
    },
    "currency": {
      "type": "string",
      "description": "Currency in which the cancellation cost is specified. This is set by Telenor."
    },
    "expirationDate": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time when the item can no longer be cancelled for the specified cost. This is set by Telenor."
    },
    "reviewerName": {
      "type": "string",
      "description": "Name of the person on Telenor side who reviewed the cancellation request. This is set by Telenor."
    },
    "reviewerComment": {
      "type": "string",
      "description": "Comment from the reviewer. This is set by Telenor."
    },
    "contactPersons": {
      "type": "array",
      "description": "Contact persons on customer side.",
      "items": {
        "$ref": "#/$defs/CancellationContactPerson"
      }
    }
  },
  "$defs": {
    "CancellationContactPerson": {
      "type": "object",
      "properties": {
        "firstName": {
          "type": "string",
          "description": "The first name of the person to be contacted."
        },
        "lastName": {
          "type": "string",
          "description": "The last name of the person to be contacted."
        },
        "email": {
          "type": "string",
          "format": "email",
          "description": "The e-mail address of the contact person."
        },
        "phoneNumber": {
          "type": "string",
          "description": "The phone number of the person to be contacted.\nPhone number should consist only of digits, spaces, dashes with optional leading plus.",
          "maxLength": 20,
          "minLength": 0
        },
        "mobileNumber": {
          "type": "string",
          "description": "The mobile number of the person to be contacted.\nMobile number should consist only of digits, spaces, dashes with optional leading plus.",
          "maxLength": 20,
          "minLength": 0
        }
      },
      "required": [
        "email",
        "firstName",
        "lastName"
      ]
    }
  }
}