# Create catalogue entry
URL: https://docs.fluenta.io/docs/reference/catalogue/create-catalogue-entry
Operation: `createCatalogueEntry`
Required permission: `program`

`POST /v1/external/organizations/{organizationId}/catalogue`

Add a reusable style to the «Catálogo de referencias», as its «Nueva referencia» does: the name is unique in the catálogo (409 `REFERENCE_TEMPLATE_EXISTS`).

### Authorization

- `apiToken` — Bearer token. An API token created in Configuración › Tokens de API, or a connected app’s access token

Send it as `Authorization: Bearer <your API token>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | no | A fresh unique string per intended write (1 to 255 visible ASCII characters). Sent again unchanged only to retry THAT write after a timeout or a 409 `IDEMPOTENCY_IN_PROGRESS`: the stored answer comes back (`Idempotency-Replayed: true`) and nothing is written twice. The same key with another request is a 422 `IDEMPOTENCY_KEY_REUSED`. |
| `organizationId` | path | integer | yes | The organization, from `getMe` or `listOrganizations`. |

### Request body

`application/json`

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | yes | «Referencia»: stored trimmed with inner whitespace collapsed; unique in the catálogo, case-insensitively (409 otherwise). |
| `description` | string | no | «Descripción»: for search only, never copied to an OC. |
| `garment` | string | no | «Categoría»: one of the plant's categories (any case; stored in the list's spelling) when the plant has a list, free text otherwise. |
| `goal` | integer, 1–100000 | no | «Meta por hora»: a whole number from 1 to 100000. |
| `orderNumber` | string | no | «Corte (OC)» by default: the order number a new OC made from this entry starts with, still editable there. A starting value only: the entry is never linked to an OC. |
| `total` | integer, 1–1000000 | no | «Total de unidades» by default: a whole number from 1 to 1000000, the total a new OC made from this entry starts with. |
| `price` | number, 0–1000000000 | no | «Precio por unidad»: 0 or more, at most two decimals. Not stored on a plan without facturación. |
| `color` | string | no | «Color»: `#RRGGBB`, or `#RGB` (expanded). Not stored on a plan without the referencia colour. |
| `step1Name` | string | no | «Subproceso 1»: the first named step of the «referencia», with its own goal (`step1Goal`). A name without its goal is refused with a 400. Stored whether or not the plant uses «Subprocesos». |
| `step1Goal` | integer, 1–100000 | no | «Meta subproceso 1»: a whole number in the «Meta por hora» range, 1 to 100000. |
| `step2Name` | string | no | «Subproceso 2»: the second step; needs step 1. |
| `step2Goal` | integer, 1–100000 | no | «Meta subproceso 2». |

### Responses

| Status | Description |
| --- | --- |
| `201` | `ExternalCatalogueEntryDto` |
| `400` | `INVALID_REQUEST`: a body or a parameter the route cannot take, as `{statusCode, code: 'INVALID_REQUEST', message, details}`, with one `{field, message}` in `details` per failure (`field` the body field as a path, such as `items.0.name`; null when the failure names none). Or a value the dashboard refuses (its own `code`), or `INVALID_IDEMPOTENCY_KEY`. Nothing changed. |
| `401` | Missing, malformed, unknown, expired or revoked credential: `INVALID_API_TOKEN`. |
| `402` | The organization is blocked: `ORG_BLOCKED`. |
| `403` | `ROLE_NOT_ALLOWED`: the usuario’s role does not make this change in the dashboard (it needs ADMIN or MODERATOR, or an account with platform-wide access);`INSUFFICIENT_SCOPE`: the credential lacks «Gestionar el Programa»; `PLAN_LIMIT`: the organization’s plan does not answer this credential (a connected app needs «Conectar con IA», Plan Pro). Nothing changed. |
| `404` | The organization does not exist or is out of the credential’s reach: `ORGANIZATION_NOT_FOUND`. One body for both. |
| `409` | `IDEMPOTENCY_IN_PROGRESS` (with `Retry-After`): the same `Idempotency-Key` is still being answered; retry it unchanged. Or the dashboard’s own conflict. |
| `422` | `IDEMPOTENCY_KEY_REUSED`: the `Idempotency-Key` answered another request. Nothing changed. |
| `429` | The credential is over its rate limit: `RATE_LIMITED`. Per credential, in fixed windows of 60 seconds: 60 requests in one organization on Light and 120 on Pro; 20 on the heavy reads (the range figures, the whole floor, the month and the pauses); 300 across every organization; 60 on the routes that name no organization. Wait `Retry-After` seconds; a refused request counts against nothing. |

### Example

```bash
curl -X POST 'https://api.fluenta.io/v1/external/organizations/{organizationId}/catalogue' \
  -H 'Authorization: Bearer <your API token>' \
  -H 'Content-Type: application/json' \
  -d @body.json
```