{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/api-evangelist/grubhub/main/json-schema/grubhub-orderchangerequeststatus-schema.json", "title": "OrderChangeRequestStatus", "x-generated": "2026-09-17", "x-method": "derived", "x-source": "openapi/grubhub-orders-openapi.yml#/components/schemas/OrderChangeRequestStatus", "required": [ "change_request_id", "order_id", "request", "status" ], "type": "object", "properties": { "order_id": { "type": "string", "description": "Order Id for which the change request was submitted.", "format": "uuid" }, "change_request_id": { "type": "string", "description": "Change Request Id that was created.", "format": "uuid" }, "request": { "$ref": "#/$defs/OrderChangeRequest" }, "status": { "type": "string", "description": "Current status of the change request" }, "ticket_id": { "type": "integer", "description": "Ticket ID of the change request", "format": "int64" }, "requested_action": { "type": "string", "description": "Requested action" } }, "description": "Status of a submitted order change request.", "$defs": { "AddLineSubstitution": { "type": "object", "description": "Add Line Substitution", "allOf": [ { "$ref": "#/$defs/LineSubstitutionType" } ] }, "LineOptionSubstitution": { "type": "object", "properties": { "name": { "type": "string", "description": "Name of the replacement option" }, "option_id": { "type": "string", "description": "ID of the replacement option" }, "price": { "type": "integer", "description": "Price for replacement option", "format": "int32" }, "delta": { "type": "integer", "description": "The absolute value of the difference in cents requested to change the total by", "format": "int32" }, "quantity": { "type": "integer", "description": "Quantity of replacement option", "format": "int32" }, "line_option_substitution_type": { "$ref": "#/$defs/LineSubstitutionType" }, "sub_options": { "type": "array", "description": "Options for the replacement", "items": { "$ref": "#/$defs/LineOptionSubstitution" } } }, "description": "Options for the replacement" }, "LineSubstitutionAdjustment": { "required": [ "line_substitution_type", "line_uuid", "menu_item_id", "merchant_id", "name", "quantity", "type" ], "type": "object", "allOf": [ { "$ref": "#/$defs/SubstitutionAdjustment" }, { "type": "object", "properties": { "name": { "type": "string", "description": "Name of the line item" }, "menu_item_id": { "type": "string", "description": "Menu item ID of the line item" }, "line_uuid": { "type": "string", "description": "UUID of the line to substitute", "format": "uuid" }, "special_instructions": { "type": "string", "description": "Special instructions for the substitution" }, "price": { "type": "integer", "description": "Price of the substitution item", "format": "int32" }, "delta": { "type": "integer", "description": "The absolute value of the difference in cents requested to change the total by", "format": "int32" }, "quantity": { "type": "integer", "description": "Quantity of items for the replacement", "format": "int32" }, "weight": { "type": "number", "description": "Weight of the substitution item", "format": "float" }, "measurement_unit": { "type": "string", "description": "Measurement unit of the substitution item" }, "line_substitution_type": { "$ref": "#/$defs/LineSubstitutionType" }, "options": { "type": "array", "description": "The options for this substitution", "items": { "$ref": "#/$defs/LineOptionSubstitution" } }, "merchant_id": { "type": "string", "description": "Merchant ID of the order" }, "packaging_options": { "uniqueItems": true, "type": "array", "description": "Options for packaging", "items": { "type": "string", "description": "Options for packaging", "enum": [ "INDIVIDUALLY_PACKAGED", "TRAY", "PLATTER" ] }, "enum": [ "INDIVIDUALLY_PACKAGED", "TRAY", "PLATTER" ] }, "replacements": { "type": "array", "description": "Replacement items", "items": { "$ref": "#/$defs/LineSubstitutionReplacement" } } } } ] }, "LineSubstitutionReplacement": { "type": "object", "properties": { "replacement_id": { "type": "string", "description": "ID for replacement item" }, "replacement_name": { "type": "string", "description": "Name for replacement item" }, "replacement_price": { "type": "integer", "description": "Price for replacement item", "format": "int32" }, "replacement_quantity": { "type": "integer", "description": "Quantity of replacement item", "format": "int32" }, "replacement_weight": { "type": "number", "description": "Weight of the replacement item", "format": "float" }, "replacement_measurement_unit": { "type": "string", "description": "Measurement unit for the replacement item" }, "options": { "type": "array", "description": "Options for the replacement", "items": { "$ref": "#/$defs/LineOptionSubstitution" } }, "merchant_id": { "type": "string", "description": "ID of the merchant that this item belongs to" }, "packaging_options": { "uniqueItems": true, "type": "array", "description": "Options for packaging", "items": { "type": "string", "description": "Options for packaging", "enum": [ "INDIVIDUALLY_PACKAGED", "TRAY", "PLATTER" ] }, "enum": [ "INDIVIDUALLY_PACKAGED", "TRAY", "PLATTER" ] }, "replacement_gtin": { "type": "string", "description": "GTIN ID of the replacement item" } }, "description": "Replacement items" }, "LineSubstitutionType": { "required": [ "type" ], "type": "object", "properties": { "type": { "type": "string" } }, "description": "The type of substitution: ADDED, REMOVED, QUANTITY_CHANGED, QUANTITY_WEIGHT_CHANGED, SUBITEMS_CHANGED, REPLACED", "discriminator": { "propertyName": "type", "mapping": { "ADDED": "#/components/schemas/AddLineSubstitution", "REMOVED": "#/components/schemas/RemoveLineSubstitution", "QUANTITY_CHANGED": "#/components/schemas/QuantityLineSubstitution", "QUANTITY_WEIGHT_CHANGED": "#/components/schemas/QuantityAndWeightLineSubstitution", "SUBITEMS_CHANGED": "#/components/schemas/SubItemLineSubstitution", "REPLACED": "#/components/schemas/ReplaceLineSubstitution" } }, "oneOf": [ { "$ref": "#/$defs/AddLineSubstitution" }, { "$ref": "#/$defs/RemoveLineSubstitution" }, { "$ref": "#/$defs/QuantityLineSubstitution" }, { "$ref": "#/$defs/QuantityAndWeightLineSubstitution" }, { "$ref": "#/$defs/SubItemLineSubstitution" }, { "$ref": "#/$defs/ReplaceLineSubstitution" } ] }, "OrderChangeRequest": { "required": [ "change_action", "requestor_email", "requestor_first_name", "requestor_last_name", "restaurant_agent_name" ], "type": "object", "properties": { "amount": { "type": "integer", "description": "Price change requested on the order in US cents.", "format": "int32" }, "restaurant_agent_name": { "type": "string", "description": "Name of the agent who is requesting the change. Should be the logged-in user at the POS. Displayed as a comment on the ticket." }, "requestor_email": { "type": "string", "description": "Email address of the contact to be notified for ticket updates." }, "requestor_first_name": { "type": "string", "description": "First name of the merchant contact to be notified for ticket updates." }, "requestor_last_name": { "type": "string", "description": "Last name of the merchant contact to be notified for ticket updates." }, "reason": { "type": "string", "description": "A description of the reason for the change." }, "reason_code": { "type": "string", "description": "Reason Code for the change." }, "notes": { "type": "string", "description": "Additional notes." }, "substitution_requests": { "type": "array", "description": "Substitution Request List", "items": { "$ref": "#/$defs/SubstitutionRequest" } }, "change_action": { "type": "string", "description": "The action to take.", "enum": [ "adjust.action", "cancel.action", "substitution.action" ] } }, "description": "Payload required to change an order state" }, "QuantityAndWeightLineSubstitution": { "required": [ "new_quantity", "new_weight", "old_quantity", "old_weight" ], "type": "object", "description": "Quantity And Weight Line Substitution", "allOf": [ { "$ref": "#/$defs/LineSubstitutionType" }, { "type": "object", "properties": { "old_quantity": { "type": "integer", "description": "Old quantity", "format": "int32" }, "new_quantity": { "type": "integer", "description": "New quantity", "format": "int32" }, "old_weight": { "type": "number", "description": "Old weight" }, "new_weight": { "type": "number", "description": "New weight" } } } ] }, "QuantityLineSubstitution": { "required": [ "new_quantity", "old_quantity" ], "type": "object", "description": "Quantity Line Substitution", "allOf": [ { "$ref": "#/$defs/LineSubstitutionType" }, { "type": "object", "properties": { "old_quantity": { "type": "integer", "description": "Old quantity", "format": "int32" }, "new_quantity": { "type": "integer", "description": "New quantity", "format": "int32" } } } ] }, "RemoveLineSubstitution": { "required": [ "old_quantity" ], "type": "object", "description": "Remove Line Substitution", "allOf": [ { "$ref": "#/$defs/LineSubstitutionType" }, { "type": "object", "properties": { "old_quantity": { "type": "integer", "description": "Old quantity", "format": "int32" } } } ] }, "ReplaceLineSubstitution": { "type": "object", "description": "Replace Line Substitution", "allOf": [ { "$ref": "#/$defs/LineSubstitutionType" } ] }, "SubItemLineSubstitution": { "type": "object", "description": "Sub Item Line Substitution", "allOf": [ { "$ref": "#/$defs/LineSubstitutionType" } ] }, "SubstitutionAdjustment": { "required": [ "type" ], "type": "object", "properties": { "type": { "type": "string", "description": "The type of substitution requested.", "enum": [ "TOTAL", "LINE" ] } }, "description": "Represents the details for a line or total substitution adjustment", "discriminator": { "propertyName": "type", "mapping": { "LINE": "#/components/schemas/LineSubstitutionAdjustment", "TOTAL": "#/components/schemas/TotalSubstitutionAdjustment" } }, "oneOf": [ { "$ref": "#/$defs/LineSubstitutionAdjustment" }, { "$ref": "#/$defs/TotalSubstitutionAdjustment" } ] }, "SubstitutionRequest": { "required": [ "substitution_adjustment" ], "type": "object", "properties": { "substitution_adjustment": { "$ref": "#/$defs/SubstitutionAdjustment" }, "reason": { "type": "string", "description": "Reason for the request" }, "reason_code": { "type": "string", "description": "reasonCode" } }, "description": "Substitution Request" }, "TotalSubstitutionAdjustment": { "required": [ "type" ], "type": "object", "allOf": [ { "$ref": "#/$defs/SubstitutionAdjustment" }, { "type": "object", "properties": { "delta": { "type": "integer", "description": "The absolute value of the difference in cents requested to change the total by", "format": "int32" }, "total_adjustment_type": { "type": "string", "description": "The type of adjustment", "enum": [ "ADJUST_UP, ADJUST_DOWN" ] } } } ] } } }