Trust Rail

Publish a new mandate version (revokes approvals if tightened)

PUT
/mandates/current

Publish a new mandate version (revokes approvals if tightened). Requires the OWNER role. Idempotent: send an Idempotency-Key.

Authorization

__Host-qm_session<token>

Session cookie set by sign-in on HTTPS deployments (the hosted demo).

In: cookie

Header Parameters

X-Requested-With*string

CSRF guard: must be quartermaster on every mutation.

Idempotency-Key*string

A unique key per user action; retries with the same key return the first result.

Length8 <= length <= 128

Request Body

application/json

A new Spend Mandate version (optimistic concurrency on expected_version).

A new Spend Mandate version (optimistic concurrency on expected_version).

currency*"USD"

ISO 4217 currency code.

Value in

  • "USD"
weekly_budget_minor*integer

Weekly budget, in minor units (cents).

Range0 <= value <= 100000000
per_order_limit_minor*integer

Per order limit, in minor units (cents).

Range0 <= value <= 100000000
auto_approval_limit_minor*integer

Auto approval limit, in minor units (cents).

Range0 <= value <= 100000000
human_approval_required*boolean

An owner must approve every purchase (always true). Always true.

approved_supplier_ids*array<>

Suppliers the owner has approved for payment.

Itemsitems <= 200
allowed_categories*array<>

Product categories purchases may contain.

Items1 <= items <= 8
max_market_price_premium_pct*integer

Max market price premium, in percent.

Range0 <= value <= 500
market_price_action*string

What happens when a price exceeds the market premium: REVIEW or BLOCK.

Value in

  • "REVIEW"
  • "BLOCK"
duplicate_window_hours*integer

Duplicate window, in hours.

Range0 <= value <= 720
duplicate_action*string

What happens to a likely duplicate order: REVIEW or BLOCK.

Value in

  • "REVIEW"
  • "BLOCK"
subscriptions_allowed*boolean

Whether recurring purchases are allowed.

certificate_ttl_minutes*integer

Certificate ttl, in minutes.

Range5 <= value <= 60
max_quantity_multiple_of_need*number
Range1 <= value <= 10
expected_version*integer

The mandate version being edited (refused if it changed meanwhile).

Range1 <= value <= 9007199254740991

Response 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}