Transactions: Persona's API-first object for KYB and other
server-side checks. You create a transaction of a transaction type
configured in the dashboard (e.g. a KYB type), with the business and
its associated people in fields; Persona workflows then run the
business reports, verify owners and open a case, and move the
transaction's status (by default created, approved, declined,
needs_review, errored; statuses are configurable per type).
Functions
create-transaction
fn (transaction-type-id: Str, fields: Map): Map
fn (transaction-type-id: Str, fields: Map, opts: Map): Map
fn (transaction-type-id: Str, fields: Map, opts: Map, options: Map): Map
POST /transactions - Create a transaction of type transaction-type-id
(txntp_...). fields holds the inputs configured on the type, e.g.
for KYB {business_name, business_tax_identification_number, business_registered_address: {street_1, city, subdivision, postal_code, country_code}, associated_people: [...]}. opts: reference-id,
tags. In sandbox, fields.debug: "passed" | "failed" forces the
outcome.
Example
txn ::persona::transactions/create-transaction("txntp_...", {
business_name: "Acme Robotics LLC",
business_registered_address: {street_1: "1 Main St", city: "Austin", subdivision: "TX", postal_code: "78701", country_code: "US"}
}, {reference-id: "biz-42"}, {idempotency-key: "biz-42-kyb"})
get-transaction
fn (transaction-id: Str): Map
fn (transaction-id: Str, opts: Map): Map
fn (transaction-id: Str, opts: Map, options: Map): Map
GET /transactions/{id} - Retrieve a transaction. opts takes include
(e.g. ["related-objects"]) and fields.
Example
txn ::persona::transactions/get-transaction("txn_123", {include: ["related-objects"]})
::persona::api/attr(txn, "status")
is-done
fn (doc: Any): Bool
True when a transaction left created/pending: Persona's workflows
have set a decision or an error.
Example
::persona::transactions/is-done({data: {id: "txn_1", type: "transaction", attributes: {status: "needs_review"}}}) // true
::persona::transactions/is-done({data: {id: "txn_2", type: "transaction", attributes: {status: "created"}}}) // false
label-transaction
fn (transaction-id: Str, label: Str): Map
fn (transaction-id: Str, label: Str, opts: Map): Map
fn (transaction-id: Str, label: Str, opts: Map, options: Map): Map
POST /transactions/{id}/label - Record a label (e.g. "fraud",
"legitimate"), with optional score and model-version in opts.
Example
::persona::transactions/label-transaction("txn_123", "legitimate")
// With a model score
::persona::transactions/label-transaction("txn_123", "fraud", {score: 0.92, model-version: "2026-11"})
list-transactions
fn (filters: Map): Map
fn (filters: Map, opts: Map): Map
fn (filters: Map, opts: Map, options: Map): Map
GET /transactions - One page of transactions. Filters: reference-id,
transaction-type-id. opts takes page-size, after, before.
Example
page ::persona::transactions/list-transactions({reference-id: "biz-42"}, {page-size: 25})
map(page.data, %.id)
redact-transaction
fn (transaction-id: Str): Map
fn (transaction-id: Str, options: Map): Map
DELETE /transactions/{id} - Permanently remove a transaction's PII.
Example
::persona::transactions/redact-transaction("txn_123")
update-transaction
fn (transaction-id: Str, attributes: Map): Map
fn (transaction-id: Str, attributes: Map, options: Map): Map
PATCH /transactions/{id} - Update fields, status (one configured on
the type), reference-id or tags. Send field and status changes one
after another, not in parallel (Persona returns 409).
Example
::persona::transactions/update-transaction("txn_123", {status: "approved"})