Search Documentation
Search for a documentation page...
Collections API
REST API endpoints for managing product collections.
Collections group products together for display on your storefront (e.g. "Featured", "New Arrivals", "Sale Items"). YNS supports both manual collections (products added individually) and dynamic collections (products auto-included based on price range).
List Collections
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | number | 10 | Collections per page (1-100) |
offset | number | 0 | Collections to skip |
query | string | — | Search by collection name |
active | boolean | — | Filter by active status |
lang | string | — | Locale code for translations (e.g. pl-PL) |
Response
Get Collection
Returns a single collection by UUID or slug, with associated products and translations. Supports ?lang= for translated content.
Create Collection
Creates a product collection. Slug is auto-generated from the name if not provided. Image URLs are downloaded and re-uploaded to the store's CDN.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Collection name |
slug | string | No | URL slug (auto-generated from name) |
description | string | No | Plain text description |
image | string | No | Image URL |
filter | object | No | Filter type (default: { type: "manual" }) |
active | boolean | No | Visible on storefront (default: true) |
Filter Types
| Type | Description |
|---|---|
{ type: "manual" } | Products are manually added |
{ type: "dynamicPrice", min?: number, max?: number } | Products auto-included by price range |
Response (201)
Returns the created collection with full data.