Get All Collections

1
Last updated yesterday

get
Get All Collections

https://api.moltin.com
/v2/collections
Request
Response
Headers
Authorization
required
string
The Bearer token to grant access to the API.
Query Parameters
include
optional
string
collection, products
filter
optional
string
Filter the results
200: OK
{
"data": [
{
"id": "645f97aa-ae63-4ee9-9259-062e570ba064",
"type": "collection",
"status": "live",
"name": "Winter Season",
"slug": "winter-season",
"description": "Our Winter Season is now live!",
"meta": {
"timestamps": {
"created_at": "2018-05-10T14:23:18+00:00",
"updated_at": "2018-05-10T14:23:18+00:00"
}
},
"relationships": {}
},
{
"id": "fbc05bbb-638a-4d36-998b-005c7bdf3dc9",
"type": "collection",
"status": "live",
"name": "Winter Season",
"slug": "winter-season",
"description": "Our Winter Season is now live!",
"meta": {
"timestamps": {
"created_at": "2018-05-10T02:36:29+00:00",
"updated_at": "2018-05-10T02:36:29+00:00"
}
},
"relationships": {}
}
],
"links": {
"current": "https://api.moltin.com/v2/collections?page[limit]=100&page[offset]=0",
"first": "https://api.moltin.com/v2/collections?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 -X GET https://api.moltin.com/v2/collections \
-H "Authorization: Bearer XXXX"
const MoltinGateway = require('@moltin/sdk').gateway
const Moltin = MoltinGateway({
client_id: 'XXXX'
})
Moltin.Collections.all().then(collections => {
// Do something
})
const { createClient } = require('@moltin/request')
const client = new createClient({
client_id: 'X'
})
client
.get('collections')
.then(collections => {
// Do something...
})
.catch(console.error)
let moltin = Moltin(withClientID: "<your client ID>")
moltin.collection.all { result in
switch result {
case .success(let response):
print(response)
case .failure(let error):
print(error)
}
}