{ "parameters": { "attributeID": { "name": "attributeID", "in": "query", "description": "Unique ID for the record. This or attributeCode is required.", "required": false, "type": "integer" }, "attributeIDRequired": { "name": "attributeID", "in": "query", "description": "Unique ID for the record.", "required": true, "type": "integer" }, "attributeCodeForViewAndEdit": { "name": "attributeCode", "in": "query", "description": "Unique code for the record. This or the ID is required.", "required": false, "type": "string" }, "productID": { "name": "productID", "in": "query", "description": "The parent productID. The resulting list is retricted to Attributes assigned to this product.", "required": false, "type": "integer" } }, "paths": { "/attribute": { "get": { "summary": "Attribute View", "description": "View the details of a Attribute record.", "tags": [ "CRUD Operations", "View Operations" ], "parameters": [ { "$ref": "#/parameters/attributeID" }, { "$ref": "#/parameters/attributeCodeForViewAndEdit" }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" } ], "responses": { "200": { "description": "Attribute object", "schema": { "$ref": "#/definitions/WrappedAttribute" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } }, "delete": { "summary": "Attribute Delete", "description": "Delete an Attribute record.", "tags": [ "CRUD Operations", "Delete Operations" ], "parameters": [ { "$ref": "#/parameters/attributeIDRequired" }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/WrappedAttribute" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } }, "patch": { "summary": "Attribute Edit", "description": "Edits an Attribute record.", "tags": [ "CRUD Operations", "Edit Operations" ], "parameters": [ { "name": "attribute", "in": "body", "description": "The attribute to be edited. Either the attributeID or attributeCode must be provided.", "required": true, "schema": { "$ref": "#/definitions/Attribute" } }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" } ], "responses": { "200": { "description": "Attribute object", "schema": { "$ref": "#/definitions/WrappedAttribute" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } }, "post": { "summary": "Attribute Add", "description": "Adds an Attribute record.", "tags": [ "CRUD Operations", "Add Operations" ], "parameters": [ { "name": "attribute", "in": "body", "description": "The attribute to be added.", "required": true, "schema": { "$ref": "#/definitions/NewAttribute" } }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" } ], "responses": { "200": { "description": "Attribute object", "schema": { "$ref": "#/definitions/WrappedAttribute" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } } }, "/attribute/list": { "get": { "summary": "Attribute List", "description": "View a list of Attributes.", "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/parentIDField" }, { "$ref": "#/parameters/productID" }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" } ], "responses": { "200": { "description": "Attribute List", "schema": { "$ref": "#/definitions/WrappedAttributeList" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } } } }, "definitions": { "BaseAttribute": { "type": "object", "properties": { "attributeType": { "description": "Determines how this attribute and its options will be displayed on the product page. Valid values are 'compact' (drop down), 'expanded', 'compactInput' (text field), 'expandedInput' (text area), 'yesNo' (checkbox). Note that the 'compact' (drop down) and 'expanded' (radio) types require options to be present under this attribute to display correctly.", "type": "string", "maxLength": 255 }, "attributeUnitPrice": { "description": "This attribute's price, used for display to customers and for calculating order totals.", "type": "number", "default": 0 }, "attributeAltPrice": { "description": "An alternate price for the attribute. If present it will show up as this product's Compare At price. (Not used in any processing logic.)", "type": "number", "default": 0 }, "attributeUnitCost": { "description": "This attribute's (manufacturing or other) cost. (Not used in any processing logic.)", "type": "number", "default": 0 }, "attributeWeight": { "description": "This attribute's weight. Used to calculate shipment weights.", "type": "number", "default": 0 }, "attributeDescription": { "description": "The full description for this attribute as displayed to customers (may include HTML tags).", "type": "string" }, "attributeSmallImage": { "description": "The URL path to the thumbnail image for this attribute.", "type": "string", "maxLength": 255 }, "attributeLargeImage": { "description": "The URL path to the large image for this attribute.", "type": "string", "maxLength": 255 }, "attributeOrder": { "description": "The order in which this attribute will appear relative to other attributes, on the product page.", "type": "integer", "default": 0 }, "attributeIsRequired": { "description": "If true, the customer must enter a value or choose a selection for this attribute before being able to add the product to the cart.", "type": "boolean", "default": true }, "defaultOptionID": { "description": "The option under this attribute that will be pre-selected by default when customers first arrive at the product page.", "type": "integer", "default": 0 }, "attributeIsActive": { "description": "If false, this attribute will not appear to customers.", "type": "boolean", "default": true } } }, "NewAttribute": { "type": "object", "allOf": [ { "required": [ "attributeName" ], "properties": { "attributeCode": { "type": "string", "description": "Unique code for the attribute. If blank, the code is generated from the name. (No spaces, commas, or pipe characters.)" }, "attributeName": { "type": "string", "description": "The name of this attribute as it appears to customers." }, } }, { "$ref": "#/definitions/BaseAttribute" } ] }, "Attribute": { "type": "object", "allOf": [ { "properties": { "attributeID": { "type": "integer", "description": "Unique identifier representing a specific attribute. This or the code is required." }, "attributeCode": { "type": "string", "description": "Unique code for the attribute. This or the attributeID is required." }, "attributeName": { "type": "string", "description": "Name of the attribute." } } }, { "$ref": "#/definitions/BaseAttribute" } ] }, "WrappedAttribute": { "type": "object", "properties": { "success": { "type": "boolean" }, "errors": { "type": "array", "items": { "type": "string" } }, "messages": { "type": "array", "items": { "type": "string" } }, "jsonResult": { "type": "object", "$ref": "#/definitions/Attribute" } } }, "WrappedAttributeList": { "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/Attribute" } }, "itemCount": { "description": "The total number of items matching the criteria. This value may used to compose paging parameters.", "type": "integer" } } } } } } }