Publish a new mandate version (revokes approvals if tightened)
Publish a new mandate version (revokes approvals if tightened). Requires the OWNER role. Idempotent: send an Idempotency-Key.
Session cookie set by sign-in on HTTPS deployments (the hosted demo).
In: cookie
Header Parameters
CSRF guard: must be quartermaster on every mutation.
A unique key per user action; retries with the same key return the first result.
8 <= length <= 128Request Body
application/json
A new Spend Mandate version (optimistic concurrency on expected_version).
A new Spend Mandate version (optimistic concurrency on expected_version).
ISO 4217 currency code.
Value in
- "USD"
Weekly budget, in minor units (cents).
0 <= value <= 100000000Per order limit, in minor units (cents).
0 <= value <= 100000000Auto approval limit, in minor units (cents).
0 <= value <= 100000000An owner must approve every purchase (always true). Always true.
Suppliers the owner has approved for payment.
items <= 200Product categories purchases may contain.
1 <= items <= 8Max market price premium, in percent.
0 <= value <= 500What happens when a price exceeds the market premium: REVIEW or BLOCK.
Value in
- "REVIEW"
- "BLOCK"
Duplicate window, in hours.
0 <= value <= 720What happens to a likely duplicate order: REVIEW or BLOCK.
Value in
- "REVIEW"
- "BLOCK"
Whether recurring purchases are allowed.
Certificate ttl, in minutes.
5 <= value <= 601 <= value <= 10The mandate version being edited (refused if it changed meanwhile).
1 <= value <= 9007199254740991Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PUT "https://example.com/mandates/current" \ -H "X-Requested-With: quartermaster" \ -H "Idempotency-Key: 3b8c2c1e-6f6d-4a59-9a43-8f0c2a9e1d22" \ -H "Content-Type: application/json" \ -d '{ "currency": "USD", "weekly_budget_minor": 0, "per_order_limit_minor": 0, "auto_approval_limit_minor": 0, "human_approval_required": true, "approved_supplier_ids": [ "5592dc76-b889-42ec-a8bf-b045b038bdfd" ], "allowed_categories": [ "food_packaging" ], "max_market_price_premium_pct": 0, "market_price_action": "REVIEW", "duplicate_window_hours": 0, "duplicate_action": "REVIEW", "subscriptions_allowed": true, "certificate_ttl_minutes": 5, "max_quantity_multiple_of_need": 1, "expected_version": 1 }'{ "mandate": { "id": "string", "version": 0, "status": "ACTIVE", "currency": "string", "weekly_budget_minor": 0, "per_order_limit_minor": 0, "auto_approval_limit_minor": 0, "human_approval_required": true, "approved_supplier_ids": [ "string" ], "allowed_categories": [ "food_packaging" ], "max_market_price_premium_pct": 0, "market_price_action": "REVIEW", "duplicate_window_hours": 0, "duplicate_action": "REVIEW", "subscriptions_allowed": true, "certificate_ttl_minutes": 0, "max_quantity_multiple_of_need": 0, "created_by": "string", "created_at": "string" }, "budget": { "period_start": "string", "period_end": "string", "currency": "string", "limit_minor": 0, "reserved_minor": 0, "spent_minor": 0, "remaining_minor": 0 }, "revoked_certificates": 0}