# settle/payment/terms/accept

https://toip.tools/spec/settle/payment/terms/accept/0.1

The payee returns the agreed terms with its own signed acceptance. The payer checks that the terms are the ones it proposed and that the payee signed them. It then opens the escrow through the processor.

- **Sent**: payee's party → payer's party
- **Kind**: One-way. No response is expected; any answer is a separate message.
- **Envelope**: Signed by the issuer, addressed to one recipient, timestamped, and encrypted in a TSP Direct message. The signature and recipient binding prevent its use as a bearer token.
- **Defined in**: [`projects/settle/src/protocol/specs.ts:9`](https://github.com/yourbuddyconner/toip-tools/blob/main/projects/settle/src/protocol/specs.ts#L9) as `TERMS_ACCEPT`
- **Handled in**: [`projects/settle/src/agents/party.ts`](https://github.com/yourbuddyconner/toip-tools/blob/main/projects/settle/src/agents/party.ts)
- **Design**: [7. The Trust Tasks](https://github.com/yourbuddyconner/toip-tools/blob/main/projects/settle/docs/design.md#7-the-trust-tasks) in `projects/settle/docs/design.md`

## Payload

As the handler declares it, in projects/settle/src/agents/party.ts:

```ts
{ terms: Terms; acceptance: Acceptance }
```

### Types it uses

projects/settle/src/protocol/documents.ts:71:

```ts
export interface Terms {
  type: "settle/terms";
  version: 1;
  payment: string;
  purpose: string;
  payer: Party;
  payee: Party & { credentials: Credential[] };
  arbiter: { did: string; key: Address };
  amount: { mint: Address; units: string; display: string };
  conditions: { policy: "settle/policies/attested-completion/1"; attester: string; disputeWindowSeconds: number };
  /** The processor's facilitator fee: `units` = max(price × bps, minUnits), funded on top of the price, paid on every outcome. */
  fee: { bps: number; minUnits: string; units: string; account: Address; to: string };
  threshold: number;
  refundAfter: number;
}
```

projects/settle/src/protocol/documents.ts:94:

```ts
/** A party's signature on the terms, as its own small document bound to the terms hash. */
export interface Acceptance {
  type: "settle/acceptance";
  issuer: string;
  termsHash: string;
  proof?: unknown;
}
```

## Notes

The design says the payload is the terms with both proofs. The code sends the terms and the payee's acceptance only.

## Document envelope

Every Trust Task uses this envelope. Replace `payload` with the structure shown above.

Shape of a document of this type:

```json
{
  "id": "urn:uuid:…",
  "type": "https://toip.tools/spec/settle/payment/terms/accept/0.1",
  "issuer": "did:key:… (the sender)",
  "recipient": "did:key:… (the receiver)",
  "issuedAt": "2026-11-06T18:00:00.000Z",
  "payload": { … },
  "proof": {
    "type": "DataIntegrityProof",
    "cryptosuite": "eddsa-jcs-2022",
    "verificationMethod": "did:key:…#…",
    "proofPurpose": "assertionMethod",
    "proofValue": "z…"
  }
}
```

---

This is the Markdown version of https://toip.tools/spec/settle/payment/terms/accept/0.1/. An index of the documentation for AI assistants is at https://toip.tools/llms.txt.
