{
  "_comment": "Revel Web-Order cart submit — ONE POST. Built by scripts/adapters/revel/order_dispatch.js. Mirrors the legacy kds-management-service production path. Content-Type is text/plain (NOT application/json) — Revel returns 'Unhandled error' otherwise.",

  "request": {
    "method": "POST",
    "url": "https://acme.revelup.com/specialresources/cart/submit",
    "headers": {
      "API-AUTHENTICATION": "{apiKey}:{apiSecret}",
      "Accept": "application/json",
      "Content-Type": "text/plain"
    },
    "body": {
      "skin": "weborder",
      "establishmentId": 456,
      "customMenuInfo": { "mode": 0, "name": "" },
      "items": [
        {
          "product": 501,
          "quantity": 2,
          "price": 5.50,
          "special_request": "no onion",
          "product_name_override": "",
          "product_sub_id": "",
          "has_upsell": false,
          "modifieritems": [
            {
              "modifier": 3001,
              "product_id": 501,
              "modifier_price": 0.75,
              "qty": 1,
              "qty_type": 0,
              "mod_type": 0
            },
            {
              "modifier": 3005,
              "product_id": 501,
              "modifier_price": 1.50,
              "qty": 1,
              "qty_type": 0,
              "mod_type": 0
            }
          ],
          "products_sets": null
        },
        {
          "product": 8315,
          "quantity": 1,
          "price": 27.00,
          "is_combo": true,
          "special_request": "",
          "product_name_override": "",
          "product_sub_id": "",
          "has_upsell": false,
          "modifieritems": [],
          "products_sets": [
            {
              "id": 284,
              "name": "Soft Taco",
              "products": [
                {
                  "product": 8295,
                  "quantity": 1,
                  "price": 0,
                  "special_request": "",
                  "product_name_override": "",
                  "upcharge_price_override": null,
                  "modifieritems": []
                },
                {
                  "product": 8294,
                  "quantity": 1,
                  "price": 0,
                  "special_request": "",
                  "product_name_override": "",
                  "upcharge_price_override": null,
                  "modifieritems": []
                }
              ]
            },
            {
              "id": 283,
              "name": "Hard Taco",
              "products": [
                {
                  "product": 8288,
                  "quantity": 1,
                  "price": 0,
                  "special_request": "extra crispy",
                  "product_name_override": "",
                  "upcharge_price_override": null,
                  "modifieritems": [
                    {
                      "modifier": 2424,
                      "product_id": 8288,
                      "modifier_price": 0,
                      "qty": 1,
                      "qty_type": 0,
                      "mod_type": 0
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "product": 503,
          "quantity": 1,
          "price": 4.25,
          "special_request": "",
          "product_name_override": "",
          "product_sub_id": "",
          "has_upsell": false,
          "modifieritems": [],
          "products_sets": null
        }
      ],
      "orderInfo": {
        "dining_option": 3,
        "notes": "no onion",
        "asap": true,
        "pickup_time": "",
        "customer": {
          "first_name": "Jane",
          "last_name": "Doe",
          "email": "jane@example.com",
          "phone_number": "+6591234567"
        },
        "call_name": "Jane"
      },
      "serviceFees": [
        { "amount": 1.20, "alias": "Cata Fee" }
      ],
      "discounts": null,
      "discount_code": "",
      "paymentInfo": [
        {
          "tip": 2.00,
          "type": 7,
          "transaction_id": "ORD-20240815-001",
          "amount": 46.95
        }
      ]
    }
  },

  "response_ok_example": {
    "status": "OK",
    "orderId": 987654
  },

  "response_error_example": {
    "status": "ERROR",
    "error": "PRODUCTS_NOT_AVAILABLE_FOR_SELECTED_TIME"
  },

  "_notes": [
    "skin MUST be 'weborder' (lowercase). 'WebPortal' was the old value and now triggers an internal Revel 'Unhandled error'.",
    "customMenuInfo MUST be present even when default — missing field also triggers internal errors.",
    "serviceFees / discounts / paymentInfo are 'null' (not '[]') when empty — adapter writes nil-on-wire to match legacy production payload shape.",
    "orderInfo fields are snake_case on the wire. camelCase (e.g. diningOption) is rejected with 'DINING_OPTION_ERROR'.",
    "items[].price is the item-only price — Revel sums modifier prices itself.",
    "Bundle rows: parent carries the full combo price; bundle children priced 0 (or per-child surcharge).",
    "products_sets[].id is parsed from sectionItemCode 'CPS_<int>'; defaults to 0 when missing/non-numeric.",
    "paymentInfo[].amount uses order.totalPay (the full order total), not payment.amount.",
    "paymentInfo[].type is the outlet's paymentTypeId setting (default 7 = CREDIT_PLUS). Cata's payment.method enum is NOT mapped per-order."
  ]
}
