> ## Documentation Index
> Fetch the complete documentation index at: https://integration.delogue.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage styles

> Create, publish, and update the styles that sit at the heart of a Delogue collection — from first draft to delivery.

<Info>
  **When to use this.** A style is the core product unit in Delogue PLM: it carries the design
  brief, BOM, files, sample requests, and supplier assignment for one product. Use these endpoints
  to create styles, manage their lifecycle (unpublished → published → delivered), update header
  fields and custom fields, and synchronise your collection with downstream systems.
</Info>

## The workflow

A style moves through a predictable lifecycle. The API mirrors that journey step by step.

<Steps>
  <Step title="Create the style">
    `POST /api/styles` with a brand, season, and style number. The style starts as `unpublished`
    — an internal draft not yet visible to the supplier.
  </Step>

  <Step title="Assign colours and fields">
    Update the style with `PUT /api/styles/{styleId}` to add colour variants (`styleColors`),
    custom field values (`customFields`), and a supplier assignment. Use `PUT /api/styles` (bulk)
    to update many styles in one request.
  </Step>

  <Step title="Publish to the supplier">
    Change `state` to `published` via `PUT /api/styles/{styleId}`. The supplier can now see the
    style. Note: once published a style cannot revert to `unpublished`.
  </Step>

  <Step title="Advance to delivered">
    When the style ships, set `state` to `delivered`. Delivered styles are archived and no longer
    appear in the default style list; retrieve them by filtering on `state=delivered`.
  </Step>
</Steps>

```mermaid theme={"dark"}
sequenceDiagram
  participant D as Designer
  participant API as Delogue API
  participant S as Supplier

  D->>API: POST /api/styles  (state: unpublished)
  API-->>D: style id

  D->>API: PUT /api/styles/{styleId}  (add colours, custom fields)
  API-->>D: updated style

  D->>API: PUT /api/styles/{styleId}  (state: published)
  API-->>D: published style
  API-->>S: style is now visible

  D->>API: PUT /api/styles/{styleId}  (state: delivered)
  API-->>D: delivered style
```

## Walkthrough

Create a new style filed under a brand and season. The request body is an array — one or many
styles are created in a single all-or-nothing transaction.

<CodeGroup>
  ```bash cURL theme={"dark"}
  curl -X POST "https://service.my.delogue.com/api/styles" \
    -H "Accept: application/json" \
    -H "X-Auth-Token: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '[
    {
      "name": "Summer Linen Shirt",
      "customId": "SS27-LIN-001",
      "state": "unpublished",
      "description": "Relaxed fit linen shirt for SS27",
      "logo": null,
      "extraText": null,
      "season": {
        "id": 25609,
        "customId": null,
        "name": "202708",
        "project": "AW27 Drop 1"
      },
      "group": null,
      "brand": {
        "id": 1389,
        "customId": null,
        "name": "Meridian Studio",
        "contactPersonId": null,
        "contactPersonName": null
      },
      "supplier": null,
      "categories": [
        {
          "id": 44,
          "customId": "SHIRTS",
          "name": "Shirts"
        }
      ],
      "styleColors": [
        {
          "id": 2388287,
          "name": "Black",
          "customId1": "001",
          "customId2": null
        }
      ],
      "customFields": [
        {
          "id": 301,
          "customId1": "CF-FABRIC",
          "type": "text",
          "name": "Fabric composition",
          "value": {
            "id": null,
            "value": "100% Linen"
          }
        }
      ],
      "properties": null
    }
  ]'
  ```

  ```js JavaScript theme={"dark"}
  const res = await fetch("https://service.my.delogue.com/api/styles", {
    method: "POST",
    headers: {
      "Accept": "application/json",
      "X-Auth-Token": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify([
    {
      "name": "Summer Linen Shirt",
      "customId": "SS27-LIN-001",
      "state": "unpublished",
      "description": "Relaxed fit linen shirt for SS27",
      "logo": null,
      "extraText": null,
      "season": {
        "id": 25609,
        "customId": null,
        "name": "202708",
        "project": "AW27 Drop 1"
      },
      "group": null,
      "brand": {
        "id": 1389,
        "customId": null,
        "name": "Meridian Studio",
        "contactPersonId": null,
        "contactPersonName": null
      },
      "supplier": null,
      "categories": [
        {
          "id": 44,
          "customId": "SHIRTS",
          "name": "Shirts"
        }
      ],
      "styleColors": [
        {
          "id": 2388287,
          "name": "Black",
          "customId1": "001",
          "customId2": null
        }
      ],
      "customFields": [
        {
          "id": 301,
          "customId1": "CF-FABRIC",
          "type": "text",
          "name": "Fabric composition",
          "value": {
            "id": null,
            "value": "100% Linen"
          }
        }
      ],
      "properties": null
    }
  ]),
  });
  const { data } = await res.json();
  ```
</CodeGroup>

```json theme={"dark"}
{
  "status": "success",
  "code": "styles_created",
  "data": [
    {
      "id": 1149001,
      "name": "Summer Linen Shirt",
      "customId": "SS27-LIN-001",
      "state": "unpublished",
      "description": "Relaxed fit linen shirt for SS27",
      "logo": null,
      "extraText": null,
      "lastUpdated": "2025-06-30T09:00:00Z",
      "season": {
        "id": 25609,
        "customId": null,
        "name": "202708",
        "project": "AW27 Drop 1"
      },
      "group": null,
      "brand": {
        "id": 1389,
        "customId": null,
        "name": "Meridian Studio",
        "contactPersonId": null,
        "contactPersonName": null
      },
      "supplier": null,
      "categories": [
        {
          "id": 44,
          "customId": "SHIRTS",
          "name": "Shirts"
        }
      ],
      "styleColors": [
        {
          "id": 2388287,
          "name": "Black",
          "customId1": "001",
          "customId2": null,
          "state": "active"
        }
      ],
      "customFields": [
        {
          "id": 301,
          "customId1": "CF-FABRIC",
          "type": "text",
          "name": "Fabric composition",
          "value": {
            "id": 0,
            "value": "100% Linen"
          }
        }
      ],
      "properties": [
        "primary"
      ]
    }
  ]
}
```

The response wraps the created styles in the standard envelope. Hold onto each `id` — it is the
stable key for all subsequent style operations.

## Field reference

The fields that matter most when creating or updating a style:

| Field          | What it means at Delogue                                                                                                                                          |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `brand`        | Brand to assign to the style. Required.                                                                                                                           |
| `categories`   | Style categories to tag this style with. Null or omitted leaves categories unchanged; empty list removes all; populated list replaces all.                        |
| `customFields` | Custom field values to set on the style. Null or omitted leaves custom fields unchanged.                                                                          |
| `customId`     | Customer-defined style number. Required unless a style number auto-generator is configured. Must be unique within the organisation when provided.                 |
| `description`  | Optional free-text description of the style.                                                                                                                      |
| `extraText`    | Optional extra text appended to the generated style name when the style number auto-generator is active.                                                          |
| `group`        | Style group to assign. Optional.                                                                                                                                  |
| `logo`         | Optional URL of the style header image.                                                                                                                           |
| `name`         | Display name of the style. Required unless a style name auto-generator is configured for the brand/season.                                                        |
| `properties`   | Reserved for future extensibility; currently unused on write.                                                                                                     |
| `season`       | Season to assign to the style. Required.                                                                                                                          |
| `state`        | Initial lifecycle state of the style. Defaults to unpublished if omitted. Accepted values: unpublished, published, deleted, delivered, cancelled, workInProgress. |
| `styleColors`  | Color variants to associate with the style. Null or omitted leaves colors unchanged; empty list removes all; populated list replaces all.                         |
| `supplier`     | Supplier to assign to the style. Optional; can be set after creation.                                                                                             |

<Note>
  `PUT /api/styles` (bulk) and `PUT /api/styles/{styleId}` (single) both use patch semantics
  for nested collections: omitting `styleColors`, `categories`, or `customFields` preserves
  existing values. Provide `[]` to explicitly clear a collection.
</Note>

<Warning>
  **Breaking change — `GET /api/styles` filter.** The `ReadyForExport` query parameter is now a
  boolean (`true`/`false`) instead of an array of integers. Pass `ReadyForExport=true` to return
  only styles marked ready for export. Integrations that previously sent an integer list must
  switch to the boolean form.
</Warning>

## Roles & permissions

Managing styles requires the **`styles`** permission on a **designer (brand)** account —
typically `CompanyAdmin` or `CompanyUser`. Supplier accounts can read published styles assigned
to them but cannot create or delete styles. Setting a style to `workInProgress` temporarily
locks all supplier edits on that style (they can only view the header).

## When things go wrong

Errors use the standard envelope (`status: "error"`, a `code`, and `error.details[]`). See
[Errors & responses](/concepts/errors) for the full list of codes and how to resolve them.

Common cases:

* **400 `validation_error.required_field`** — `brand` or `season` was omitted on create.
* **404 `resource_error.style_not_found`** — the `id` in the path does not exist or belongs to another organisation.
* **409 `resource_conflict_error.style_already_exists`** — the `customId` is already in use within the organisation.
* **422 `unprocessable_error.*`** — a state transition was rejected (e.g. attempting to revert `published` to `unpublished`).

## What to call next

<CardGroup cols={2}>
  <Card title="Seasons" href="/guides/seasons">
    Every style requires a season. Create or look up seasons before creating styles.
  </Card>

  <Card title="Style categories" href="/guides/style-categories">
    Tag styles with categories for filtering and collection reporting.
  </Card>

  <Card title="Style items" href="/guides/style-items">
    Add materials, trims, and fabrics to a style as style items.
  </Card>

  <Card title="Style custom fields" href="/guides/style-custom-fields">
    Extend style data with organisation-specific custom fields.
  </Card>

  <Card title="Sample requests" href="/guides/sample-requests">
    Request and track development samples against a style.
  </Card>

  <Card title="Style files" href="/guides/style-files">
    Attach and organise a style's files and file folders.
  </Card>

  <Card title="Style SKUs" href="/guides/style-skus">
    Read and manage a style's colour/size SKU matrix.
  </Card>

  <Card title="Style prices" href="/guides/style-prices">
    Look up a style's negotiated and calculated prices.
  </Card>

  <Card title="Measurement charts" href="/guides/measurement-charts">
    Read a style's measurement chart, its lines, and files.
  </Card>

  <Card title="Supplier facilities" href="/guides/style-supplier-facilities">
    See which supplier facilities a style is produced at.
  </Card>
</CardGroup>
