Update a Category

put
Update a Category by ID

https://api.moltin.com/v2/categories/:id
Request
Response
Headers
Authorization
required
string
The Bearer token to gran access to the API
Body Parameters
id
required
string
ID of the category to update.
type
required
string
Represents the type of the object being returned, e.g. category
200: OK
{
"data": {
"id": "57fbb8eb-34cc-4076-8ec8-7e6f52c07100",
"type": "category",
"status": "live",
"name": "Womens",
"slug": "Womens",
"description": "Womens clothing",
"meta": {
"timestamps": {
"created_at": "2018-10-05T15:18:48+00:00",
"updated_at": "2018-10-05T15:18:48+00:00"
}
},
"relationships": {}
}
}
cURL
JavaScript SDK
curl -X PUT https://api.moltin.com/v2/categories/:id \
-H "Authorization: Bearer XXXX" \
-H "Content-Type: application/json" \
-d $'{
"data": {
"type": "category",
"id": "645f97aa-ae63-4ee9-9259-062e570ba064",
"name": "Category #1 Updated",
"slug": "category-1-update",
"description": "First category updated",
"status": "live"
}
}'
const MoltinGateway = require('@moltin/sdk').gateway
const Moltin = MoltinGateway({
client_id: 'X',
client_secret: 'X'
})
const id = 'XXXX'
const category = {
name: "Category #1 Updated",
slug: "category-1-update",
description: "First category updated",
status: "live"
}
Moltin.Categories.update(id, category).then(category => {
// Do something
})