The collection object
{
"id": "0199ed2a-…",
"title": "Nuevos",
"slug": "nuevos",
"description": "Lo último en la tienda.",
"createdAt": "2026-10-12T15:04:05.000Z",
"updatedAt": "2026-10-12T15:04:05.000Z"
}GET/collections
| Query | |
|---|---|
q |
Title search. |
exclude |
Comma-separated ids to leave out. |
limit |
1–100, default 10. |
cursor |
From the previous page. |
const { data } = await malla.collections.list({ q: 'regalos' })GET/collections/:id
Returns one collection.
POST/collections
title and slug are required, description optional. Answers 201.
curl -X POST "https://api.malla.fun/collections" \
-H "Authorization: Bearer $MALLA_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "title": "Regalos", "slug": "regalos" }'const collection = await malla.collections.create({ title: 'Regalos', slug: 'regalos' })PATCH/collections/:id
Any of title, slug, description.
DELETE/collections/:id
Deletes the collection, not its products.
POST/collections/:id/products/:productId
Adds a product. Answers 201 with { "ok": true }.
await malla.collections.addProduct(collectionId, productId)DELETE/collections/:id/products/:productId
Removes a product from the collection.
await malla.collections.removeProduct(collectionId, productId)