Skip to content

Quickstart

This takes about five minutes. You will create a test key, hash a customer identifier on your side, and score one transaction.

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.

Asqary never receives raw customer identifiers. You hash them with a key only you hold:

Terminal window
openssl rand -hex 32

Store the result in your secrets manager. See Identifier hashing for the rules.

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:

Terminal window
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"'" }
}'
{
"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_action is one of approve, step_up, manual_review or block. What you do with it is your decision.
  • reasons lists the rules that raised the score and how many points each added.
  • Store decision_id with your transaction so you can look it up and report its outcome later.
  • Scoring the same transaction.id again returns the original decision, so retries are safe.