Create a Shipping Category
Creates a Shipping Category
POST
/
api
/
v2
/
platform
/
shipping_categories
Create a Shipping Category
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({shipping_category: {name: 'Another Category'}})
};
fetch('http://{defaultHost}/api/v2/platform/shipping_categories', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url http://{defaultHost}/api/v2/platform/shipping_categories \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"shipping_category": {
"name": "Another Category"
}
}
'{
"data": {
"id": "138",
"type": "shipping_category",
"attributes": {
"name": "ShippingCategory 138",
"created_at": "2022-11-08T19:35:21.863Z",
"updated_at": "2022-11-08T19:35:21.863Z"
}
}
}{
"error": "Name can't be blank",
"errors": {
"name": [
"can't be blank"
]
}
}Was this page helpful?
⌘I
Create a Shipping Category
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({shipping_category: {name: 'Another Category'}})
};
fetch('http://{defaultHost}/api/v2/platform/shipping_categories', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url http://{defaultHost}/api/v2/platform/shipping_categories \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"shipping_category": {
"name": "Another Category"
}
}
'{
"data": {
"id": "138",
"type": "shipping_category",
"attributes": {
"name": "ShippingCategory 138",
"created_at": "2022-11-08T19:35:21.863Z",
"updated_at": "2022-11-08T19:35:21.863Z"
}
}
}{
"error": "Name can't be blank",
"errors": {
"name": [
"can't be blank"
]
}
}
