Skip to content

Quickstart — Fraud scoring

From credentials to a first successful ML (or rule) prediction.

Prerequisites

  1. RS256 key pair exchanged for your environment — Auth tutorial.
  2. Tenant id issued.
  3. Base URL — Base URLs (local confirmed; cloud = owner decision).

Steps

  1. Mint a JWT (iss=software-service, aud=ai-service, short exp).
  2. POST {fraud_ml_base}/call-and-predict with:
POST /call-and-predict HTTP/1.1
Authorization: ApiKey <jwt>
x-tenant-id: <tenant>
Content-Type: application/json
{
  "timestamp": "2024-12-31 21:55:44",
  "type": "transaction",
  "event": {
    "transaction": {
      "id": "5753ed0f-7c8e-4bdc-8056-d8dd50fc1db0",
      "time": "21:55:44",
      "date": "2024-12-31",
      "amount": 26130.92,
      "currency": "NGN",
      "description": "Boutique purchase",
      "type": "bill payment",
      "channel": "WEB"
    },
    "user": { "user_id": "user-001" },
    "merchant": { "id": "m-1", "name": "Example Merchant" },
    "location": { "country": "NG" },
    "account": {}
  }
}
  1. For cold start (no baseline profile), omit lastCheckReport or call the rule service instead — see examples.

Observable success

Signal Meaning
HTTP 200 with prediction.probability_score (ML) or prediction.flagged/score (rules) Scoring succeeded
Later: report on your create-report endpoint Async handoff succeeded (separate from scoring)

A 200 score does not guarantee a dashboard report — see TM lifecycle.

If it fails

Status Likely cause
401 JWT scheme/claims/key — auth tutorial
422 Missing x-tenant-id or body validation

Next: Fraud examples · Report callback · OpenAPI