# Build chargeback evidence

Build a signed, offline-verifiable evidence pack for an agent order a person approved, for a "cardholder did not authorize" dispute response.

*Available on Growth and Enterprise.*

When a charge for an agent's order is disputed as "I didn't authorize this", build an evidence pack and attach it to your response. The pack shows what was approved, who approved it and how, when and from where, and lets anyone check it offline.

**Before you begin:** the order needs an approved [cart approval](https://provenanceauth.com/docs/authorize/guides/ask-your-own-customer.md), or an approved (`frictionless`) [assessment](https://provenanceauth.com/docs/authorize/guides/assess-checkouts.md). Each pack is one evidence export on your bill.

```bash
export PROVENANCE_API=https://sandbox-api.provenanceauth.com
export PROVENANCE_KEY=prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x
```

## 1. Build the pack

Call [`POST /v1/authorize/checkout_approvals/{id}/evidence_packs`](https://provenanceauth.com/docs/api/evidence-packs.md#post-v1-authorize-checkout-approvals-id-evidence-packs) for a cart approval, or [`POST /v1/authorize/checkout_assessments/{id}/evidence_packs`](https://provenanceauth.com/docs/api/evidence-packs.md#post-v1-authorize-checkout-assessments-id-evidence-packs) for an assessment. Add up to 10 of your own fulfillment references; they're labelled as yours in the pack.

**curl**

```bash norun
curl -s -X POST $PROVENANCE_API/v1/authorize/checkout_approvals/$CHECKOUT_APPROVAL_ID/evidence_packs \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "references": [{ "kind": "tracking", "value": "1Z999AA10123456784" }] }'
```

**Node**

```ts
const pack = await prov.authorize.checkoutApprovals.createEvidencePack(approvalId, {
  references: [{ kind: "tracking", value: "1Z999AA10123456784" }],
});
```

**Python**

```python
pack = prov.authorize.checkout_approvals.create_evidence_pack(
    approval_id, references=[{"kind": "tracking", "value": "1Z999AA10123456784"}],
)
```

```json
{
  "object": "export",
  "id": "exp_01M6KH2Q4V9TBN3W7XYZ5A8C6D",
  "status": "ready",
  "source": { "checkout_approval_id": "coap_01M5WX3K8Q2V7N4T6YBA9RJ5DM", "assessment_id": null },
  "manifest_hash": "3f1c9a0d6b2e4f7a8c5d1e9b0a7f6c3d2e1b4a5c6d7e8f9a0b1c2d3e4f5a6b7c",
  "timestamp": { "status": "not_configured" },
  "file_count": 11,
  "download_url": "/v1/exports/exp_01M6KH2Q4V9TBN3W7XYZ5A8C6D/download",
  "expires_at": "2026-11-05T15:00:00.000Z"
}
```

## 2. Download it

`GET` the `download_url` with the same key within 24 hours. The zip holds:

| File | What it is |
| --- | --- |
| `summary.pdf` | One page for a reviewer: the cart, who approved, when, from where, the agent, and how to verify |
| `receipt.jws` | The signed receipt of the decision |
| `intent_token.jws` | The cart-bound token the person's approval minted |
| `binding.json` | The cart exactly as bound; its SHA-256 is the token's `payload_hash` |
| `signals.json` | How the person approved ([approval signals](https://provenanceauth.com/docs/authorize/concepts/approval-signals.md)), with the IP only as `ip_commitment` |
| `assessment.json` | The assessment, when one exists |
| `threeds.json` | The [bank check](https://provenanceauth.com/docs/authorize/guides/bank-check.md)'s 3-D Secure outcome, when one completed: your provider, the transaction status, ECI and authentication id, as you reported them |
| `references.json` | Your references, labelled as yours and not checked by us |
| `jwks.json` | Our public keys at export time |
| `manifest.json`, `evidence.jwt` | Every file's hash, and our ES256 signature over the manifest |
| `verify-bundle.mjs`, `VERIFY.txt` | The offline verifier, and the same steps for any JOSE library |

The summary shows the approving device's IP while we still hold it; after its retention it says "held by the store", with the commitment. The pack is a document: we send nothing to any card network or acquirer.

### Several orders in one zip

[`POST /v1/authorize/evidence_pack_batches`](https://provenanceauth.com/docs/api/evidence-packs.md#post-v1-authorize-evidence-pack-batches) builds one zip for up to 100 orders: checkout assessments, cart approvals and chargebacks together. Each order gets its own folder holding the same files as a single pack, so every folder verifies on its own. `index.json` at the top lists the folders and anything that could not be included. It bills one `evidence_export` per folder.

**curl**

```bash norun
curl -s -X POST $PROVENANCE_API/v1/authorize/evidence_pack_batches \
  -H "Authorization: Bearer $PROVENANCE_KEY" -H "Content-Type: application/json" \
  -d '{"checkout_assessment_ids":["cas_01M81CTCDNA4K8YYRSRJ6AS7CR"],"chargeback_ids":["chb_01M7ZC4K2R8T5W1Y3B6D9F0H2J"]}'
```

**Node**

```ts
const res = await fetch(`${process.env.PROVENANCE_API}/v1/authorize/evidence_pack_batches`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({
    checkout_assessment_ids: ["cas_01M81CTCDNA4K8YYRSRJ6AS7CR"],
    chargeback_ids: ["chb_01M7ZC4K2R8T5W1Y3B6D9F0H2J"],
  }),
});
const batch = await res.json();
```

**Python**

```python
import os, httpx

batch = httpx.post(
    f"{os.environ['PROVENANCE_API']}/v1/authorize/evidence_pack_batches",
    headers={"Authorization": f"Bearer {os.environ['PROVENANCE_KEY']}"},
    json={
        "checkout_assessment_ids": ["cas_01M81CTCDNA4K8YYRSRJ6AS7CR"],
        "chargeback_ids": ["chb_01M7ZC4K2R8T5W1Y3B6D9F0H2J"],
    },
).json()
```

The answer carries the `export` to download and one result per ID. An order with nothing to prove, or a chargeback no decision matched, is a `failed` result with the reason. In the console, tick rows on Orders or Chargebacks and choose **Download evidence**.

## 3. Check it yourself

Anyone can run the verifier with Node 18 or later, with no network and no key:

```bash norun
node verify-bundle.mjs --ip 203.0.113.7 --nonce xY3k9QpL2vN8tB4mW7sYdA
```

It checks every file against the manifest, our signature over the manifest in `evidence.jwt`, and the receipt and token signatures against `jwks.json`. It also checks that the token binds `binding.json`.

With `--ip` and `--nonce` it also checks the IP you hold against the commitment. Any change to any file makes it exit 1.

When the deployment has a timestamp authority configured, the manifest carries an RFC 3161 timestamp; otherwise `timestamp` says `not_configured`.

## Errors you might see

| Symptom | Cause | Fix |
| --- | --- | --- |
| `parameter_invalid` (400) on `id` | The cart approval isn't approved, or the assessment isn't approved (`frictionless`) | Build the pack once the person has approved. |
| `parameter_invalid` (400) on `id`: "no person approved it" | Your own Approve rule let the cart through with nothing covering it (`policy_rule_approved`, `covered: none`) | There is no person's approval to prove; the assessment's receipt records that your rule approved it. |
| `plan_required` (402) | Evidence packs are on Growth and above | Upgrade. |
| `resource_missing` (404) on the download | The download is past its 24 hours, or belongs to another account | Build a new pack. |

## See also

- [Respond to chargebacks automatically](https://provenanceauth.com/docs/authorize/guides/chargeback-responses.md)
- [3-D Secure for agentic commerce](https://provenanceauth.com/docs/authorize/guides/assess-checkouts.md)
- [Approval signals](https://provenanceauth.com/docs/authorize/concepts/approval-signals.md)
- [Ask your own customer](https://provenanceauth.com/docs/authorize/guides/ask-your-own-customer.md)
