Relationships

You can use the Collections API to associate Collections with each other in a hierarchical tree structure. The relationship between Collections is known as parents and children.

get
Get the Collections tree

https://api.moltin.com/v2/collections/tree
Request
Response
Headers
Authorization
required
string
The Bearer token to grant access to the API
200: OK
{
"data": [
{
"id": "12912957-4159-4eea-b1c4-685876588300",
"type": "collection",
"status": "live",
"name": "Top Picks",
"slug": "top_picks",
"description": "Top Picks Collection"
}
]
}
cURL
JavaScript SDK
Swift SDK
curl -X GET https://api.moltin.com/v2/collections/tree \
-H "Authorization: Bearer XXXX"
const MoltinGateway = require('@moltin/sdk').gateway
const Moltin = MoltinGateway({
client_id: 'X'
})
Moltin.Collections.Tree().then(collections => {
// Do something
})
let moltin = Moltin(withClientID: "<your client ID>")
moltin.brand.tree { result in
switch result {
case .success(let response):
print(response)
case .failure(let error):
print(error)
}
}