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

# Centra

> Let the Dema Agent work directly with your Centra store — read products, orders, customers, inventory, and pricing, and optionally act on them by updating stock, confirming orders, creating shipments, and managing discounts.

## Overview

Once Centra is connected, the Dema Agent can pull live data from your store — products, variants, orders, customers, inventory, markets, pricelists, categories, and discounts — directly inside a conversation. With write permissions, it can also take action for you: correct stock, confirm or cancel orders, create shipments, update products and customers, and turn discounts on or off.

The agent only acts when you ask it to, and Dema asks you to confirm sensitive changes before they are applied. You stay in control of both what the agent can see and what it can do.

<Note>
  This is a **separate connection** from the [Centra data integration](/integrations/ecommerce/centra) that syncs orders and inventory into Dema's analytics. That one is a read-only background sync; this one lets the agent read **and act** in real time when you ask. They use different credentials — see below.
</Note>

***

## Use a dedicated token for the agent

Create a **new Integration API token just for the agent**, separate from the one your data sync uses. The agent can act on your store, not just read it, so its own token keeps access independently scoped, auditable, and revocable — cutting the agent off or rotating its token never touches your analytics sync. Name it something obvious like `Dema Agent`.

***

## Prerequisites

* A Centra account with permission to create **Integration API tokens** (System → API Tokens).
* Your store URL, in the form `https://your-store.centra.com`.

***

## Connect Centra

<Steps>
  <Step title="Create a dedicated API token in Centra">
    1. In Centra, go to **System → API Tokens**.
    2. Click **Create integration API token** in the top right.
    3. Give it a description and set **Integration name** to `Dema Agent` (create it if it does not exist).
    4. Set an **expiry date**. Centra tokens are time-limited (30 days by default); pick a window that fits your rotation policy.
    5. Leave **Restrictions** unchecked, or scope them if your security team requires it.
    6. Under **Permissions**, select the permissions listed in [Permissions to grant](#permissions-to-grant) below. Grant the read set for analysis; add write permissions only if you want the agent to make changes.
    7. Click **Save** and copy the generated token.
  </Step>

  <Step title="Connect in Dema">
    In Dema, go to **Agents → Settings → Integrations**, find **Centra**, and click **Connect**. Enter:

    * **API token** — the token you just created.
    * **Account URL** — your store URL, for example `https://your-store.centra.com`.

    Click **Add**. Dema verifies the credentials and marks the integration as Active.
  </Step>
</Steps>

***

## Permissions to grant

Centra permissions are granular and chosen when you create the token. We recommend the principle of least privilege: grant the **read** set so the agent can analyze your store, and add **write** permissions only for the actions you actually want it to perform.

<Note>
  Centra tells you the exact permission every request uses. If the agent ever reports a missing permission, Centra's error names the precise one — add it to the token and reconnect. This is also the surest way to grant the agent the minimum it needs and nothing more.
</Note>

### Read access (recommended baseline)

Grant these so the agent can answer questions across your catalogue, orders, customers, inventory, and pricing.

<AccordionGroup>
  <Accordion title="Products & catalogue" icon="box">
    | Permission            | What it unlocks                          |
    | --------------------- | ---------------------------------------- |
    | `Product:read`        | Read products and their details          |
    | `ProductVariant:read` | Read variants (colours, styles)          |
    | `ProductSize:read`    | Read sizes, SKUs, and EANs               |
    | `Brand:read`          | Read the brand on a product              |
    | `Collection:read`     | Read the collection a product belongs to |
    | `Display:read`        | Read catalogue items shown to shoppers   |
    | `Bundle:read`         | Identify bundle products                 |
  </Accordion>

  <Accordion title="Inventory" icon="boxes-stacked">
    | Permission                  | What it unlocks                     |
    | --------------------------- | ----------------------------------- |
    | `Warehouse:read`            | Read warehouses and stock locations |
    | `ProductVariant.stock:read` | Read stock levels per variant       |
    | `ProductSize.stock:read`    | Read stock levels per size          |
  </Accordion>

  <Accordion title="Orders & returns" icon="file-invoice-dollar">
    | Permission                   | What it unlocks                     |
    | ---------------------------- | ----------------------------------- |
    | `Order:read`                 | Read orders, line items, and totals |
    | `Order.shippingAddress:read` | Read shipping addresses on orders   |
    | `Order.billingAddress:read`  | Read billing addresses on orders    |
    | `Return:read`                | Read return details on an order     |
  </Accordion>

  <Accordion title="Customers" icon="user">
    | Permission                     | What it unlocks                           |
    | ------------------------------ | ----------------------------------------- |
    | `Customer:read`                | Look up customers and their order history |
    | `Customer.billingAddress:read` | Read a customer's billing address         |
  </Accordion>

  <Accordion title="Markets, pricing & merchandising" icon="store">
    | Permission       | What it unlocks                      |
    | ---------------- | ------------------------------------ |
    | `Market:read`    | Read markets and sales channels      |
    | `Store:read`     | Read stores                          |
    | `Pricelist:read` | Read pricelists                      |
    | `Category:read`  | Read the merchandising category tree |
    | `Voucher:read`   | Read discount codes and vouchers     |
    | `Campaign:read`  | Read scheduled price campaigns       |
  </Accordion>

  <Accordion title="Reference data" icon="globe">
    These cover currency and country values that appear on prices, totals, addresses, markets, and pricelists.

    | Permission      | What it unlocks                                      |
    | --------------- | ---------------------------------------------------- |
    | `Currency:read` | Read currencies on prices and totals                 |
    | `Country:read`  | Read countries on addresses, markets, and pricelists |
  </Accordion>
</AccordionGroup>

The full read baseline, ready to copy:

```text Read permissions theme={null}
Product:read
ProductVariant:read
ProductSize:read
Brand:read
Collection:read
Display:read
Bundle:read
Warehouse:read
ProductVariant.stock:read
ProductSize.stock:read
Order:read
Order.shippingAddress:read
Order.billingAddress:read
Return:read
Customer:read
Customer.billingAddress:read
Market:read
Store:read
Pricelist:read
Category:read
Voucher:read
Campaign:read
Currency:read
Country:read
```

### Write access (optional)

Add these only if you want the agent to make changes in Centra. Write tools run only when you ask, and Dema prompts you to approve sensitive changes before they are applied.

<AccordionGroup>
  <Accordion title="Inventory" icon="boxes-stacked">
    | Permission                                     | What it unlocks                 |
    | ---------------------------------------------- | ------------------------------- |
    | `StockChange:write` + `WarehouseDelivery:read` | Set or correct stock quantities |
  </Accordion>

  <Accordion title="Order operations" icon="truck">
    | Permission                                                                                               | What it unlocks                    |
    | -------------------------------------------------------------------------------------------------------- | ---------------------------------- |
    | `Order:write`                                                                                            | Confirm or cancel orders           |
    | `Purchaser:read`                                                                                         | Required to cancel an order        |
    | `OrderHistory:write`                                                                                     | Add notes to an order              |
    | `Shipment:write`, `Shipment:read`, `Shipment.shippingAddress:read`, `AdminUser:read`, `StorePlugin:read` | Create shipments and fulfil orders |
  </Accordion>

  <Accordion title="Catalogue & customers" icon="pen-to-square">
    | Permission        | What it unlocks                                                |
    | ----------------- | -------------------------------------------------------------- |
    | `Product:write`   | Update product fields (name, status, number, internal comment) |
    | `Customer:write`  | Update customer fields (status, internal comment)              |
    | `Attribute:write` | Set custom attributes (custom fields) on any object            |
  </Accordion>

  <Accordion title="Merchandising" icon="sitemap">
    | Permission       | What it unlocks                              |
    | ---------------- | -------------------------------------------- |
    | `Category:write` | Create categories and add or remove displays |
  </Accordion>

  <Accordion title="Pricing & promotions" icon="tag">
    | Permission      | What it unlocks                      |
    | --------------- | ------------------------------------ |
    | `Price:write`   | Set a product's price in a pricelist |
    | `Voucher:write` | Disable or delete vouchers           |
  </Accordion>
</AccordionGroup>

<Note>
  Creating a shipment also requires `AdminUser:read` and `StorePlugin:read` on the token — Centra needs them to resolve the shipping configuration even though the agent never reads that data directly.
</Note>

The write permissions, ready to add on top of the read baseline:

```text Write permissions theme={null}
StockChange:write
WarehouseDelivery:read
Order:write
Purchaser:read
OrderHistory:write
Shipment:write
Shipment:read
Shipment.shippingAddress:read
AdminUser:read
StorePlugin:read
Product:write
Customer:write
Attribute:write
Category:write
Price:write
Voucher:write
```

***

## When your token expires

Centra Integration API tokens are static and expire on the date you set (30 days by default). When a token expires, the integration shows as expired in Dema and the agent stops using it. To restore access, create a fresh token in Centra and paste it in via **Reconnect** on the integration card.

<Tip>
  Set a calendar reminder a few days before the expiry date so the agent never loses access unexpectedly. A longer expiry window means fewer rotations, at the cost of a longer-lived credential — pick what fits your security policy.
</Tip>

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="The agent says it is missing a permission">
    Centra names the exact permission in the error (it returns `permissionsUsed` on every request). Open the token in **System → API Tokens**, add the named permission, save, and click **Reconnect** in Dema. If the token cannot be edited, create a new one with the added permission and reconnect.
  </Accordion>

  <Accordion title="Dema says the Account URL is invalid">
    The Account URL must be an HTTPS URL pointing at your Centra store, in the form `https://your-store.centra.com`. Use your real store hostname, not a hand-written value.
  </Accordion>

  <Accordion title="Dema says my connection has expired">
    Your Centra token reached its expiry date. Create a new token in Centra and click **Reconnect** on the Centra integration card to paste it in.
  </Accordion>

  <Accordion title="The agent cannot see a write action working">
    Make sure you granted the matching write permission when you created the token (see [Write access](#write-access-optional)). Write permissions are not included in the read baseline and must be added deliberately.
  </Accordion>
</AccordionGroup>

If you are still stuck, contact [support](mailto:info@dema.ai) with the error message you see.

***

## Additional resources

* [Centra Integration API documentation](https://centra.dev/docs)
* [Centra data integration (analytics sync)](/integrations/ecommerce/centra) — the separate read-only connection that feeds Dema's reporting
