A202
v0.1.0Verifiable agreements for agent-led commerce: mandates, obligations, evidence, transaction records.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
issue_mandate Issue a commercial mandate
Issue and sign a commercial mandate: the document stating which organisation an agent represents, which acts it may take, under which limits, for which transaction or category, and for how long. Call this once per acting agent before anything else. Every other tool names the mandate an agent acts under. A spending_limit becomes two explicit constraints, an amount ceiling and a currency, both visible in the audit record. The mandate is checked before it is signed, so a refused one never receives a signature that would make it look issued. Refusals: no constraint at all (A202-MANDATE-UNBOUNDED…
| Parameter | Type | Description |
|---|---|---|
actions * | array | The acts the subject may take, for example offer.submit, offer.accept, agreement.sign. Deny by default: an omitted act is not allowed. |
issuer * | object | The principal issuing the authority, and the key it signs with. |
represented_organization_id * | string | The organisation the subject represents in its acts, prefixed org_. |
scope * | object | The boundary of the authority. Must carry transaction_ids, categories, or both. Counterparty and geography narrow an existing boundary and cannot establish one, so a scope naming only a country is ref… |
status_endpoint * | string | HTTPS URL where this mandate's current status is published. HTTPS only: cached status is the only channel a revocation reaches a relying party through. |
subject * | object | Who acts under the mandate: exactly one of an agent or a delegated principal, never both. |
valid_from * | string | RFC 3339 UTC instant. Must be strictly earlier than valid_until. |
valid_until * | string | RFC 3339 UTC instant. The mandate authorises nothing at or after it. |
approval_rules | array | Optional. Each rule carries id, a when predicate of path, operator, and value, an approver of organization_id and role, and expires_after_seconds. A matching act is held until an approval from that ap… |
constraints | array | Optional further constraints, each with id, type, path, operator, value, and on_failure of deny or require_approval. At least one constraint must exist in total, counting those a spending limit genera… |
delegation | object | Optional, defaults to no delegation. allowed false requires maximum_depth 0; allowed true requires at least 1. An incoherent pair is refused rather than interpreted. |
evidence_refs | array | Optional identity, role, or authorisation evidence supporting the issue. |
mandate_id | string | Optional explicit identifier, prefixed mnd_. One is minted when absent. |
parent_mandate_id | string | null | The mandate this one is delegated from, or null for a root mandate. |
spending_limit | object | Optional. Becomes an amount ceiling and a currency constraint. A ceiling with no currency would be satisfied by that number of any currency, so both are written. |
verify_mandate Verify a mandate and decide on an act
Check a mandate and decide whether an act is permitted under it. Call this before every act, on your own mandate or on one a counterparty presented. It checks the document against the published schema and the rules the schema cannot express, verifies the issuer signature, checks the validity interval, and, when proposed_action is given, checks the act against the mandate's actions, its four scope axes, its constraints in stable order, and its approval rules. Returns one decision, allow, deny, or require_approval, with the registered reason codes behind it, the per-constraint outcomes, and ac…
| Parameter | Type | Description |
|---|---|---|
approval | object | An approval object presented directly, instead of approval_id. |
approval_id | string | An approval this server holds, from issue_approval, that releases a require_approval hold. |
at | string | RFC 3339 instant to check against. Defaults to now. |
mandate | object | The mandate document, when it came from a counterparty. |
mandate_id | string | A mandate this server holds, as returned by issue_mandate. |
proposed_action | object | The act to evaluate against the mandate. Constraint paths address this document from $, so a spending limit reads $.proposed_terms.core.total.amount. |
status | object | What you retrieved from the mandate's status endpoint, and when. Omit it and the decision is deny. |
issue_approval Approve one exact act
Record a named principal's approval of one exact act, bound to the action_hash verify_mandate reported. Call this only after verify_mandate answered require_approval, then call verify_mandate again passing approval_id and the identical proposed_action. The approval is signed by the approving principal's own key, not by the agent's, because the control is that somebody other than the acting agent said yes. It binds one action hash and one transaction and is reusable across neither: change one byte of the act and the next verify_mandate returns A202-APPROVAL-HASH-MISMATCH. It also expires, afte…
| Parameter | Type | Description |
|---|---|---|
action_hash * | string | The action_hash verify_mandate returned for this act. 64 lowercase hexadecimal characters. |
approver * | object | The principal giving the approval, and the key that principal signs with. |
requested_by * | object | The agent whose act is being approved. The approver is a principal of this same organisation. |
transaction_id * | string | The transaction the approved act belongs to, prefixed txn_. |
conditions | array | Optional conditions the approver attached. They are part of the signed approval and travel with it. |
decision | Defaults to approved. A rejected approval releases nothing and is recorded as the refusal it is. | |
expires_after_seconds | integer | How long the approval is good for, from now. Defaults to 3600. |
expires_at | string | RFC 3339 instant the approval expires, when you would rather state it than count from now. Overrides expires_after_seconds. |
create_agreement Form an agreement with a known counterparty
Form an agreement between two parties who already know each other, with no marketplace and no negotiation room. Call this once per transaction. Both parties present the allow decision their own mandate produced. The offeror verifies {"action_type": "offer.submit", "transaction_id": ..., "counterparty_organization_id": <the offeree's org>, "proposed_terms": <the same terms>} and the offeree verifies the same document with action_type offer.accept and the offeror's organisation. Pass each result as buyer_decision and supplier_decision. A decision over a different act, a different mandate, or an…
| Parameter | Type | Description |
|---|---|---|
buyer * | object | The buying party: organisation, agent, mandate, and signing key. |
buyer_decision * | object | The result verify_mandate returned for this exact act, passed through unchanged. It must be an allow, made under this party's own mandate, over the act document this tool builds, and made within the l… |
offer_valid_until * | string | RFC 3339 instant the offer expires. Must be later than now. |
supplier * | object | The supplying party: organisation, agent, mandate, and signing key. |
supplier_decision * | object | The result verify_mandate returned for this exact act, passed through unchanged. It must be an allow, made under this party's own mandate, over the act document this tool builds, and made within the l… |
terms * | object | The commercial terms. core is identical for every transaction profile; profile_terms is validated against the schema the profile names. |
transaction_id * | string | The transaction, prefixed txn_. Choose one per deal; it is the key everything else is recorded under. |
offer_evidence_refs | array | Optional evidence the offer relies on, such as an accreditation. |
offeror_role | Which party makes the offer. Defaults to supplier. | |
rules_version | string | The rule set version the record is written under. Defaults to 1.3, the version that registers direct formation. Earlier versions never registered it and refuse the path. |
session_id | string | Optional session identifier, prefixed ses_. The offeror mints one when absent. Bilaterally this names the relationship; nothing orders it. |
record_obligation Issue, assert, or answer an obligation
Record one act in the obligation exchange. Three acts, in this order, each signed by a different party, and each carrying that party's own allow decision from verify_mandate. act=issue: the obligee derives an obligation from a committed agreement and activates it. Needs agreement_id, obligor, obligee, term_path, quantity, unit_code, due_condition, and a decision the obligee obtained for {"action_type": "obligation.activated", "transaction_id": ..., "counterparty_organization_id": <the obligor's org>, "proposed_terms": {"core": {"quantity": ..., "unit_code": ..., "total": <the consideration>}}…
| Parameter | Type | Description |
|---|---|---|
act * | Which act to record. Which other fields are required depends on it. | |
decision * | object | The result verify_mandate returned for this exact act, passed through unchanged. It must be an allow, made under this party's own mandate, over the act document this tool builds, and made within the l… |
accepted_quantity | string | act=respond with accept. Defaults to the asserted quantity. Below what is owed, a remainder_obligation_id is required. |
agreement_id | string | act=issue. The committed agreement the obligation derives from, prefixed agr_. |
asserted_quantity | string | act=assert. Base-10 string of how much was performed. |
assertion_id | string | act=respond. The assertion being answered, prefixed prf_. |
commitment_id | string | act=issue. Optional. Defaults to the agreement's first commitment. |
consideration | object | null | act=issue. The money attached to this obligation as currency and amount, or null. |
counterparty | object | act=respond. The other party, which countersigns the event. |
due_condition | object | act=issue. One of due_at_time with at, due_on_event with act_ref or evidence_type, due_on_discharge with obligation_id, or all_of with at least two of those. Anything else is refused with A202-OBLIGAT… |
evidence | array | act=assert. At least one entry. Each becomes a signed evidence object the assertion references by hash. |
obligation_id | string | act=assert. The obligation being performed, prefixed obl_. |
obligee | object | act=issue and act=assert. The party owed to. |
obligor | object | act=issue and act=assert. The party that owes. |
quantity | string | act=issue. Base-10 string of how much is owed. |
reason_code | act=respond with reject. The list is closed and anything else is refused. | |
remainder_obligation_id | string | act=respond with a short acceptance. The obligation carrying the shortfall, so it stays in the record. |
responder | object | act=respond. Must be the obligee named on the obligation. |
response_type | act=respond. | |
rules_version | string | The rule set version the record is written under. Defaults to 1.3. |
term_path | string | act=issue. The owed term, addressed under $.terms.core or $.terms.profile_terms. The obligation points at the agreement's terms and never restates them, so drift shows up as a hash mismatch. |
unit_code | string | act=issue. UN/ECE Recommendation 20 common code, matching the terms. |
verify_evidence Verify a record against the published procedure
Run the seven-step verification procedure over a set of objects: content hashes, signatures and the purpose each was issued for, version chains, event-chain continuity, guarded transitions replayed against the rules version in force, whether each determination follows from its rules, and what could not be checked. Use it on your own record before relying on it, and on anything a counterparty sends you. Pass transaction_id to verify this server's record of one transaction, object_ids to verify part of it, or objects to verify a bundle somebody handed you. Every check returns verified, failed,…
| Parameter | Type | Description |
|---|---|---|
object_ids | array | Identifiers of objects this server holds. |
objects | array | Objects presented by value, for example a bundle a counterparty sent. |
rules_version | string | The rule set version in force when the record appended, for example 1.3. A record replays against the version it was written under, never the current one. |
transaction_id | string | Verify every object this server holds for one transaction. |
get_transaction_record Read the transaction record
Return this party's own copy of the hash-chained transaction record: every event in chain order with the state it moved the transaction to, which keys signed it, and the object it concerns, plus the state the record currently reaches and every object identifier held for the transaction. Call it at any point to see where a transaction stands before deciding what to do next. Ordering is by predecessor reference rather than by a counter, because bilaterally there is no ordering service, and a record whose links do not form one chain is reported as broken with A202-EVIDENCE-CHAIN-GAP.
| Parameter | Type | Description |
|---|---|---|
transaction_id * | string | The transaction to read, prefixed txn_. |