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
A sixth verb,
create, with the capability<resource>.create, forproduct,category,manufacturerandcoupon. A call carriesitems[{ idempotencyKey, set }](up tomaxItemsPerWrite), independent items, one result per item in order. There is noexpected: nothing exists yet to compare.Idempotency is the module's, by key. The API sends an
idempotencyKeyfor 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 canonicalsetand the id of the record it made.- Same key, same content: the answer is
createdwithreplayed: trueand 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_errorand 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
applyhasexpected. A create does not.
- Same key, same content: the answer is
The answer carries the record. A created item answers
idandafter, 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>.getand compares it withset, as it does afterapply; a difference is a receipt that says so.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 existingproduct.write.status,category.write.statusandcoupon.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.storefrontIdsdefaults to every storefront of the shop, so enabling the draft later is one step.Errors.
rejectedwith areason,fieldand, where known,conflictingId:invalid_item(a value the platform cannot store),unknown_reference(acategoryId,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;failedas forapply. References are checked before anything is written.createis not allowed while Store Deputy is paused.Fields of a create set need their write capability. Each key of
setalso needs the module's<resource>.write.<key>, otherwise the item isfield_not_writable. A module that declaresproduct.createtherefore declares at leastproduct.write.texts,product.write.priceandproduct.write.code. A module may offer create with a subset of fields; no new capability property is needed.More fields for
apply, each its own<resource>.write.<field>capability withconditional: atomic | emulatedand the compare-and-set rules of 004:Resource New writable fields productcode(OpenCart: model),sku,mpn,gtin,manufacturerId,categoryIds,weight,dimensions,taxClassId,minQuantity,availableAt,seoKeywords,specials,discountscategorytexts,seoKeywords,sortOrder(statusandparentIdexist)manufacturername,seoKeywords,sortOrdercouponcode,name,discount(kindpercent or fixed_order,value,minimumTotal,freeShipping),usage(limitTotal,limitPerCustomer),startsAt,endsAt,productIds,categoryIds,loggedInOnly(statusexists)customerstatus,customerGroupId,firstName,lastName,telephone,emailorderhistory(an append, below);statusexistsNames follow the neutral model that exists (
codefor OpenCart's model,minQuantity,availableAt,usage.limitTotal), not the platform's column names. Money isMoneyInput, ids are strings, times are UTC.Specials and quantity discounts are product fields, not sub-records.
specialsanddiscountsare 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'sgetwithinclude: ["details"], becausePriceRuleshows 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.Order history is an append guarded by the newest entry.
order.write.history:expected: { history: { lastEntryId } },set: { history: { comment, notify } }. IflastEntryIdis still the newest entry, the module adds the entry (under the order's current status; changing the status staysorder.write.status) and answersappliedwithafter { lastEntryId, comment, notify }; any other newest entry is aconflictwithcurrent { 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 ofapplyholds without exception. An item namesstatusorhistory, never both.notify: truemakes the platform email the customer; the approval card shows it.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.trackingNumbercan be proposed for a platform that keeps the field; it is not in this proposal.Deferred or outside:
attributesandoptionsof a product: attributes live in groups and per language, options carry values, price and weight prefixes, stock and a required flag and interact withvariantPricing. 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.
Permissions in the API (described, not implemented).
createmaps to new agent permissionscatalog.create(product, category, manufacturer) andsales.create(coupon), requiringcatalog.writeandsales.write. PerSTANDARD_PERMISSION_FIELDSinagentDefaultsSetting.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 existingcatalog.write(product, category, manufacturer: they edit existing records as price does) andsales.write(coupon, customer, order history). Whether a customer's email or an order'snotify: trueshould be a switch of their own is an open question.
Fields in the neutral model
- Product.
weightis{ value, unit }withunitofkg,g,lb,oz;dimensionsis{ length, width, height, unit }withcm,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 isunknown_reference.taxClassIdis one of a new optional manifest liststore.taxClasses[{ id, name }], asstore.languages.availableAtis a date expressed as 00:00 of a shop day, in UTC, as the neutral Product already reads it.categoryIdsis a set.gtinis the primary barcode: see the open questions. - SEO keywords.
seoKeywordsis{ "<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 isduplicatewithfield: "seoKeywords". - Category and manufacturer texts.
textsfor a category is the same partial per-language object as the proposed product texts (name,description,metaTitle,metaDescription,metaKeywords). A manufacturer'snameis not per language in OpenCart and is a plain string. - Coupon.
discountandusageare partial objects compared per sub-field, like texts.kindacceptspercentandfixed_order, the two OpenCart has;fixed_itemandotherstay read-only. The neutral Coupon gains optionalproductIds,categoryIdsandloggedInOnly; until now they were platform data inextensions. - Customer.
emailmust be unique: another customer's email isrejected/duplicatewithfield: "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.
| Subject | OpenCart 3.0.x | OpenCart 4.x |
|---|---|---|
| Product model, SKU, MPN, barcodes | columns 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, tax | weight and weight_class_id, length, width, height and length_class_id, tax_class_id on product | the same |
| Special price, quantity discount | rows 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 keyword | a keyword row per store and language, written separately from the product | keyword 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 |
| Variants | none; variantPricing: options | a 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 restrictions | coupon_product and coupon_category tables, logged, shipping, uses_total, uses_customer columns (the modules read the coupon and its usage today) | the same |
| Order history | order_history rows (status, comment, notify, date) through the platform's addHistory | the same, with addHistory in the catalog model |
| Tracking number | no field read or written by the module; none assumed | none 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
createas a case ofapply(anapplyitem withoutid). It breaks the one-line rule of 004 (an item is{ id, expected, set }), has nothing forexpectedto be, and hides the one operation that makes a record twice.- No idempotency key; the API searches before it creates.
searchby 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
applymachinery 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'sCapabilityDeclarationname 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 branchfeat/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:
| Question | Owner |
|---|---|
| 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 ofset, 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 ofean,upc,jan,isbn); the others stay. It moves only when it does not fit there (13 or more digits intoupc, anything but 13 digits intojan): then toupcfor 12 digits andeanotherwise. A product without a barcode getsupcfor 12 digits andeanotherwise.nullclears 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/keywordcollides 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, isduplicate. 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 languagessetleaves out with a keyword made from the name (the module's own transliteration table;product-<id>when nothing is left;-2,-3when taken). - Empty values in
expected.sku: ""andmpn: ""match a product without one (it reads asnull, andexpectedtakes nonull);minQuantity: 1matches a product that sets no minimum (OpenCart 0, read asnull). - A create fills what
setleaves out with the admin form's defaults, except status (disabled) and stock (0 withoutstock); the texts of the default language are copied to every other language, as OpenCart does when a language is added, andmetaTitledefaults toname. A create reaches no listener of the admin'saddProduct:store.describewarnsproduct_add_listenerwhere 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
availableAthides the product; an emptycategoryIds,specialsordiscountsremoves them all; a quantity discount from 1 changes the product's price for that customer group;gtin: nullclears 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
duplicatewith 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,
metaTitledefaults to the name, and every storefront and language gets a keyword made from the name (category-<id>,manufacturer-<id>when nothing is left).storefrontIdsis not accepted (nocategory.write.storefrontIdsormanufacturer.write.storefrontIds). - Listeners.
store.describewarnscategory_add_listenerandmanufacturer_add_listenerwhere 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,nullfor none),startsAtandendsAt(nullfor 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
duplicatewith 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 inextensions.opencartuntil the API stops reading them there.productIdsandcategoryIdsreplace the whole list; an unknown id isunknown_reference. - Listeners.
store.describewarnscoupon_add_listenerwhere 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.
- The create permissions stay a platform-wide setting and now default to on.
catalog.createandsales.createare still two switches of the platform'sagents/defaultsgroup (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. - 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. OnlycreateCatalogandcreateSalesare named as exceptions inDEFAULT_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. - A team API key may hold the create permissions. When a person makes a team API key (
sd_…),mcp:catalog.createandmcp:sales.createare 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. - 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 problemsinvalid_valueandmissing_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.