Quickstart
This takes about five minutes. You will create a test key, hash a customer identifier on your side, and score one transaction.
1. Get a test API key
Section titled “1. Get a test API key”Sign in to the dashboard with an email link, create your organization, and copy the test API key (asq_test_…). Test keys use test data, which never mixes with live data.
Keep the key on your server. Never put it in a mobile app or a browser.
2. Create an identifier key
Section titled “2. Create an identifier key”Asqary never receives raw customer identifiers. You hash them with a key only you hold:
openssl rand -hex 32Store the result in your secrets manager. See Identifier hashing for the rules.
3. Score a transaction
Section titled “3. Score a transaction”With the Node.js SDK, which hashes identifiers for you:
import { Asqary } from "@twalle/asqary";
const asqary = new Asqary(); // reads ASQARY_API_KEY and ASQARY_IDENTIFIER_KEY
const decision = await asqary.score({ transactionId: "loan_1001", type: "loan_disbursement", amount: 5_000_000, // minor units: ₦50,000.00 currency: "NGN", occurredAt: new Date(), customerId: "customer_456",});
console.log(decision.score, decision.riskLevel, decision.recommendedAction);Or with any HTTP client. Here $CUSTOMER_HASH is the HMAC-SHA256 hex of the customer ID:
curl -X POST https://api-staging.asqary.com/v1/score \ -H "Authorization: Bearer $ASQARY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "transaction": { "id": "loan_1001", "type": "loan_disbursement", "amount": 5000000, "currency": "NGN", "occurred_at": "2026-09-27T10:15:00Z" }, "customer": { "id_hash": "'"$CUSTOMER_HASH"'" } }'4. Read the decision
Section titled “4. Read the decision”{ "decision_id": "dec_01a0e30da731725886aab649d88d2f04", "transaction_id": "loan_1001", "score": 74, "risk_level": "high", "confidence": 100, "recommended_action": "manual_review", "reasons": [ { "code": "amount_anomaly", "contribution": 25, "message": "Amount is 10.0× the customer's typical amount" } ], "policy": { "id": "pol_…", "version": 1, "version_id": "plv_…" }, "environment": "test"}recommended_actionis one ofapprove,step_up,manual_revieworblock. What you do with it is your decision.reasonslists the rules that raised the score and how many points each added.- Store
decision_idwith your transaction so you can look it up and report its outcome later. - Scoring the same
transaction.idagain returns the original decision, so retries are safe.
Next steps
Section titled “Next steps”- How scoring works
- Backtest a policy on your historical transactions before you change anything live.
- Receive webhooks instead of polling.