Authorize · Guide
When a deal goes wrong
Use this when a report arrives late, a delivery's hash doesn't match, or a tab's call count is off. A dispute puts both sides' evidence in one place: the signed offer, the acceptance, approvals, the payment reference, the delivery receipt, usage statements and both agents' records. Deterministic findings say what that evidence shows. The parties, the rail or the arbiter named in the offer record the outcome. Opening, responding, adding evidence, arbitrating and exporting are free.
Before you begin: you have a deal or a tab with another company's agent.
How a dispute runs
| State | What happens |
|---|---|
draft | A deal that ends delivery_ gets a draft. Only the buyer sees it. |
open | The buyer opened it. The seller has 5 days to respond. |
responded | The seller accepted or contested. |
resolved | The parties, the rail or the arbiter recorded buyer_, seller_ or split. |
withdrawn | The buyer withdrew it. |
expired | 60 days passed with no outcome. |
Every step is a row in the dispute's hash-chained history and a dispute row in both companies' decision ledgers. Each change of state sends a dispute.* webhook to both sides and to a named arbiter: opened, responded, resolved and expired.
1. Open a dispute (buyer)
Open it within 30 days of the deal's deadline or its delivery, whichever is later. One dispute per deal can be open at a time.
curl -s -X POST $PROVENANCE_API/v1/authorize/deals/$DEAL_ID/disputes \
-H "Authorization: Bearer $PROVENANCE_KEY" -H "Content-Type: application/json" \
-d '{ "reason": "not_as_offered", "statement": "The report has 12 pages; the offer said 20.", "amount_claimed": 20 }'
| Reason | Use it when |
|---|---|
not_ | Nothing arrived. |
late | It arrived after the deadline. |
not_ | It isn't what the offer described. |
content_ | Its hash differs from the signed delivery receipt. |
overcharged | You were charged more than agreed. |
unauthorized | Nobody on your side authorized the deal. |
other | Something else (a statement is required). |
From a mismatch draft. When your confirmed hash differed from the seller's delivery receipt, open the draft as it stands with POST /. List your drafts with GET /v1/authorize/disputes?status=draft.
For a tab. When a UTC day settles with the two counts more than 2% apart, the day is contested. Dispute a period inside it with POST / and { period_start, period_end, claimed_calls }, within 30 days of the day's end.
2. Read the bundle and findings
GET / returns the dispute with its bundle, findings and history. Each bundle item has a type, a sha256 hash and who supplied it: the buyer, the seller or Provenance. Signed items, such as the offer and the delivery receipt, carry their content.
Each finding is a check over the evidence as it stood when the dispute opened:
| Check | What it compares |
|---|---|
delivery_ | The hash the buyer confirmed against the seller's signed delivery receipt |
delivered_ | The delivery time against the offer's deadline |
total_ | The deal's total against the offer's total |
acceptance_ | Whether the acceptance passed the buyer's grant, budget and policy at the time |
seller_ | Whether the seller's key was active when it signed the offer |
offer_ | The acceptance time against the offer's expiry |
usage_ | The seller's statements against the buyer's count for the period (tabs) |
statements_ | Each statement against max_ (tabs) |
day_ | The day's usage against daily_ (tabs) |
run_, run_ | Each agent's run record, when one is linked to the deal |
Each finding's result says which side the evidence supports, neutral, or not_checkable when the evidence isn't there, and lists the items it used. A finding describes the evidence; the outcome comes from the parties, the rail or the arbiter.
3. Add evidence (either side)
While the dispute is open, each side may add up to 20 items: the content (base64, up to 10 MB) or only its hash for material you keep yourself.
curl -s -X POST $PROVENANCE_API/v1/authorize/disputes/$DISPUTE_ID/evidence \
-H "Authorization: Bearer $PROVENANCE_KEY" -H "Content-Type: application/json" \
-d '{ "kind": "document", "description": "The first page of the PDF we received",
"content": "'"$(base64 -w0 first-page.pdf)"'", "content_type": "application/pdf" }'
Content is sealed at rest with AES-256-GCM. Each item's hash goes into the history, and nothing can be removed. The other side and a named arbiter read it with GET /.
4. Respond (seller)
You have 5 days. Accept the claim, or contest it with a statement:
curl -s -X POST $PROVENANCE_API/v1/authorize/disputes/$DISPUTE_ID/respond \
-H "Authorization: Bearer $PROVENANCE_KEY" -H "Content-Type: application/json" \
-d '{ "action": "accept", "statement": "We sent the UK edition by mistake." }'
After you accept, refund on your rail and record the rail, its reference and the amount with POST /. The dispute resolves buyer_favored, decided by the parties. You can also send the refund with the accept. With no response in 5 days, the response reads unanswered and the dispute stays open for an outcome.
5. Record the outcome
Who decides is fixed by the offer the buyer accepted. The offer's arbiter field sets it:
arbiter in the offer | Who decides | How |
|---|---|---|
| absent | The parties | One side proposes with POST /; the other accepts with POST /. |
"rail" | The rail | Either side records the rail's case reference, then its outcome, with POST /. |
an arb_ id | That arbiter | The arbiter records the outcome and its statement. See Act as an arbiter. |
The buyer can withdraw at any time before an outcome with POST /. Each side can set its own case owner with assign and keep private notes with notes; the other side sees only a note's hash in the history.
When the dispute ends, GET / returns a signed receipt with the outcome, who recorded it and any refund reference.
6. Export for a rail
GET / returns the bundle with every hash, the findings and the public history, plus token: an ES256 JWS (typ: evidence+jwt) over the sha256 of the bundle's canonical JSON, signed with the key in our JWKS. Attach both to the rail's dispute. Anyone can check them offline:
import { verifyDisputeBundle } from "@provenanceauth/rails/disputes";
const jwks = await (await fetch(`${process.env.PROVENANCE_API}/.well-known/jwks.json`)).json();
const { bundle, token } = exported;
const r = await verifyDisputeBundle(bundle, token, jwks);
// r.valid: the bundle is unchanged, every embedded item hashes to its hash, and the history is one chain.
The export leaves out notes and assignments.
In the console
Authorize → Disputes lists your disputes from both sides and the ones you arbitrate, filtered by state, reason or role. A deal's drawer in Authorize → Deals links to its disputes, where the buyer can open one. The case page shows the findings, the timeline and the evidence bundle, with only the actions open to you: respond, record a refund, propose an outcome, record a rail case or, for a named arbiter, record the outcome.
Track records
Only disputes that ended with an outcome count. A seller's record gains dispute_rate (resolved disputes per accepted deal) and disputes_seller_favored_rate; withdrawn and expired disputes never count against it. A buyer's record gains disputes_filed_rate and disputes_withdrawn_rate, shown to sellers on the deal approval page. Rates appear once a record has 50 completed deals from 5 companies, and loop-flagged deals never count.
Errors you might see
| Code | What to do |
|---|---|
dispute_ | The 30 days have passed. Settle it with the seller directly or through the rail. |
dispute_ | Add to the open dispute, or open its draft (error.). |
dispute_ | Read the dispute: status, decider and actions say what can happen next. |
arbiter_ | Only the arbiter the offer named records this outcome. |
evidence_ | Combine related files into one item, or send a hash. |
dispute_ | The server has no evidence key yet. The bundle and findings still work. |