Form an agreement with a known counterparty
create_agreementForm an agreement between two known parties in a single transaction, capturing signed offer, acceptance, and commitment from their verified mandate decisions.
Instructions
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": } 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 amount the mandate did not allow refuses the whole call and records nothing.
It writes the whole formation in one call: the offeror's signed offer carrying a session identifier it mints, the offeree's acceptance over the exact offer hash, the agreement carrying both parties' signatures over the same bytes, the supplier's commitment, and two events, agreement.direct (draft to agreement_pending) and agreement.committed (agreement_pending to committed), each countersigned by the other party.
The transaction ends this call in state committed. Follow with record_obligation act=issue.
Refusals: a transaction that already left draft (A202-STATE-TRANSITION-DENIED), an unregistered profile (A202-PROFILE-UNKNOWN), terms the profile does not allow (A202-PROFILE-TERMS-INVALID), an offer expiring before it was made (A202-OFFER-EXPIRED).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| buyer | Yes | The buying party: organisation, agent, mandate, and signing key. | |
| terms | Yes | The commercial terms. core is identical for every transaction profile; profile_terms is validated against the schema the profile names. | |
| supplier | Yes | The supplying party: organisation, agent, mandate, and signing key. | |
| session_id | No | Optional session identifier, prefixed ses_. The offeror mints one when absent. Bilaterally this names the relationship; nothing orders it. | |
| offeror_role | No | Which party makes the offer. Defaults to supplier. | |
| rules_version | No | 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. | |
| buyer_decision | Yes | 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 last 60 seconds. Where it does not match, the refusal detail states the exact proposed_action to verify. For the buyer this is the decision over its own act: offer.accept when the supplier is the offeror, offer.submit when the buyer is. | |
| transaction_id | Yes | The transaction, prefixed txn_. Choose one per deal; it is the key everything else is recorded under. | |
| offer_valid_until | Yes | RFC 3339 instant the offer expires. Must be later than now. | |
| supplier_decision | Yes | 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 last 60 seconds. Where it does not match, the refusal detail states the exact proposed_action to verify. For the supplier this is the decision over its own act: offer.submit when the supplier is the offeror, offer.accept when the buyer is. | |
| offer_evidence_refs | No | Optional evidence the offer relies on, such as an accreditation. |