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

# Record commands

> Create, update and list stores, versions, components, functions and business rules from the terminal, by flags or by one JSON document

These commands manage the records the Admin shows, without the Admin. They all need a login, take ids as flags, print one JSON line and accept `--dry-run`, `--fields`, `-o` and `--data` (see [Global flags](/ollie-shop/cli.md#global-flags)).

List commands accept `ls` as an alias (`ollieshop store ls`).

## store

```bash theme={"system"}
ollieshop store create --name "Acme" --platform vtex --platform-store-id acme [--logo <url>] [--org <uuid>]
ollieshop store list [--org <uuid>]
```

| Flag | Required | Notes |
| - | :-: | - |
| `--name`, `-n` | yes | Display name |
| `--platform`, `-p` | yes | `vtex`, `shopify`, `vnda` or `custom`. VTEX is the platform available today |
| `--platform-store-id` | yes | The account on the platform (the VTEX account name) |
| `--logo` | | A URL |
| `--org <uuid>` | | Which organization, when you belong to more than one. Without it, the CLI lists your organizations and asks you to pick |

`create` returns `{"data":{"id":"…"}}`. `list` returns `id`, `name`, `platform`, `platform_store_id`, `organization_id`, `logo`, `settings`, `created_at`.

## version

```bash theme={"system"}
ollieshop version create --store-id <uuid> --name "Black Friday" [--template sales] [--active] [--default]
ollieshop version list --store-id <uuid>
```

`--active` and `--default` are off unless passed. See [Managing Versions](/ollie-shop/configuration/versions.md) for what active and default mean; remember only one version can be the default.

## component

```bash theme={"system"}
ollieshop component create --version-id <uuid> --name "Free Shipping Bar" --slot cart_header_full_page [--active true|false] [--props '{"target":35000}']
ollieshop component update --id <uuid> [--name …] [--slot …] [--active …] [--props …] [--version-id <uuid>]
ollieshop component list --store-id <uuid> [--version-id <uuid>]
```

| Flag | Notes |
| - | - |
| `--version-id` | The version the component belongs to. Required on `create`; on `update` it moves the component to another version |
| `--name`, `-n` | Display name. Independent of the folder name |
| `--slot`, `-s` | A slot id from the [catalog](/ollie-shop/concepts/slots-catalog.md). Note `-s` means slot here, not stage |
| `--active` | `true` or `false`. Default `true` on create |
| `--props` | A JSON object, or `null` to clear. Must be an object: `--props '{"discount":10}'` |

`create` only creates the record; it does not write `ollie.json` or upload code. Link the folder (see [Project configuration](/ollie-shop/cli/project-config.md)) and deploy with [`deploy`](/ollie-shop/cli/deploy). `update` with no field to change fails with `No fields to update`.

`list` returns `id`, `name`, `slot`, `active`, `version_id`, `props`, `created_at` and the version's `id` and `name`.

## function

```bash theme={"system"}
ollieshop function create --version-id <uuid> --name "Fraud check" \
  [--invocation request|response] [--trigger-url <url> --trigger-expression '<jsonata>'] \
  [--on-error throw|skip] [--priority 0] [--active true|false]
ollieshop function update --function-id <uuid> [same flags]
ollieshop function list --store-id <uuid> [--version-id <uuid>]
ollieshop function dev   # see its own page
```

| Flag | Notes |
| - | - |
| `--invocation` | `request` runs before the upstream call, `response` after. Default `response` |
| `--trigger-url`, `--trigger-expression` | Both or neither. The URL the function intercepts and the JSONata condition. See [Triggers](/ollie-shop/functions/triggers.md) |
| `--on-error` | `throw` stops the request with an error, `skip` ignores the failure. Default `throw` |
| `--priority` | Integer ≥ 0, lower runs first. Default 0 |
| `--active` | Default `false` on create |

To remove a trigger, use the JSON form: `--data '{"functionId":"…","trigger":null}'`. `list` returns `id`, `name`, `active`, `urn`, `on_error`, `priority`, `trigger`, `invocation`, `version_id`, `created_at` and the version.

## business-rule

```bash theme={"system"}
ollieshop business-rule list [--store-id <uuid>] [--version-id <uuid>] [--code-updated true|false]
ollieshop business-rule get --id <uuid>
ollieshop business-rule update --id <uuid> --content "…" [--versions-ids '[…]'] [--components-ids '[…]'] [--functions-ids '[…]']
```

Business rules are plain-language rules Ollie turns into code for you. `update` replaces the content, keeps the previous text, and marks the rule as not yet implemented in code. The feature is currently enabled by Ollie per store; ask your contact if the list comes back empty.

## schema

```bash theme={"system"}
ollieshop schema                      # list the schemas
ollieshop schema component.create     # JSON schema of one command's input
ollieshop schema deploy
```

Prints the JSON schema of the input a command accepts through `--data`. Useful for scripts and for coding agents that generate the JSON. Available: `store`, `version`, `component`, `function` with their actions, and `deploy`.

## The --data form

Every create and update command accepts its whole input as one JSON object, with camelCase keys. When `--data` is present the individual flags are ignored (except `--org` on `store create`).

```bash theme={"system"}
ollieshop component create --data '{
  "versionId": "0b7e4d2c-9f1a-4c3b-8e5d-6a7b8c9d0e1f",
  "name": "Free Shipping Bar",
  "slot": "cart_header_full_page",
  "props": { "target": 35000 }
}'
```

Pair it with `--dry-run` to validate a document before sending it:

```json theme={"system"}
{"dryRun":true,"action":"component.create","data":{"versionId":"…","name":"Free Shipping Bar","slot":"cart_header_full_page","active":true,"props":{"target":35000}}}
```

## Related

* [Managing Components](/ollie-shop/customization/managing-components.md) and [Managing Versions](/ollie-shop/configuration/versions.md): the same records in the Admin
* [deploy](/ollie-shop/cli/deploy.md): shipping code to a component or function record


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.