Get All Categories

get
Get all Categories

https://api.moltin.com/v2/categories
Request
Response
Headers
Authorization
required
string
The Bearer token to grant access to the API.
Query Parameters
include
optional
string
categories, products
filter
optional
string
Filter the results.
200: OK
{
"data": [
{
"id": "9dd56fc2-5746-46a2-bdf6-fe396bb6b7af",
"type": "category",
"status": "live",
"name": "Clothing",
"slug": "clothing",
"description": "Browse our clothing line",
"meta": {
"timestamps": {
"created_at": "2018-05-10T14:11:32+00:00",
"updated_at": "2018-05-10T14:11:32+00:00"
}
},
"relationships": {}
},
{
"id": "75542cfa-38e2-4a48-8416-74055af7d62e",
"type": "category",
"status": "live",
"name": "Clothing",
"slug": "clothing",
"description": "Browse our clothing line",
"meta": {
"timestamps": {
"created_at": "2018-05-10T02:20:47+00:00",
"updated_at": "2018-05-10T02:24:10+00:00"
}
},
"relationships": {}
}
],
"links": {
"current": "https://api.moltin.com/v2/categories?page[limit]=100&page[offset]=0",
"first": "https://api.moltin.com/v2/categories?page[limit]=100&page[offset]=0",
"last": null
},
"meta": {
"page": {
"limit": 100,
"offset": 0,
"current": 1,
"total": 1
},
"results": {
"total": 2
}
}
}

You can use pagination with this resource. See: Settings for details.

cURL
JavaScript SDK
Moltin Request
Swift SDK
curl https://api.moltin.com/v2/categories \
-H "Authorization: Bearer XXXX"
const MoltinGateway = require('@moltin/sdk').gateway
const Moltin = MoltinGateway({
client_id: 'X'
})
Moltin.Categories.All().then(categories => {
// Do something
})
const { MoltinClient } = require('@moltin/request')
const client = new MoltinClient({
client_id: 'X'
})
client
.get('categories')
.then(categories => {
// Do something...
})
.catch(console.error)
let moltin = Moltin(withClientID: "<your client ID>")
moltin.category.all { result in
switch result {
case .success(let response):
print(response)
case .failure(let error):
print(error)
}
}