# settle/payment/request

https://toip.tools/spec/settle/payment/request/0.1

The payee sends an invoice to the payer. It carries the price, the purpose, a new payment key bound to the payee's DID, and the payee's credentials. The payer checks the key binding and the credentials and records the invoice. If the invoice answers one of its own checkouts, the payer then proposes terms without a click.

- **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:7`](https://github.com/yourbuddyconner/toip-tools/blob/main/projects/settle/src/protocol/specs.ts#L7) as `PAYMENT_REQUEST`
- **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

projects/settle/src/agents/messages.ts:7:

```ts
export interface OfferPayload {
  payment: string;
  purpose: string;
  units: string;
  payee: TermsParty;
  credentials: Credential[];
  /** The payee's own name for itself (shown to people, never trusted). */
  name?: string;
  /** Set when the invoice answers a checkout from a payment link. */
  link?: string;
  checkout?: string;
  /** The release conditions the payment link fixed; the payee accepts only terms that use them. */
  conditions?: { attester: string; disputeWindowDays: number };
}
```

## Notes

The payee also sends it in reply to settle/checkout/start. Then the payload has link, checkout and conditions set.

## 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/request/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/request/0.1/. An index of the documentation for AI assistants is at https://toip.tools/llms.txt.
