# prov.authorize.issuer.decisions.review

prov.authorize.issuer.decisions.review in Node SDK. Slice 8: "Right call" or "Should have approved" on a decline or an ask, once (409 `issuer_review_not_open`).

## Signature

```ts
prov.authorize.issuer.decisions.review(id: string, verdict: IssuerReviewVerdict, note?: string | null): Promise<IssuerDecision>
```

## Parameters

- `id` (string)
- `verdict` (IssuerReviewVerdict)
- `note` (string | null, optional)

## Returns

`Promise<IssuerDecision>`

## HTTP operation

[`POST /v1/authorize/issuer_decisions/{id}/review`](https://provenanceauth.com/docs/api/issuer-controls.md#post-v1-authorize-issuer-decisions-id-review): Review an issuer decline

## Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`insufficient_scope`](https://provenanceauth.com/docs/platform/errors.md#insufficient_scope)
- [`issuer_review_not_open`](https://provenanceauth.com/docs/platform/errors.md#issuer_review_not_open)
- [`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/authorize/issuer_programs`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x", "Content-Type": "application/json" },
  body: JSON.stringify({
    "name": "Fernhill agent cards",
    "processor": "lithic",
    "mode": "live"
  }),
})).json();
const program = step1.id;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/issuer_policies/${program}`, {
  method: "PUT",
  headers: { Authorization: "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x", "Content-Type": "application/json" },
  body: JSON.stringify({
    "document": {
      "rules": [
        {
          "label": "No gambling",
          "when": [
            {
              "fact": "auth.mcc",
              "op": "eq",
              "value": "7995"
            }
          ],
          "require": {
            "deny": true
          }
        }
      ]
    }
  }),
})).json();
const step3 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/issuer_decisions`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x", "Content-Type": "application/json" },
  body: JSON.stringify({
    "program_id": program,
    "authorization_id": "auth_9Kd3",
    "amount": 4000,
    "currency": "USD",
    "card": {
      "token": "card_tok_fernhill_3",
      "last4": "4417"
    },
    "merchant": {
      "mcc": "7995",
      "id": "mid_lucky_lanes",
      "name": "Lucky Lanes",
      "country": "US"
    },
    "token": {
      "requestor_id": "40010030273",
      "requestor_type": "AI_AGENT"
    }
  }),
})).json();
const decision = step3.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/issuer_decisions/${decision}/review`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x", "Content-Type": "application/json" },
  body: JSON.stringify({
    "verdict": "should_have_approved",
    "note": "The cardholder buys from this shop every month."
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/authorize/issuer_programs", headers={"Authorization": "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x"}, json={
    "name": "Fernhill agent cards",
    "processor": "lithic",
    "mode": "live"
}).json()
program = step1["id"]
step2 = httpx.put(f"{api}/v1/authorize/issuer_policies/{program}", headers={"Authorization": "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x"}, json={
    "document": {
        "rules": [
            {
                "label": "No gambling",
                "when": [
                    {
                        "fact": "auth.mcc",
                        "op": "eq",
                        "value": "7995"
                    }
                ],
                "require": {
                    "deny": True
                }
            }
        ]
    }
}).json()
step3 = httpx.post(f"{api}/v1/authorize/issuer_decisions", headers={"Authorization": "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x"}, json={
    "program_id": program,
    "authorization_id": "auth_9Kd3",
    "amount": 4000,
    "currency": "USD",
    "card": {
        "token": "card_tok_fernhill_3",
        "last4": "4417"
    },
    "merchant": {
        "mcc": "7995",
        "id": "mid_lucky_lanes",
        "name": "Lucky Lanes",
        "country": "US"
    },
    "token": {
        "requestor_id": "40010030273",
        "requestor_type": "AI_AGENT"
    }
}).json()
decision = step3["id"]
data = httpx.post(f"{api}/v1/authorize/issuer_decisions/{decision}/review", headers={"Authorization": "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x"}, json={
    "verdict": "should_have_approved",
    "note": "The cardholder buys from this shop every month."
}).json()
```
