Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
17097 lines (16734 sloc) 880 KB
#%RAML 0.8
title: YaasApiProductV2
version: v2
mediaType: application/json
baseUri: https://api.yaas.io/hybris/product/v2
securitySchemes:
- !include https://api.yaas.io/patterns/v1/security-schema-basic.yaml
schemas:
- errorMessage: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
- YRN: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "YRN attribute",
"type": "string",
"format": "uri",
"description": "Contains the YaaS Resource Name (YRN) of a specific resource on base of the 'yaas' URN scheme"
}
- mediaMetadata: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "Media file metadata",
"properties": {
"id": {
"type": "string"
},
"yrn": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "YRN attribute",
"type": "string",
"format": "uri",
"description": "Contains the YaaS Resource Name (YRN) of a specific resource on base of the 'yaas' URN scheme"
},
"createdAt": {
"type": "string",
"description": "ISO 8601 format date in which the media metadata was created."
},
"url": {
"type": "string",
"format": "uri",
"description": "URL of file content"
},
"tags": {
"type": "array",
"items": {
"type": "string"
},
"description": "Media file tags"
},
"contentType": {
"type": "string",
"description": "MIME type of the media file",
"example": "image/jpeg"
},
"uploadLink": {
"type": "string",
"description": "Link on which user should upload (PUT) media file."
},
"uncommittedMedia": {
"type": "boolean",
"description": "If true, the media file is not committed yet. If property is set to false or is not present the media is already committed"
},
"customAttributes": {
"type": "object",
"additionalProperties": true,
"description": "Map of custom attributes. The map key is a string, the value can be any JSON object"
}
},
"additionalProperties": false
}
- mediaMetadataCollection: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "Media file metadata",
"properties": {
"id": {
"type": "string"
},
"yrn": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "YRN attribute",
"type": "string",
"format": "uri",
"description": "Contains the YaaS Resource Name (YRN) of a specific resource on base of the 'yaas' URN scheme"
},
"createdAt": {
"type": "string",
"description": "ISO 8601 format date in which the media metadata was created."
},
"url": {
"type": "string",
"format": "uri",
"description": "URL of file content"
},
"tags": {
"type": "array",
"items": {
"type": "string"
},
"description": "Media file tags"
},
"contentType": {
"type": "string",
"description": "MIME type of the media file",
"example": "image/jpeg"
},
"uploadLink": {
"type": "string",
"description": "Link on which user should upload (PUT) media file."
},
"uncommittedMedia": {
"type": "boolean",
"description": "If true, the media file is not committed yet. If property is set to false or is not present the media is already committed"
},
"customAttributes": {
"type": "object",
"additionalProperties": true,
"description": "Map of custom attributes. The map key is a string, the value can be any JSON object"
}
},
"additionalProperties": false
}
}
- mediaMetadataCreation: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "Media file metadata",
"properties": {
"tags": {
"type": "array",
"items": {
"type": "string"
},
"description": "Media file tags"
},
"position": {
"type": "integer",
"default": 0,
"description": "Media order is set based on position property. Position is indexed from 0. If value is <= 0 the media is ordered as first. If value is higher that media count or is not specified the media is ordered as last. When retrieving product media they are ordered, but position property is not returned as it is not persisted"
},
"contentType": {
"type": "string",
"description": "MIME type of the file. The provided content type should be the same as the Content-Type header provided during media update, otherwise the update will fail"
},
"customAttributes": {
"type": "object",
"additionalProperties": true,
"description": "Map of custom attributes. The map key should be a string, the value can be any JSON object"
}
},
"additionalProperties": false,
"required": [
"contentType"
]
}
- mediaMetadataUpdate: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "Schema to update media file metadata",
"properties": {
"tags": {
"type": "array",
"items": {
"type": "string"
},
"description": "Media file tags"
},
"position": {
"type": "integer",
"default": 0,
"description": "Media order is set based on position property. Position is indexed from 0. If value is <= 0 the media is ordered as first. If value is higher that media count or is not specified the media is ordered as last. When retrieving product media they are ordered, but position property value is not returned as it is not persisted"
},
"customAttributes": {
"type": "object",
"additionalProperties": true,
"description": "Map of custom attributes. The map key should be a string, the value can be any JSON object"
}
},
"additionalProperties": false
}
- productCreation: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"metadata": {
"type": "object",
"additionalProperties": false,
"properties": {
"mixins": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "uri"
}
},
"variants": {
"type": "object",
"additionalProperties": false,
"properties": {
"options": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "uri"
}
}
}
}
}
},
"id": {
"type": "string",
"description": "Unique identifier"
},
"code": {
"type": [
"string"
],
"description": "Unique, mandatory user-defined identifier of a product",
"minLength": 1,
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\/\\-\\s_*]*$"
},
"name": {
"description": "The name of the product.",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "localized",
"oneOf": [
{
"type": "string",
"minLength": 1,
"description": "value of property in default language"
},
{
"type": "object",
"description": "value of property in specific language",
"additionalProperties": {
"type": "string",
"minLength": 1
}
}
]
},
"description": {
"description": "The description of the product.",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "localized",
"oneOf": [
{
"type": "string",
"description": "value of property in default language"
},
{
"type": "object",
"description": "value of property in specific language",
"additionalProperties": {
"type": "string"
}
},
{
"type": "null"
}
]
},
"published": {
"type": "boolean",
"default": false,
"description": "This flag determines if product is live."
},
"mixins": {
"type": "object"
}
},
"additionalProperties": false,
"required": [
"name",
"code"
]
}
- productUpdate: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"metadata": {
"type": "object",
"additionalProperties": false,
"properties": {
"mixins": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "uri"
}
},
"variants": {
"type": "object",
"additionalProperties": false,
"properties": {
"options": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "uri"
}
}
}
}
}
},
"code": {
"type": [
"string"
],
"description": "Unique, mandatory user-defined identifier of a product",
"minLength": 1,
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\/\\-\\s_*]*$"
},
"name": {
"description": "The name of the product.",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "localized",
"oneOf": [
{
"type": "string",
"minLength": 1,
"description": "value of property in default language"
},
{
"type": "object",
"description": "value of property in specific language",
"additionalProperties": {
"type": "string",
"minLength": 1
}
}
]
},
"description": {
"description": "The description of the product.",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "localized",
"oneOf": [
{
"type": "string",
"description": "value of property in default language"
},
{
"type": "object",
"description": "value of property in specific language",
"additionalProperties": {
"type": "string"
}
},
{
"type": "null"
}
]
},
"published": {
"type": "boolean",
"default": false,
"description": "This flag determines if product is live."
},
"mixins": {
"type": "object"
}
},
"additionalProperties": false,
"required": [
"name",
"code"
]
}
- product: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"metadata": {
"type": "object",
"additionalProperties": false,
"properties": {
"mixins": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "uri"
}
},
"variants": {
"type": "object",
"additionalProperties": false,
"properties": {
"options": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "uri"
}
},
"mixins": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "uri"
}
}
}
},
"version": {
"type": "number"
},
"createdAt": {
"type": "string",
"description": "ISO 8601 format date in which the product was created."
},
"modifiedAt": {
"type": "string",
"description": "ISO 8601 format date in which the product was modified."
}
}
},
"id": {
"type": "string",
"description": "Unique identifier"
},
"yrn": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "YRN attribute",
"type": "string",
"format": "uri",
"description": "Contains the YaaS Resource Name (YRN) of a specific resource on base of the 'yaas' URN scheme"
},
"code": {
"type": [
"string"
],
"description": "Unique, mandatory user-defined identifier of a product",
"minLength": 1,
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\/\\-\\s_*]*$"
},
"name": {
"description": "The name of the product.",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "localized",
"oneOf": [
{
"type": "string",
"minLength": 1,
"description": "value of property in default language"
},
{
"type": "object",
"description": "value of property in specific language",
"additionalProperties": {
"type": "string",
"minLength": 1
}
}
]
},
"description": {
"description": "The description of the product.",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "localized",
"oneOf": [
{
"type": "string",
"description": "value of property in default language"
},
{
"type": "object",
"description": "value of property in specific language",
"additionalProperties": {
"type": "string"
}
},
{
"type": "null"
}
]
},
"published": {
"type": "boolean",
"default": false,
"description": "This flag determines if product is live."
},
"media": {
"type": "array",
"items": {
"type": "object",
"description": "Media file metadata",
"properties": {
"id": {
"type": "string"
},
"yrn": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "YRN attribute",
"type": "string",
"format": "uri",
"description": "Contains the YaaS Resource Name (YRN) of a specific resource on base of the 'yaas' URN scheme"
},
"mediaId": {
"type": "string"
},
"url": {
"type": "string",
"format": "uri",
"description": "URL of file content"
},
"tags": {
"type": "array",
"items": {
"type": "string"
},
"description": "Media file tags"
},
"contentType": {
"type": "string",
"description": "MIME type of the media file"
},
"stored": {
"type": "boolean",
"description": "If true, the media file is stored in the service. Otherwise the service only stores external URL of the file and metadata."
},
"createdAt": {
"type": "string",
"description": "Date of media metadata creation."
},
"commitLink": {
"type": "string",
"description": "Contains link which is used when user triggers media commit operation. This link is not returned to user as product service internally triggers the commit"
},
"uploadLink": {
"type": "string",
"description": "Contains link on which user should send media for upload before he triggers the commit operation"
},
"uncommittedMedia": {
"type": "boolean",
"description": "If true, the media file is not committed yet. Not committed media does no have url property provided"
}
},
"additionalProperties": false
},
"description": "Contains media information (including url). This attribute is Read-Only, to manage media collection please use the /media subresource. To get this attribute included in product please add the expand=media query param. By default this attribute is not returned with product."
},
"mixins": {
"type": "object"
}
},
"additionalProperties": false,
"required": [
"id",
"yrn"
]
}
- products: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"metadata": {
"type": "object",
"additionalProperties": false,
"properties": {
"mixins": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "uri"
}
},
"variants": {
"type": "object",
"additionalProperties": false,
"properties": {
"options": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "uri"
}
},
"mixins": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "uri"
}
}
}
},
"version": {
"type": "number"
},
"createdAt": {
"type": "string",
"description": "ISO 8601 format date in which the product was created."
},
"modifiedAt": {
"type": "string",
"description": "ISO 8601 format date in which the product was modified."
}
}
},
"id": {
"type": "string",
"description": "Unique identifier"
},
"yrn": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "YRN attribute",
"type": "string",
"format": "uri",
"description": "Contains the YaaS Resource Name (YRN) of a specific resource on base of the 'yaas' URN scheme"
},
"code": {
"type": [
"string"
],
"description": "Unique, mandatory user-defined identifier of a product",
"minLength": 1,
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\/\\-\\s_*]*$"
},
"name": {
"description": "The name of the product.",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "localized",
"oneOf": [
{
"type": "string",
"minLength": 1,
"description": "value of property in default language"
},
{
"type": "object",
"description": "value of property in specific language",
"additionalProperties": {
"type": "string",
"minLength": 1
}
}
]
},
"description": {
"description": "The description of the product.",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "localized",
"oneOf": [
{
"type": "string",
"description": "value of property in default language"
},
{
"type": "object",
"description": "value of property in specific language",
"additionalProperties": {
"type": "string"
}
},
{
"type": "null"
}
]
},
"published": {
"type": "boolean",
"default": false,
"description": "This flag determines if product is live."
},
"media": {
"type": "array",
"items": {
"type": "object",
"description": "Media file metadata",
"properties": {
"id": {
"type": "string"
},
"yrn": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "YRN attribute",
"type": "string",
"format": "uri",
"description": "Contains the YaaS Resource Name (YRN) of a specific resource on base of the 'yaas' URN scheme"
},
"mediaId": {
"type": "string"
},
"url": {
"type": "string",
"format": "uri",
"description": "URL of file content"
},
"tags": {
"type": "array",
"items": {
"type": "string"
},
"description": "Media file tags"
},
"contentType": {
"type": "string",
"description": "MIME type of the media file"
},
"stored": {
"type": "boolean",
"description": "If true, the media file is stored in the service. Otherwise the service only stores external URL of the file and metadata."
},
"createdAt": {
"type": "string",
"description": "Date of media metadata creation."
},
"commitLink": {
"type": "string",
"description": "Contains link which is used when user triggers media commit operation. This link is not returned to user as product service internally triggers the commit"
},
"uploadLink": {
"type": "string",
"description": "Contains link on which user should send media for upload before he triggers the commit operation"
},
"uncommittedMedia": {
"type": "boolean",
"description": "If true, the media file is not committed yet. Not committed media does no have url property provided"
}
},
"additionalProperties": false
},
"description": "Contains media information (including url). This attribute is Read-Only, to manage media collection please use the /media subresource. To get this attribute included in product please add the expand=media query param. By default this attribute is not returned with product."
},
"mixins": {
"type": "object"
}
},
"additionalProperties": false,
"required": [
"id",
"yrn"
]
}
}
- resourceLocation: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"yrn": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "YRN attribute",
"type": "string",
"format": "uri",
"description": "Contains the YaaS Resource Name (YRN) of a specific resource on base of the 'yaas' URN scheme"
},
"link": {
"type": "string"
}
},
"required": [
"id",
"link",
"yrn"
]
}
- mediaLocation: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"yrn": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "YRN attribute",
"type": "string",
"format": "uri",
"description": "Contains the YaaS Resource Name (YRN) of a specific resource on base of the 'yaas' URN scheme"
},
"uploadLink": {
"type": "string"
}
},
"required": [
"id",
"uploadLink",
"yrn"
]
}
- tenantAction: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"tenant": {
"type": "string"
},
"action": {
"type": "string"
}
},
"required": [
"tenant",
"action"
]
}
- genericResponse: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"code": {
"type": "string"
},
"status": {
"type": "string"
},
"message": {
"type": "string"
},
"data": {
"type": "string"
}
},
"required": [
"code"
]
}
- productVariant: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"metadata": {
"type": "object",
"additionalProperties": false,
"properties": {
"mixins": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "uri"
}
},
"version": {
"type": "number"
},
"createdAt": {
"type": "string",
"description": "ISO 8601 format date in which the product variant was created."
},
"modifiedAt": {
"type": "string",
"description": "ISO 8601 format date in which the product variant was modified."
}
}
},
"id": {
"type": "string",
"description": "Unique identifier"
},
"yrn": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "YRN attribute",
"type": "string",
"format": "uri",
"description": "Contains the YaaS Resource Name (YRN) of a specific resource on base of the 'yaas' URN scheme"
},
"code": {
"type": [
"string"
],
"description": "Unique, mandatory user-defined identifier of a product variant",
"minLength": 1,
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\/\\-\\s_*]*$"
},
"name": {
"description": "The name of the product variant.",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "localized",
"oneOf": [
{
"type": "string",
"description": "value of property in default language"
},
{
"type": "object",
"description": "value of property in specific language",
"additionalProperties": {
"type": "string"
}
},
{
"type": "null"
}
]
},
"options": {
"type": "object"
},
"media": {
"type": "array",
"items": {
"type": "object",
"description": "Media file metadata",
"properties": {
"id": {
"type": "string"
},
"yrn": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "YRN attribute",
"type": "string",
"format": "uri",
"description": "Contains the YaaS Resource Name (YRN) of a specific resource on base of the 'yaas' URN scheme"
},
"mediaId": {
"type": "string"
},
"url": {
"type": "string",
"format": "uri",
"description": "URL of file content"
},
"tags": {
"type": "array",
"items": {
"type": "string"
},
"description": "Media file tags"
},
"contentType": {
"type": "string",
"description": "MIME type of the media file"
},
"stored": {
"type": "boolean",
"description": "If true, the media file is stored in the service. Otherwise the service only stores external URL of the file and metadata."
},
"createdAt": {
"type": "string",
"description": "Date of media metadata creation."
},
"commitLink": {
"type": "string",
"description": "Contains link which is used when user triggers media commit operation. This link is not returned to user as product service internally triggers the commit"
},
"uploadLink": {
"type": "string",
"description": "Contains link on which user should send media for upload before he triggers the commit operation"
},
"uncommittedMedia": {
"type": "boolean",
"description": "If true, the media file is not committed yet. Not committed media does no have url property provided"
}
},
"additionalProperties": false
},
"description": "Contains media information (including url). This attribute is Read-Only, to manage media collection please use the /media subresource. To get this attribute included in product please add the expand=media query param. By default this attribute is not returned with product."
},
"mixins": {
"type": "object"
},
"default": {
"type": "boolean",
"default": false,
"description": "This flag determines if variant is a default variant."
}
},
"additionalProperties": false,
"required": [
"id",
"yrn"
]
}
- productVariantWithProduct: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"productId": {
"type": "string",
"description": "Product identifier"
},
"id": {
"type": "string",
"description": "Unique identifier"
},
"yrn": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "YRN attribute",
"type": "string",
"format": "uri",
"description": "Contains the YaaS Resource Name (YRN) of a specific resource on base of the 'yaas' URN scheme"
},
"code": {
"type": [
"string",
"null"
],
"description": "Unique, mandatory user-defined identifier of a product variant",
"minLength": 1,
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\/\\-\\s_*]*$"
},
"name": {
"description": "The name of the product variant.",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "localized",
"oneOf": [
{
"type": "string",
"description": "value of property in default language"
},
{
"type": "object",
"description": "value of property in specific language",
"additionalProperties": {
"type": "string"
}
},
{
"type": "null"
}
]
},
"options": {
"type": "object"
},
"default": {
"type": "boolean",
"default": false,
"description": "This flag determines if variant is a default variant."
},
"product": {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"metadata": {
"type": "object",
"additionalProperties": false,
"properties": {
"mixins": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "uri"
}
},
"variants": {
"type": "object",
"additionalProperties": false,
"properties": {
"options": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "uri"
}
},
"mixins": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "uri"
}
}
}
},
"version": {
"type": "number"
},
"createdAt": {
"type": "string",
"description": "ISO 8601 format date in which the product was created."
},
"modifiedAt": {
"type": "string",
"description": "ISO 8601 format date in which the product was modified."
}
}
},
"id": {
"type": "string",
"description": "Unique identifier"
},
"yrn": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "YRN attribute",
"type": "string",
"format": "uri",
"description": "Contains the YaaS Resource Name (YRN) of a specific resource on base of the 'yaas' URN scheme"
},
"code": {
"type": [
"string"
],
"description": "Unique, mandatory user-defined identifier of a product",
"minLength": 1,
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\/\\-\\s_*]*$"
},
"name": {
"description": "The name of the product.",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "localized",
"oneOf": [
{
"type": "string",
"minLength": 1,
"description": "value of property in default language"
},
{
"type": "object",
"description": "value of property in specific language",
"additionalProperties": {
"type": "string",
"minLength": 1
}
}
]
},
"description": {
"description": "The description of the product.",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "localized",
"oneOf": [
{
"type": "string",
"description": "value of property in default language"
},
{
"type": "object",
"description": "value of property in specific language",
"additionalProperties": {
"type": "string"
}
},
{
"type": "null"
}
]
},
"published": {
"type": "boolean",
"default": false,
"description": "This flag determines if product is live."
},
"media": {
"type": "array",
"items": {
"type": "object",
"description": "Media file metadata",
"properties": {
"id": {
"type": "string"
},
"yrn": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "YRN attribute",
"type": "string",
"format": "uri",
"description": "Contains the YaaS Resource Name (YRN) of a specific resource on base of the 'yaas' URN scheme"
},
"mediaId": {
"type": "string"
},
"url": {
"type": "string",
"format": "uri",
"description": "URL of file content"
},
"tags": {
"type": "array",
"items": {
"type": "string"
},
"description": "Media file tags"
},
"contentType": {
"type": "string",
"description": "MIME type of the media file"
},
"stored": {
"type": "boolean",
"description": "If true, the media file is stored in the service. Otherwise the service only stores external URL of the file and metadata."
},
"createdAt": {
"type": "string",
"description": "Date of media metadata creation."
},
"commitLink": {
"type": "string",
"description": "Contains link which is used when user triggers media commit operation. This link is not returned to user as product service internally triggers the commit"
},
"uploadLink": {
"type": "string",
"description": "Contains link on which user should send media for upload before he triggers the commit operation"
},
"uncommittedMedia": {
"type": "boolean",
"description": "If true, the media file is not committed yet. Not committed media does no have url property provided"
}
},
"additionalProperties": false
},
"description": "Contains media information (including url). This attribute is Read-Only, to manage media collection please use the /media subresource. To get this attribute included in product please add the expand=media query param. By default this attribute is not returned with product."
},
"mixins": {
"type": "object"
}
},
"additionalProperties": false,
"required": [
"id",
"yrn"
]
}
},
"additionalProperties": false,
"required": [
"id",
"yrn"
]
}
- productVariants: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"metadata": {
"type": "object",
"additionalProperties": false,
"properties": {
"mixins": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "uri"
}
},
"version": {
"type": "number"
},
"createdAt": {
"type": "string",
"description": "ISO 8601 format date in which the product variant was created."
},
"modifiedAt": {
"type": "string",
"description": "ISO 8601 format date in which the product variant was modified."
}
}
},
"id": {
"type": "string",
"description": "Unique identifier"
},
"yrn": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "YRN attribute",
"type": "string",
"format": "uri",
"description": "Contains the YaaS Resource Name (YRN) of a specific resource on base of the 'yaas' URN scheme"
},
"code": {
"type": [
"string"
],
"description": "Unique, mandatory user-defined identifier of a product variant",
"minLength": 1,
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\/\\-\\s_*]*$"
},
"name": {
"description": "The name of the product variant.",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "localized",
"oneOf": [
{
"type": "string",
"description": "value of property in default language"
},
{
"type": "object",
"description": "value of property in specific language",
"additionalProperties": {
"type": "string"
}
},
{
"type": "null"
}
]
},
"options": {
"type": "object"
},
"media": {
"type": "array",
"items": {
"type": "object",
"description": "Media file metadata",
"properties": {
"id": {
"type": "string"
},
"yrn": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "YRN attribute",
"type": "string",
"format": "uri",
"description": "Contains the YaaS Resource Name (YRN) of a specific resource on base of the 'yaas' URN scheme"
},
"mediaId": {
"type": "string"
},
"url": {
"type": "string",
"format": "uri",
"description": "URL of file content"
},
"tags": {
"type": "array",
"items": {
"type": "string"
},
"description": "Media file tags"
},
"contentType": {
"type": "string",
"description": "MIME type of the media file"
},
"stored": {
"type": "boolean",
"description": "If true, the media file is stored in the service. Otherwise the service only stores external URL of the file and metadata."
},
"createdAt": {
"type": "string",
"description": "Date of media metadata creation."
},
"commitLink": {
"type": "string",
"description": "Contains link which is used when user triggers media commit operation. This link is not returned to user as product service internally triggers the commit"
},
"uploadLink": {
"type": "string",
"description": "Contains link on which user should send media for upload before he triggers the commit operation"
},
"uncommittedMedia": {
"type": "boolean",
"description": "If true, the media file is not committed yet. Not committed media does no have url property provided"
}
},
"additionalProperties": false
},
"description": "Contains media information (including url). This attribute is Read-Only, to manage media collection please use the /media subresource. To get this attribute included in product please add the expand=media query param. By default this attribute is not returned with product."
},
"mixins": {
"type": "object"
},
"default": {
"type": "boolean",
"default": false,
"description": "This flag determines if variant is a default variant."
}
},
"additionalProperties": false,
"required": [
"id",
"yrn"
]
}
}
- productVariantCreation: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"code": {
"type": [
"string"
],
"description": "Unique, mandatory user-defined identifier of a product variant",
"minLength": 1,
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\/\\-\\s_*]*$"
},
"name": {
"description": "The name of the product variant.",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "localized",
"oneOf": [
{
"type": "string",
"description": "value of property in default language"
},
{
"type": "object",
"description": "value of property in specific language",
"additionalProperties": {
"type": "string"
}
},
{
"type": "null"
}
]
},
"options": {
"type": "object"
},
"default": {
"type": "boolean",
"default": false,
"description": "This flag determines if variant is a default variant."
}
},
"additionalProperties": false,
"required": [
"code"
]
}
- productVariantUpdate: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"code": {
"type": [
"string"
],
"description": "Unique, mandatory user-defined identifier of a product variant",
"minLength": 1,
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\/\\-\\s_*]*$"
},
"name": {
"description": "The name of the product variant.",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "localized",
"oneOf": [
{
"type": "string",
"description": "value of property in default language"
},
{
"type": "object",
"description": "value of property in specific language",
"additionalProperties": {
"type": "string"
}
},
{
"type": "null"
}
]
},
"options": {
"type": "object"
},
"default": {
"type": "boolean",
"default": false,
"description": "This flag determines if variant is a default variant."
}
},
"additionalProperties": false,
"required": [
"code"
]
}
- searchQuery: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"yrns": {
"type": "array",
"description": "List of yrns. Each yrn identifies either product or product variant",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "YRN attribute",
"type": "string",
"format": "uri",
"description": "Contains the YaaS Resource Name (YRN) of a specific resource on base of the 'yaas' URN scheme"
}
},
"params": {
"type": "object",
"description": "Optional query params",
"properties": {
"product": {
"type": "object",
"description": "Optional query params for products",
"properties": {
"fields": {
"type": "string",
"description": "Optional projection for product"
}
}
},
"variant": {
"type": "object",
"description": "Optional query params for product variant",
"properties": {
"fields": {
"type": "string",
"description": "Optional projection for product variant"
},
"expand": {
"enum": [
"product"
],
"description": "Optional expand option for product variants"
}
}
}
}
}
},
"additionalProperties": false,
"required": [
"yrns"
]
}
- searchQueryResult: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array",
"items": {
"oneOf": [
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"productId": {
"type": "string",
"description": "Product identifier"
},
"id": {
"type": "string",
"description": "Unique identifier"
},
"yrn": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "YRN attribute",
"type": "string",
"format": "uri",
"description": "Contains the YaaS Resource Name (YRN) of a specific resource on base of the 'yaas' URN scheme"
},
"code": {
"type": [
"string",
"null"
],
"description": "Unique, mandatory user-defined identifier of a product variant",
"minLength": 1,
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\/\\-\\s_*]*$"
},
"name": {
"description": "The name of the product variant.",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "localized",
"oneOf": [
{
"type": "string",
"description": "value of property in default language"
},
{
"type": "object",
"description": "value of property in specific language",
"additionalProperties": {
"type": "string"
}
},
{
"type": "null"
}
]
},
"options": {
"type": "object"
},
"default": {
"type": "boolean",
"default": false,
"description": "This flag determines if variant is a default variant."
},
"product": {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"metadata": {
"type": "object",
"additionalProperties": false,
"properties": {
"mixins": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "uri"
}
},
"variants": {
"type": "object",
"additionalProperties": false,
"properties": {
"options": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "uri"
}
},
"mixins": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "uri"
}
}
}
},
"version": {
"type": "number"
},
"createdAt": {
"type": "string",
"description": "ISO 8601 format date in which the product was created."
},
"modifiedAt": {
"type": "string",
"description": "ISO 8601 format date in which the product was modified."
}
}
},
"id": {
"type": "string",
"description": "Unique identifier"
},
"yrn": {
"$ref": "YRN"
},
"code": {
"type": [
"string"
],
"description": "Unique, mandatory user-defined identifier of a product",
"minLength": 1,
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\/\\-\\s_*]*$"
},
"name": {
"$ref": "notEmptyLocalizedAttribute",
"description": "The name of the product."
},
"description": {
"$ref": "nullableLocalizedAttribute",
"description": "The description of the product."
},
"published": {
"type": "boolean",
"default": false,
"description": "This flag determines if product is live."
},
"media": {
"type": "array",
"items": {
"type": "object",
"description": "Media file metadata",
"properties": {
"id": {
"type": "string"
},
"yrn": {
"$ref": "YRN"
},
"mediaId": {
"type": "string"
},
"url": {
"type": "string",
"format": "uri",
"description": "URL of file content"
},
"tags": {
"type": "array",
"items": {
"type": "string"
},
"description": "Media file tags"
},
"contentType": {
"type": "string",
"description": "MIME type of the media file"
},
"stored": {
"type": "boolean",
"description": "If true, the media file is stored in the service. Otherwise the service only stores external URL of the file and metadata."
},
"createdAt": {
"type": "string",
"description": "Date of media metadata creation."
},
"commitLink": {
"type": "string",
"description": "Contains link which is used when user triggers media commit operation. This link is not returned to user as product service internally triggers the commit"
},
"uploadLink": {
"type": "string",
"description": "Contains link on which user should send media for upload before he triggers the commit operation"
},
"uncommittedMedia": {
"type": "boolean",
"description": "If true, the media file is not committed yet. Not committed media does no have url property provided"
}
},
"additionalProperties": false
},
"description": "Contains media information (including url). This attribute is Read-Only, to manage media collection please use the /media subresource. To get this attribute included in product please add the expand=media query param. By default this attribute is not returned with product."
},
"mixins": {
"type": "object"
}
},
"additionalProperties": false,
"required": [
"id",
"yrn"
]
}
},
"additionalProperties": false,
"required": [
"id",
"yrn"
]
},
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"metadata": {
"type": "object",
"additionalProperties": false,
"properties": {
"mixins": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "uri"
}
},
"variants": {
"type": "object",
"additionalProperties": false,
"properties": {
"options": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "uri"
}
},
"mixins": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "uri"
}
}
}
},
"version": {
"type": "number"
},
"createdAt": {
"type": "string",
"description": "ISO 8601 format date in which the product was created."
},
"modifiedAt": {
"type": "string",
"description": "ISO 8601 format date in which the product was modified."
}
}
},
"id": {
"type": "string",
"description": "Unique identifier"
},
"yrn": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "YRN attribute",
"type": "string",
"format": "uri",
"description": "Contains the YaaS Resource Name (YRN) of a specific resource on base of the 'yaas' URN scheme"
},
"code": {
"type": [
"string"
],
"description": "Unique, mandatory user-defined identifier of a product",
"minLength": 1,
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\/\\-\\s_*]*$"
},
"name": {
"description": "The name of the product.",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "localized",
"oneOf": [
{
"type": "string",
"minLength": 1,
"description": "value of property in default language"
},
{
"type": "object",
"description": "value of property in specific language",
"additionalProperties": {
"type": "string",
"minLength": 1
}
}
]
},
"description": {
"description": "The description of the product.",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "localized",
"oneOf": [
{
"type": "string",
"description": "value of property in default language"
},
{
"type": "object",
"description": "value of property in specific language",
"additionalProperties": {
"type": "string"
}
},
{
"type": "null"
}
]
},
"published": {
"type": "boolean",
"default": false,
"description": "This flag determines if product is live."
},
"media": {
"type": "array",
"items": {
"type": "object",
"description": "Media file metadata",
"properties": {
"id": {
"type": "string"
},
"yrn": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "YRN attribute",
"type": "string",
"format": "uri",
"description": "Contains the YaaS Resource Name (YRN) of a specific resource on base of the 'yaas' URN scheme"
},
"mediaId": {
"type": "string"
},
"url": {
"type": "string",
"format": "uri",
"description": "URL of file content"
},
"tags": {
"type": "array",
"items": {
"type": "string"
},
"description": "Media file tags"
},
"contentType": {
"type": "string",
"description": "MIME type of the media file"
},
"stored": {
"type": "boolean",
"description": "If true, the media file is stored in the service. Otherwise the service only stores external URL of the file and metadata."
},
"createdAt": {
"type": "string",
"description": "Date of media metadata creation."
},
"commitLink": {
"type": "string",
"description": "Contains link which is used when user triggers media commit operation. This link is not returned to user as product service internally triggers the commit"
},
"uploadLink": {
"type": "string",
"description": "Contains link on which user should send media for upload before he triggers the commit operation"
},
"uncommittedMedia": {
"type": "boolean",
"description": "If true, the media file is not committed yet. Not committed media does no have url property provided"
}
},
"additionalProperties": false
},
"description": "Contains media information (including url). This attribute is Read-Only, to manage media collection please use the /media subresource. To get this attribute included in product please add the expand=media query param. By default this attribute is not returned with product."
},
"mixins": {
"type": "object"
}
},
"additionalProperties": false,
"required": [
"id",
"yrn"
]
}
]
}
}
- notEmptyLocalizedAttribute: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "localized",
"oneOf": [
{
"type": "string",
"minLength": 1,
"description": "value of property in default language"
},
{
"type": "object",
"description": "value of property in specific language",
"additionalProperties": {
"type": "string",
"minLength": 1
}
}
]
}
- nullableLocalizedAttribute: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "localized",
"oneOf": [
{
"type": "string",
"description": "value of property in default language"
},
{
"type": "object",
"description": "value of property in specific language",
"additionalProperties": {
"type": "string"
}
},
{
"type": "null"
}
]
}
traits:
- localizedModification:
usage: Apply this trait when you want to modify localized attributes.
description: |
This trait provides localization headers for modifying localized attributes.
headers:
Content-Language:
type: string
description: |
The locale identifier of the language of the updated attribute.
example: pl
required: false
responses:
400:
description: |
Request syntactically incorrect. Any details will be provided within the response payload.
body:
application/json:
example: |
{
"status": 400,
"message": "There are validation problems, see details section for more information",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html",
"type": "validation_violation",
"details": [
{
"field": "Content-Language",
"message": "not a language",
"type": "invalid_header"
}
]
}
schema: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
- localizedRetrieval:
usage: Apply this trait when you want to retrieve localized attributes.
description: |
This trait provides localization headers for retrieving localized attributes.
headers:
Accept-Language:
type: string
description: |
The value of the locale identifier of the language in which the attribute should be returned.
Provide several values separated by comma, in order to specify fallback languages.
example: pl
repeat: true
required: false
hybris-languages:
type: string
description: |
Comma separated list of language identifiers for which the localization for an attribute
should be provided.
example: en,pl,it
repeat: true
required: false
responses:
400:
description: |
Request syntactically incorrect. Any details will be provided within the response payload.
body:
application/json:
example: |
{
"status": 400,
"message": "There are validation problems, see details section for more information",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html",
"type": "validation_violation",
"details": [
{
"field": "Accept-Language",
"message": "not a language",
"type": "invalid_header"
}
]
}
schema: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
- paged:
usage: |
Apply this trait to a method returning a list of entities which should be paged.
description: |
This trait adds query parameters to the request so that the result can be paginated on the server side.
The specified parameters are page number and page size.
queryParameters:
pageNumber:
type: integer
description: |
The page number to be retrieved where the size of the pages must be specified by the pageSize parameter.
The number of the first page is 1.
minimum: 1
example: 1
default: 1
required: false
pageSize:
type: integer
description: |
The number of documents being retrieved on the page.
minimum: 1
example: 16
default: 16
required: false
responses:
200:
description: |
Request was successful.
headers:
Link:
description: |
Link to the current page, the next page and the previous page. Marked accordingly with *rel* **self**, *rel* **next** and *rel* **prev**. The syntax must be conform to [RFC-5988](https://tools.ietf.org/html/rfc5988).
The link to the current page (**self**) is required and must be provided always.
The link to the next page (**next**) is optional. If not present, the next page is not available, as the current page is the last page of the result.
The link to the previous page (**prev**) is optional. If not present, the previous page is not available, as the current page is the first page of the result.
example: |
'<http://sample.com?pageNumber=2&pageSize=10>; rel="self", <http://sample.com?pageNumber=3&pageSize=10>; rel="next"'
required: true
repeat: true
type: string
displayName: Link
400:
description: |
Request was syntactically incorrect. Any details will be provided within the response payload.
body:
application/json:
example: |
{
"status": 400,
"message": "There are validation problems, see details section for more information",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html",
"type": "validation_violation",
"details": [
{
"field": "pageNumber",
"message": "must be a positive number",
"type": "invalid_query_parameter"
}
]
}
schema: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
- sortable:
usage: |
Apply this to any method that support sorted results.
queryParameters:
sort:
type: string
description: |
The list of comma-separated properties used to sort the results.
By default, the column values are sorted in ascending order.
Can either be in the form of fieldName or fieldName:asc,fieldName:desc.
If you want to sort by localized attributes, you must use the following form:
fieldName.language or fieldName.language:asc,fieldName.language:desc.
example: |
size,species:asc,weight:desc
required: false
- queryable:
usage: |
Apply this trait to a method returning a list of entities which should be queried.
description: |
This trait adds query parameters to the request so that the result can be queried and limited.
queryParameters:
q:
type: string
description: |
The simple query criteria based on available fields to limit returned results or a set of modified documents.
example: |
species:dog name:"Clifford"
required: false
responses:
400:
description: |
Request syntactically incorrect. Any details will be provided within the response payload.
body:
application/json:
example: |
{
"status": 400,
"message": "There are validation problems, see details section for more information",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html",
"type": "validation_violation",
"details": [
{
"field": "q",
"message": "not a valid query",
"type": "invalid_query_parameter"
}
]
}
schema: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
- oauth2:
usage: Apply this trait to support OAuth 2.0 authentication.
description: |
Supports OAuth 2.0 for authenticating all API requests.
headers:
Authorization:
type: string
description: |
Used to send a valid OAuth2 access token.
example: Bearer access_token
required: true
responses:
401:
description: |
Given request is unauthorized. Bad or expired token. Reauthenticate
the user. Any details will be provided within the response payload.
body:
application/json:
example: |
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html"
}
schema: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
403:
description: |
Evaluated request scopes in access token are not sufficient and do not match required scopes.
body:
application/json:
example: |
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
schema: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
- restricted:
usage: |
Apply this trait to methods being protected in some way so that a call might
be rejected in cause of lacking permissions
description: |
Indicates that a method is restricted and that it might return a 403 response
responses:
403:
description: |
Access forbidden. The caller is not allowed to access this resource.
body:
application/json:
example: |
{
"status": 403,
"message": "Not allowed to access this resource",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html",
"type": "insufficient_permissions"
}
schema: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
- projectable:
usage: |
Apply this trait to a method or resource where you want to limit number of fields returned.
description: |
This trait adds "fields" query parameter to the request so that the the result fields can be
filtered on the server side.
queryParameters:
fields:
type: string
description: |
Contains a comma separated list of field identifiers, by which the fields of the response entities should be filtered by.
Empty or not initialized value result in a minimal set of entity fields returned. Non-existing or invalid fields will be ignored.
example: code,name,description
/{tenant}/products:
uriParameters:
tenant:
type: string
required: true
get:
is: [ localizedRetrieval, paged, sortable, queryable, oauth2, projectable ]
description: |
Get all products.
Accepted scopes:
* `hybris.product_read_unpublished` - required to retrieve non-public products. If not provided only published products are returned
headers:
Authorization:
type: string
description: |
Used to send a valid OAuth2 access token.
example: Bearer access_token
required: true
Accept-Language:
type: string
description: |
The value of the locale identifier of the language in which the attribute should be returned.
Provide several values separated by comma, in order to specify fallback languages.
example: pl
repeat: true
required: false
hybris-languages:
type: string
description: |
Comma separated list of language identifiers for which the localization for an attribute
should be provided.
example: en,pl,it
default: false
repeat: true
required: false
queryParameters:
fields:
type: string
description: |
Contains a comma separated list of field identifiers, by which the fields of the response entities should be filtered by.
Empty or not initialized value result in a minimal set of entity fields returned. Non-existing or invalid fields will be ignored.
example: code,name,description
q:
type: string
description: |
The simple query criteria based on available fields to limit returned results or a set of modified documents.
example: |
species:dog name:"Clifford"
required: false
sort:
type: string
description: |
The list of comma-separated properties used to sort the results.
By default, the column values are sorted in ascending order.
Can either be in the form of fieldName or fieldName:asc,fieldName:desc.
If you want to sort by localized attributes, you must use the following form:
fieldName.language or fieldName.language:asc,fieldName.language:desc.
example: |
size,species:asc,weight:desc
required: false
pageNumber:
type: integer
description: |
The page number to be retrieved where the size of the pages must be specified by the pageSize parameter.
The number of the first page is 1.
minimum: 1
example: 1
default: 1
required: false
pageSize:
type: integer
description: |
The number of documents being retrieved on the page.
minimum: 1
example: 16
default: 16
required: false
responses:
200:
description: |
Resource successfully retrieved.
headers:
Link:
description: |
Link to the current page, the next page and the previous page. Marked accordingly with *rel* **self**, *rel* **next** and *rel* **prev**. The syntax must be conform to [RFC-5988](https://tools.ietf.org/html/rfc5988).
The link to the current page (**self**) is required and must be provided always.
The link to the next page (**next**) is optional. If not present, the next page is not available, as the current page is the last page of the result.
The link to the previous page (**prev**) is optional. If not present, the previous page is not available, as the current page is the first page of the result.
example: |
'<http://sample.com?pageNumber=2&pageSize=10>; rel="self", <http://sample.com?pageNumber=3&pageSize=10>; rel="next"'
required: true
repeat: true
type: string
displayName: Link
hybris-count:
description: |
Total count of queried elements.
type: integer
example: 100
displayName: hybris-count
body:
application/json:
schema: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"metadata": {
"type": "object",
"additionalProperties": false,
"properties": {
"mixins": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "uri"
}
},
"variants": {
"type": "object",
"additionalProperties": false,
"properties": {
"options": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "uri"
}
},
"mixins": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "uri"
}
}
}
},
"version": {
"type": "number"
},
"createdAt": {
"type": "string",
"description": "ISO 8601 format date in which the product was created."
},
"modifiedAt": {
"type": "string",
"description": "ISO 8601 format date in which the product was modified."
}
}
},
"id": {
"type": "string",
"description": "Unique identifier"
},
"yrn": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "YRN attribute",
"type": "string",
"format": "uri",
"description": "Contains the YaaS Resource Name (YRN) of a specific resource on base of the 'yaas' URN scheme"
},
"code": {
"type": [
"string"
],
"description": "Unique, mandatory user-defined identifier of a product",
"minLength": 1,
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\/\\-\\s_*]*$"
},
"name": {
"description": "The name of the product.",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "localized",
"oneOf": [
{
"type": "string",
"minLength": 1,
"description": "value of property in default language"
},
{
"type": "object",
"description": "value of property in specific language",
"additionalProperties": {
"type": "string",
"minLength": 1
}
}
]
},
"description": {
"description": "The description of the product.",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "localized",
"oneOf": [
{
"type": "string",
"description": "value of property in default language"
},
{
"type": "object",
"description": "value of property in specific language",
"additionalProperties": {
"type": "string"
}
},
{
"type": "null"
}
]
},
"published": {
"type": "boolean",
"default": false,
"description": "This flag determines if product is live."
},
"media": {
"type": "array",
"items": {
"type": "object",
"description": "Media file metadata",
"properties": {
"id": {
"type": "string"
},
"yrn": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "YRN attribute",
"type": "string",
"format": "uri",
"description": "Contains the YaaS Resource Name (YRN) of a specific resource on base of the 'yaas' URN scheme"
},
"mediaId": {
"type": "string"
},
"url": {
"type": "string",
"format": "uri",
"description": "URL of file content"
},
"tags": {
"type": "array",
"items": {
"type": "string"
},
"description": "Media file tags"
},
"contentType": {
"type": "string",
"description": "MIME type of the media file"
},
"stored": {
"type": "boolean",
"description": "If true, the media file is stored in the service. Otherwise the service only stores external URL of the file and metadata."
},
"createdAt": {
"type": "string",
"description": "Date of media metadata creation."
},
"commitLink": {
"type": "string",
"description": "Contains link which is used when user triggers media commit operation. This link is not returned to user as product service internally triggers the commit"
},
"uploadLink": {
"type": "string",
"description": "Contains link on which user should send media for upload before he triggers the commit operation"
},
"uncommittedMedia": {
"type": "boolean",
"description": "If true, the media file is not committed yet. Not committed media does no have url property provided"
}
},
"additionalProperties": false
},
"description": "Contains media information (including url). This attribute is Read-Only, to manage media collection please use the /media subresource. To get this attribute included in product please add the expand=media query param. By default this attribute is not returned with product."
},
"mixins": {
"type": "object"
}
},
"additionalProperties": false,
"required": [
"id",
"yrn"
]
}
}
example: |
[
{
"id": "545b4e3dfaee4c10def3db24",
"yrn": "urn:yaas:hybris:product:product:myshop;545b4e3dfaee4c10def3db24",
"code": "SmartphoneZonyXperiaZ21415269949943",
"name": "Smartphone Zony Yperia X2",
"description": "The world's best camera and camcorder in a waterproof smartphone.",
"published": false
}
]
400:
description: |
Request syntactically incorrect. Any details will be provided within the response payload.
body:
application/json:
example: |
{
"status": 400,
"message": "There are validation problems, see details section for more information",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html",
"type": "validation_violation",
"details": [
{
"field": "Accept-Language",
"message": "not a language",
"type": "invalid_header"
}
]
}
schema: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
401:
description: |
Given request is unauthorized. Bad or expired token. Reauthenticate
the user. Any details will be provided within the response payload.
body:
application/json:
example: |
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html"
}
schema: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
403:
description: |
Evaluated request scopes in access token are not sufficient and do not match required scopes.
body:
application/json:
example: |
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
schema: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
500:
description: |
Some server-side error occurred. Any details will be provided within the response payload.
body:
application/json:
schema: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
503:
description: |
Service temporarily unavailable.
body:
application/json:
schema: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
post:
is: [ localizedModification, oauth2, restricted ]
description: |
Create new product.
Accepted scopes:
* `hybris.product_create` - mandatory
* `hybris.product_publish` - required if product is created as published (by providing published flag true )
headers:
Authorization:
type: string
description: |
Used to send a valid OAuth2 access token.
example: Bearer access_token
required: true
Content-Language:
type: string
description: |
Single language code. If provided localized values should be provided as simple Strings, otherwise a 'language code/ value' map is expected for localized values.
example: pl
required: false
body:
application/json:
schema: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"metadata": {
"type": "object",
"additionalProperties": false,
"properties": {
"mixins": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "uri"
}
},
"variants": {
"type": "object",
"additionalProperties": false,
"properties": {
"options": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "uri"
}
}
}
}
}
},
"id": {
"type": "string",
"description": "Unique identifier"
},
"code": {
"type": [
"string"
],
"description": "Unique, mandatory user-defined identifier of a product",
"minLength": 1,
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\/\\-\\s_*]*$"
},
"name": {
"description": "The name of the product.",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "localized",
"oneOf": [
{
"type": "string",
"minLength": 1,
"description": "value of property in default language"
},
{
"type": "object",
"description": "value of property in specific language",
"additionalProperties": {
"type": "string",
"minLength": 1
}
}
]
},
"description": {
"description": "The description of the product.",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "localized",
"oneOf": [
{
"type": "string",
"description": "value of property in default language"
},
{
"type": "object",
"description": "value of property in specific language",
"additionalProperties": {
"type": "string"
}
},
{
"type": "null"
}
]
},
"published": {
"type": "boolean",
"default": false,
"description": "This flag determines if product is live."
},
"mixins": {
"type": "object"
}
},
"additionalProperties": false,
"required": [
"name",
"code"
]
}
example: |
{
"name": "Smartphone Zony Yperia X2",
"code": "SmartphoneZonyYperiaX21415269949943",
"description": "The world's best camera and camcorder in a waterproof smartphone."
}
responses:
201:
description: |
The resource has been successfully created.
body:
application/json:
schema: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"yrn": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "YRN attribute",
"type": "string",
"format": "uri",
"description": "Contains the YaaS Resource Name (YRN) of a specific resource on base of the 'yaas' URN scheme"
},
"link": {
"type": "string"
}
},
"required": [
"id",
"link",
"yrn"
]
}
headers:
Location:
description: |
The Location of the new resource which was created by the request.
The value consists of a single absolute URI.
example: http://www.hybris.com/items/myItem
required : true
displayName: Location
type: string
400:
description: |
Request syntactically incorrect. Any details will be provided within the response payload.
body:
application/json:
example: |
{
"status": 400,
"message": "There are validation problems, see details section for more information",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html",
"type": "validation_violation",
"details": [
{
"field": "Content-Language",
"message": "not a language",
"type": "invalid_header"
}
]
}
schema: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},