# prov.authorize.assessments.createEvidencePack

prov.authorize.assessments.createEvidencePack in Node SDK. A chargeback evidence pack for an allowed assessment, or one whose challenge was approved (Growth+).

## Signature

```ts
prov.authorize.assessments.createEvidencePack(id: string, params?: EvidencePackParams): Promise<EvidencePack>
```

## Parameters

- `id` (string)
- `params` (EvidencePackParams, optional)

## Returns

`Promise<EvidencePack>`

## HTTP operation

[`POST /v1/authorize/checkout_assessments/{id}/evidence_packs`](https://provenanceauth.com/docs/api/evidence-packs.md#post-v1-authorize-checkout-assessments-id-evidence-packs): Build an evidence pack from an assessment

## Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`insufficient_scope`](https://provenanceauth.com/docs/platform/errors.md#insufficient_scope)
- [`invalid_json`](https://provenanceauth.com/docs/platform/errors.md#invalid_json)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`plan_required`](https://provenanceauth.com/docs/platform/errors.md#plan_required)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)

## Example

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/intents`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({
    "action_description": "Checkout at harborbean.example: order ord_8814, USD 38.00",
    "action_payload": {
      "order_id": "ord_8814",
      "total": 3800,
      "currency": "usd",
      "merchant_id": "harborbean",
      "origin": "https://harborbean.example",
      "items": [
        {
          "sku": "mug-sage",
          "name": "Stoneware mug",
          "quantity": 2,
          "unit_amount": 1900
        }
      ]
    },
    "agent_session_id": "sess_reference_evidence",
    "device_id": "dev_00000000000000000000000000000001",
    "biometric_present": true,
    "audience": "https://harborbean.example"
  }),
})).json();
const intentToken = step1.intent_token;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/checkout_assessments`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x", "Content-Type": "application/json" },
  body: JSON.stringify({
    "cart": {
      "order_id": "ord_8814",
      "total": 3800,
      "currency": "USD",
      "merchant_id": "harborbean",
      "origin": "https://harborbean.example",
      "items": [
        {
          "sku": "mug-sage",
          "name": "Stoneware mug",
          "quantity": 2,
          "unit_amount": 1900
        }
      ]
    },
    "intent_token": intentToken
  }),
})).json();
const assessmentId = step2.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/checkout_assessments/${assessmentId}/evidence_packs`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x", "Content-Type": "application/json" },
  body: JSON.stringify({
    "references": [
      {
        "kind": "tracking",
        "value": "1Z999AA10123456784"
      },
      {
        "kind": "note",
        "value": "Delivered to the front door."
      }
    ]
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/intents", headers={"Authorization": f"Bearer {os.environ['PROVENANCE_KEY']}"}, json={
    "action_description": "Checkout at harborbean.example: order ord_8814, USD 38.00",
    "action_payload": {
        "order_id": "ord_8814",
        "total": 3800,
        "currency": "usd",
        "merchant_id": "harborbean",
        "origin": "https://harborbean.example",
        "items": [
            {
                "sku": "mug-sage",
                "name": "Stoneware mug",
                "quantity": 2,
                "unit_amount": 1900
            }
        ]
    },
    "agent_session_id": "sess_reference_evidence",
    "device_id": "dev_00000000000000000000000000000001",
    "biometric_present": True,
    "audience": "https://harborbean.example"
}).json()
intent_token = step1["intent_token"]
step2 = httpx.post(f"{api}/v1/authorize/checkout_assessments", headers={"Authorization": "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x"}, json={
    "cart": {
        "order_id": "ord_8814",
        "total": 3800,
        "currency": "USD",
        "merchant_id": "harborbean",
        "origin": "https://harborbean.example",
        "items": [
            {
                "sku": "mug-sage",
                "name": "Stoneware mug",
                "quantity": 2,
                "unit_amount": 1900
            }
        ]
    },
    "intent_token": intent_token
}).json()
assessment_id = step2["id"]
data = httpx.post(f"{api}/v1/authorize/checkout_assessments/{assessment_id}/evidence_packs", headers={"Authorization": "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x"}, json={
    "references": [
        {
            "kind": "tracking",
            "value": "1Z999AA10123456784"
        },
        {
            "kind": "note",
            "value": "Delivered to the front door."
        }
    ]
}).json()
```
