{ "parameters": { "categoryID": { "name": "categoryID", "in": "query", "description": "Unique ID for the record. This or code is required.", "required": false, "type": "integer" }, "categoryIDRequired": { "name": "categoryID", "in": "query", "description": "Unique ID for the record.", "required": true, "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": { "/category": { "get": { "summary": "Category View", "description": "View the details of a Category record.", "tags": [ "CRUD Operations", "View Operations" ], "parameters": [ { "$ref": "#/parameters/categoryID" }, { "$ref": "../swagger-spec.json#/parameters/codeForViewAndEdit" }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" } ], "responses": { "200": { "description": "Category object", "schema": { "$ref": "#/definitions/WrappedCategory" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } }, "delete": { "summary": "Category Delete", "description": "Delete a Category record.", "tags": [ "CRUD Operations", "Delete Operations" ], "parameters": [ { "$ref": "#/parameters/categoryIDRequired" }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/WrappedCategory" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } }, "patch": { "summary": "Category Edit", "description": "Edits a Category record.", "tags": [ "CRUD Operations", "Edit Operations" ], "parameters": [ { "name": "category", "in": "body", "description": "The category to be edited. Either the categoryID or code must be provided.", "required": true, "schema": { "$ref": "#/definitions/Category" } }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" }, { "$ref": "#/parameters/updateAdvancedSearchIndex" } ], "responses": { "200": { "description": "Category object", "schema": { "$ref": "#/definitions/WrappedCategory" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } }, "post": { "summary": "Category Add", "description": "Adds a Category record.", "tags": [ "CRUD Operations", "Add Operations" ], "parameters": [ { "name": "category", "in": "body", "description": "The category to be added.", "required": true, "schema": { "$ref": "#/definitions/NewCategory" } }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" }, { "$ref": "#/parameters/updateAdvancedSearchIndex" } ], "responses": { "200": { "description": "Category object", "schema": { "$ref": "#/definitions/WrappedCategory" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } } }, "/category/list": { "get": { "summary": "Category List", "description": "View a list of categories.", "tags": [ "CRUD Operations", "List 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/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" } ], "responses": { "200": { "description": "Category List", "schema": { "$ref": "#/definitions/WrappedCategoryList" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } } } }, "definitions": { "BaseCategory": { "type": "object", "properties": { "parentCategory": { "description": "The categoryID of the parent category for this category.", "type": "integer" }, "description": { "description": "The full description for this category as displayed to customers (may include HTML tags).", "type": "string" }, "shortDecription": { "description": "A short description for this category. Used for category searches, and with the meta/description tag for the category page.", "type": "string", "maxLength": 255 }, "categoryOrder": { "description": "The order in which this category will appear relative to other categories, on list pages such as the category page, or search results.", "type": "integer", "default": 0 }, "keywords": { "description": "Search keywords for this category. Used for category searches, and with the meta/keywords tag for the category page.", "type": "string", "maxLength": 255 }, "header": { "description": "Any HTML that will appear above the category detail on this category's page.", "type": "string" }, "footer": { "description": "Any HTML that will appear below the category detail on this category's page.", "type": "string" }, "smallImage": { "description": "The URL path to the thumbnail image for this category.", "type": "string", "maxLength": 255 }, "mediumImage": { "description": "The URL path to the regular-sized image for this category, as appears on this category's page.", "type": "string", "maxLength": 255 }, "largeImage": { "description": "The URL path to the zoom image for this category.", "type": "string", "maxLength": 255 }, "extra1": { "description": "Any extra, or custom information associated with this category.", "type": "string", "maxLength": 255 }, "extra2": { "description": "Any extra, or custom information associated with this category.", "type": "string", "maxLength": 255 }, "extra3": { "description": "Any extra, or custom information associated with this category.", "type": "string", "maxLength": 255 }, "isContentPage": { "description": "If true, this category is a Content Page.", "type": "boolean", "default": false }, "categoryTreeID": { "description": "If set to anything other than 1, this category will not appear on the store's category tree.", "type": "integer", "default": 1 }, "isActive": { "description": "If false, this category will not appear to customers.", "type": "boolean", "default": true } } }, "NewCategory": { "type": "object", "allOf": [ { "required": [ "name" ], "properties": { "code": { "type": "string", "description": "Unique code for the category. If blank, the code is generated from the name. (No spaces, commas, or pipe characters.)" }, "name": { "type": "string", "description": "Name of the category." }, } }, { "$ref": "#/definitions/BaseCategory" } ] }, "Category": { "type": "object", "allOf": [ { "properties": { "categoryID": { "type": "integer", "description": "Unique identifier representing a specific category. This or the code is required." }, "code": { "type": "string", "description": "Unique code for the category. This or the categoryID is required." }, "name": { "type": "string", "description": "Name of the category." } } }, { "$ref": "#/definitions/BaseCategory" } ] }, "WrappedCategory": { "type": "object", "properties": { "success": { "type": "boolean" }, "errors": { "type": "array", "items": { "type": "string" } }, "messages": { "type": "array", "items": { "type": "string" } }, "jsonResult": { "type": "object", "$ref": "#/definitions/Category" } } }, "WrappedCategoryList": { "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/Category" } }, "itemCount": { "description": "The total number of items matching the criteria. This value may used to compose paging parameters.", "type": "integer" } } } } } } }