Rules live in the domain
An account is Pending until the vendor confirms it, then Synced; updating it re-queues a sync. You cannot update or delete an account that has never reached the vendor, nor delete one with active orders. Orders accept item changes only in Draft. Each rule is a named exception mapped to a stable error code.
One response shape
Every endpoint returns an ApiResult<T> envelope with status, data and error. Error codes are gapped integers grouped by domain: 1xxx generic, 2xxx Account, 3xxx Order, 4xxx Product, 5xxx Vendor. Auth is JWT with a 15-minute access token and a 7-day refresh token; logout always returns 204 to avoid revealing which emails exist.