Skip to main content

Transaction checks

A transaction check screens one transaction from the point of view of your customer: the money they received in a deposit, or the money they are sending in a withdrawal. It uses the same endpoint, the same scope (checks:write) and the same verdict as an address check, so read that page for every field of the response.

Request​

FieldRequiredDescription
subjectyes"transaction".
assetyesAn asset symbol exactly as listed in Supported assets.
tx_hashyesThe transaction hash, at most 160 characters. Its shape must be valid for the asset.
directionyes"deposit" when your customer receives the funds, "withdrawal" when your customer sends them.
addresssometimesYour customer's address in the transaction, at most 160 characters. See the next section.

Unknown fields are rejected. As with every check, send an Idempotency-Key so a retry cannot screen or charge twice; see Idempotency.

The customer's address​

address is your customer's address in the transaction: the recipient of a deposit, the sender of a withdrawal.

  • On TRX, ETH, BNB and BASE you may leave it out. The API reads the transaction and uses the recipient for a deposit and the sender for a withdrawal. Quota, balance and capacity are checked first, so a refused account drives no lookups.
  • On every other asset it is required, and a request without it answers 422 ADDRESS_REQUIRED. Supported assets shows the assets that can derive it.
  • Sandbox keys always need it. A transaction check under a sandbox key without address also answers ADDRESS_REQUIRED; see Sandbox and live.
  • If you send it, it is used as given. Nothing is derived.

The verdict pins the address that was used: the address field of the response, the evidence report and a rederive all carry it, whether you sent it or the API derived it. Check the address field against your own records if you rely on the derived value.

When the address is left out and the transaction cannot be read, the request answers 422 TRANSACTION_UNRESOLVED. That happens when the hash does not exist on that network, when the recipient of a deposit cannot be decoded, or when the chain data source did not answer in time. Nothing is accepted and nothing is charged. Check the hash and the network, retry, or send the address yourself.

Examples​

A TRON deposit with the address left out, and an Ethereum withdrawal with the address supplied.

# TRON deposit, address derived from the transaction
curl -s -X POST https://api.leeri.ai/v1/checks \
-H "Authorization: Bearer $LEERI_API_KEY" \
-H "Idempotency-Key: deposit-2291" \
-H "Content-Type: application/json" \
-d '{"subject":"transaction","asset":"TRX","tx_hash":"'"$TX_HASH"'","direction":"deposit"}'

# Ethereum withdrawal, address supplied
curl -s -X POST https://api.leeri.ai/v1/checks \
-H "Authorization: Bearer $LEERI_API_KEY" \
-H "Idempotency-Key: payout-5530" \
-H "Content-Type: application/json" \
-d '{"subject":"transaction","asset":"ETH","tx_hash":"'"$ETH_TX_HASH"'","direction":"withdrawal","address":"'"$ADDRESS"'"}'

What the response adds​

The response is the same CheckView an address check returns, so status can be completed or pending; see Pending and polling. For a transaction check these fields are filled:

FieldMeaning
subjecttransaction.
tx_hashThe transaction that was screened.
directiondeposit or withdrawal, as you sent it.
addressThe customer address that was used, sent or derived.
amountThe amount of the transaction as a decimal string, never a float. null when it is not known.
risky_volume_usdThe USD value of the transaction's flow that was tied to risky counterparties, as a decimal string. null until the check completes.

Checking an address you were already charged for on the same chain in the last 7 days is free, also when you screen it as a transaction; see Rate limits and quotas.

Errors​

Everything in Address checks applies, plus:

StatusCodeWhen
422ADDRESS_REQUIREDaddress left out for an asset that cannot derive it, or under a sandbox key.
422TRANSACTION_UNRESOLVEDaddress left out and the transaction could not be read. Never charged.
400VALIDATION_ERRORA tx_hash, direction or address with an invalid shape, or an unknown field.

Items of a batch always send address, because a batch is accepted without reading any chain.