Create categories
const url = 'https://catalog.shopgate.io/v1/merchants/example/categories';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"categories":[{"code":"someCode","parentCategoryCode":"ParentCategoryA","image":{"en-us":"string in english","de-de":"Zeichenkette auf Deutsch"},"name":{"en-us":"string in english","de-de":"Zeichenkette auf Deutsch"},"url":{"en-us":"string in english","de-de":"Zeichenkette auf Deutsch"},"sequenceId":1,"description":{"en-us":"string in english","de-de":"Zeichenkette auf Deutsch"},"externalUpdateDate":"2018-12-15T00:00:23.114Z","status":"active"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://catalog.shopgate.io/v1/merchants/example/categories \ --header 'Content-Type: application/json' \ --data '{ "categories": [ { "code": "someCode", "parentCategoryCode": "ParentCategoryA", "image": { "en-us": "string in english", "de-de": "Zeichenkette auf Deutsch" }, "name": { "en-us": "string in english", "de-de": "Zeichenkette auf Deutsch" }, "url": { "en-us": "string in english", "de-de": "Zeichenkette auf Deutsch" }, "sequenceId": 1, "description": { "en-us": "string in english", "de-de": "Zeichenkette auf Deutsch" }, "externalUpdateDate": "2018-12-15T00:00:23.114Z", "status": "active" } ] }'Create new categories.
Localizations
The following properties are localized:
- name
- image
- url
- description
see Entity Localization for further information.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”Request Body
Section titled “Request Body”object
object
Human readable code of the entity
Example
someCodeExample
ParentCategoryALocalization object, see Entity Localization for further information.
object
Example
{ "en-us": "string in english", "de-de": "Zeichenkette auf Deutsch"}Localization object, see Entity Localization for further information.
object
Example
{ "en-us": "string in english", "de-de": "Zeichenkette auf Deutsch"}Localization object, see Entity Localization for further information.
object
Example
{ "en-us": "string in english", "de-de": "Zeichenkette auf Deutsch"}By default this creates an ascending order of categories meaning 0 is the first.
Example
1Localization object, see Entity Localization for further information.
object
Example
{ "en-us": "string in english", "de-de": "Zeichenkette auf Deutsch"}Example
2018-12-15T00:00:23.114ZResponses
Section titled “Responses”Successfully created
object
object
object
Machine readable error code
Human readable error code
Example
{ "errors": [ { "code": 400, "entity": "planet", "entityId": "pluto", "entityIndex": 1, "reason": "Planet pluto was not found (did you mean dwarf planet pluto?)", "subentityPath": [ "categories", 0 ], "validationErrors": [ { "code": "MAX_LENGTH", "message": "Name too long", "description": "Property Name is too long", "path": [ "name" ] } ] } ]}Validation error
object
object
object
object
The parameter-field, that failed to validate, like “userId”
The value, that was sent, like “xxx”
Machine readable error code
Human readable error code
object
object
Machine readable error code
Human readable error code
Example
{ "error": { "code": "SCHEMA_VALIDATION_FAILED", "results": { "errors": [ { "code": "MAX_LENGTH", "message": "Name too long", "description": "Property Name is too long", "path": [ "name" ] } ] } }}Merchant not found
object
Example
{ "code": "NotFound", "message": "Merchant not found"}
