Create category
Create a category. Requires a Write key.
POST
/categoriesAuthorization
AuthorizationBearer token (API key) · headerrequiredOrganization API key.
Request body
requiredapplication/jsonnamestringrequiredindexnumbershowOnScreenbooleanimageUrlstringmarginMinPercentnumbermarginMaxPercentnumberhideStorestring[]allowStorestring[]Responses
200Category created
successbooleanrequiredidstringrequired400Bad request
statusCodeintegerrequiredHTTP status code
messagestringrequiredHuman-readable error message
timestampstring<date-time>requiredpathstringrequiredRequest path
403Unauthorized
statusCodeintegerrequiredHTTP status code
messagestringrequiredHuman-readable error message
timestampstring<date-time>requiredpathstringrequiredRequest path
Request
curl -X POST "https://dashboard.scango.ch/api/v1/categories" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"index": 0,
"showOnScreen": true,
"imageUrl": "string",
"marginMinPercent": 0,
"marginMaxPercent": 0,
"hideStore": [
"string"
],
"allowStore": [
"string"
]
}'const response = await fetch("https://dashboard.scango.ch/api/v1/categories", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"name": "string",
"index": 0,
"showOnScreen": true,
"imageUrl": "string",
"marginMinPercent": 0,
"marginMaxPercent": 0,
"hideStore": [
"string"
],
"allowStore": [
"string"
]
})
});Response
{
"success": true,
"id": "string"
}{
"statusCode": 0,
"message": "string",
"timestamp": "2024-01-01T00:00:00Z",
"path": "string"
}{
"statusCode": 0,
"message": "string",
"timestamp": "2024-01-01T00:00:00Z",
"path": "string"
}