Create Category
POST/categories
Use this endpoint to create a single category. If a category is successfully created, the response will include the category id
.
Fields
Name | Required |
---|---|
names | yes |
descriptions | no |
shortDescriptions | no |
language | yes |
parent | yes |
sourceId | no |
source | only when sourceId is provided |
Request
- application/json
Body
Array [
]
Array [
]
Array [
]
descriptions
object[]
language string
value string
language string
name
object[]
language string
value string
parent
object
id number
shortDescriptions
object[]
language string
value string
source string
sourceId string
Responses
- 201
- 400
Create Category - 200
Response Headers
Alt-Svc
string
Via
string
alt-svc
string
content-length
string
date
string
return-format
string
server
string
x-request-id
string
- application/json
- Schema
- Example (from schema)
- Create Category - 200
Schema
Array [
]
Array [
]
Array [
]
data
object
descriptions
object[]
language string
value string
id number
language string
names
object[]
language string
value string
parent
object
id number
shortDescriptions
object[]
language string
value string
source string
sourceId string
messages string[]
total number
{
"data": {
"descriptions": [
{
"language": "NL",
"value": "Fiets"
},
{
"language": "EN",
"value": "Bike"
}
],
"id": 1771,
"language": "NL",
"names": [
{
"language": "NL",
"value": "Fiets"
},
{
"language": "EN",
"value": "Bike"
}
],
"parent": {
"id": 1320
},
"shortDescriptions": [
{
"language": "NL",
"value": "Fiets"
},
{
"language": "EN",
"value": "Bike"
}
],
"source": "REST-API",
"sourceId": "020000"
},
"messages": [
"Category created"
],
"total": 1
}
{
"data": {
"descriptions": [
{
"language": "NL",
"value": "Fiets"
},
{
"language": "EN",
"value": "Bike"
}
],
"id": 1771,
"language": "NL",
"names": [
{
"language": "NL",
"value": "Fiets"
},
{
"language": "EN",
"value": "Bike"
}
],
"parent": {
"id": 1320
},
"shortDescriptions": [
{
"language": "NL",
"value": "Fiets"
},
{
"language": "EN",
"value": "Bike"
}
],
"source": "REST-API",
"sourceId": "020000"
},
"messages": [
"Category created"
],
"total": 1
}
Create Category - 400 (invalid schema)
Response Headers
Alt-Svc
string
Via
string
alt-svc
string
content-length
string
date
string
return-format
string
server
string
x-request-id
string
- application/json
- Schema
- Example (from schema)
- Create Category - 400 (invalid schema)
Schema
error
object
code number
messages string[]
moreInfo string
status number
type string
{
"error": {
"code": 10007,
"messages": [
"#: required key [names] not found",
"#: extraneous key [name] is not permitted"
],
"moreInfo": "https://www.propel.us/docs/errors/10007",
"status": 400,
"type": "SchemaValidationException"
}
}
{
"error": {
"code": 10007,
"messages": [
"#: required key [names] not found",
"#: extraneous key [name] is not permitted"
],
"moreInfo": "https://www.propel.us/docs/errors/10007",
"status": 400,
"type": "SchemaValidationException"
}
}
Loading...