{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/usps/json-schema/usps-cancellation-request-schema.json",
  "title": "Cancellation Request",
  "description": "Cancellation Request details.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/usps-appointments-openapi.yml#/components/schemas/CancellationRequest",
  "type": "object",
  "required": [
    "consigneeAppointmentID",
    "shipperAppointmentRequestID",
    "CRID",
    "destinationEntry",
    "cancelReasonCode",
    "cancelComments"
  ],
  "properties": {
    "consigneeAppointmentID": {
      "pattern": "^[A-Za-z0-9]{1,9}$",
      "type": "string",
      "description": "FAST appointment ID.",
      "maxLength": 9
    },
    "shipperAppointmentRequestID": {
      "pattern": "^[A-Za-z0-9-]{1,12}$",
      "type": "string",
      "description": "Mailer assigned ID.",
      "maxLength": 12
    },
    "CRID": {
      "pattern": "^[0-9]{2,18}$",
      "type": "string",
      "description": "The CRID of the appointment scheduler.",
      "minLength": 2,
      "maxLength": 18
    },
    "systemID": {
      "pattern": "^[A-Za-z0-9]{1,30}$",
      "type": "string",
      "description": "Identifies the submitting application.",
      "maxLength": 30,
      "default": "FastAPI"
    },
    "destinationEntry": {
      "description": "Dropship is YES. Origin Entry is NO.",
      "type": "string",
      "enum": [
        "YES",
        "NO"
      ]
    },
    "cancelReasonCode": {
      "description": "The reason the appointment was cancelled. Only set when the appointment is cancelled.\n\n- `A` - Appointment made in error\n- `D` - Delivery appointment Cancelled per request of consignee\n- `E` - Product combined into another existing appointment\n- `M` - Major change in expected delivery window\n- `P` - Product not available\n",
      "type": "string",
      "enum": [
        "A",
        "D",
        "E",
        "M",
        "P"
      ]
    },
    "cancelComments": {
      "description": "Comments the user enters upon appointment cancellation",
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    }
  }
}