Understanding API docs
One endpoint for bounded money decisions. Send a decision and its input; get back an answer, its probability, reason codes and a flag that hands unclear cases to a person.
Built and tested, not yet deployed. Early access.
On this page
An example call
curl "$UNDERSTANDING_API_URL/v1/understand" \ -H "Authorization: Bearer $UNDERSTANDING_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "decision": "restricted_merchant", "input": { "merchant": "DRAFTKINGS", "mcc": "7995" } }'
const base = process.env.UNDERSTANDING_API_URL; const key = process.env.UNDERSTANDING_API_KEY; const body = { decision: "restricted_merchant", input: { merchant: "DRAFTKINGS", mcc: "7995" }, }; const res = await fetch(`${base}/v1/understand`, { method: "POST", headers: { Authorization: `Bearer ${key}`, "Content-Type": "application/json", }, body: JSON.stringify(body), }); const result = await res.json();
import os import requests base = os.environ["UNDERSTANDING_API_URL"] key = os.environ["UNDERSTANDING_API_KEY"] body = { "decision": "restricted_merchant", "input": {"merchant": "DRAFTKINGS", "mcc": "7995"}, } res = requests.post( f"{base}/v1/understand", headers={"Authorization": f"Bearer {key}"}, json=body, timeout=10, ) result = res.json()
{ "decision": "restricted_merchant", "type": "predicate", "answer": true, "probability": 0.97, "reasons": [ "mcc_7995", "rule_gambling_category", "kind_sportsbook" ], "abstain": false }
Start here
Decisions
| Decision | What it answers | Answers |
|---|---|---|
| Restricted merchant | Is this merchant a gambling or wagering business? | true or false |
| Spend type | Is spending in this category essential, discretionary or neutral? | essential, discretionary or neutral |
| Receipt to charge | Which one card charge paid for this receipt? | a transaction id, or "none" |
| Refund to purchase | Which transaction refunds this purchase? | a transaction id, or "none" |
Connect
Reference
More resources
# Understanding API docs
One endpoint for bounded money decisions. Send a decision and its input; get back an answer, its probability, reason codes and a flag that hands unclear cases to a person.
Built and tested, not yet deployed. Early access.
## An example call
The request in cURL:
```bash
curl "$UNDERSTANDING_API_URL/v1/understand" \
-H "Authorization: Bearer $UNDERSTANDING_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"decision": "restricted_merchant",
"input": { "merchant": "DRAFTKINGS", "mcc": "7995" }
}'
```
The request in TypeScript:
```typescript
const base = process.env.UNDERSTANDING_API_URL;
const key = process.env.UNDERSTANDING_API_KEY;
const body = {
decision: "restricted_merchant",
input: { merchant: "DRAFTKINGS", mcc: "7995" },
};
const res = await fetch(`${base}/v1/understand`, {
method: "POST",
headers: {
Authorization: `Bearer ${key}`,
"Content-Type": "application/json",
},
body: JSON.stringify(body),
});
const result = await res.json();
```
The request in Python:
```python
import os
import requests
base = os.environ["UNDERSTANDING_API_URL"]
key = os.environ["UNDERSTANDING_API_KEY"]
body = {
"decision": "restricted_merchant",
"input": {"merchant": "DRAFTKINGS", "mcc": "7995"},
}
res = requests.post(
f"{base}/v1/understand",
headers={"Authorization": f"Bearer {key}"},
json=body,
timeout=10,
)
result = res.json()
```
Response: 200 OK (the probability is a stand-in)
```json
{
"decision": "restricted_merchant",
"type": "predicate",
"answer": true,
"probability": 0.97,
"reasons": [
"mcc_7995",
"rule_gambling_category",
"kind_sportsbook"
],
"abstain": false
}
```
## Start here
- [Quickstart](/api/docs/quickstart)
- [Keys and authentication](/api/docs/authentication)
- [The answer](/api/docs/answer)
## Decisions
| Decision | What it answers | Answers |
| --- | --- | --- |
| [Restricted merchant](/api/docs/decisions/restricted-merchant) | Is this merchant a gambling or wagering business? | `true` or `false` |
| [Spend type](/api/docs/decisions/spend-type) | Is spending in this category essential, discretionary or neutral? | `essential`, `discretionary` or `neutral` |
| [Receipt to charge](/api/docs/decisions/receipt-match) | Which one card charge paid for this receipt? | a transaction `id`, or `"none"` |
| [Refund to purchase](/api/docs/decisions/refund-pairing) | Which transaction refunds this purchase? | a transaction `id`, or `"none"` |
[Five more are built](/api/docs/decisions#newer)
## Connect
- [Connect an MCP client](/api/docs/guides/mcp)
- [Where it plugs in](/api/docs/integrations)
- [Batch requests and idempotency](/api/docs/guides/batch)
## Reference
- [POST /v1/understand](/api/docs/reference)
- [Errors](/api/docs/errors)
- [Limits](/api/docs/limits)
## More resources
- [Types](/api/docs/types)
- [What it isn’t for](/api/docs/use)
- [Pricing](/api/docs/pricing)
Source: /api/docs