Factuarea APIDevelopers
Added

ERP setup and automations: dry run by document, rule and run context, stock ledger split, webhook payloads

The automations dry run accepts a document, the catalog, usage, rules and runs publish more context, the stock ledger gains the initial split reason, the automation webhooks carry the same fields as the resources, and the Storefront is not granted to members. 0 new operations, 19 updated ones, 1 new rejection code.

2 December 2026 — The setup side of the omnichannel ERP gives integrators more to work with in automations and in the stock ledger: a dry run that needs only the document it samples, a catalog that says which triggers each action accepts, rules that publish their last run and their pause, runs that name the document that started them, and webhooks whose payloads carry the same fields. The company axis (/v1/companies/{company}/…) is unchanged, and no operation is added, removed or renamed.

What is new

  • Operations. 0 new operations and 19 updated ones: 13 of automations, 4 of events and webhook deliveries and 2 of the stock ledger. They are listed at the end of this page.
  • MCP. No new tools. 7 existing tools publish a new description or input schema, and each publishes the same changes as its operation. search_stock_movements and search_stock_transfers check the values of their filters with the rules of their v1 routes (stock_movements.list and stock_transfers.list), so a rejected value answers with the same status, code, param and subcode as the route. See the tool catalog.
  • Rejection codes. 1 new top-level code: automation_dry_run_document_not_found (404). The text of module_not_grantable is updated. See All rejection codes.

Summary by group

  • Automations. The dry run (automations.rules.dry_run) accepts event_aggregate_id and answers with sample. The catalog (automations.catalog.show) publishes supported_trigger_prefixes for each action, and the trigger fields (automations.catalog.trigger_fields) publish label and entity_type. The usage (automations.usage.show) publishes by_rule and previous_period. The list of rules (automations.rules.list) filters by module, and the rule resource (automations.rules.*) publishes last_run and pause. The runs (automations.runs.list, .show) publish document, the list filters by it, and the steps (automations.runs.steps.list) list in summary.created what each one created. See Automations.
  • Stock ledger. stock_movements.list and products.stock_movements.list accept and publish the reason initial_split. See Inventory and warehouses.
  • Events. events.list, events.show, webhook_endpoints.deliveries.list and webhook_endpoints.deliveries.show describe the payloads of the automation events. See Events.
  • Members. account.members.module_access.update keeps its contract; the description of its tool, update_account_member_module_access, names the Storefront among the modules that are not granted.
  • Returns. The buyer of a return (buyer.address_lines, in the return resource of the returns.* operations and of their MCP tools) writes the line of the town as «postal code town (province)» and adds the province only when it is not the town, compared without accents or case: «46001 Valencia», «30201 Cartagena (Murcia)». The shape of the field (list<string>) does not change.

Behaviors the contract defines

  1. Automations.
    • The dry run (automations.rules.dry_run, tool dry_run_automation_rule) works with only event_aggregate_id: event_payload is optional, data.sample answers {id, number, type} with the document that was used and, when both are sent, event_payload prevails and sample is null. A document that does not exist, that belongs to another company or whose family has no sample payload responds 404 with code automation_dry_run_document_not_found and param event_aggregate_id; the three cases answer the same. Sending only event_aggregate_id makes the server read the document, so the dry run also needs the automation_runs:read permission, in the API and in the tool dry_run_automation_rule; without it the response is 403 with code insufficient_scope. With event_payload the document is not read and automations:read is enough.
    • The catalog (automations.catalog.show, tool get_automation_catalog) publishes supported_trigger_prefixes for each action: the list of trigger prefixes it accepts, or null when it accepts any trigger. The trigger fields (automations.catalog.trigger_fields, tool get_automation_trigger_fields) publish label, which is the path when the field has no label of its own, and entity_type.
    • The usage (automations.usage.show, tool get_automation_usage) splits the month in by_rule ({rule_id, name, runs}: the five largest rules and a row for the rest) and compares it with previous_period ({period, consumed} or null). The split comes from the history of the last 30 days, so it can add up to less than consumed.
    • The list of rules (automations.rules.list, tool list_automation_rules) filters by module: a known module that the plan does not include returns an empty list, and an unknown key responds 400 with code parameter_invalid_enum.
    • The rule (automations.rules.{list,show,create,update,activate,pause}, tools list_automation_rules, get_automation_rule, create_automation_rule, update_automation_rule, activate_automation_rule and pause_automation_rule) publishes last_run ({id, status, finished_at} or null) and pause ({kind, at, consecutive_failures, last_discard_reason, last_discard_reason_label} or null, with kind manual or auto). Both are always present.
    • The run (automations.runs.{list,show}, tools list_automation_runs and get_automation_run) publishes document ({type, id, number, origin, warehouse_name, counterparty_name} or null), the triggering document, and the list filters by document with the exact number within the retention of 30 days. The filter by rule is still automation_rule_id. Its rule_snapshot, the definition the run used, holds trigger_type, conditions and actions; conditions is always an object, so a rule without conditions publishes {}, as the rule and its versions do.
    • The result of a step (automations.runs.steps.list) lists in summary.created[] what it created, as {type, id, number, key}, where type is delivery_note, purchase_order or task and key appears only in a task. The list is empty when the step created nothing. The step of create_task also publishes in summary.project the project of the task, as {id, name}.
  2. The stock ledger gains initial_split. stock_movements.list and products.stock_movements.list (tools search_stock_movements and list_product_stock_movements) accept the value initial_split in reason, and the rows publish it. It belongs to the group initial and records the exit from the default warehouse in the initial split of the stock. The tool search_stock_movements answers like its route: an unknown reason or source_type responds 400 with code parameter_invalid_enum and that param, a source_id without source_type responds 400 with code parameter_missing and param source_type, and a period whose occurred_from is later than its occurred_to returns an empty page.
  3. The automation webhooks carry the fields of the resources. In the events automation_rule.activated, automation_rule.paused and automation_rule.auto_paused, data.object publishes pause and last_run; in automation_run.started, automation_run.completed, automation_run.failed and automation_run.step_dead_lettered it publishes document, with the same serialization as the v1 resources. automation_run.step_dead_lettered adds step_index and discard_reason next to object. They are read by events.list, events.show, webhook_endpoints.deliveries.list and webhook_endpoints.deliveries.show, and by the tools list_events, get_event, list_webhook_deliveries and get_webhook_delivery.
  4. Granting the Storefront to a member is rejected. The operation public-api.v1.account.members.module_access.update (PATCH /accounts/{account}/members/{member}/module-access, scope members:write, tool update_account_member_module_access) responds 422 with code business_rule_violation, subcode module_not_grantable and param grants when the grants include storefront_api, a module reserved to administrators that is never granted. The response has the shape that the operation already had, and the grant is not written.

Automations, Events, Inventory and warehouses, the tool catalog and All rejection codes.

Updated endpoints19

EndpointDescription
GET/v1/companies/{company}/automations/catalogRetrieve the automation catalog
GET/v1/companies/{company}/automations/catalog/triggers/{trigger}/fieldsRetrieve the evaluable fields of a trigger
POST/v1/companies/{company}/automations/rules/{rule}/activateActivate an automation rule
POST/v1/companies/{company}/automations/rulesCreate an automation rule
POST/v1/companies/{company}/automations/rules/{rule}/dry-runDry-run an automation rule
GET/v1/companies/{company}/automations/rulesList your automation rules
POST/v1/companies/{company}/automations/rules/{rule}/pausePause an automation rule
GET/v1/companies/{company}/automations/rules/{rule}Retrieve an automation rule
PATCH/v1/companies/{company}/automations/rules/{rule}Update an automation rule
GET/v1/companies/{company}/automations/runsList automation runs
GET/v1/companies/{company}/automations/runs/{run}Retrieve an automation run
GET/v1/companies/{company}/automations/runs/{run}/stepsList the steps of an automation run
GET/v1/companies/{company}/automations/usageRetrieve automation usage
GET/v1/companies/{company}/eventsList all events
GET/v1/companies/{company}/events/{event}Retrieve an event
GET/v1/companies/{company}/products/{product}/stock-movementsList stock movements of a product
GET/v1/companies/{company}/stock-movementsList the stock movements of the company
GET/v1/companies/{company}/webhook-endpoints/{webhook_endpoint}/deliveriesList webhook deliveries
GET/v1/companies/{company}/webhook-endpoints/{webhook_endpoint}/deliveries/{delivery}Retrieve webhook delivery

On this page

Need a hand?Contact support