{"openapi":"3.0.1","info":{"title":"Attribute Model Validator","description":"Validate Attribute Model against attribute selections\n","termsOfService":"https://mcpapis.cimpress.io/api/attribute-model-validator","contact":{"name":"CT RAD Squad","email":"CTProductRADSquad@cimpress.com"},"version":"0.0.1"},"servers":[{"url":"/"}],"security":[{"auth0AccessToken":[]},{"cimpressAccessToken":[]}],"paths":{"/livecheck":{"get":{"tags":["Livecheck"],"summary":"Runs a healthcheck to ensure that the service is running.","operationId":"getLivecheck","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}},"head":{"tags":["Livecheck"],"summary":"Runs a healthcheck to ensure that the service is running.","operationId":"headLivecheck","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/models:validate":{"get":{"tags":["/v1/models"],"summary":"This API has been deprecated. Please use /v2/models:validate instead.","operationId":"V1ModelValidate","responses":{"200":{"description":"Whether the Attribute Model is valid if not why it is not valid.","headers":{"Attribute-Model-Engine-Calculation-Version":{"description":"Calculation Version of the Attribute Model Engine, indicating changes in calculation integrity.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"isValid":{"type":"boolean","description":"Whether the Attribute Model is valid to provided selections, indicating the selections are valid."},"violatedAttributeSelections":{"type":"array","description":"The selected option values that violated the option's possible values. Only returned for invalid responses.","items":{"$ref":"#/components/schemas/ViolatedSelectionV1"}},"violatedConstraints":{"type":"array","description":"The selected constraints whose assertions were violated. Only returned for invalid responses.","items":{"$ref":"#/components/schemas/ViolatedConstraint"}}}}}}},"401":{"description":"The caller was not authorized.","content":{}},"500":{"description":"An error occurred within the engine or service. Catch-all error response code.","content":{}}},"deprecated":true},"head":{"tags":["/v1/models"],"summary":"This API has been deprecated. Please use /v2/models:validate instead.","description":"Information regarding attribute resolution with the Attribute Model Engine.","operationId":"headV1ModelValidate","responses":{"200":{"description":"Empty body return.","headers":{"Attribute-Model-Engine-Calculation-Version":{"description":"Calculation Version of the Attribute Model Engine, indicating changes in calculation integrity.","schema":{"type":"string"}}},"content":{}},"401":{"description":"The caller was not authorized.","content":{}},"500":{"description":"An error occurred within the engine or service. Catch-all error response code.","content":{}}},"deprecated":true}},"/v1/products/{productId}/versions/{version}:validate":{"post":{"tags":["/v1/products:validate"],"summary":"Validate selections and constraints against an attribute model.","operationId":"validateV1AttributeModelWithConstraints","parameters":[{"name":"productId","in":"path","description":"The product identifier.","required":true,"schema":{"type":"string"}},{"name":"version","in":"path","description":"The version of the product.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1ProductValidateRequest"}}},"required":true},"responses":{"200":{"description":"Whether the Product/Version with/out constraints is valid or not.","headers":{"Attribute-Model-Engine-Calculation-Version":{"description":"Calculation Version of the Attribute Model Engine, indicating changes in calculation integrity.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"isValid":{"type":"boolean","description":"Whether the Attribute Model is valid to provided selections, indicating the selections are valid."}}}}}},"401":{"description":"The caller was not authorized.","content":{}},"500":{"description":"An error occurred within the engine or service. Catch-all error response code.","content":{}}},"x-codegen-request-body-name":"body"}},"/v2/models:validate":{"post":{"tags":["/v2/models"],"summary":"Validates selections against an attribute model.","operationId":"postV2ModelValidate","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V2ValidateRequest"}}},"required":true},"responses":{"200":{"description":"Whether the Attribute Model is valid if not why it is not valid.","headers":{"Attribute-Model-Engine-Calculation-Version":{"description":"Calculation Version of the Attribute Model Engine, indicating changes in calculation integrity.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"isValid":{"type":"boolean","description":"Whether the Attribute Model is valid to provided selections, indicating the selections are valid."},"violatedAttributeSelections":{"type":"array","description":"The selected option values that violated the option's possible values. Only returned for invalid responses.","items":{"$ref":"#/components/schemas/ViolatedSelectionV2"}},"violatedConstraints":{"type":"array","description":"The selected constraints whose assertions were violated. Only returned for invalid responses.","items":{"$ref":"#/components/schemas/ViolatedConstraint"}}}}}}},"400":{"description":"The request was malformed, as described within the details.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"A summary of the error."},"details":{"type":"object","properties":{}}}}}}},"401":{"description":"The caller was not authorized.","content":{}},"500":{"description":"An error occurred within the engine or service. Catch-all error response code.","content":{}}},"x-codegen-request-body-name":"body"},"head":{"tags":["/v2/models"],"summary":"Get header information regarding attribute resolution with the Attribute Model Engine.","description":"Information regarding attribute resolution with the Attribute Model Engine.","operationId":"headV2ModelValidate","responses":{"200":{"description":"Empty body return.","headers":{"Attribute-Model-Engine-Calculation-Version":{"description":"Calculation Version of the Attribute Model Engine, indicating changes in calculation integrity.","schema":{"type":"string"}}},"content":{}},"401":{"description":"The caller was not authorized.","content":{}},"500":{"description":"An error occurred within the engine or service. Catch-all error response code.","content":{}}}}},"/v2/models/constraints:validate":{"post":{"tags":["/v2/models"],"summary":"Validates selections against the provided constraints.","operationId":"postV2ValidateConstraints","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateConstraintsV2"}}},"required":true},"responses":{"200":{"description":"Response indicating if the constraints are valid.","headers":{"Attribute-Model-Engine-Calculation-Version":{"description":"Calculation Version of the Attribute Model Engine, indicating changes in calculation integrity.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"isValid":{"type":"boolean","description":"Whether the Attribute Model is valid to provided selections, indicating the selections are valid."}}}}}},"401":{"description":"The caller was not authorized.","content":{}},"500":{"description":"An error occurred within the engine or service. Catch-all error response code.","content":{}}},"x-codegen-request-body-name":"body"},"head":{"tags":["/v2/models"],"summary":"Get header information regarding attribute resolution with the Attribute Model Engine.","description":"Information regarding attribute resolution with the Attribute Model Engine.","operationId":"headV2ValidateConstraints","responses":{"200":{"description":"Empty body return.","headers":{"Attribute-Model-Engine-Calculation-Version":{"description":"Calculation Version of the Attribute Model Engine, indicating changes in calculation integrity.","schema":{"type":"string"}}},"content":{}},"401":{"description":"The caller was not authorized.","content":{}},"500":{"description":"An error occurred within the engine or service. Catch-all error response code.","content":{}}}}}},"components":{"schemas":{"AttributeSelectionsV1":{"type":"object","properties":{"attributeKey":{"type":"string","description":"Selected value example. Replace \"attributeKey\" with the attribute key selected."}},"description":"Key-value pairs describing the values selected for a set of attributes.","example":{"attributeKey":"attributeValue"}},"AttributeSelectionsV2":{"type":"array","description":"Array of selections.","example":[{"key":"Substrate","value":"Matte"},{"key":"Available Spot Colors","value":"Red"}],"items":{"required":["key","value"],"properties":{"key":{"type":"string","description":"The attribute's key."},"value":{"type":"string","description":"The selected value(s).\nNote:- \"value\" should be a string.\nEx.\n\"{\n  selections: [\n      { key: 'Substrate', value: 'Matte' },\n      { key: 'Available Spot Colors', value: 'Red' }\n    ]\n}\""}}}},"Context":{"type":"object","description":"Key-value map of the attribute name and selected value.","example":{"merchant":"Vista","country":"NL"}},"V1ProductValidateRequest":{"type":"object","properties":{"constraintIds":{"type":"array","description":"The HAM-condition-constraint-resource-id's.","items":{"type":"string","example":"this-is-a-constraintresource-guid"}},"selections":{"$ref":"#/components/schemas/AttributeSelectionsV1"},"context":{"$ref":"#/components/schemas/Context"},"includeConstraints":{"type":"array","description":"If provided it will include the constraints associated with the identifier","items":{"type":"string"}}},"description":"A request to resolve an Attribute Model with constraints and selections."},"V2ValidateRequest":{"required":["attributeModelResource"],"type":"object","properties":{"attributeModelResource":{"type":"string","description":"The Attribute Model resource to validate with respect to the Attribute Selections."},"selections":{"$ref":"#/components/schemas/AttributeSelectionsV2"}},"description":"A request to resolve an Attribute Model."},"ValidateConstraintsV2":{"required":["constraintIds"],"type":"object","properties":{"constraintIds":{"type":"array","description":"List of constraint resource ids.","items":{"type":"string"}},"selections":{"$ref":"#/components/schemas/AttributeSelectionsV2"}},"description":"A request to resolve provided constraints and selections against each other."},"ViolatedSelectionV1":{"required":["errorMessage","key","value"],"type":"object","properties":{"key":{"type":"string","description":"The key of the attribute."},"value":{"type":"string","description":"The selected value that violated the attribute's possible values."},"errorMessage":{"type":"string","description":"A human-readable message describing why the selection violated the attribute's possible values."}},"description":"A selected attribute value that violated the attribute's possible values."},"ViolatedSelectionV2":{"required":["errorMessage","key","type"],"type":"object","properties":{"key":{"type":"string","description":"The key of the attribute."},"type":{"type":"string","description":"The type of attribute, defining what would you get a value(string) can be specified.\n* numeric - You will get `value` (a string).\n* string - You will get `value` (a string).\n","enum":["numeric","string"]},"value":{"type":"string","description":"The selected value that violated the attribute's possible values."},"errorMessage":{"type":"string","description":"A human-readable message describing why the selection violated the attribute's possible values."}},"description":"A selected attribute values that violated the attribute's possible values."},"ViolatedConstraint":{"required":["errorMessage","name","type"],"type":"object","properties":{"name":{"type":"string","description":"The name of the violated constraint."},"type":{"type":"string","description":"The type of constraint that was violated.","enum":["rule","dataSheet"]},"errorMessage":{"type":"string","description":"A human-readable message describing why the constraint was violated."}},"description":"A constraint whose assertion was violated."}},"responses":{"AttributeModelEmptyBody":{"description":"Empty body return.","headers":{"Attribute-Model-Engine-Calculation-Version":{"description":"Calculation Version of the Attribute Model Engine, indicating changes in calculation integrity.","schema":{"type":"string"}}},"content":{}},"AttributeModelValidationResponseV1":{"description":"Whether the Attribute Model is valid if not why it is not valid.","headers":{"Attribute-Model-Engine-Calculation-Version":{"description":"Calculation Version of the Attribute Model Engine, indicating changes in calculation integrity.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"isValid":{"type":"boolean","description":"Whether the Attribute Model is valid to provided selections, indicating the selections are valid."},"violatedAttributeSelections":{"type":"array","description":"The selected option values that violated the option's possible values. Only returned for invalid responses.","items":{"$ref":"#/components/schemas/ViolatedSelectionV1"}},"violatedConstraints":{"type":"array","description":"The selected constraints whose assertions were violated. Only returned for invalid responses.","items":{"$ref":"#/components/schemas/ViolatedConstraint"}}}}}}},"ProductWithValidationResponseV1":{"description":"Whether the Product/Version with/out constraints is valid or not.","headers":{"Attribute-Model-Engine-Calculation-Version":{"description":"Calculation Version of the Attribute Model Engine, indicating changes in calculation integrity.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"isValid":{"type":"boolean","description":"Whether the Attribute Model is valid to provided selections, indicating the selections are valid."}}}}}},"AttributeModelValidationResponseV2":{"description":"Whether the Attribute Model is valid if not why it is not valid.","headers":{"Attribute-Model-Engine-Calculation-Version":{"description":"Calculation Version of the Attribute Model Engine, indicating changes in calculation integrity.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"isValid":{"type":"boolean","description":"Whether the Attribute Model is valid to provided selections, indicating the selections are valid."},"violatedAttributeSelections":{"type":"array","description":"The selected option values that violated the option's possible values. Only returned for invalid responses.","items":{"$ref":"#/components/schemas/ViolatedSelectionV2"}},"violatedConstraints":{"type":"array","description":"The selected constraints whose assertions were violated. Only returned for invalid responses.","items":{"$ref":"#/components/schemas/ViolatedConstraint"}}}}}}},"ValidateConstraintsResponseV2":{"description":"Response indicating if the constraints are valid.","headers":{"Attribute-Model-Engine-Calculation-Version":{"description":"Calculation Version of the Attribute Model Engine, indicating changes in calculation integrity.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"isValid":{"type":"boolean","description":"Whether the Attribute Model is valid to provided selections, indicating the selections are valid."}}}}}},"V2ModelDoesNotExistResponse":{"description":"The request was malformed, as described within the details.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"A summary of the error."},"details":{"type":"object","properties":{}}}}}}}},"securitySchemes":{"auth0AccessToken":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://cimpress.auth0.com/authorize","scopes":{}}}},"cimpressAccessToken":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://oauth.cimpress.io/authorize","scopes":{}}}}}},"x-original-swagger-version":"2.0"}