Create a Brand
Create a Brand
POST
https://api.moltin.com/v2/brands
Headers
Request Body
{
"data": {
"id": "06e510ae-4ddd-4150-a721-561ca5c4ce31",
"type": "brand",
"status": "live",
"name": "Cool Clothing",
"slug": "cool-clothing",
"description": "Cool clothing make cool clothes!",
"relationships": {}
}
}
{
"errors": [
{
"title": "Failed Validation",
"detail": "The data.name field is required."
}
]
}
curl -X POST https://api.moltin.com/v2/brands \
-H "Authorization: Bearer XXXX" \
-H "Content-Type: application/json" \
-d $'{
"data": {
"type": "brand",
"name": "Cool Clothing",
"slug": "cool-clothing",
"description": "Cool clothing make cool clothes!",
"status": "live"
}
}'
const MoltinGateway = require('@moltin/sdk').gateway
const Moltin = MoltinGateway({
client_id: 'X',
client_secret: 'X'
})
const brand = {
name: 'Cool Clothing',
slug: 'cool-clothing',
description: 'Cool clothing make cool clothes.',
status: 'live'
}
Moltin.Brands.Create(id, brand).then(brand => {
// Do something
})
const { MoltinClient } = require('@moltin/request')
const client = new MoltinClient({
client_id: 'X',
client_secret: 'X'
})
const data = {
type: 'brand',
name: 'Cool Clothing',
slug: 'cool-clothing',
description: 'Cool clothing make cool clothes.',
status: 'live'
}
client
.post('brands', data)
.then(brand => {
// Do something...
})
.catch(console.error)
Last updated