Smart Collections REST API
In certain circumstances, merchants might need to work directly with the Admin API to manipulate Collections
Smart Collections REST API provides the full range of capabilities when you want to automate your routines while working with them.
Smart Collection Model
{
"id": number, // id of the collection in Findify
"slot": "string", // collection slot used to identify collection on the page
"query": { // query used to setup the collection. You can use the same filters
"q": "", // as when working with the Search API
"filters": [
{
"values": [
{
"value": "yes"
}
],
"action": "include",
"type": "text",
"name": "custom_fields.discount_present"
}
],
"sort": [] // sorting object. You can use the same sorting options
// as when working with the Search API
},
"enabled": boolean, // indicates whether collection is enabled or not
"showConfiguredFilters": boolean, // indicates whether configured filters are shown or not
"created_at": "DATE",
"updated_at": "DATE"
}
Get a list of existing Smart Collections
curl --location --request GET 'https://admin.findify.io/v1/merchants/${API_KEY_ID}/smart-collections/${API_KEY_ID}' \
--header 'Content-Type: application/json' \
--header 'x-token: your_x_token'
Creating a Smart Collection
curl --location --request POST 'https://admin.findify.io/v1/merchants/${API_KEY_ID}/smart-collections/${API_KEY_ID}' \
--header 'Content-Type: application/json' \
--header 'x-token: your_x_token'
--data-raw '{"slot":"some_slot","query":{"filters":[{"values":[{"value":"some_category"}],"action":"include","type":"category","name":"category"}]}}'
Updating a Smart Collection
curl --location --request PUT 'https://admin.findify.io/v1/merchants/${API_KEY_ID}/smart-collections/${API_KEY_ID}/{COLLECTION_ID}' \
--header 'Content-Type: application/json' \
--header 'x-token: your_x_token'
--data-raw '{"id": 1, "slot":"some_slot","query":{"filters":[{"values":[{"value":"some_category"}],"action":"include","type":"category","name":"category"}]}}'
Removing a Smart Collection
curl --location --request DELETE 'https://admin.findify.io/v1/merchants/${API_KEY_ID}/smart-collections/${API_KEY_ID}/{COLLECTION_ID}' \
--header 'Content-Type: application/json' \
--header 'x-token: your_x_token'
Updated 5 months ago