{ "parameters": { "productID": { "name": "productID", "in": "query", "description": "Unique ID for the record. This or code is required.", "required": false, "type": "integer" }, "productIDRequired": { "name": "productID", "in": "query", "description": "Unique ID for the record.", "required": true, "type": "integer" }, "parentProductID": { "name": "parentProductID", "in": "query", "description": "The parent productID. The resulting list is retricted to 'Related Products' under this product.", "required": false, "type": "integer" }, "categoryID": { "name": "categoryID", "in": "query", "description": "The parent categoryID. The resulting list is retricted to products under this category.", "required": false, "type": "integer" }, "parentManufacturerID": { "name": "parentManufacturerID", "in": "query", "description": "The parent manufacturerID. The resulting list is retricted to products under this manufacturer.", "required": false, "type": "integer" }, "updateAdvancedSearchIndex": { "name": "updateAdvancedSearchIndex", "in": "query", "description": "If true, as this record is saved, the corresponding document stored in the advanced search index will be updated.", "required": false, "type": "boolean", "default": true } }, "paths": { "/product": { "get": { "summary": "Product View", "description": "View the details of a Product record.", "tags": [ "Administrative/CRUD Operations" ], "parameters": [ { "$ref": "#/parameters/productID" }, { "$ref": "../swagger-spec.json#/parameters/codeForViewAndEdit" }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" } ], "responses": { "200": { "description": "Product object", "schema": { "$ref": "#/definitions/WrappedProduct" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } }, "delete": { "summary": "Product Delete", "description": "Delete a Product record.", "tags": [ "Administrative/CRUD Operations" ], "parameters": [ { "$ref": "#/parameters/productIDRequired" }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/WrappedProduct" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } }, "patch": { "summary": "Product Edit", "description": "Edits a Product record.", "tags": [ "Administrative/CRUD Operations" ], "parameters": [ { "name": "product", "in": "body", "description": "The product to be edited. Either the productID or code must be provided.", "required": true, "schema": { "$ref": "#/definitions/Product" } }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" }, { "$ref": "#/parameters/updateAdvancedSearchIndex" } ], "responses": { "200": { "description": "Product object", "schema": { "$ref": "#/definitions/WrappedProduct" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } }, "post": { "summary": "Product Add", "description": "Adds a Product record.", "tags": [ "Administrative/CRUD Operations" ], "parameters": [ { "name": "product", "in": "body", "description": "The product to be added.", "required": true, "schema": { "$ref": "#/definitions/NewProduct" } }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" }, { "$ref": "#/parameters/updateAdvancedSearchIndex" } ], "responses": { "200": { "description": "Product object", "schema": { "$ref": "#/definitions/WrappedProduct" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } } }, "/product/list": { "get": { "summary": "Product List", "description": "View a list of products.", "tags": [ "Administrative/CRUD Operations" ], "parameters": [ { "$ref": "../swagger-spec.json#/parameters/itemsPerPage" }, { "$ref": "../swagger-spec.json#/parameters/firstRow" }, { "$ref": "../swagger-spec.json#/parameters/sortByString" }, { "$ref": "../swagger-spec.json#/parameters/sortAscOrDesc" }, { "$ref": "../swagger-spec.json#/parameters/searchString" }, { "$ref": "../swagger-spec.json#/parameters/parentIDField" }, { "$ref": "../swagger-spec.json#/parameters/assignments" }, { "$ref": "#/parameters/parentProductID" }, { "$ref": "#/parameters/categoryID" }, { "$ref": "#/parameters/parentManufacturerID" }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" } ], "responses": { "200": { "description": "Product List", "schema": { "$ref": "#/definitions/WrappedProductList" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } } } }, "definitions": { "BaseProduct": { "type": "object", "properties": { "seoCode": { "type": "string", "description": "A unique code used for the URL for this product's detail page, if the 'Use SEO Code for Product URLs' setting on the Settings -> SEO screen is set to yes. If not present, the system will look for the product using the code value. (No spaces, commas, or pipe characters.)" }, "unitPrice": { "description": "This product's price, used for display to customers and for calculating order totals.", "type": "number", "default": 0 }, "primaryCategoryID": { "description": "The categoryID of the main category for this product. Determines which category is shown by default in the breadcrumbing on the product's page.", "type": "integer" }, "description": { "description": "The full description for this product as displayed to customers (may include HTML tags).", "type": "string" }, "shortDescription": { "description": "A short description for this product. Used for product searches, and with the meta/description tag for the product page.", "type": "string", "maxLength": 255 }, "manufacturerID": { "description": "The manufacturerID of the manufacturer for this product.", "type": "integer" }, "productOrder": { "description": "The order in which this product will appear relative to other products, on list pages such as the category page, or search results.", "type": "integer", "default": 0 }, "isTaxed": { "description": "If true, the order item total for this product will be added to the order's taxable subtotal.", "type": "boolean", "default": true }, "altPrice": { "description": "An alternate price for the product. If present it will show up as this product's Compare At price. (Not used in any processing logic.)", "type": "number", "default": 0 }, "unitCost": { "description": "This product's (manufacturing or other) cost. (Not used in any processing logic.)", "type": "number", "default": 0 }, "weight": { "description": "This product's weight. Used to calculate shipment weights.", "type": "number", "default": 0 }, "keywords": { "description": "Search keywords for this product. Used for product searches, and with the meta/keywords tag for the product page.", "type": "string", "maxLength": 255 }, "header": { "description": "Any HTML that will appear above the product detail on this product's page.", "type": "string" }, "footer": { "description": "Any HTML that will appear below the product detail on this product's page.", "type": "string" }, "smallImage": { "description": "The URL path to the thumbnail image for this product, as appears on category and other list pages.", "type": "string", "maxLength": 255 }, "mediumImage": { "description": "The URL path to the regular-sized image for this product, as appears on this product's page.", "type": "string", "maxLength": 255 }, "largeImage": { "description": "The URL path to the zoom image for this product. Appears when customers click the click to zoom link on the product page.", "type": "string", "maxLength": 255 }, "extra1": { "description": "Any extra, or custom information associated with this product.", "type": "string", "maxLength": 255 }, "extra2": { "description": "Any extra, or custom information associated with this product.", "type": "string", "maxLength": 255 }, "extra3": { "description": "Any extra, or custom information associated with this product.", "type": "string", "maxLength": 255 }, "extra4": { "description": "Any extra, or custom information associated with this product.", "type": "string", "maxLength": 255 }, "extra5": { "description": "Any extra, or custom information associated with this product.", "type": "string", "maxLength": 255 }, "isActive": { "description": "If false, this product will not appear to customers.", "type": "boolean", "default": true } } }, "NewProduct": { "type": "object", "allOf": [ { "required": [ "name" ], "properties": { "code": { "type": "string", "description": "Unique code for the product. If blank, the code is generated from the name. (No spaces, commas, or pipe characters.)" }, "name": { "type": "string", "description": "Name of the product." }, } }, { "$ref": "#/definitions/BaseProduct" } ] }, "Product": { "type": "object", "allOf": [ { "properties": { "productID": { "type": "integer", "description": "Unique identifier representing a specific product. This or the code is required." }, "code": { "type": "string", "description": "Unique code for the product. This or the productID is required." }, "name": { "type": "string", "description": "Name of the product." } } }, { "$ref": "#/definitions/BaseProduct" } ] }, "WrappedProduct": { "type": "object", "properties": { "success": { "type": "boolean" }, "errors": { "type": "array", "items": { "type": "string" } }, "messages": { "type": "array", "items": { "type": "string" } }, "jsonResult": { "type": "object", "$ref": "#/definitions/Product" } } }, "WrappedProductList": { "type": "object", "properties": { "success": { "type": "boolean" }, "errors": { "type": "array", "items": { "type": "string" } }, "messages": { "type": "array", "items": { "type": "string" } }, "jsonResult": { "type": "object", "properties": { "itemCollection": { "type": "array", "description": "The list of items being requested that match the criteria, limited to the number of itemsPerPage.", "items": { "$ref": "#/definitions/Product" } }, "itemCount": { "description": "The total number of items matching the criteria. This value may used to compose paging parameters.", "type": "integer" } } } } } } }