{"openapi":"3.0.1","info":{"title":"Walmart Grocery REST","description":"In-memory Walmart grocery API for testing MCP Piper OpenAPI / Swagger → MCP.\nImport http://localhost:8090/v3/api-docs (or this server's /v3/api-docs) in the add-server wizard.\n","version":"1.0.0"},"servers":[{"url":"/","description":"This grocery test server"}],"tags":[{"name":"Tracking","description":"Dummy ELD / visibility API (X-Api-Key). Start tracking after pickup; read position and ETA."},{"name":"Grocery","description":"Walmart grocery REST API for OpenAPI / Swagger → MCP testing"},{"name":"TMS","description":"Dummy brokerage TMS (OAuth 2.0 client credentials). No database — demo load is Midwest Grocers Dallas→Atlanta."}],"paths":{"/api/cart/items":{"post":{"tags":["Grocery"],"summary":"Add a product to the cart","description":"Add a catalog product to a customer's open cart and reduce stock.","operationId":"addProductToCart","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddToCartRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CartResponse"}}}}}}},"/api/cart/checkout":{"post":{"tags":["Grocery"],"summary":"Check out the open cart","description":"Purchase the current cart. Creates a bought-cart id and clears the open cart.","operationId":"buyCart","parameters":[{"name":"customerId","in":"query","description":"Customer id. Defaults to default.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CartResponse"}}}}}}},"/api/products":{"get":{"tags":["Grocery"],"summary":"List Walmart products","description":"List products in the in-memory Walmart catalog. Optional name/id search and category filter.","operationId":"listProducts","parameters":[{"name":"query","in":"query","description":"Case-insensitive product name or id search","required":false,"schema":{"type":"string"}},{"name":"category","in":"query","description":"Aisle such as dairy, produce, pantry, bakery, meat","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProductListResponse"}}}}}}},"/api/orders":{"get":{"tags":["Grocery"],"summary":"List purchased carts","description":"List Walmart carts this customer has already purchased, newest first.","operationId":"listBoughtCarts","parameters":[{"name":"customerId","in":"query","description":"Customer id. Defaults to default.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CartResponse"}}}}}}}},"/api/orders/{boughtCartId}":{"get":{"tags":["Grocery"],"summary":"Get a purchased cart","description":"Return the products that were in a purchased cart (id from buyCart, e.g. ord_1).","operationId":"getBoughtCart","parameters":[{"name":"boughtCartId","in":"path","description":"Bought cart id returned by checkout","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CartResponse"}}}}}}},"/api/cart":{"get":{"tags":["Grocery"],"summary":"Get the open cart","description":"Return the customer's current unpurchased Walmart cart.","operationId":"getCart","parameters":[{"name":"customerId","in":"query","description":"Customer id. Defaults to default.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CartResponse"}}}}}}}},"components":{"schemas":{"StartTrackingRequest":{"type":"object","properties":{"shipmentId":{"type":"string"},"tractorNumber":{"type":"string"},"driverPhone":{"type":"string"},"origin":{"type":"string"},"destination":{"type":"string"}}},"TrackingSession":{"type":"object","properties":{"id":{"type":"string"},"shipmentId":{"type":"string"},"tractorNumber":{"type":"string"},"status":{"type":"string"},"origin":{"type":"string"},"destination":{"type":"string"},"lat":{"type":"number"},"lon":{"type":"number"},"progressPercent":{"type":"integer","format":"int32"},"milesRemaining":{"type":"integer","format":"int32"},"eta":{"type":"string"}}},"CreateShipmentRequest":{"type":"object","properties":{"customer":{"type":"string"},"poNumber":{"type":"string"},"equipment":{"type":"string"},"weightLbs":{"type":"integer","format":"int32"},"pallets":{"type":"integer","format":"int32"},"miles":{"type":"integer","format":"int32"},"pickup":{"$ref":"#/components/schemas/Stop"},"delivery":{"$ref":"#/components/schemas/Stop"}},"description":"Create a shipment from an Excel / order row"},"Stop":{"type":"object","properties":{"city":{"type":"string"},"state":{"type":"string"},"facility":{"type":"string"},"window":{"type":"string"}},"description":"Stop on a truckload"},"ShipmentResponse":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"customer":{"type":"string"},"poNumber":{"type":"string"},"equipment":{"type":"string"},"weightLbs":{"type":"integer","format":"int32"},"pallets":{"type":"integer","format":"int32"},"miles":{"type":"integer","format":"int32"},"pickup":{"$ref":"#/components/schemas/Stop"},"delivery":{"$ref":"#/components/schemas/Stop"},"assignedCarrierScac":{"type":"string"},"assignedCarrierName":{"type":"string"},"linehaulUsd":{"type":"number"},"fuelSurchargeUsd":{"type":"number"},"allInUsd":{"type":"number"}},"description":"Shipment in the dummy TMS"},"TenderRequest":{"type":"object","properties":{"carrierScac":{"type":"string"},"carrierName":{"type":"string"},"linehaulUsd":{"type":"number"},"fuelSurchargeUsd":{"type":"number"},"allInUsd":{"type":"number"}},"description":"Tender the winning carrier onto an uncovered shipment"},"TokenResponse":{"type":"object","properties":{"access_token":{"type":"string"},"token_type":{"type":"string"},"expires_in":{"type":"integer","format":"int32"},"scope":{"type":"string"}}},"AddToCartRequest":{"required":["productId"],"type":"object","properties":{"productId":{"type":"string","description":"Catalog product id, e.g. milk","example":"milk"},"quantity":{"type":"integer","description":"Units to add. Defaults to 1.","format":"int32","example":2},"customerId":{"type":"string","description":"Customer whose cart to update. Defaults to default.","example":"alice"}},"description":"Add a product to the open cart"},"CartItemResponse":{"type":"object","properties":{"productId":{"type":"string"},"name":{"type":"string"},"quantity":{"type":"integer","format":"int32"},"unitPrice":{"type":"number"},"lineTotal":{"type":"number"}},"description":"Line in an open or purchased cart"},"CartResponse":{"type":"object","properties":{"id":{"type":"string"},"storeName":{"type":"string"},"customerId":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/CartItemResponse"}},"itemCount":{"type":"integer","format":"int32"},"total":{"type":"number"},"purchasedAt":{"type":"string"}},"description":"Open or purchased Walmart cart"},"EtaResponse":{"type":"object","properties":{"sessionId":{"type":"string"},"destination":{"type":"string"},"eta":{"type":"string"},"milesRemaining":{"type":"integer","format":"int32"},"status":{"type":"string"}}},"LaneCarrier":{"type":"object","properties":{"scac":{"type":"string"},"name":{"type":"string"},"lastAllInUsd":{"type":"number"},"onTimePercent":{"type":"integer","format":"int32"},"loadsLast90Days":{"type":"integer","format":"int32"}},"description":"Carrier who recently hauled this lane"},"LaneHistoryResponse":{"type":"object","properties":{"originCity":{"type":"string"},"originState":{"type":"string"},"destCity":{"type":"string"},"destState":{"type":"string"},"equipment":{"type":"string"},"carriers":{"type":"array","items":{"$ref":"#/components/schemas/LaneCarrier"}}},"description":"Recent carriers on a lane"},"ProductListResponse":{"type":"object","properties":{"storeName":{"type":"string"},"products":{"type":"array","items":{"$ref":"#/components/schemas/ProductResponse"}}},"description":"Catalog listing"},"ProductResponse":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"category":{"type":"string"},"price":{"type":"number"},"stock":{"type":"integer","format":"int32"}},"description":"Walmart catalog product"}}}}