# Apply a catalog import

Source: https://docs.fiest.io/api/reference/apply-catalog-import
Canonical sandbox contract: https://docs.fiest.io/openapi.yaml

## POST /v1/restaurants/{restaurantId}/catalog-import/apply

Creates the planned catalog entities and one inactive draft menu. The plan hash, explicit confirmation, and idempotency key are required; this operation never publishes the new menu. Organization-boundary tokens also require fiest.organization.read.

## Authentication

Send an OAuth access token in the `Authorization` header as
`Bearer $FIEST_ACCESS_TOKEN`.

Required scopes: `fiest.restaurant.read`, `fiest.menu.read`, `fiest.catalog.import.write`

## Quick request

```bash
curl --request POST \
  --url 'https://api-sandbox.fiest.io/v1/restaurants/11111111-1111-4111-8111-111111111111/catalog-import/apply' \
  --header 'Authorization: Bearer $FIEST_ACCESS_TOKEN'
```

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `restaurantId` | path | Yes | string (uuid) | A restaurant identifier returned by the authorized restaurant list. |

## Success response

### 201 — The committed create-only import result.

```json
{
  "data": {
    "actionId": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa",
    "restaurantId": "11111111-1111-4111-8111-111111111111",
    "menu": {
      "menuPublicId": "43f64da8-4ec2-4900-b137-1c0927c975d2",
      "name": "Lunch menu",
      "activeForPos": false,
      "onlineOrdering": false,
      "categoryCount": 1,
      "itemCount": 1
    },
    "created": {
      "menus": 1,
      "newMenus": 1,
      "menuCategories": 1,
      "menuItems": 1,
      "optionGroups": 0,
      "options": 0,
      "productCategories": 0,
      "products": 0,
      "combos": 0,
      "comboComponents": 0
    },
    "ids": {
      "menu": {
        "lunch-menu": "33333333-3333-4333-8333-333333333333"
      },
      "menuCategories": {
        "pizzas": "44444444-4444-4444-8444-444444444444"
      },
      "existingMenuCategories": {},
      "menuItems": {
        "margherita": "55555555-5555-4555-8555-555555555555"
      },
      "optionGroups": {},
      "options": {},
      "productCategories": {},
      "products": {}
    },
    "replayed": false
  }
}
```

## Error responses

### 400 — The request parameters are invalid.

```json
{
  "error": "invalid_request",
  "message": "The requested date range is invalid.",
  "request_id": "req_sandbox_invalid_request"
}
```

### 401 — The access token is missing, invalid, or expired.

```json
{
  "error": "invalid_token",
  "error_description": "The access token is invalid.",
  "request_id": "req_sandbox_invalid_token"
}
```

### 403 — The authorization has expired or does not include the required scope.

```json
{
  "error": "insufficient_scope",
  "error_description": "The operation requires an OAuth scope that is not granted.",
  "request_id": "req_sandbox_insufficient_scope"
}
```

### 404 — The restaurant or requested resource does not exist or is outside the authorization.

```json
{
  "error": "not_found",
  "request_id": "req_sandbox_not_found"
}
```

### 409 — The write conflicts with current state, its idempotency key, or an active external integration.

```json
{
  "error": "conflict",
  "request_id": "req_sandbox_conflict"
}
```

### 413 — The JSON request body exceeds one megabyte.

```json
{
  "error": "payload_too_large",
  "request_id": "req_sandbox_payload_too_large"
}
```

### 429 — The partner request limit has been exceeded.

```json
{
  "error": "rate_limited",
  "request_id": "req_sandbox_rate_limited"
}
```

### 503 — The capability is disabled in this environment or a required service is unavailable.

```json
{
  "error": "capability_disabled",
  "request_id": "req_sandbox_capability_disabled"
}
```

## Related

- [Quick start](https://docs.fiest.io/api/quickstart)
- [Stable API errors](https://docs.fiest.io/api/reference/errors)
- [OpenAPI 3.1 contract, YAML](https://docs.fiest.io/openapi.yaml)
- [OpenAPI 3.1 contract, JSON](https://docs.fiest.io/openapi.json)
- [Authorize and call the Fiest Partner API](https://docs.fiest.io/api/quickstart)