# Prebit tools for AI apps

This is every tool the Prebit connector offers to ChatGPT, Claude, Muse and other AI apps (79 tools). It is generated from the live server, so it is always current.

## Connecting

- **Server address:** `https://mcp.prebit.in/mcp` (MCP over HTTPS).
- **Sign-in:** OAuth 2.1 with PKCE (S256). The merchant signs in at https://admin.prebit.in and chooses **one store**. Clients can identify themselves with a Client ID Metadata Document or dynamic registration. Public clients only.
- **Access the merchant grants:** **View your store**: Products, collections, orders, customers, discounts, content and your theme's code. **Edit your store**: Create and change products, collections, discounts, menus, blog posts and pages. It can archive products but never delete them. Shipping changes need a code we email to you. **Edit your theme's code**: Changes go to a draft copy, never your live store. Going live always needs a code we email to you. View-only is available; nobody can grant more than their role in the store allows, and the role is re-checked on every call.
- **Disconnecting:** Settings → Connected AI apps in the Prebit dashboard shows every connection with its recent activity and ends access immediately.

## What AI apps can never do

Delete anything (products are archived, not deleted; shipping zones and rates are switched off), refund or cancel orders, mark orders paid, issue gift cards, change tax, or change payments, domains, staff or billing. These stay in the Prebit dashboard. Changes to the store's design are made on a **draft** theme; making a draft live needs a 6-digit code emailed to the merchant, and the store owner is emailed afterwards. Changing shipping zones, rates or delivery & COD rules also needs a 6-digit code emailed to the merchant that lists the exact change; after one approval, further shipping changes on that connection need none for 10 minutes.

## Classes

Each tool is filed as **Read** (changes nothing), **Write** (changes something that is easy to change back) or **Sensitive write** (customer-facing or hard to undo; AI apps should ask the person every time).

## Limits and errors

- **Rate limits (per connection):** 180 tool calls per minute, 90 writes per minute, 25 product archives per hour, 5 approval emails per hour. Exceeding a limit returns an error saying how long to wait.
- **Errors** are plain sentences that say what to fix (a missing permission, an unknown id, an invalid value). A write that is rejected changes nothing: theme edits and page edits are all-or-nothing.
- **Data:** tools return only what the merchant's role may see. Amounts are in the store currency's main unit (499 means 499 INR). Tokens are stored hashed, and the activity log records a summary of each change, never credentials.

## Core tools (56)

Products, collections, media, themes and store content. These are what the connector is for and are fully supported.

### `get_store` — Get store details

The store this connection manages: its name, handle, live storefront address, currency, languages, plan, and the signed-in person's role in it.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** none

### `get_store_overview` — Get store overview

How the store did in the last 30 days compared with the 30 days before: orders placed, total sales (what those orders are worth, cash on delivery included, as on the Analytics page), the money collected so far, average order value, visitors and conversion, plus what needs attention now (orders to ship, payments to collect) and the dashboard's insight cards. Amounts are in the store currency's main unit. Checkouts that were never completed are not orders and aren't counted.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** none

### `list_product_options` — List product vendors, types, tags and collections

The vendors, product types, categories, tags and collections this store already uses, so new or edited products can match the store's existing values.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** none

### `search_product_categories` — Search product categories

Searches Prebit's standard product category list (the taxonomy used for search and marketplaces). Each match has a fullName, which is the value the product tools accept as `category`.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `query` (string, required)

### `search_products` — Search products

Finds products in the store. With no arguments it returns the newest non-archived products. Each result has its id, status (active, draft or archived), price and stock.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `query` (string), `status` (all | active | draft | archived), `collectionId` (string), `vendor` (string), `productType` (string), `tag` (string), `sort` (newest | name | price-asc | price-desc), `page` (integer), `limit` (integer)

### `get_product` — Get a product

One product in full: description, price and compare-at price, images, options, variants with stock, tags, collections, SEO fields and status.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `productId` (string, required)

### `create_product` — Create a product

Creates a product. Only `name` and `price` are required. It is saved as a draft (hidden from customers) unless `status` is 'active'. `options` (e.g. sizes, colours) generates one variant per combination; `packConfig` adds 'pack of 2/3' variants. Images can be public links; they are downloaded into the store's media library.

- **Class:** Write · **Role needed:** editor or above · **Access:** `prebit:write`
- **Side effects:** Created as a draft (hidden) unless the merchant asks for it to be live.
- **Inputs:** `name` (string, required), `description` (string), `price` (number), `compareAtPrice` (number), `costPrice` (number), `sku` (string), `barcode` (string), `vendor` (string), `productType` (string), `category` (string), `tags` (string[]), `collectionIds` (string[]), `status` (draft | active), `images` (object[]), `options` (object[]), `variants` (object[]), `trackInventory` (boolean), `stock` (integer), `taxable` (boolean), `weightKg` (number), `seoTitle` (string), `seoDescription` (string), `faqs` (object[]), `packConfig` (object)

### `update_product` — Update a product

Changes a product. Only the fields sent are changed; everything else stays as it is. Fields marked REPLACES (images, options, variants, collectionIds) overwrite the whole list with the one sent. `status` moves the product between draft and active.

- **Class:** Write · **Role needed:** editor or above · **Access:** `prebit:write`
- **Inputs:** `productId` (string, required), `name` (string), `description` (string), `price` (number), `compareAtPrice` (number), `costPrice` (number), `sku` (string), `barcode` (string), `vendor` (string), `productType` (string), `category` (string), `tags` (string[]), `collectionIds` (string[]), `status` (draft | active), `images` (object[]), `options` (object[]), `variants` (object[]), `trackInventory` (boolean), `stock` (integer), `taxable` (boolean), `weightKg` (number), `seoTitle` (string), `seoDescription` (string), `faqs` (object[]), `packConfig` (object)

### `update_inventory` — Update product stock

Sets or adjusts stock. For a product without variants: `stock` (set) or `adjustStockBy` (add or remove). For variants: `variants`, each identified by optionValues or sku, with `stock` or `adjustBy`. Pack-size variants share their single's stock and are not set directly. Stock can't go below zero.

- **Class:** Write · **Role needed:** editor or above · **Access:** `prebit:write`
- **Inputs:** `productId` (string, required), `stock` (integer), `adjustStockBy` (integer), `variants` (object[])

### `duplicate_product` — Duplicate a product

Makes a copy of a product (named 'Copy of …', saved as a draft) with the same details, variants and collections.

- **Class:** Write · **Role needed:** editor or above · **Access:** `prebit:write`
- **Inputs:** `productId` (string, required)

### `archive_product` — Archive a product

Hides a product from the store without deleting it: customers can no longer see or buy it, and it can be restored later. One product per call, and at most 25 per hour per connection. Products can't be deleted through this connector.

- **Class:** Sensitive write · **Role needed:** editor or above · **Access:** `prebit:write` · repeat-safe
- **Side effects:** Hides the product from the store. Reversible with unarchive_product. Limited to 25 per hour.
- **Inputs:** `productId` (string, required)

### `unarchive_product` — Unarchive a product

Restores an archived product. It returns with the status it had before (active or draft).

- **Class:** Write · **Role needed:** editor or above · **Access:** `prebit:write` · repeat-safe
- **Inputs:** `productId` (string, required)

### `list_collections` — List collections

The store's collections with their id, type (manual or automated), status and product count.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `query` (string), `page` (integer), `limit` (integer)

### `get_collection` — Get a collection

One collection in full: its description, rules (for an automated one), SEO fields and the products in it (up to 100, with names).

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `collectionId` (string, required)

### `create_collection` — Create a collection

Creates a collection. Manual: `productIds` lists a hand-picked group. Automated: `rules` select matching products automatically and stay up to date (e.g. price less_than 999, or vendor equals 'Acme'). New collections are active (visible) unless `status` is 'draft'.

- **Class:** Write · **Role needed:** editor or above · **Access:** `prebit:write`
- **Inputs:** `title` (string, required), `productIds` (string[]), `rules` (object[]), `matchAnyRule` (boolean), `description` (string), `status` (draft | active), `imageUrl` (string), `seoTitle` (string), `seoDescription` (string)

### `update_collection` — Update a collection

Changes a collection's title, description, image, status, SEO fields or, for an automated collection, its rules. Only the fields sent are changed; `rules` REPLACES the existing rules. The products in a manual collection are not changed here.

- **Class:** Write · **Role needed:** editor or above · **Access:** `prebit:write`
- **Inputs:** `collectionId` (string, required), `title` (string), `rules` (object[]), `matchAnyRule` (boolean), `description` (string), `status` (draft | active), `imageUrl` (string), `seoTitle` (string), `seoDescription` (string)

### `add_products_to_collection` — Add products to a collection

Adds products to the end of a hand-picked collection. Products already in it are skipped. Doesn't apply to automated collections.

- **Class:** Write · **Role needed:** editor or above · **Access:** `prebit:write` · repeat-safe
- **Inputs:** `collectionId` (string, required), `productIds` (string[], required)

### `remove_products_from_collection` — Remove products from a collection

Takes products out of a hand-picked collection. The products themselves stay in the store. Doesn't apply to automated collections.

- **Class:** Write · **Role needed:** editor or above · **Access:** `prebit:write` · repeat-safe
- **Inputs:** `collectionId` (string, required), `productIds` (string[], required)

### `upload_image_from_url` — Add an image to the media library

Adds an image to the store's media library (resized for fast loading) and returns the store's own image URL. The image comes from a public link (`url`) or, in ChatGPT, from a file attached to the chat (`file`). The product tools also accept image links directly.

- **Class:** Write · **Role needed:** editor or above · **Access:** `prebit:write`
- **Inputs:** `url` (string), `file` (object)

### `create_image_upload_link` — Get a link to upload photos

Creates a one-time web page where the merchant uploads photos from their phone or computer straight into the store's media library. It is how photos attached to a chat reach the store when the AI app can't pass the file itself. Returns the page link (valid 30 minutes, up to 10 photos, no sign-in needed) and an uploadId for reading back what was uploaded.

- **Class:** Write · **Role needed:** editor or above · **Access:** `prebit:write`
- **Side effects:** Makes a one-time upload page (30 minutes, up to 10 photos, no sign-in) whose photos go into the store's media library.
- **Inputs:** none

### `get_uploaded_images` — Get photos from an upload link

The photos uploaded so far through an upload page, in the order they were added, each with its media-library URL. Those URLs are accepted anywhere an image link is (products, collections, blog posts, theme settings).

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `uploadId` (string, required)

### `list_media` — List media library

The store's media library (uploaded images and videos), newest first, optionally filtered by file name.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `query` (string), `type` (image | video), `page` (integer), `limit` (integer)

### `list_menus` — List navigation menus

The store's navigation menus (e.g. main menu, footer) with their id, handle and top-level item labels.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** none

### `get_menu_link_options` — List what a menu can link to

What menu items can link to: the store's collections and products (searchable, up to 100 products), its pages and its policy pages, with the id or key each link needs.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `productQuery` (string)

### `get_menu` — Get a navigation menu

One menu's full item tree, in the same format that updating a menu accepts.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `menuId` (string, required)

### `create_menu` — Create a navigation menu

Creates a navigation menu with its links. Themes show a menu by its handle, which is made from the title. `items` is the complete list; each item links to the home page, a collection, a product, a page, a policy, the search page or a web address.

- **Class:** Write · **Role needed:** editor or above · **Access:** `prebit:write`
- **Inputs:** `title` (string, required), `items` (object[])

### `update_menu` — Update a navigation menu

Renames a menu and/or changes its links. `items` REPLACES the whole tree (existing items keep their id). Renaming also changes the handle that themes use to show the menu.

- **Class:** Write · **Role needed:** editor or above · **Access:** `prebit:write`
- **Inputs:** `menuId` (string, required), `title` (string), `items` (object[])

### `list_blog_posts` — List blog posts

The store's blog posts, newest first, with their id and status (draft or published).

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `query` (string), `status` (draft | published), `page` (integer), `limit` (integer)

### `get_blog_post` — Get a blog post

One blog post in full: body (HTML), excerpt, author, tags, cover image, SEO fields and status.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `postId` (string, required)

### `create_blog_post` — Create a blog post

Creates a blog post. It is saved as a draft (hidden from customers) unless `status` is 'published'.

- **Class:** Write · **Role needed:** editor or above · **Access:** `prebit:write`
- **Inputs:** `title` (string, required), `excerpt` (string), `content` (string), `author` (string), `imageUrl` (string), `tags` (string[]), `seoTitle` (string), `seoDescription` (string), `status` (draft | published)

### `update_blog_post` — Update a blog post

Changes a blog post; only the fields sent are changed. `status` 'published' publishes it and 'draft' takes it off the store. Posts can't be deleted through this connector.

- **Class:** Write · **Role needed:** editor or above · **Access:** `prebit:write`
- **Inputs:** `postId` (string, required), `title` (string), `excerpt` (string), `content` (string), `author` (string), `imageUrl` (string), `tags` (string[]), `seoTitle` (string), `seoDescription` (string), `status` (draft | published)

### `get_policies` — Get store policies

The store's written policies as HTML: returns (return and refund), privacy, terms (terms of service), shipping, contact (contact information) and legal (legal notice) — empty when not written — plus additionalInstructions, a private note for AI assistants that customers never see.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** none

### `update_policies` — Update store policies

Sets the text of one or more store policies. Each policy is legal text on its own store page (/policies/refund-policy, privacy-policy, terms, shipping-policy, contact-information, legal-notice), live immediately. Send plain text (blank lines separate paragraphs) or simple HTML (p, h2, h3, strong, em, u, ul, ol, li, a). Each policy sent REPLACES its existing text and an empty string removes it; policies not sent are unchanged. additionalInstructions is a private note for AI assistants, never shown to customers.

- **Class:** Write · **Role needed:** admin or above · **Access:** `prebit:write`
- **Side effects:** Store policy text goes live immediately.
- **Inputs:** `returns` (string), `privacy` (string), `terms` (string), `shipping` (string), `contact` (string), `legal` (string), `additionalInstructions` (string)

### `list_redirects` — List URL redirects

The store's URL redirects (old address → new address), newest first.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** none

### `create_redirect` — Create a URL redirect

Sends visitors from an old address on the store to a new one (e.g. /old-product → /products/new-product), so old links and search results keep working. `fromPath` is a path on this store; `toPath` is another path or a full https:// address.

- **Class:** Write · **Role needed:** editor or above · **Access:** `prebit:write`
- **Inputs:** `fromPath` (string, required), `toPath` (string, required)

### `list_themes` — List themes

The store's live theme and its draft themes (id, name, revision). When a theme is published, the previous live theme is kept as a draft.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** none

### `create_theme_draft` — Create a theme draft

Creates a draft theme: a working copy customers don't see, starting as a copy of the live theme (or of another draft). Every theme edit through this connector happens on a draft.

- **Class:** Write · **Role needed:** editor or above · **Access:** `prebit:theme`
- **Side effects:** Copies a theme into a new draft; the live store is untouched.
- **Inputs:** `name` (string), `copyFrom` (string)

### `get_theme_preview_url` — Get a draft's preview link

A link that shows a draft theme on the real storefront. Anyone with the link can view that draft; it expires after 30 days.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `themeId` (string, required)

### `list_theme_files` — List a draft's files

Every file in a draft theme with its size: theme/theme.bit (page layout), theme/theme.css, sections/<name>.bit, blocks/<name>.bit, snippets/*, locales/*.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `themeId` (string, required)

### `read_theme_file` — Read a theme file

Reads a theme file with line numbers, up to 400 lines at a time (`startLine` continues from a given line).

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `themeId` (string, required), `path` (string, required), `startLine` (integer), `endLine` (integer)

### `search_theme_files` — Search a draft's files

Case-insensitive text search across every file of a draft theme: where a class, setting, colour or sentence appears.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `themeId` (string, required), `query` (string, required)

### `edit_theme_files` — Edit a draft's code

Changes theme code in a draft, as one all-or-nothing batch. Each edit is `replace` (swaps one exact piece of text; oldString must match exactly once), `write` (replaces a whole existing file) or `create` (a new sections/<name>.bit, blocks/<name>.bit, sections/<name>.css|js or snippets/<name>.html|css|js). The draft is compiled with the whole batch applied; if it would break, nothing is saved and the compile errors are returned.

- **Class:** Write · **Role needed:** editor or above · **Access:** `prebit:theme`
- **Side effects:** Changes a draft theme only; the live store is untouched.
- **Inputs:** `themeId` (string, required), `edits` (object[], required)

### `validate_theme` — Check that a draft compiles

Compiles a draft theme and reports every error and warning (file, line, message). Saved drafts always compile, so this mainly shows warnings and confirms a draft is ready to publish.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `themeId` (string, required)

### `list_theme_pages` — List a draft's pages

The pages of a draft theme (home, product, collection, cart, about, custom pages, alternate templates…) with each page's key and number of sections.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `themeId` (string, required)

### `get_theme_page` — Get a page's sections

A page of a draft theme, top to bottom: the header and footer sections that wrap it and the page's own sections, each with its id, current setting values, visibility and blocks (with ids), plus the section types that can be added.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `themeId` (string, required), `page` (string, required)

### `get_section_schema` — Get a section's settings

Every setting a section accepts (id, type, allowed options, min/max, default) and the block types it can hold. `sectionId` describes a section already on `page`; `sectionType` describes a section type that can be added.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `themeId` (string, required), `page` (string, required), `sectionId` (string), `sectionType` (string)

### `edit_theme_page` — Edit a page's sections

Changes a page of a draft theme the way the visual builder does, as one all-or-nothing batch: set section or block settings, add, remove or move sections, show or hide a section, add, remove or move blocks. Every value is validated against the section's own settings; anything invalid rejects the whole batch with the reason. An add_section operation can take a `saveAs` name, and later operations in the same batch refer to the new section as '@name'. Header and footer sections appear on every page.

- **Class:** Write · **Role needed:** editor or above · **Access:** `prebit:theme`
- **Side effects:** Changes a draft theme only; the live store is untouched.
- **Inputs:** `themeId` (string, required), `page` (string, required), `operations` (object[], required)

### `get_theme_design_settings` — Get a draft's design settings

The store-wide design settings of a draft theme (colours, spacing, corner radius, …) with their current values and allowed options. They affect every page.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `themeId` (string, required)

### `edit_theme_design_settings` — Change a draft's design settings

Changes store-wide design settings of a draft theme (setting id → value), all-or-nothing; invalid values are rejected with the reason. These settings affect every page of the draft.

- **Class:** Write · **Role needed:** editor or above · **Access:** `prebit:theme`
- **Side effects:** Changes a draft theme only; the live store is untouched.
- **Inputs:** `themeId` (string, required), `values` (object, required)

### `list_theme_revisions` — List a draft's history

The saved versions of a draft theme, newest first. Every edit creates one version, and any version can be restored.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `themeId` (string, required), `limit` (integer)

### `restore_theme_revision` — Restore an earlier version of a draft

Puts a draft theme back to an earlier version. The restore is recorded as a new version, so it can itself be undone. Only the draft is affected.

- **Class:** Write · **Role needed:** editor or above · **Access:** `prebit:theme`
- **Side effects:** Changes a draft theme only; the live store is untouched.
- **Inputs:** `themeId` (string, required), `revisionId` (string, required)

### `request_theme_publish` — Ask to publish a draft (emails a code)

Step 1 of publishing a draft theme. Checks that the draft compiles, then emails a 6-digit approval code to the person who connected, describing what will go live (with a preview link). Nothing is published by this step. The code stops working if the draft changes afterwards. If a publish was approved on this connection within the last hour, no email is sent and the reply says no code is needed.

- **Class:** Write · **Role needed:** admin or above · **Access:** `prebit:theme`
- **Side effects:** Emails the person who connected a 6-digit approval code. Publishes nothing.
- **Inputs:** `themeId` (string, required)

### `confirm_theme_publish` — Publish a draft with the emailed code

Step 2 of publishing: makes the draft the live theme for all customers. Requires the 6-digit code emailed in step 1, which works once, within 10 minutes, for the exact draft version it was sent for. Within an hour of an approved publish on this connection, no code is required. The previous live theme is kept as a draft, and the store owner is emailed.

- **Class:** Sensitive write · **Role needed:** admin or above · **Access:** `prebit:theme`
- **Side effects:** Makes a draft theme the LIVE theme for all customers; the previous live theme is kept as a draft. Emails the store owner. Needs the emailed code.
- **Inputs:** `themeId` (string, required), `confirmationCode` (string)

### `create_theme_page` — Create a new page in a draft

Adds a new empty page (like /pages/faq) to a draft theme and returns its page key. It appears on the live store only when the draft is published. A slug is lowercase letters, numbers and hyphens, and can't match a built-in page.

- **Class:** Write · **Role needed:** editor or above · **Access:** `prebit:theme`
- **Side effects:** Adds an empty page to a draft theme; nothing changes on the live store until the draft is published.
- **Inputs:** `themeId` (string, required), `title` (string, required), `slug` (string, required), `group` (content | legal)

### `search_fonts` — Find fonts

Searches the Google Fonts catalogue the theme editor uses, most popular first. Each result has the family name (the value font design settings take, e.g. 'Playfair Display') and its available weights.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `query` (string), `category` (sans-serif | serif | display | handwriting | monospace), `limit` (integer)

### `read_docs` — Read Prebit documentation

Prebit's documentation: the .bit theme language (sections, blocks, snippets, template syntax, settings, variables), the storefront SDK, and the store design guide ('store-design') covering layout, colour, type, spacing, copy and conversion. With no arguments it lists the topics. Long docs return a table of contents plus one section; `heading` selects a section.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `topic` (string), `heading` (string)

## Optional tools (23)

Orders, customers, draft orders, discounts, analytics, shipping (each change approved with an emailed code) and reading tax settings. Offered as conveniences and **not guaranteed**: they may change, be limited or be withdrawn.

### `list_orders` — List orders

Placed orders (abandoned checkouts are not included), newest first, with customer, payment and fulfillment status and totals. Filters: search text (order number, customer name, email or phone), payment status, fulfillment status and time range.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `query` (string), `paymentStatus` (all | pending | authorized | captured | failed | refunded | partially_refunded), `fulfillmentStatus` (all | unfulfilled | partial | in_progress | on_hold | fulfilled), `range` (7d | 30d | 90d | 1y), `sort` (newest | oldest), `page` (integer), `limit` (integer)

### `get_order` — Get an order

One order in full: items, customer and shipping address, payment (with refunded amounts), fulfillments with tracking, what is still to ship, notes, tags and the timeline. Amounts are in the main currency unit.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `orderId` (string, required)

### `update_order` — Update an order's note, tags or hold

Sets an order's internal note or tags (neither is shown to the customer), or marks its fulfillment 'on_hold' or 'in_progress'. `note` and `tags` REPLACE the existing values. Shipments are recorded separately.

- **Class:** Write · **Role needed:** editor or above · **Access:** `prebit:write`
- **Inputs:** `orderId` (string, required), `note` (string), `tags` (string[]), `fulfillmentFlag` (in_progress | on_hold)

### `fulfill_order` — Mark items as shipped

Records a shipment: everything still unshipped (no `items`) or only some items, optionally with a tracking number, carrier and tracking link. The customer is emailed that their order has shipped. For a partial shipment, `items` lists productId, optional variantId and quantity.

- **Class:** Write · **Role needed:** editor or above · **Access:** `prebit:write`
- **Side effects:** Emails the customer that their order has shipped.
- **Inputs:** `orderId` (string, required), `items` (object[]), `trackingNumber` (string), `trackingCarrier` (string), `trackingUrl` (string)

### `list_customers` — List customers

The store's customers (people who ordered, plus imported or manually added ones) with their order count and total spent, searchable by name, email or phone. Results contain personal data.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `query` (string), `sort` (newest | oldest | spent | orders), `range` (7d | 30d | 90d | 1y), `page` (integer), `limit` (integer)

### `get_customer` — Get a customer

A customer's profile and order history, by email address (or phone number): contact details, address, lifetime spend, order count, tags and marketing consent. Contains personal data.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `email` (string, required)

### `list_draft_orders` — List draft orders

Draft orders (orders being prepared by hand), newest first, with status, customer and total. Statuses: open, invoice_sent, completed (became a real order).

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `status` (all | open | invoice_sent | completed), `query` (string), `page` (integer)

### `get_draft_order` — Get a draft order

One draft order in full, re-priced against the live catalog right now: items, customer, address, discounts, shipping (including the shipping rates that apply), totals and any warnings (like not enough stock). Amounts are in the main currency unit.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `draftId` (string, required)

### `create_draft_order` — Create a draft order

Creates a draft order for a customer ordering by phone, chat or in person. Only the items and customer details are sent; prices, stock, discounts and shipping are worked out by the store. Nothing is charged or emailed and no stock is reserved. Returns the priced draft. A draft becomes an order when the customer pays its invoice, or when the merchant completes it in the Prebit dashboard.

- **Class:** Write · **Role needed:** editor or above · **Access:** `prebit:write`
- **Inputs:** `items` (object[], required), `customer` (object), `shippingAddress` (object), `note` (string), `tags` (string[]), `discountCode` (string), `applyAutomaticDiscounts` (boolean), `customDiscount` (object or null), `shipping` (object), `paymentDueLater` (boolean)

### `update_draft_order` — Edit a draft order

Changes an open draft order. Only the fields sent are changed; `items` REPLACES the whole list of items. A completed draft, or one whose invoice is being paid, can't be edited. Returns the re-priced draft.

- **Class:** Write · **Role needed:** editor or above · **Access:** `prebit:write`
- **Inputs:** `draftId` (string, required), `items` (object[]), `customer` (object), `shippingAddress` (object), `note` (string), `tags` (string[]), `discountCode` (string), `applyAutomaticDiscounts` (boolean), `customDiscount` (object or null), `shipping` (object), `paymentDueLater` (boolean)

### `send_draft_order_invoice` — Email a draft order's invoice

Emails the customer a link to pay this draft online and marks the draft 'invoice_sent'. Needs Razorpay connected and an email address (on the draft or in `to`). Sending again issues a new link and the previous one stops working. This sends an email to a real person.

- **Class:** Sensitive write · **Role needed:** editor or above · **Access:** `prebit:write`
- **Side effects:** Emails the customer a link to pay.
- **Inputs:** `draftId` (string, required), `to` (string), `message` (string)

### `list_discounts` — List discounts

The store's discounts and coupon codes with what each does, its status (active, inactive, scheduled, expired, used up) and how often it has been used.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `query` (string), `page` (integer), `limit` (integer)

### `get_discount` — Get a discount

One discount in full: its effect, conditions (minimum order, customers, payment methods), usage limits and dates, combination rules, and the products or collections it applies to by name.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `discountId` (string, required)

### `create_discount` — Create a discount

Creates a discount or coupon. `kind`: amount_off_order (percentage or fixed amount off the whole order), amount_off_products (off specific products or collections), buy_x_get_y, free_shipping, or bundle_price (any `bundleQuantity` items from `collectionIds`/`productIds` for `bundlePrice` together, e.g. any 3 for 1200. A bundle applies by itself, also in Razorpay Magic Checkout, and the most expensive items in the cart form it). Otherwise either a coupon `code` or `automatic` true. It is created inactive (customers can't use it) unless `status` is 'active'. An active discount reduces what customers pay.

- **Class:** Write · **Role needed:** editor or above · **Access:** `prebit:write`
- **Side effects:** Created inactive; it does nothing until activated.
- **Inputs:** `kind` (amount_off_order | amount_off_products | buy_x_get_y | free_shipping | bundle_price, required), `title` (string, required), `discountType` (percentage | fixed_amount), `value` (number), `code` (string), `automatic` (boolean), `showAtCheckout` (boolean), `productIds` (string[]), `collectionIds` (string[]), `buyQuantity` (integer), `bundleQuantity` (integer), `bundlePrice` (number), `maxBundlesPerOrder` (integer or null), `getQuantity` (integer), `getDiscount` (free | percentage | amount), `getDiscountValue` (number), `getProductIds` (string[]), `maxShippingAmount` (number or null), `minOrderAmount` (number or null), `minQuantity` (integer or null), `customerEligibility` (all | new_customers | existing_customers), `paymentMethods` (prepaid | cod | both), `maxUses` (integer or null), `usagePerCustomer` (integer or null), `startsAt` (string or null), `expiresAt` (string or null), `canCombineWithOtherDiscounts` (boolean), `canCombineWithShipping` (boolean), `canCombineWithProductDiscounts` (boolean), `tags` (string[]), `description` (string), `status` (inactive | active)

### `update_discount` — Update a discount

Changes a discount's values, conditions, dates or limits, or switches it on and off with `status` ('active' / 'inactive'). Only the fields sent are changed. A discount's kind can't be changed, and discounts can't be deleted. null clears minOrderAmount, minQuantity, maxUses, usagePerCustomer, startsAt or expiresAt.

- **Class:** Write · **Role needed:** editor or above · **Access:** `prebit:write`
- **Inputs:** `discountId` (string, required), `title` (string), `discountType` (percentage | fixed_amount), `value` (number), `code` (string), `automatic` (boolean), `showAtCheckout` (boolean), `productIds` (string[]), `collectionIds` (string[]), `buyQuantity` (integer), `bundleQuantity` (integer), `bundlePrice` (number), `maxBundlesPerOrder` (integer or null), `getQuantity` (integer), `getDiscount` (free | percentage | amount), `getDiscountValue` (number), `getProductIds` (string[]), `maxShippingAmount` (number or null), `minOrderAmount` (number or null), `minQuantity` (integer or null), `customerEligibility` (all | new_customers | existing_customers), `paymentMethods` (prepaid | cod | both), `maxUses` (integer or null), `usagePerCustomer` (integer or null), `startsAt` (string or null), `expiresAt` (string or null), `canCombineWithOtherDiscounts` (boolean), `canCombineWithShipping` (boolean), `canCombineWithProductDiscounts` (boolean), `tags` (string[]), `description` (string), `status` (inactive | active)

### `get_shipping_settings` — Get shipping zones and rates

The store's shipping zones (which countries, and for India which states, each covers) and the rates in each, plus its delivery & COD rules: pincodes it doesn't deliver to, pincodes that are prepaid only, products/collections with no cash on delivery (one in a cart makes the whole order prepaid only), and the order amount above which there's no cash on delivery. Zone and rate ids are included, and switched-off zones and rates are marked active false.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** none

### `get_tax_settings` — Get tax settings

How the store handles tax: whether it collects GST at all, whether prices include or exclude tax, the default rate and the GSTIN. Read-only; tax is changed in the Prebit dashboard.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** none

### `get_store_analytics` — Get store analytics

Sales, orders, traffic, customers and the conversion funnel for a time range, compared with the period before. `modules` selects which (default: sales, orders, traffic). Amounts are in the store currency's main unit. Orders are placed orders only (checkouts never completed aren't counted); sales.summary.totalSales is what the placed orders are worth (cash on delivery included, cancellations and refunds taken off) and sales.summary.collected is the money received so far.

- **Class:** Read · **Role needed:** viewer or above · **Access:** `prebit:read` · repeat-safe
- **Inputs:** `range` (today | yesterday | 7d | 30d | 90d | 1y), `modules` (overview | sales | orders | traffic | customers | funnel[])

### `update_delivery_rules` — Change delivery & COD rules

Changes the store's delivery & cash-on-delivery rules, which apply in the storefront checkout and in Magic Checkout: pincodes it doesn't deliver to, pincodes that are prepaid only, products and collections with no cash on delivery (one in the cart makes the whole order prepaid only), and the order amount above which there's no cash on delivery. Lists are changed by adding and removing entries; anything not mentioned stays as it is. Needs approval: the first call without confirmationCode emails a 6-digit code to the person who connected, listing the exact change, and changes nothing; the same call with the code makes the change. Within 10 minutes of an approved shipping change on this connection, no code is needed.

- **Class:** Sensitive write · **Role needed:** admin or above · **Access:** `prebit:write`
- **Side effects:** Changes what every checkout charges or allows from that moment. Needs a 6-digit code emailed to the person who connected, listing the exact change; after one approval, no code for 10 minutes on that connection.
- **Inputs:** `addNoDeliveryPincodes` (string[]), `removeNoDeliveryPincodes` (string[]), `addPrepaidOnlyPincodes` (string[]), `removePrepaidOnlyPincodes` (string[]), `addNoCodProductIds` (string[]), `removeNoCodProductIds` (string[]), `addNoCodCollectionIds` (string[]), `removeNoCodCollectionIds` (string[]), `noCodAboveOrderAmount` (number or null), `confirmationCode` (string)

### `update_shipping_zone` — Change a shipping zone

Renames a shipping zone, changes which Indian states it covers, or switches it on or off (zones are never deleted). A state no active India zone covers isn't delivered to. Zones are checked in order, so the first zone covering an address is the one used. Needs approval: the first call without confirmationCode emails a 6-digit code to the person who connected, listing the exact change, and changes nothing; the same call with the code makes the change. Within 10 minutes of an approved shipping change on this connection, no code is needed.

- **Class:** Sensitive write · **Role needed:** admin or above · **Access:** `prebit:write`
- **Side effects:** Changes what every checkout charges or allows from that moment. Needs a 6-digit code emailed to the person who connected, listing the exact change; after one approval, no code for 10 minutes on that connection.
- **Inputs:** `zoneId` (string, required), `name` (string), `addIndianStates` (string[]), `removeIndianStates` (string[]), `active` (boolean), `confirmationCode` (string)

### `create_shipping_zone` — Add a shipping zone

Adds a shipping zone (a set of countries, and for India optionally specific states) with its first rates. It is checked after the existing zones, so places an earlier zone already covers keep using that one; the reply says when that happens. Needs approval: the first call without confirmationCode emails a 6-digit code to the person who connected, listing the exact change, and changes nothing; the same call with the code makes the change. Within 10 minutes of an approved shipping change on this connection, no code is needed.

- **Class:** Sensitive write · **Role needed:** admin or above · **Access:** `prebit:write`
- **Side effects:** Changes what every checkout charges or allows from that moment. Needs a 6-digit code emailed to the person who connected, listing the exact change; after one approval, no code for 10 minutes on that connection.
- **Inputs:** `name` (string, required), `countries` (string[]), `indianStates` (string[]), `restOfWorld` (boolean), `rates` (object[], required), `confirmationCode` (string)

### `create_shipping_rate` — Add a shipping rate

Adds a shipping rate to a zone: what customers there are charged for shipping, with which payment methods, optional free shipping above an order amount, and the delivery time shown. Needs approval: the first call without confirmationCode emails a 6-digit code to the person who connected, listing the exact change, and changes nothing; the same call with the code makes the change. Within 10 minutes of an approved shipping change on this connection, no code is needed.

- **Class:** Sensitive write · **Role needed:** admin or above · **Access:** `prebit:write`
- **Side effects:** Changes what every checkout charges or allows from that moment. Needs a 6-digit code emailed to the person who connected, listing the exact change; after one approval, no code for 10 minutes on that connection.
- **Inputs:** `zoneId` (string, required), `name` (string, required), `price` (number, required), `codPrice` (number), `paymentMethods` (both | prepaid | cod), `freeAboveOrderAmount` (number or null), `estimatedDelivery` (string), `confirmationCode` (string)

### `update_shipping_rate` — Change a shipping rate

Changes a zone's shipping rate: its name, charge, cash-on-delivery charge, payment methods, free-shipping threshold or delivery time, or switches it on or off (rates are never deleted). Fields not given stay as they are; when a rate charges the same for both payment methods, changing price changes both. A zone's only active rate can't be switched off. Needs approval: the first call without confirmationCode emails a 6-digit code to the person who connected, listing the exact change, and changes nothing; the same call with the code makes the change. Within 10 minutes of an approved shipping change on this connection, no code is needed.

- **Class:** Sensitive write · **Role needed:** admin or above · **Access:** `prebit:write`
- **Side effects:** Changes what every checkout charges or allows from that moment. Needs a 6-digit code emailed to the person who connected, listing the exact change; after one approval, no code for 10 minutes on that connection.
- **Inputs:** `zoneId` (string, required), `rateId` (string, required), `name` (string), `price` (number), `codPrice` (number), `paymentMethods` (both | prepaid | cod), `freeAboveOrderAmount` (number or null), `estimatedDelivery` (string), `active` (boolean), `confirmationCode` (string)
