Skip to main content
All Docs
FeaturesPurple PepperUpdated April 6, 2026

AML Credit Ledger & Calmony Pay Integration

AML Credit Ledger & Calmony Pay Integration

The AML Credits system lets your organisation purchase and consume credits for AML/KYC identity checks powered by the Blinc-UK provider. Credits are bought via Calmony Pay and tracked in a full audit ledger per organisation.

Getting Started

1. Configure Environment Variables

Before AML checks can be run, set the following environment variables:

# Blinc-UK provider
BLINC_UK_API_KEY=your_blinc_api_key
BLINC_UK_API_URL=https://api.blinc-uk.com
BLINC_UK_WEBHOOK_SECRET=your_webhook_secret

# Calmony Pay (credit purchasing)
CALMONY_PAY_SECRET_KEY=your_calmony_secret_key

Credits can be purchased in advance even if the Blinc-UK integration is not yet configured. The dashboard will display a warning if BLINC_UK_API_KEY is missing.


Dashboard

Navigate to Dashboard → AML Credits (/dashboard/aml).

Balance Card

Shows the current credit balance for your organisation in real time.

Integration Status

Displays a green/red indicator based on whether the Blinc-UK API key is configured.

Low-Balance Warning

A warning is shown automatically when your balance drops below 5 credits.


Purchasing Credits

  1. Click Purchase Credits on the AML Credits dashboard.
  2. Select a credit pack from the modal.
  3. You will be redirected to a hosted Calmony Pay checkout.
  4. On successful payment you are returned to the dashboard; credits are automatically added to your balance.
  5. If you cancel the checkout, no credits are charged or added.

Available Credit Packs

PackCreditsPricePer Credit
Starter10£50.00£5.00
Standard25£112.50£4.50
Professional50£200.00£4.00
Enterprise100£350.00£3.50

Volume discounts apply automatically — larger packs have a lower cost per credit.


Transaction History

All credit movements are recorded and viewable in the Transaction History table on the AML Credits page.

Transaction Types

TypeDescription
purchaseCredits added via a Calmony Pay checkout
consumption1 credit consumed per AML check initiated
refundCredit returned when a check is cancelled
adjustmentManual admin top-up or correction

The table shows:

  • Transaction type (colour-coded badge)
  • Credit amount (positive = credit added, negative = credit consumed)
  • Running balance after each transaction
  • Description
  • Timestamp (relative)

Use the type filter dropdown to narrow the view to a specific transaction type. History is paginated in pages of 20.


tRPC API Reference

All procedures are under the aml router (trpc.aml.*).

getBalance

Returns the current credit balance for the authenticated organisation.

const { data } = trpc.aml.getBalance.useQuery();
// data.balance: number

getCreditPacks

Returns the list of available credit packs with pricing.

const { data } = trpc.aml.getCreditPacks.useQuery();
// data: Array<{ id, name, credits, priceGBP, perCreditGBP }>

purchaseCredits

Creates a Calmony Pay checkout session. The client should redirect to the returned URL.

const mutation = trpc.aml.purchaseCredits.useMutation();
mutation.mutate({ packId: '25-credits' });
// returns: { checkoutUrl: string }

fulfilPurchase

Called automatically on successful payment return. Adds credits and records the purchase in the audit ledger.

const mutation = trpc.aml.fulfilPurchase.useMutation();
mutation.mutate({ packId: '25-credits' });

creditHistory

Paginated transaction ledger, optionally filtered by type.

const { data } = trpc.aml.creditHistory.useQuery({
  type: 'purchase', // optional: 'purchase' | 'consumption' | 'refund' | 'adjustment'
  cursor: '...', // optional: pagination cursor
  limit: 20,
});
// data: { items: Transaction[], nextCursor?: string }

initiateCheck

Consumes 1 credit and dispatches an AML check via Blinc-UK.

cancelCheck

Cancels an in-progress check and refunds 1 credit.

integrationStatus

Returns whether the Blinc-UK provider is configured.

const { data } = trpc.aml.integrationStatus.useQuery();
// data: { configured: boolean, provider: string }

Notes

  • All credit operations are scoped per organisation — balances are not shared between orgs.
  • Credits do not expire.
  • The audit ledger (creditHistory) is append-only; no transactions are deleted.