Create a supplier product category
POSThttps://api.staging.powerapi.com/api/v1/suppliers/:id/supplier_product_categories
Create a supplier product category
Request
Path Parameters
id int32required
- application/vnd.api+json
Body
required
data
object
Responses
- 201
Create a supplier product category
- application/vnd.api+json
- Schema
- Example (from schema)
- Example
Schema
data
object
required
{
"data": {
"id": "string",
"type": "string",
"attributes": {
"name": "string",
"name-fr": "string",
"name-de": "string",
"name-it": "string",
"name-es": "string",
"name-el": "string",
"children": [
{
"id": "string",
"name": "string"
}
],
"custom-category-id": "string",
"parent-category": "string",
"parent-name": "string",
"delivery-schedule": {},
"ordering-deadline": 0,
"ordering-lead-time": 0
}
}
}
{
"data": {
"id": "d0f96dc7-0d07-44c5-984b-8000b5a3b3af",
"type": "supplier-product-categories",
"attributes": {
"name": "Updated Category Name",
"name-fr": "French translation of Category Name",
"name-de": "German translation of Category Name",
"name-it": "Italian translation of Category Name",
"name-es": "Spanish translation of Category Name",
"name-el": "Greek translation of Category Name",
"parent-category": "fb0a19d1-012b-54da-ae40-ff17c0f12b97",
"parent-name": "Parent Category",
"children": [
{
"name": "Child Category",
"id": "c0f68dc7-0f07-43c5-984b-8002b5a7b3ad"
}
],
"custom-category-id": "A113",
"delivery-schedule": {
"id": "1e24a232-7862-477f-8184-231835169047",
"monday": [
2,
660
],
"tuesday": [],
"wednesday": [],
"thursday": [],
"friday": [],
"saturday": [],
"sunday": []
},
"ordering-deadline": 57600,
"ordering-lead-time": 172800
}
}
}
- curl
- python
- go
- nodejs
- ruby
- java
- powershell
- CURL
curl -L 'https://api.staging.powerapi.com/api/v1/suppliers/:id/supplier_product_categories' \
-H 'Content-Type: application/vnd.api+json' \
-H 'Accept: application/vnd.api+json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"data": {
"type": "supplier_product_categories",
"attributes": {
"name": "string",
"name_fr": "string",
"name_de": "string",
"name_it": "string",
"name_es": "string",
"name_el": "string",
"parent_category_name": "string",
"delivery_schedule": {
"monday": [
null
],
"tuesday": [
null
],
"wednesday": [
null
],
"thursday": [
null
],
"friday": [
null
],
"saturday": [
null
],
"sunday": [
null
]
},
"ordering_deadline": 0,
"ordering_lead_time": 0,
"custom_category_id": "string"
},
"relationships": {
"parent_category": {
"data": {
"type": "supplier_product_categories",
"id": "string"
}
}
}
}
}'
ResponseClear