Integrate
Connect your repricer, ERP, workflow or agent in one call.
Commerce Gate answers one question before your tool acts: does this action clear the policy your operations team published? There are three ways to ask. They share one contract, one policy and one Decision Ledger, and none of them lets Commerce Gate write to your marketplace or ERP.
Recipe 1
Before the push: your repricer or ERP asks over HTTPS
One request per proposed action, sent before the tool writes to the marketplace. The operation is evaluateCommerceDecision in the published contract at /.well-known/openapi.json.
- Request
POST https://api.decionis.com/v1/protocol/evaluate-decision- Headers
Authorization: Bearer <workspace API key>andIdempotency-Key, stable for retries of the same proposed action.- Who is asking
channelisrepricer,erp,workfloworapi;sourceis your tool's name. Both are recorded on the dossier.- Mode
SHADOW. The verdict is the same as enforcement would give; enforcing it is your tool honoring the answer.
A price change from a repricer, with the signals the starter policy reads:
{
"org_id": "your-workspace-id",
"decision_type": "PRICE_CHANGE",
"transaction_type": "price_change",
"workflow_key": "commerce_price_change",
"amount": 89,
"channel": "repricer",
"source": "acme-repricer",
"mode": "SHADOW",
"idempotency_key": "sku:DC-AFR-55:price:89.00:2026-09-10T12:00:00Z",
"context": {
"action_type": "PRICE_CHANGE",
"actor_type": "REPRICER",
"actor_id": "acme-repricer",
"platform": "walmart-marketplace",
"signals": {
"sku": "DC-AFR-55",
"from_price": 129,
"to_price": 89,
"currency": "USD",
"estimated_cost": 81.79,
"net_margin_percent": 8.1
}
}
}The answer, trimmed to what the tool acts on:
{
"outcome": "REVIEW",
"policy_version": "commerce-policy-v2",
"dossier_id": "9d8b4c1e-2f0a-4b6e-9c3d-1e2f3a4b5c6d",
"reason_codes": [
"MARGIN_BELOW_FLOOR"
],
"mode": "SHADOW"
}| Contract says | Operators read | Your tool does |
|---|---|---|
APPROVE | PROCEED | Go ahead. This is a policy result, not consent from a person. |
REVIEW | HOLD | Stop. Leave the marketplace as it is and put the action in front of an operator. |
ESCALATE | ESCALATE | Stop. A named approver decides before you ask again. |
REJECT | BLOCK | Stop. Outside policy; do not retry the same action. |
An error, a timeout or an answer you cannot parse means hold. Keep the dossier_id with your own record of the push; finance can open it in the Decision Ledger months later.
What to send: the signals the starter policy reads
Rules read context.signals. The starter policy every workspace begins with reads these; a rule you add on the Policies page reads whatever field you name.
| Rule | Reads | Fires when | Send it with | How |
|---|---|---|---|---|
| Protect minimum margin | signals.net_margin_percent | LT 12 → require review | PRICE_CHANGE, ORDER_ACCEPTANCE | Percentage points: (net revenue minus landed cost) divided by net revenue, times 100. Landed cost is your unit cost plus the marketplace referral fee and shipping you bear. Send it as a number, so 8.1 means 8.1%. |
| Protect low inventory | signals.available_inventory | LT 10 → require review | INVENTORY_MUTATION, ORDER_ACCEPTANCE | Units left after the change or the order, at the location it applies to, from your source of truth. |
| Review stacked promotions | signals.discount_count | GT 1 → require review | ORDER_ACCEPTANCE, PROMOTION_CHANGE | How many discount sources combine on the order or would combine under the promotion. |
| Reject refunds above the refundable balance | signals.refund_exceeds_refundable | EQ true → auto reject | REFUND_REQUEST | true when the refund amount is more than the order line still has left to refund; send remaining_refundable beside it. |
| Escalate refunds above the unattended limit | signals.refund_amount | GT 1000 → escalate | REFUND_REQUEST | The refund amount in the order currency; send currency and reason_code beside it. |
| Review a second refund on the same line | signals.prior_refund_count | GT 0 → require review | REFUND_REQUEST | How many refunds the same order line already carries; 0 for the first. |
No landed cost, no margin rule: Commerce Gate fails open rather than guess a cost. Send estimated_cost and the margin it produces, or expect PROCEED on price and order checks.
Recipe 2
An AI agent asks through the CommerceGate MCP
The MCP does the normalization above for the agent: it takes the plain facts (SKU, prices, cost, quantities, refund amounts), derives the signals, and sends the same request in Shadow Mode. Install it with npx -y @decionis/commerce@0.1.3.
-
commercegate_describe_capabilities -
commercegate_validate_erp_transaction -
commercegate_evaluate_action -
commercegate_get_dossier -
commercegate_get_proof_packet -
commercegate_list_shadow_reports -
commercegate_summarize_shadow_reports
Recipe 3
After the push: let Commerce Gate see what the repricer already did
A repricer that never asks can still be watched. On Walmart Marketplace, the listing sweep reads the price of every published listing through the Items API, lands the cost with your referral-fee schedule, and checks each listing against the margin floor in Shadow Mode. Listings below the floor get a signed decision and appear on the Price Guard page; nothing on Walmart is written.
The sweep waits for Walmart to grant the Items read scope on your connection; the Price Guard page shows “Waiting for Walmart” until then, and the switch unlocks when it is granted. Until that day, recipe 1 is how a repricer is governed.
What Commerce Gate never does
- Write a price, a quantity, an order change or a refund to your marketplace or ERP through these recipes.
- Invent a cost. Unknown landed cost fails open on price and order checks.
- Treat PROCEED as consent from a person, or as an execution grant.
Where to look next
- Capabilities: what each platform enforces on its own.
- Walmart, Shopify, Adobe Commerce, Business Central.
- Pricing: Shadow Mode is free with no time limit.