Send unclear cases to a person
Built and tested, not yet deployed. Early access.
On this page
The pattern
- Call the decision.
- If
abstainis true, put the case in your review queue with itsreasons. - Otherwise apply
answer.
Code
base and key are set as in the Quickstart.
// sendToReview and applyDecision are your own functions const payload = { merchant: "LUCKY COINS LLC", mcc: "5816" }; const res = await fetch(`${base}/v1/understand`, { method: "POST", headers: { Authorization: `Bearer ${key}`, "Content-Type": "application/json", }, body: JSON.stringify({ decision: "restricted_merchant", input: payload }), }); const result = await res.json(); if (!res.ok) throw new Error(`${res.status}: ${result.error.message}`); if (result.abstain) { await sendToReview({ decision: result.decision, reasons: result.reasons, input: payload }); } else { await applyDecision(result.answer); }
# send_to_review and apply_decision are your own functions payload = {"merchant": "LUCKY COINS LLC", "mcc": "5816"} res = requests.post( f"{base}/v1/understand", headers={"Authorization": f"Bearer {key}"}, json={"decision": "restricted_merchant", "input": payload}, timeout=10, ) result = res.json() if not res.ok: raise RuntimeError(f"{res.status_code}: {result['error']['message']}") if result["abstain"]: send_to_review(decision=result["decision"], reasons=result["reasons"], input=payload) else: apply_decision(result["answer"])
Log the reasons and the rate
Store reasons with each case. Review cases with rule_differs first: there the model and our engine disagree.
Count abstains per decision on your own traffic before you move the line.
Don’t build adverse action on it
An answer is an input to your process, not a credit decision. What it isn’t for
# Send unclear cases to a person
Built and tested, not yet deployed. Early access.
## The pattern
1. Call the decision.
2. If `abstain` is true, put the case in your review queue with its `reasons`.
3. Otherwise apply `answer`.
## Code
`base` and `key` are set as in the [Quickstart](/api/docs/quickstart).
The review pattern in TypeScript:
```typescript
// sendToReview and applyDecision are your own functions
const payload = { merchant: "LUCKY COINS LLC", mcc: "5816" };
const res = await fetch(`${base}/v1/understand`, {
method: "POST",
headers: {
Authorization: `Bearer ${key}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ decision: "restricted_merchant", input: payload }),
});
const result = await res.json();
if (!res.ok) throw new Error(`${res.status}: ${result.error.message}`);
if (result.abstain) {
await sendToReview({ decision: result.decision, reasons: result.reasons, input: payload });
} else {
await applyDecision(result.answer);
}
```
The review pattern in Python:
```python
# send_to_review and apply_decision are your own functions
payload = {"merchant": "LUCKY COINS LLC", "mcc": "5816"}
res = requests.post(
f"{base}/v1/understand",
headers={"Authorization": f"Bearer {key}"},
json={"decision": "restricted_merchant", "input": payload},
timeout=10,
)
result = res.json()
if not res.ok:
raise RuntimeError(f"{res.status_code}: {result['error']['message']}")
if result["abstain"]:
send_to_review(decision=result["decision"], reasons=result["reasons"], input=payload)
else:
apply_decision(result["answer"])
```
## Log the reasons and the rate
Store `reasons` with each case. Review cases with `rule_differs` first: there the model and our engine disagree.
Count abstains per decision on your own traffic before you move the line.
## Don’t build adverse action on it
An answer is an input to your process, not a credit decision. [What it isn’t for](/api/docs/use)
Source: /api/docs/guides/review-queue