Update a Category

Last updated 7 months ago

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
200: OK
cURL
JavaScript
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
})