order.expire_unpaid
Cancel every unpaid order (pending_payment) whose payment window has run out, exactly as order.cancel would — reservation released, coupon uses returned, order.cancelled emitted with reason payment_expired — and end its open payment attempt (failed, reason expired). The window is the payment app’s declared reservationWindowSeconds for the method, or the store’s override on the app’s ficha, counted from the latest payment attempt. Orders with no payment intent, or whose app is uninstalled or declares no window, never expire (counted as windowless). Only payments whose intent was born after the expiry began running in the tenant are reached: an older one never expires and is counted as predating. An order whose payment is being confirmed at that instant is skipped (spared), never cancelled under it; a payment confirmed after the expiry is reported as payment.orphaned. The kernel runs this every minute; calling it by hand is safe and idempotent.
- Scope:
order.write - System: no
- Reachable from:
POST /v1/commands/order.expire_unpaid— the tenant data face, with a tenant credential carryingorder.write· MCP toolorder.expire_unpaid· SDKclient.call('order.expire_unpaid', …) - Events:
order.cancelled,inventory.released,payment.attempt_failed
Input (JSON Schema)
Section titled “Input (JSON Schema)”{ "properties": { "limit": { "maximum": 1000, "minimum": 1, "type": "integer" } }, "type": "object"}Result (200)
Section titled “Result (200)”{ "additionalProperties": false, "properties": { "examined": { "maximum": 9007199254740991, "minimum": -9007199254740991, "type": "integer" }, "expired": { "items": { "additionalProperties": false, "properties": { "order_id": { "type": "string" }, "store_id": { "type": "string" } }, "required": [ "order_id", "store_id" ], "type": "object" }, "type": "array" }, "predating": { "maximum": 9007199254740991, "minimum": -9007199254740991, "type": "integer" }, "spared": { "items": { "type": "string" }, "type": "array" }, "windowless": { "maximum": 9007199254740991, "minimum": -9007199254740991, "type": "integer" } }, "required": [ "expired", "spared", "examined", "windowless", "predating" ], "type": "object"}Errors
Section titled “Errors”validation_failed (400) · unauthorized (401) · forbidden (403) · conflict (409) · internal (500)