Commerce

Assess the previous ninety complete dates

POST
/v1/protocol/commerce/history/assessments

Default off; requires COMMERCE_MCP_OAUTH_DATA_ACCESS_ENABLED and COMMERCE_MCP_BUSINESS_CENTRAL_ENABLED, a live Accounts Microsoft purchase, current membership and signed v2 or v3 consent. An opaque connection identifies a separately verified company within the purchaser tenant extracted by Accounts. Reads are bounded to eight seconds and 100 documents, return no connector credentials, and cannot execute an ERP action. Connected v3 source discovery reports BC history unavailable; its historical tools cover only Walmart and Adobe. This preserved BC historical flow admits only v2 erp:read and history:assess consent; v3 grants are refused. COMMERCE_HISTORY_ENABLED and an explicit history_assessment_limit_monthly in the verified publisher/offer/plan mapping are required; a missing limit disables assessments. Compares available historical merchandise margin against the exact selected policy floor over the previous ninety complete UTC dates. Missing costs or provenance are not_assessed; this is not full policy replay, execution authority, or a ninety-day trial. Results disclose partial coverage and are unsigned. One durable allowance reservation per new idempotent report; an exact completed retry returns the original report without another charge. An uncertain attempt is retained and cannot silently rerun.

Authorization

CommerceAccountsOAuth
AuthorizationBearer <token>

Opaque Accounts-issued Commerce OAuth access credential with resource-bound current purchase. Legacy base3, signed v2 ERP/history and fresh signed v3 nine-scope connected grants retain distinct route profiles. Refresh credentials never authenticate. Per-operation connection, current role, proof, quota and confirmation checks remain mandatory.

In: header

Header Parameters

Idempotency-Key*string
Match^[A-Za-z0-9._:-]+$
Length1 <= length <= 200

Request Body

application/json

org_id*string
Formatuuid
connection_id*string
Formatuuid
policy_version*string
Length1 <= length <= 100
idempotency_key*string
Match^[A-Za-z0-9._:-]+$
Length1 <= length <= 200

Response Body

application/json

curl -X POST "https://example.com/v1/protocol/commerce/history/assessments" \  -H "Idempotency-Key: string" \  -H "Content-Type: application/json" \  -d '{    "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",    "connection_id": "d3547de1-d1f2-4344-b4c2-17169b7526f9",    "policy_version": "string",    "idempotency_key": "string"  }'
{  "version": "commerce-history-assessment-v1",  "status": "completed",  "mode": "historical_only",  "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",  "assessment_id": "9f60a03f-b3de-4b19-9361-0380d9aa1e9e",  "connection_id": "d3547de1-d1f2-4344-b4c2-17169b7526f9",  "connection_revision": -9007199254740991,  "assessed_at": "2019-08-24T14:15:22Z",  "observed_at": "2019-08-24T14:15:22Z",  "window": {    "days": 90,    "start_date": "string",    "end_date_exclusive": "string",    "date_field": "postingDate",    "anchor": "server_utc_date"  },  "policy": {    "bundle_id": "fc6f5a67-caa1-4339-9c14-a67826143b60",    "version": "string",    "policy_digest": "string",    "floor_percent": 0,    "comparison": "merchandise_margin_against_selected_floor",    "full_policy_evaluated": false  },  "source": "business-central",  "cost_scope": "merchandise_margin",  "summary": {    "documents_scanned": 0,    "documents_assessed": 0,    "within_floor": 0,    "below_floor": 0,    "not_assessed": 0,    "missing_cost": 0,    "missing_currency": 0  },  "findings": [    {      "record_id": "string",      "transaction_date": "string",      "date_precision": "day",      "currency": "string",      "finding": "within_floor",      "reason_codes": [        "MARGIN_WITHIN_FLOOR"      ],      "net_margin_percent": 0,      "proof_ref": null    }  ],  "coverage": {    "record_limit": 100,    "complete": true,    "truncated": true,    "reasons": [      "historical_cost_unavailable"    ]  },  "proof_ref": null,  "evidence_verification": "unsigned",  "execution_available": false,  "no_downstream_action_executed": true}

Read bounded current Business Central orders GET

Default off; requires COMMERCE_MCP_OAUTH_DATA_ACCESS_ENABLED and COMMERCE_MCP_BUSINESS_CENTRAL_ENABLED, a live Accounts Microsoft purchase, current membership and signed v2 or v3 consent. An opaque connection identifies a separately verified company within the purchaser tenant extracted by Accounts. Reads are bounded to eight seconds and 100 documents, return no connector credentials, and cannot execute an ERP action. Connected v3 source discovery reports BC history unavailable; its historical tools cover only Walmart and Adobe. Requires erp:read.

Read an immutable historical assessment GET

Default off; requires COMMERCE_MCP_OAUTH_DATA_ACCESS_ENABLED and COMMERCE_MCP_BUSINESS_CENTRAL_ENABLED, a live Accounts Microsoft purchase, current membership and signed v2 or v3 consent. An opaque connection identifies a separately verified company within the purchaser tenant extracted by Accounts. Reads are bounded to eight seconds and 100 documents, return no connector credentials, and cannot execute an ERP action. Connected v3 source discovery reports BC history unavailable; its historical tools cover only Walmart and Adobe. This preserved BC historical flow admits only v2 erp:read and history:assess consent; v3 grants are refused. COMMERCE_HISTORY_ENABLED and an explicit history_assessment_limit_monthly in the verified publisher/offer/plan mapping are required; a missing limit disables assessments. Compares available historical merchandise margin against the exact selected policy floor over the previous ninety complete UTC dates. Missing costs or provenance are not_assessed; this is not full policy replay, execution authority, or a ninety-day trial. Results disclose partial coverage and are unsigned. Requires the same immutable Accounts user, workspace, membership and source entitlement; current authority and company connection are checked. Reading a saved report consumes no allowance.