Skip to content

Status, 9 November 2026: accepted at a call on 9 November 2026 (as Yevhen Kariakin reports it; the founder, Dmitriy Zhuk, and Artem Belikov took part). Proposed by Yevhen Kariakin (Jira STOR-119). Accepted as written: the call did not report answers to the proposal's open questions, so none is invented here. Accepted is not implemented: no module and no MCP tool does any of it yet, and the API does not send it to a module that does not declare it. The contract text is now in the main blocks of contracts/module/operations.json (the verb create, the capabilities, rules.create, rules.history) and in protocol.yaml (the capability name pattern, store.taxClasses, the product details); every new operation is to_implement; its examples are illustrative.

008 — Creating records and editing more fields ​

Add one verb, create, for four resources, and open more fields to apply, so that the Admin Agent can start a product, a category, a manufacturer or a coupon and can correct the fields of existing records that it cannot touch today. Both keep the shape of decision 004: the module does what it is told, one conditional write at a time, and the approval, the ledger and the receipt stay in the Store Deputy API. This record also answers the open question of 004, "idempotency rule for create operations".

Context ​

Decision 004 fixed five verbs: search, get, list, query and apply, and wrote that creation and deletion "are not apply". Today apply can change price, status, stock, storefrontIds and (proposed on 3 November 2026) texts of a product, parentId and status of a category, the status of an order and of a coupon. A manufacturer, a customer and a coupon's code cannot be changed at all.

What an owner meets: asking the agent to "add this product" or "make a 10 % coupon" has no answer, and neither has "change the SKU", "put it in the Kettles category", "make the special price run until Sunday" or "tell the customer the parcel is on its way".

Decision ​

  1. A sixth verb, create, with the capability <resource>.create, for product, category, manufacturer and coupon. A call carries items[{ idempotencyKey, set }] (up to maxItemsPerWrite), independent items, one result per item in order. There is no expected: nothing exists yet to compare.

  2. Idempotency is the module's, by key. The API sends an idempotencyKey for every item, derived from the change ledger's item id so that a retry sends the same key. The module keeps, per resource, the key, a SHA-256 of the canonical set and the id of the record it made.

    • Same key, same content: the answer is created with replayed: true and the same record, read back now. A second record is never made. This is how the API recovers from a timeout: it sends the item again.
    • Same key, different content: rejected / idempotency_key_reused. Nothing is created and nothing changes.
    • Retention (proposed, not measured): at least 30 days. The API never resends a key older than half of that. A key past retention would be a new key, which is why the API's limit exists. The number is a starting value for Artem Belikov and the API's retry horizon to settle.
    • On tables without transactions (MyISAM, common in OpenCart 3) the module writes the key row first, then the record, then the id into the key row. A crash between them leaves a key without an id: a retry answers failed / database_error and creates nothing; the API reconciles by searching and the owner decides.
    • This is the one place where the module keeps state of its own. 004 said the module "takes no idempotency key"; that held because every apply has expected. A create does not.
  3. The answer carries the record. A created item answers id and after, the whole record in the neutral model as the platform stores it (read back, not an echo of the request). The API then reads the record again with <resource>.get and compares it with set, as it does after apply; a difference is a receipt that says so.

  4. A created record is disabled. A product, a category and a coupon are created disabled whatever the caller wants; a create set has no status. Publishing is the existing product.write.status, category.write.status and coupon.write.status, a second step with its own approval. Why: creating changes nothing a buyer sees, enabling does, and an enabled coupon is money off. Two cheap approvals are safer than one that hides a launch in a draft. A manufacturer has no status in OpenCart; it shows only once a product uses it. storefrontIds defaults to every storefront of the shop, so enabling the draft later is one step.

  5. Errors. rejected with a reason, field and, where known, conflictingId: invalid_item (a value the platform cannot store), unknown_reference (a categoryId, manufacturerId, taxClassId, customerGroupId, product id or unit the shop does not have), duplicate (an SEO keyword in its storefront and language, a coupon code), idempotency_key_reused, field_not_writable, unknown_language; failed as for apply. References are checked before anything is written. create is not allowed while Store Deputy is paused.

  6. Fields of a create set need their write capability. Each key of set also needs the module's <resource>.write.<key>, otherwise the item is field_not_writable. A module that declares product.create therefore declares at least product.write.texts, product.write.price and product.write.code. A module may offer create with a subset of fields; no new capability property is needed.

  7. More fields for apply, each its own <resource>.write.<field> capability with conditional: atomic | emulated and the compare-and-set rules of 004:

    ResourceNew writable fields
    productcode (OpenCart: model), sku, mpn, gtin, manufacturerId, categoryIds, weight, dimensions, taxClassId, minQuantity, availableAt, seoKeywords, specials, discounts
    categorytexts, seoKeywords, sortOrder (status and parentId exist)
    manufacturername, seoKeywords, sortOrder
    couponcode, name, discount (kind percent or fixed_order, value, minimumTotal, freeShipping), usage (limitTotal, limitPerCustomer), startsAt, endsAt, productIds, categoryIds, loggedInOnly (status exists)
    customerstatus, customerGroupId, firstName, lastName, telephone, email
    orderhistory (an append, below); status exists

    Names follow the neutral model that exists (code for OpenCart's model, minQuantity, availableAt, usage.limitTotal), not the platform's column names. Money is MoneyInput, ids are strings, times are UTC.

  8. Specials and quantity discounts are product fields, not sub-records. specials and discounts are whole lists, replaced and compared as a whole. Why: in OpenCart a special or a discount has a row id, but that id is the platform's detail and means nothing on WooCommerce or Shopify; items have no identity of their own in the neutral model; a list is what the owner sees and edits on the product page; and compare-and-set on the list is exactly the guarantee wanted (nobody changed the prices meanwhile). The cost is that changing one special sends the whole list. Reading them needs the product's get with include: ["details"], because PriceRule shows only rows in effect or upcoming and a replacement must be compared with all of them. A create does not take them: the owner sees the product first.

  9. Order history is an append guarded by the newest entry. order.write.history: expected: { history: { lastEntryId } }, set: { history: { comment, notify } }. If lastEntryId is still the newest entry, the module adds the entry (under the order's current status; changing the status stays order.write.status) and answers applied with after { lastEntryId, comment, notify }; any other newest entry is a conflict with current { lastEntryId }. Idempotency needs no key: after an unclear answer the API reads the order's history and sees whether its entry is there. The cost is that any entry someone adds meanwhile is a conflict, and the API reads again and asks again; the benefit is that the rule of apply holds without exception. An item names status or history, never both. notify: true makes the platform email the customer; the approval card shows it.

  10. Tracking numbers. OpenCart 3 and 4 core have no tracking field that this repository's modules read or write (the test shops' own databases were not opened for this record). No field is invented: a tracking number travels in the history comment. A capability order.write.trackingNumber can be proposed for a platform that keeps the field; it is not in this proposal.

  11. Deferred or outside:

    • attributes and options of a product: attributes live in groups and per language, options carry values, price and weight prefixes, stock and a required flag and interact with variantPricing. Each needs its own resources (attribute, attributeGroup, option, optionValue) to read ids first. A separate proposal.
    • Images: STOR-127.
    • customer.create, customerGroup.create, order.create, deletion of anything: see Alternatives.
  12. Permissions in the API (described, not implemented). create maps to new agent permissions catalog.create (product, category, manufacturer) and sales.create (coupon), requiring catalog.write and sales.write. Per STANDARD_PERMISSION_FIELDS in agentDefaultsSetting.ts, a permission added after the standard set must default to off, so no existing agent gains the authority by an automatic update; a platform admin switches it on. Changed by the addendum of 10 November 2026: these two default to on (an explicit exception), and a key may hold them. The new editable fields would sit under the existing catalog.write (product, category, manufacturer: they edit existing records as price does) and sales.write (coupon, customer, order history). Whether a customer's email or an order's notify: true should be a switch of their own is an open question.

Fields in the neutral model ​

  • Product. weight is { value, unit } with unit of kg, g, lb, oz; dimensions is { length, width, height, unit } with cm, mm, in, compared and written whole. The module maps a unit to the shop's own weight or length class; a unit the shop lacks is unknown_reference. taxClassId is one of a new optional manifest list store.taxClasses[{ id, name }], as store.languages. availableAt is a date expressed as 00:00 of a shop day, in UTC, as the neutral Product already reads it. categoryIds is a set. gtin is the primary barcode: see the open questions.
  • SEO keywords. seoKeywords is { "<storefrontId>": { "<language>": "keyword" } }, compared and written per storefront, language and field; the empty string removes a keyword. A keyword another record holds in the same storefront and language is duplicate with field: "seoKeywords".
  • Category and manufacturer texts. texts for a category is the same partial per-language object as the proposed product texts (name, description, metaTitle, metaDescription, metaKeywords). A manufacturer's name is not per language in OpenCart and is a plain string.
  • Coupon. discount and usage are partial objects compared per sub-field, like texts. kind accepts percent and fixed_order, the two OpenCart has; fixed_item and other stay read-only. The neutral Coupon gains optional productIds, categoryIds and loggedInOnly; until now they were platform data in extensions.
  • Customer. email must be unique: another customer's email is rejected / duplicate with field: "email". It is the customer's sign-in name, so it is its own capability, and a team can withhold it.

OpenCart 3 and 4 ​

What was read: the modules in this repository (module/opencart3x, module/opencart4x) and their README files. What was not: the test shops' databases, and the install SQL of OpenCart, which this repository does not hold. The table facts below are from the platform's own source as the proposer knows it and are not verified here; the module's owner must check each against the release's install SQL before this is accepted.

SubjectOpenCart 3.0.xOpenCart 4.x
Product model, SKU, MPN, barcodescolumns model, sku, mpn, ean, upc, jan, isbn on product (the OpenCart 3 module reads them today and builds gtins in the order ean, upc, jan, isbn)the same columns, read by the OpenCart 4 module
Weight, dimensions, taxweight and weight_class_id, length, width, height and length_class_id, tax_class_id on productthe same
Special price, quantity discountrows in product_special and product_discount (customer group, priority, price, dates; the OpenCart 3 module already reads them as price rules)the same tables
SEO keyworda keyword row per store and language, written separately from the productkeyword rows per store and language in seo_url; column names differ between 4.0 and 4.1 releases. The table is not touched by either module today
Variantsnone; variantPricing: optionsa variant is a product of its own pointing at a master (master_id); neither module declares variant.*. A create of a master product is as OpenCart 3's; creating a variant is not proposed
Coupon restrictionscoupon_product and coupon_category tables, logged, shipping, uses_total, uses_customer columns (the modules read the coupon and its usage today)the same
Order historyorder_history rows (status, comment, notify, date) through the platform's addHistorythe same, with addHistory in the catalog model
Tracking numberno field read or written by the module; none assumednone assumed
Admin notifications ("saved")the storefront-side endpoint cannot reach the admin product-save listeners (event: skipped, as for apply)not examined for this record

Both modules would need the key table (OpenCart: created by the module's installer; its schema is the module's choice).

Alternatives considered ​

  • create as a case of apply (an apply item without id). It breaks the one-line rule of 004 (an item is { id, expected, set }), has nothing for expected to be, and hides the one operation that makes a record twice.
  • No idempotency key; the API searches before it creates. search by SKU or code can find a record made a moment ago, but not a category, a coupon without a unique code, or a record whose identifying field was edited meanwhile. A key works for every resource and is a table and a hash.
  • Specials and discounts as their own resources (productSpecial). Gives them ids, but ids that are the platform's rows, a third and fourth resource with five verbs for two lists, and no whole-list compare-and-set. Rejected for now; reconsider if a platform needs per-row edits.
  • Created enabled when the owner says so. Faster, but one approval would cover both the contents and the publication. Kept as an option if owners find two steps tiresome.
  • customer.create, customerGroup.create, order.create. Not proposed. A customer is a person's identity and personal data: a created account can sign in, receive mail and is counted by the shop's rules, and the owner can add one in the admin in a minute. A customer group changes prices and approval for everyone in it. An order is a financial record (stock, totals, taxes, payment and shipping state); an agent writing orders is the unrestricted authority Store Deputy is not. Deletion of anything is not proposed: disabling is the reversible step.

Consequences ​

  • The agent can draft a product, a category, a manufacturer and a coupon, and edit the fields listed above, each behind its own capability, permission and approval. A shop whose module declares none of them keeps today's behaviour.
  • A module gains one table (the keys) and one new rule (idempotency). Everything else is the apply machinery it already has.
  • Every new field is a read the API must make before it can propose a change (include: ["details"] and the others), so each write capability costs a read shape; the contract lists them.
  • Accepting changed accepted files (done on 9 November 2026): the verb list and check.mjs, protocol.yaml's CapabilityDeclaration name pattern, the manifest (store.taxClasses), and the Product, Category, Coupon and Order read shapes; the MCP tools (contracts/mcp/tools.yaml) and the API's change engine need intents for creating and for the new fields (the API's work follows on branch feat/stor-008-create-and-edit; not merged).
  • Nothing is proven. No part of this has run against a store, and the OpenCart facts above are unverified.

Scope ​

In: the verb create for product, category, manufacturer and coupon; the idempotency rule; the new apply fields; order history; the OpenCart 3 and 4 notes; the permission mapping. Out: images (STOR-127), attributes and options, variants of OpenCart 4, customers, customer groups, orders as creatable, deletion, the MCP tools and API code.

Left open at acceptance ​

Each choice above stands as written. The call did not report an answer to any of these, so each is still open and is not decided by this page:

QuestionOwner
Key retention: 30 days is a starting value; what is the API's retry horizon, and is a key table acceptable in the module?Artem Belikov, Yevhen Kariakin — answered 13 November 2026, proposed
gtin as one primary barcode written to ean or upc by length, against two platform-shaped fields ean and upc.Artem Belikov — answered, proposed
The SEO tables of OpenCart 3, 4.0 and 4.1 as the module's owner reads them, and the collision rule per store and language.Artem Belikov — answered, proposed
Created disabled: keep, or allow status: enabled on a create with its own approval.Dmitriy Zhuk
Whether customer.write.email and order.write.history with notify: true get permissions of their own.Dmitriy Zhuk
The first platform that keeps a tracking number, and whether a field of its own is then worth a capability.Artem Belikov

Answers of the module's owner, 13 November 2026 ​

Proposed by Artem Belikov on 13 November 2026 (Jira STOR-121), worked through field by field with Claude; not accepted. Not implemented yet: the OpenCart 3 and 4 modules follow it in STOR-121. It answers three questions of the table above and states how the module treats each product field; the contract text is in contracts/module/operations.json (rules.seoKeywords, rules.create, the descriptions of ProductFields) and protocol.yaml (SeoKeywords).

  • Key retention: 30 days from a key's first use, in one module table for every resource (storedeputy_idempotency: key, resource, hash of set, record id). Rows past it are deleted at each create, with no scheduled job. The API's rule stays: it never resends a key older than half of it (15 days). Yevhen Kariakin to confirm.
  • gtin: one primary barcode, replaced where it is. The value goes into the column that holds the current primary barcode (OpenCart: the first non-empty of ean, upc, jan, isbn); the others stay. It moves only when it does not fit there (13 or more digits into upc, anything but 13 digits into jan): then to upc for 12 digits and ean otherwise. A product without a barcode gets upc for 12 digits and ean otherwise. null clears every barcode. This replaces "by length, clearing the old primary's column", which lost a second barcode the agent never named.
  • SEO tables and the collision rule. OpenCart 3.0: seo_url(store_id, language_id, query 'product_id=N', keyword), a keyword optional. OpenCart 4.0 and 4.1: seo_url(store_id, language_id, key 'product_id', value 'N', keyword, sort_order), a keyword required for every storefront and language (4.0.2 and later: 1 to 64 characters), and a keyword that ends in /keyword collides too. A keyword may repeat only within one record (the same product in its different languages, as shops with a language prefix in the URL use it); another record on the same storefront, in any language, is duplicate. Other storefronts are not compared: each has its own host. Removing a keyword is refused on OpenCart 4, where it is required. A create fills the storefronts and languages set leaves out with a keyword made from the name (the module's own transliteration table; product-<id> when nothing is left; -2, -3 when taken).
  • Empty values in expected. sku: "" and mpn: "" match a product without one (it reads as null, and expected takes no null); minQuantity: 1 matches a product that sets no minimum (OpenCart 0, read as null).
  • A create fills what set leaves out with the admin form's defaults, except status (disabled) and stock (0 without stock); the texts of the default language are copied to every other language, as OpenCart does when a language is added, and metaTitle defaults to name. A create reaches no listener of the admin's addProduct: store.describe warns product_add_listener where one is installed.
  • For the API's approval card (not the module's to decide): a tax class change changes the price buyers see; a future availableAt hides the product; an empty categoryIds, specials or discounts removes them all; a quantity discount from 1 changes the product's price for that customer group; gtin: null clears every barcode.

Categories and manufacturers, 14 November 2026 ​

Proposed by Artem Belikov on 14 November 2026 (Jira STOR-124); not accepted. Implemented in the OpenCart 3 and 4 modules in STOR-124, checked only on the local test shops. category.create and manufacturer.create follow product.create: the same key table, the same replay, the same read-back.

  • Same names are refused. A category whose name in the default language equals one under the same parent, and a manufacturer whose name equals another's (trimmed, case-insensitively), are duplicate with the holder's id. OpenCart allows both; an agent that makes the same brand twice splits the filter and the brand page.
  • A manufacturer is seen at once. OpenCart's brand page lists every manufacturer of the storefront, with products or without; the contract said it shows once a product uses it, which is not so. A created manufacturer goes to every storefront and shows as an empty brand until a product uses it.
  • Defaults of the admin form. A category is created disabled, not in the top menu and with one column (OpenCart 3 and 4.0; 4.1 has neither), sort order 0; a manufacturer with sort order 0. The number of columns and the top menu are neither read nor written.
  • Texts and keywords as for a product. The default language's texts go to every other language, metaTitle defaults to the name, and every storefront and language gets a keyword made from the name (category-<id>, manufacturer-<id> when nothing is left). storefrontIds is not accepted (no category.write.storefrontIds or manufacturer.write.storefrontIds).
  • Listeners. store.describe warns category_add_listener and manufacturer_add_listener where an extension listens to the admin's add.

Coupons, 14 November 2026 ​

Proposed by Artem Belikov on 14 November 2026 (Jira STOR-124); not accepted. Implemented in the OpenCart 3 and 4 modules in STOR-124, checked only on the local test shops. coupon.apply writes every field of CouponFields, not only the status; coupon.create follows product.create.

  • A create states its limits and dates. usage (both limits, null for none), startsAt and endsAt (null for no bound) are required. OpenCart's admin form would fill one use, one per customer and a month from today: a coupon "10 % off" would work once and lapse unseen. The owner sees the limits and the dates on the approval card.
  • A percentage above 100 is refused (invalid_item); OpenCart does not check it.
  • Dates are days. OpenCart keeps only the date: a coupon applies from 00:00 of the start day until 00:00 of the end day, in the shop's time. A time that is not 00:00 of a shop day is refused, as for a product's availableAt; the end must be after the start.
  • The code is unique in the shop, compared as the admin does: another coupon's code is duplicate with its id, on create and on a change of code.
  • Products, categories and "signed-in customers only" are read as fields of the coupon (productIds, categoryIds, loggedInOnly) and still in extensions.opencart until the API stops reading them there. productIds and categoryIds replace the whole list; an unknown id is unknown_reference.
  • Listeners. store.describe warns coupon_add_listener where an extension listens to the admin's add.

Addendum, 10 November 2026 ​

Decided by Yevhen Kariakin on 10 November 2026; implemented in the API (the contract between the API and the modules does not change). It changes two things in item 12 above and nothing else.

  1. The create permissions stay a platform-wide setting and now default to on. catalog.create and sales.create are still two switches of the platform's agents/defaults group (admin console, Settings, Agents); the store page gets no switch for them. Their default is on, because every change, a create included, still needs an owner's or admin's manual approval before Store Deputy applies it, so an agent that proposes creates by default opens no authority to act alone. They still count only while the store's "agent may propose changes" is on, and each still implies the write and the read of its side. A group that is switched off or never saved gives the defaults, so on a platform that has not saved the group the creates are available as soon as the store allows changes.
  2. The default-off rule has this one explicit exception. The rule (STANDARD_PERMISSION_FIELDS: a permission added after the standard set defaults to off, so an automatic agent update never opens a new kind of authority) stays, with its test, for every future permission. Only createCatalog and createSales are named as exceptions in DEFAULT_ON_EXCEPTIONS; a later permission needs its own decision to be added there. The Admin Agent's profile now requires the four create tools like the edit tools (profile revision 11); the grants in Agentfy do not change.
  3. A team API key may hold the create permissions. When a person makes a team API key (sd_…), mcp:catalog.create and mcp:sales.create are offered next to the other permissions; a create implies the write and the read of its side, as for the agent. For a key, the key's own permission is its store-level switch, and the platform-wide setting of item 1 still cuts a key down. Existing keys are unchanged: none gains a permission. A key's creates are proposals approved by an owner or admin, like every other change.
  4. Plain-language help for the problems of a create. The agent now gets a sentence for each refusal (duplicate, unknown_reference, field_not_writable, idempotency_key_reused, unknown_language, invalid_item, and the validation problems invalid_value and missing_field), so it can tell the owner why a change did not go through and what to do.

Checked only locally and with fakes, like the rest of decision 008; no module implements create yet.