{ "parameters": { "optionID": { "name": "optionID", "in": "query", "description": "Unique ID for the record. This by itself, or attributeCode/attributeID plus optionCode, is required.", "required": false, "type": "integer" }, "attributeCode": { "name": "attributeCode", "in": "query", "description": "Unique code for the parent Attribute of the Option. This or the attributeID plus the optionCode, or the optionID by itself, is required.", "required": false, "type": "string" }, "attributeIDViewEditOrAdd": { "name": "attributeID", "in": "query", "description": "The parent attributeID. This or the attributeCode plus the optionCode, or the optionID by itself, is required.", "required": false, "type": "integer" }, "optionCode": { "name": "optionCode", "in": "query", "description": "Code for the Option. Since multiple Options can share the same code, the attributeCode must also be submitted. This plus the attributeCode or attributeID, or the optionID by itself, is required.", "required": false, "type": "string" }, "attributeIDList": { "name": "attributeID", "in": "query", "description": "The parent attributeID. The resulting list is retricted to Options assigned to this Attribute.", "required": false, "type": "integer" } }, "paths": { "/option": { "get": { "summary": "Option View", "description": "View the details of an Option record.", "tags": [ "Administrative Operations" ], "parameters": [ { "$ref": "#/parameters/optionID" }, { "$ref": "#/parameters/attributeIDViewEditOrAdd" }, { "$ref": "#/parameters/attributeCode" }, { "$ref": "#/parameters/optionCode" }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" } ], "responses": { "200": { "description": "Option object", "schema": { "$ref": "#/definitions/WrappedOption" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } }, "delete": { "summary": "Option Delete", "description": "Delete an Option record.", "tags": [ "Administrative Operations" ], "parameters": [ { "$ref": "#/parameters/optionID" }, { "$ref": "#/parameters/attributeCode" }, { "$ref": "#/parameters/attributeIDViewEditOrAdd" }, { "$ref": "#/parameters/optionCode" }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/WrappedOption" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } }, "patch": { "summary": "Option Edit", "description": "Edits an Option record.", "tags": [ "Administrative Operations" ], "parameters": [ { "name": "option", "in": "body", "description": "The option to be edited. Either the attributeCode plus optionCode, or the optionID by itself, must be provided.", "required": true, "schema": { "$ref": "#/definitions/Option" } }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" } ], "responses": { "200": { "description": "Option object", "schema": { "$ref": "#/definitions/WrappedOption" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } }, "post": { "summary": "Option Add", "description": "Adds an Option record.", "tags": [ "Administrative Operations" ], "parameters": [ { "name": "option", "in": "body", "description": "The option to be added.", "required": true, "schema": { "$ref": "#/definitions/NewOption" } }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" } ], "responses": { "200": { "description": "Option object", "schema": { "$ref": "#/definitions/WrappedOption" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } } }, "/option/list": { "get": { "summary": "Option List", "description": "View a list of Options.", "tags": [ "Administrative 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": "#/parameters/attributeIDList" }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" } ], "responses": { "200": { "description": "Option List", "schema": { "$ref": "#/definitions/WrappedOptionList" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } } } }, "definitions": { "BaseOption": { "type": "object", "properties": { "optionName": { "description": "The name of this option as it appears to customers in the attribute's drop down menu or list of radio buttons.", "type": "string", "maxLength": 255 }, "optionCode": { "description": "A unique code for this option under the attribute, used by the system to identify it along with the attributeID. (No spaces, commas, or pipe characters.) If left blank, the system will automatically generate the code from the name.", "type": "string", "maxLength": 100 }, "optionUnitPrice": { "description": "This option's price, used for display to customers and for calculating order totals.", "type": "number", "default": 0 }, "optionAltPrice": { "description": "An alternate price for the option. (Not used in any processing logic.)", "type": "number", "default": 0 }, "optionUnitCost": { "description": "This option's (manufacturing or other) cost. (Not used in any processing logic.)", "type": "number", "default": 0 }, "optionWeight": { "description": "This option weight. Used to calculate shipment weights.", "type": "number", "default": 0 }, "optionDescription": { "description": "The description for this option as displayed to customers (may include HTML tags).", "type": "string" }, "optionSmallImage": { "description": "The URL path to the thumbnail image for this option.", "type": "string", "maxLength": 255 }, "optionLargeImage": { "description": "The URL path to the large image for this option.", "type": "string", "maxLength": 255 }, "optionOrder": { "description": "The order in which this option will appear relative to other options.", "type": "integer", "default": 0 }, "optionIsActive": { "description": "If false, this option will not appear to customers.", "type": "boolean", "default": true } } }, "NewOption": { "type": "object", "allOf": [ { "required": [ "optionName" ], "properties": { "optionCode": { "type": "string", "description": "Unique code for the option. If blank, the code is generated from the name. (No spaces, commas, or pipe characters.)" }, "optionName": { "type": "string", "description": "The name of this option as it appears to customers." }, "attributeCode": { "type": "string", "description": "Unique code for the parent attribute of the option. This or the attributeID is required." }, "attributeID": { "type": "string", "description": "Unique identifier for the parent attribute of the option. This or the attributeCode is required." } } }, { "$ref": "#/definitions/BaseOption" } ] }, "Option": { "type": "object", "allOf": [ { "properties": { "optionID": { "type": "integer", "description": "Unique identifier representing a specific option. This by itself, or the attributeCode plus optionCode, is required." }, "attributeCode": { "type": "string", "description": "Unique code for the parent attribute of the option. This and the optionCode, or the optionID by itself, is required." }, "optionCode": { "type": "string", "description": "Unique code for the option under the parent attribute. This and the attributeCode, or the optionID by itself, is required." }, "optionName": { "type": "string", "description": "Name of the option." } } }, { "$ref": "#/definitions/BaseOption" } ] }, "WrappedOption": { "type": "object", "properties": { "success": { "type": "boolean" }, "errors": { "type": "array", "items": { "type": "string" } }, "messages": { "type": "array", "items": { "type": "string" } }, "jsonResult": { "type": "object", "$ref": "#/definitions/Option" } } }, "WrappedOptionList": { "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/Option" } }, "itemCount": { "description": "The total number of items matching the criteria. This value may used to compose paging parameters.", "type": "integer" } } } } } } }