Validate variant
const url = 'https://catalog.shopgate.io/v1/merchants/example/products/example/validate';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"selectedOptions":[{"code":"color","valueCode":"black"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://catalog.shopgate.io/v1/merchants/example/products/example/validate \ --header 'Content-Type: application/json' \ --data '{ "selectedOptions": [ { "code": "color", "valueCode": "black" } ] }'Validates the selected options and returns possible options or the matching variant
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”Location code used to determine product availability
Request Body
Section titled “Request Body”object
object
Example
colorUnique identifier for the attribute value
Example
blackResponses
Section titled “Responses”Return the possible options or matching variants
object
object
Name of the attribute which will be shown to the customer. It’s saved in the language of the passed locale.
Type of the attribute. It specifies which type the attribute value will have.
object
Unique identifier for the attribute value
Sequence id of the order of the values. The lowest number is at the top and the highest number is at the bottom.
Name of the attribute value which will be shown to the customer. It’s saved in the language of the passed locale.
object
The price which is added to the base price of the configurable product. It can be positive and negative
object
Example
{ "possibleOptions": [ { "code": "color", "name": "Color", "values": [ { "code": "white", "name": "White", "sequenceId": 1 }, { "code": "black", "name": "Black", "sequenceId": 2 } ] } ]}Validation error
object
object
object
object
The parameter-field, that failed to validate, like “userId”
The value, that was sent, like “xxx”
Machine readable error code
Human readable error code
object
object
Machine readable error code
Human readable error code
Example
{ "error": { "code": "SCHEMA_VALIDATION_FAILED", "results": { "errors": [ { "code": "MAX_LENGTH", "message": "Name too long", "description": "Property Name is too long", "path": [ "name" ] } ] } }}Merchant or product not found
object
Example
{ "code": "NotFound", "message": "Merchant not found"}
