Brand Service

Download OpenAPI specification:Download

Manage detailed brand information about products.


Key Features:

  • Create, manage, and delete brands.
  • Associate collaterals or information with the brand (for example logos, descriptions, or SEO texts).

Key Benefits:

  • Associate media and other information with a brand.
  • Create brand-specific sites.
  • Find products by brand.

Brands

Manage brands

Retrieving all brands

Retrieves all brands created by the tenant.


Required scopes

No specific scopes are required.

SecurityOAuth2
Request
query Parameters
q
string

A standard query parameter is used to search for specific values.

  • Searching for items by string-based properties:
    • By field value: q=name:brand_one, where name is the field name and brand_one is its desired value.
    • By localized field value: q=name.en:brand_one, where name is the field name, en is a language code, and brand_one is the field value expressed in the specified language. Note: This query works only for localized fields stored in the map format, where key is the language code and value is the translation to a particular language.
  • Searching for items by a number-based property:
    • With a specific value: q=metadata.version:2
    • With a value greater than: q=metadata.version:>1
    • With a value lower than: q=metadata.version:<3
    • With a value greater than or equal to: q=metadata.version:>=1
    • With a value lower than or equal to: q=metadata.version:<=2
    • With a value within a range of values: q=metadata.version:(>=1 AND <=2)
      where metadata.version is the name of the number-based field, and 2 is it's querying value.
  • Searching for items by a date-based property: All numer-based property queries are also valid for dates. In that case, the date should be placed within double quotes: q=metadata.createdAt:(>="2021-05-18T07:27:27.455Z" AND <"2021-05-20T07:27:27.455Z")
  • Searching for items with a nonexistent or empty property: q=localizedDescription.en:null, where localizedDescription.en is the field that has its value set to null.
  • Searching for items with an existing property: q=localizedDescription:exists, where localizedDescription is the field that has a non-empty value.
  • Searching for items by multiple specific values: q=id:(5c3325baa9812100098ff48f,5c3325d1a9812100098ff494), where id is the field name, and strings within the bracket are the desired values.
  • Searching for items by multiple fields: q=id:5c3325baa9812100098ff48f name:brand_one where id and name are field names. All objects that contain the specified values are returned. Multiple fields (separated by space) can be specified. Multiple values for each field can also be specified in a format presented earlier.
  • Searching for items with string-based properties conforming to a regex: q=name:~_on or q=name:(~brand on) - in case of searching for strings with space, where name is the name of field and _on or brand on is its querying regex.
  • Searching for items with a localized string-based property conforming to a regex: localizedName.en:~(_on) - where localizedName is the localized field name, en is a desired language, and _on is a search term.
Example: q=name:{brandName}
header Parameters
Accept-Language
string

The language or multiple languages acceptable for the response. Defines language(s) of the localized fields that should be returned in the response body. If set to *, the response body will contain translations into all languages specified in the tenant configuration. The specified language needs to be defined in the Configuration Service, under the project_lang key.

Note: If not specified, the localized fields will be saved in the default language configured by the tenant in the Configuration Service.

Example: fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7
Responses
200

The brands have been successfully retrieved.

400

Request syntactically incorrect. Any details will be provided within the response payload.

403

Given authorization scopes are not sufficient and do not match the required scopes.

500

Some server side error occurred.

get/brands
Request samples
Response samples
application/json
[
  • {
    },
  • {
    }
]

Adding a new brand

Creates a new brand.


Required scopes

  • brand.brand_manage
SecurityOAuth2
Request
header Parameters
Content-Language
string

Defines the language in which the localized fields are specified. If set to *, the request body may contain translations into all languages specified in the tenant configuration. The specified language need to be defined in the Configuration Serivce under project_lang key.

Note: If not specified, localized fields will be saved in the default language configured by the tenant in the Configuration Service.

Example: en
Request Body schema: application/json
id
string

Unique identifier of a brand.

name
string

Brand name.

description
string

Brand description.

object

Map of key-value pairs containing localized names of the brand.

object

Map of key-value pairs containing localized descriptions of the brand.

image
string <uri>

Link to the associated media file.

cloudinaryUrl
string

Id of the associated media file.

Responses
201

The brand has been successfully created.

400

Request syntactically incorrect. Any details will be provided within the response payload.

403

Given authorization scopes are not sufficient and do not match the required scopes.

409

Creation failed because there was a conflict with another resource. Any details will be provided within the response payload.

500

Some server side error occurred.

post/brands
Request samples
application/json
{
  • "id": "55421f3b6ecea7b1a3b73d26",
  • "name": "Brand one",
  • "description": "Description of <strong>Haribo</strong> in HTML.",
  • "localizedName": {
    },
  • "localizedDescription": {
    },
  • "cloudinaryUrl": "tenant/brands/media_Id"
}
Response samples
application/json
{
  • "name": "Brand_2",
  • "description": "Description of Brand_2 in HTML.",
  • "localizedName": {
    },
  • "localizedDescription": {
    },
  • "metadata": {
    },
  • "id": "55421f3b6ecea7b1a3b73d26"
}

Retrieving a brand

Retrieves details of a specified brand.


Required scopes

No specific scopes are required.

SecurityOAuth2
Request
path Parameters
brandId
required
string

Unique identifier of a brand.

header Parameters
Accept-Language
string

The language or multiple languages acceptable for the response. Defines language(s) of the localized fields that should be returned in the response body. If set to *, the response body will contain translations into all languages specified in the tenant configuration. The specified language needs to be defined in the Configuration Service, under the project_lang key.

Note: If not specified, the localized fields will be saved in the default language configured by the tenant in the Configuration Service.

Example: fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7
Responses
200

Brand successfully retrieved.

400

Request syntactically incorrect. Any details will be provided within the response payload.

404

The requested resource does not exist.

500

Some server side error occurred.

get/brands/{brandId}
Request samples
Response samples
application/json
{
  • "name": "Haribo",
  • "description": "Description of Brand_2 in HTML.",
  • "localizedName": {
    },
  • "localizedDescription": {
    },
  • "cloudinaryUrl": "tenant/brands/media_Id",
  • "metadata": {
    },
  • "id": "55421f3b6ecea7b1a3b73d26"
}

Updating a brand

Updates a specified brand by replacing all of its existing data with data from the request body.


Required scopes

  • brand.brand_manage
SecurityOAuth2
Request
path Parameters
brandId
required
string

Unique identifier of a brand.

header Parameters
Content-Language
string

Defines the language in which the localized fields are specified. If set to *, the request body may contain translations into all languages specified in the tenant configuration. The specified language need to be defined in the Configuration Serivce under project_lang key.

Note: If not specified, localized fields will be saved in the default language configured by the tenant in the Configuration Service.

Example: en
Request Body schema: application/json
name
string

Brand name.

description
string

Brand description.

object

Map of key-value pairs containing localized names of the brand.

object

Map of key-value pairs containing localized descriptions of the brand.

image
string <uri>

Link to the associated media file.

cloudinaryUrl
string

Id of the associated media file.

object (Metadata)
Responses
200

The brand has been successfully updated.

400

Request syntactically incorrect. Any details will be provided within the response payload.

403

Given authorization scopes are not sufficient and do not match the required scopes.

404

The requested resource does not exist.

500

Some server side error occurred.

put/brands/{brandId}
Request samples
application/json
{
  • "name": "Brand one",
  • "description": "Description of <strong>Haribo</strong> in HTML.",
  • "localizedName": {
    },
  • "localizedDescription": {
    },
  • "cloudinaryUrl": "{tenant}/brands/{media_Id}",
  • "metadata": {
    }
}
Response samples
application/json
{
  • "name": "Haribo",
  • "description": "Description of <strong>Haribo</strong> in HTML.",
  • "localizedName": {
    },
  • "localizedDescription": {
    },
  • "cloudinaryUrl": "tenant/brands/media_Id",
  • "metadata": {
    },
  • "id": "55421f3b6ecea7b1a3b73d26"
}

Deleting a brand

Deletes a specified brand.


Required scopes

  • brand.brand_delete
SecurityOAuth2
Request
path Parameters
brandId
required
string

Unique identifier of a brand.

Responses
204

The brand has been successfully deleted.

403

Given authorization scopes are not sufficient and do not match the required scopes.

404

The requested resource does not exist.

500

Some server side error occurred.

delete/brands/{brandId}
Request samples
Response samples
application/json
{
  • "code": 403,
  • "message": "Given request does not have required scopes. It is not authorized to perform this operation.",
  • "status": "Forbidden",
  • "details": [
    ]
}

Media

Manage brands media

Adding an image for a brand

Creates a public image for a brand.


Required scopes

  • brand.brand_manage
SecurityOAuth2
Request
Request Body schema: multipart/form-data
file
string <byte>

Actual file content.

metadata
string

The metadata for the image as string encoded json - only simple strings are supported.

Responses
201

The image has been successfully created.

400

Request syntactically incorrect. Any details will be provided within the response payload.

403

Given authorization scopes are not sufficient and do not match the required scopes.

500

Some server side error occurred.

post/media
Request samples
Response samples
application/json
{}

Deleting an image from a brand

Deletes a specified public image from a brand.


Required scopes

  • brand.brand_delete
SecurityOAuth2
Request
path Parameters
mediaId
required
string

Unique identifier of a media file.

Responses
200

The image has been successfully deleted.

403

Given authorization scopes are not sufficient and do not match the required scopes.

404

The requested resource does not exist.

500

Some server side error occurred.

delete/media/{mediaId}
Request samples
Response samples
application/json
{
  • "code": 403,
  • "message": "Given request does not have required scopes. It is not authorized to perform this operation.",
  • "status": "Forbidden",
  • "details": [
    ]
}