Create a catalog
create_catalogBuild a catalog from a DSL document: pages, product grids and which fields each product shows. The document needs a template, which supplies the design — without one the catalog has blank covers, no fonts or colours and plain product cells. The template is the merchant's choice (list_templates shows them): a call without one creates nothing and answers requiresTemplateChoice with the choices. A wholesale document (usage: "wholesale" — a line sheet is a wholesale catalog) also needs wholesaleDiscountPercent, the percentage off the regular price the merchant gives wholesale buyers, 0 when there is none; it is the merchant's figure, and without it nothing is created either (requiresWholesaleDiscount). The grammar is foldsquare://schemas/catalog-dsl.json. Products are selected by collection, by id or by search; list_collections and search_products resolve the names a merchant uses into ids. An answer with valid: false lists issues that say exactly what to change. On success, catalog.editorUrl opens what was built — the only link that works before the catalog is published; viewerUrl is null until then.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| document | Yes | A foldsquare.catalog/v1 document | |
| idempotencyKey | No | Any string unique to this build; a retry with the same key returns the first result instead of creating a second catalog | |
| withoutTemplate | No | true builds an undesigned catalog, for a merchant who has seen the templates and wants none. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issues | No | ||
| catalog | No | The catalog built, when created | |
| created | Yes | ||
| missing | No | What the merchant still has to decide | |
| summary | No | ||
| replayed | No | A retry with the same idempotencyKey: the first result, not a second catalog | |
| templates | No | ||
| schemaIssues | No | ||
| tellTheMerchant | No | Warnings on a successful build, to relay | |
| requiresTemplateChoice | No | Nothing was built: the merchant must pick one of `templates` | |
| requiresWholesaleDiscount | No | Nothing was built: the merchant must give their wholesale discount |