{ "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 OrderItemEdit 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 OrderItemAttributes 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": [ "All 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": [ "All Public Operations", "Cart Operations" ], "responses": { "200": { "description": "Cart", "schema": { "$ref": "#/definitions/WrappedOrder" } }, "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": [ "All 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/WrappedOrder" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } } }, "/CartItemEdit": { "post": { "summary": "Cart Item Edit", "description": "Edits an item in the current user's cart.", "tags": [ "All 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/WrappedOrder" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } } }, "/CartClear": { "patch": { "summary": "Cart Clear", "description": "Clears all the items out of the current user's cart as well as the auto saved cart cookie.", "tags": [ "All Public Operations", "Cart Operations" ], "responses": { "200": { "description": "Cart", "schema": { "$ref": "#/definitions/WrappedOrder" } }, "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" } } }, "WrappedOrder": { "type": "object", "properties": { "success": { "type": "boolean" }, "errors": { "type": "array", "items": { "type": "string" } }, "messages": { "type": "array", "items": { "type": "string" } }, "jsonResult": { "type": "object", "$ref": "#/definitions/Order" } } }, "Order": { "type": "object", "properties": { "quantity": { "type": "integer" }, "subtotal": { "type": "number" }, "shippingMethod": { "type": "string" }, "shipping": { "type": "number" }, "tax": { "type": "number" }, "giftCertificates": { "type": "array", "description": "The list of gift certificates that have been applied to the order.", "items": { "$ref": "#/definitions/OrderDiscount" } }, "total": { "type": "number" }, "completed": { "type": "string", "description": "Only populated if the order is complete. The date/time it was completed." }, "orderNumber": { "type": "integer", "description": "Only populated if the order is complete. The order number assiged by the server to the order." }, "trackingNumber": { "type": "string", "description": "Only populated if the order is complete. The tracking number for the shipment for the order, if available." }, "status": { "type": "string", "description": "Only populated if the order is complete. Received is the value for recently-placed orders." }, "statusDetails": { "type": "string", "description": "Only populated if the order is complete." }, "declinedLoginBeforeCheckout": { "type": "string", "description": "Only populated for incomplete orders. Indicates if the user has previously declined to log in (via /CheckoutDeclineLogin) in the session." }, "shippingAndTaxesProcessed": { "type": "string", "description": "Only populated for incomplete orders. Indicates if the user has gotten past the shipping stage of the checkout." }, "billingInformation": { "type": "object", "description": "An object representing the billing address in the order.", "allOf": [ {"$ref": "../swagger-spec.json#/definitions/BaseBillingAddress"} ] }, "orderDeliveries": { "type": "array", "description": "An object representing the delivery address and items in the order. In the current implementation there is never more than one.", "items": { "$ref": "#/definitions/OrderDelivery" } }, "orderDiscounts": { "type": "array", "description": "An object representing discounts including coupons that have been applied to the order.", "items": { "$ref": "#/definitions/OrderDiscount" } }, "paymentInformation": { "type": "array", "description": "An object representing the payment information for the order.", "items": { "$ref": "#/definitions/Payment" } } } }, "OrderDelivery": { "type": "object", "allOf": [ { "properties": { "orderItems": { "type": "array", "description": "An object representing the items in the order.", "items": { "$ref": "#/definitions/OrderItem" } } } }, { "$ref": "../swagger-spec.json#/definitions/BaseAddress" } ] }, "OrderDiscount": { "type": "object", "properties": { "orderDiscountID": { "type": "integer", "description": "Unique identifier representing the discount." }, "code": { "type": "string", "description": "Code for the discount." }, "name": { "type": "string", "description": "Name for the discount." }, "couponCode": { "type": "string", "description": "Coupon code for the discount." }, "total": { "type": "number", "description": "The total for the discount." }, "orderItemName": { "type": "string", "description": "The name of the order item corresponding to the discount, if it is a SKU discount." }, "orderItemCode": { "type": "string", "description": "The name of the order item corresponding to the discount, if it is a SKU discount." }, "orderItemID": { "type": "integer", "description": "The id of the order item corresponding to the discount, if it is a SKU discount." }, "balance": { "type": "number", "description": "If the discount is a gift certificate, this is the remaining balance on the gift certificate after the order." } } }, "OrderItem": { "type": "object", "allOf": [ { "properties": { "orderItemID": { "type": "integer", "description": "Unique identifier representing the order item." }, "total": { "type": "number", "description": "The total for the order item." }, "quantity": { "type": "integer", "description": "The quantity for the order item." }, "price": { "type": "integer", "description": "The unit price for the order 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." }, "orderItemAttributes": { "type": "array", "description": "An object representing the attributes under an item in the order.", "items": { "$ref": "#/definitions/OrderItemAttribute" } } } }, { "$ref": "product.json.html#/definitions/BaseProduct" } ] }, "OrderItemAttribute": { "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." } } }, "Payment": { "type": "object", "properties": { "creditCardName": { "type": "string" }, "creditCardType": { "type": "string" }, "creditCardNumberDisplay": { "type": "string" }, "status": { "type": "string" } } } } }