{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/salesforce-commerce-cloud/json-schema/salesforce-commerce-cloud-oms-cancel-order-request-schema.json",
  "title": "OmsCancelOrderRequest",
  "description": "Document representing a request to cancel an order that is integrated with Order Management (OMS).\nThe cancellation always applies to the entire order; partial cancellations are not supported.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/salesforce-commerce-cloud-shopper-orders-api-openapi.yml#/components/schemas/OmsCancelOrderRequest",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "reason": {
      "description": "The reason for cancelling the order. The value must match one of the `cancelReasonCodes` configured in OMS and returned by the\n`getOmsMetaData` endpoint. When omitted, the default reason code configured in OMS is applied by the server.",
      "type": "string",
      "maxLength": 256
    },
    "orderAccessCode": {
      "$ref": "#/$defs/OrderAccessCode"
    }
  },
  "$defs": {
    "OrderAccessCode": {
      "description": "A time-limited access code that serves as an alternative access grant for guest shoppers who have lost their original session.\nThe code is generated by calling the `requestOrderAccessCode` endpoint, which delivers it via email to the address on the order.\nThe shopper provides this code to authorize the request. The code is valid for 15 minutes after generation.",
      "type": "string",
      "pattern": "^\\d{6}$",
      "maxLength": 6
    }
  }
}