{ "parameters": { "orderProductCodes": { "name": "orderProductCodes", "in": "formData", "description": "A single product code.", "required": true, "type": "string" }, "orderProductQuantities": { "name": "orderProductQuantities", "in": "formData", "description": "The quanity of the product defined by the orderProductCodes parameter.", "required": true, "type": "integer" }, "orderItemID": { "name": "orderItemID", "in": "formData", "description": "The orderItemID of the cart item being edited. This value will change after the CartItemEdit request is processed.", "required": true, "type": "integer" }, "productCode|attributeCode": { "name": "productCode|attributeCode", "in": "formData", "description": "Additional query parameters may be submitted in the form of [productCode]|[attributeCode]=[attributeValue] to define the CartItemAttributes under the cart item. For example: STScI-1990-06|FRAME=WOOD", "required": false, "type": "string" } }, "paths": { "/CSRFToken": { "get": { "summary": "CSRF Token", "description": "Retrieves the unique cross-site request token for the current session, which is needed for POSTs to sensitive endpoints.", "tags": [ "Public Operations" ], "responses": { "200": { "description": "CSRF Token", "schema": { "$ref": "#/definitions/WrappedCSRFToken" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } } }, "/Cart": { "get": { "summary": "Cart View", "description": "Return the current user's cart.", "tags": [ "Public Operations", "Cart Operations" ], "responses": { "200": { "description": "Cart", "schema": { "$ref": "#/definitions/WrappedCart" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } } }, "/CartAdd": { "post": { "summary": "Cart Add", "description": "Adds an item to the current user's cart.", "tags": [ "Public Operations", "Cart Operations" ], "parameters": [ { "$ref": "#/parameters/orderProductCodes" }, { "$ref": "#/parameters/orderProductQuantities" }, { "$ref": "#/parameters/productCode|attributeCode" }, { "$ref": "../swagger-spec.json#/parameters/Content-Type" } ], "responses": { "200": { "description": "Cart", "schema": { "$ref": "#/definitions/WrappedCart" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } } }, "/CartItemEdit": { "patch": { "summary": "Cart Item Edit", "description": "Edits an item in the current user's cart.", "tags": [ "Public Operations", "Cart Operations" ], "parameters": [ { "$ref": "#/parameters/orderItemID" }, { "$ref": "#/parameters/orderProductCodes" }, { "$ref": "#/parameters/orderProductQuantities" }, { "$ref": "#/parameters/productCode|attributeCode" }, { "$ref": "../swagger-spec.json#/parameters/Content-Type" } ], "responses": { "200": { "description": "Cart", "schema": { "$ref": "#/definitions/WrappedCart" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } } } }, "definitions": { "WrappedCSRFToken": { "type": "object", "properties": { "success": { "type": "boolean" }, "errors": { "type": "array", "items": { "type": "string" } }, "messages": { "type": "array", "items": { "type": "string" } }, "jsonResult": { "type": "string" } } }, "WrappedCart": { "type": "object", "properties": { "success": { "type": "boolean" }, "errors": { "type": "array", "items": { "type": "string" } }, "messages": { "type": "array", "items": { "type": "string" } }, "jsonResult": { "type": "object", "$ref": "#/definitions/Cart" } } }, "Cart": { "type": "object", "properties": { "quantity": { "type": "integer" }, "subtotal": { "type": "number" }, "cartDeliveries": { "type": "array", "description": "An object representing the delivery address and items in the current user's cart. In the current implementation there is never more than one.", "items": { "$ref": "#/definitions/CartDelivery" } } } }, "CartDelivery": { "type": "object", "properties": { "cartItems": { "type": "array", "description": "An object representing the items in the current user's cart.", "items": { "$ref": "#/definitions/CartItem" } } } }, "CartItem": { "type": "object", "allOf": [ { "properties": { "orderItemID": { "type": "integer", "description": "Unique identifier representing the cart item." }, "total": { "type": "number", "description": "The total for the cart item." }, "quantity": { "type": "integer", "description": "The quantity for the cart item." }, "price": { "type": "integer", "description": "The unit price for the cart item, including the price of any attributes." }, "code": { "type": "string", "description": "Unique code for the product. This or the productID is required." }, "name": { "type": "string", "description": "Name of the product." }, "cartItemAttributes": { "type": "array", "description": "An object representing the attributes under an item in the current user's cart.", "items": { "$ref": "#/definitions/CartItemAttribute" } } } }, { "$ref": "product.json.html#/definitions/BaseProduct" } ] }, "CartItemAttribute": { "type": "object", "properties": { "attributeCode": { "type": "string", "description": "Code for the attribute." }, "attributeName": { "type": "string", "description": "Name of the attribute." }, "attributeValue": { "type": "string", "description": "The value of the attribute selected by the user." }, "optionCode": { "type": "string", "description": "If the attribute corresponds to an Option, the code of the option." }, "optionName": { "type": "string", "description": "If the attribute corresponds to an Option, the name of the option." } } } } }