create_deal
Create a fairness deal. You are party 0 (initiator). Returns a deal id and one invite token per party — give each counterparty their own token. Sealed mode: everyone commits a hash, then reveals; certificate is issued automatically when the deal computes or goes VOID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | "sealed" (default, commit/reveal) or "open" (single round trip, low stakes). | |
| api_key | Yes | Your redeal API key (get one free with create_key — no signup form). | |
| algorithm | Yes | Algorithm id from list_algorithms: "split.v1" (fixed 1,000-point budget) | "random.v1" | "shapley.v1" | "auction.v1". | |
| retention | No | "standard" (inputs retained encrypted) or "purge" (destroyed 7 days after certification). | |
| supersedes | No | Optional: certificate id (c_<16 hex>) this deal's certificate replaces (re-draw after VOID etc.). | |
| terms_hash | No | Optional: "sha256:<hex>" of the deal's terms (echoed into the certificate; we never see the terms). | |
| visibility | No | Optional: "public" (default — anyone can fetch the certificate at its id) or "parties" (only you and your invite-token holders). Certificates never contain inputs, only the outcome; choose "parties" when the outcome itself is sensitive. | |
| external_ref | No | Optional: your own identifier for this deal, e.g. "campaign-4821" (echoed into the certificate). | |
| party_labels | Yes | One label per party, e.g. ["alice", "bob"] — or objects {"label", "weight"?, "statement_hash"?} (weight defaults to 1; statement_hash is "sha256:<hex>" of a declaration you want bound into the certificate). Party 0 is you (the initiator). Labels go on the public certificate permanently: use nicknames, never real names or emails. | |
| commit_deadline | Yes | Commit deadline as unix seconds UTC. Missed → deal EXPIRES (no certificate). | |
| idempotency_key | No | Optional: retries with the same key + same arguments replay the original response. | |
| reveal_deadline | Yes | Reveal deadline as unix seconds UTC (after commit_deadline). Missed → deal goes VOID and a non-participation certificate names whoever didn't reveal. | |
| algorithm_params | No | Algorithm-specific params from list_algorithms. split.v1: {"items": [...]}; random.v1: {"drand_round": N}; shapley.v1: {"coalition_values": {...}}; auction.v1: {"item": "...", "unit": "GBP", "reserve": N}. |