Skip to main content
This walkthrough mirrors examples/01-hello-world in the monorepo: constructing the smallest valid BusinessTransaction and understanding each field before executing it.

1. Start the Runtime

From the root of the parmana monorepo:
npm run dev
This starts the API server locally (see packages/api/src/server.ts). Confirm it’s up:
curl http://localhost:3000/health
{ "status": "UP" }

2. Build a Business Transaction

A BusinessTransaction is the root object Parmana evaluates. At minimum it needs an authority, an authorization, an intent, a policy reference, and any runtime signals your policy will evaluate.
import { BusinessTransactionStatus } from "@parmana/shared";

const transaction = {
  businessTransactionId: "txn-001",

  metadata: {
    executionMode: "SYNC",
  },

  authority: {
    authorityId: "authority-1",
  },

  authorization: {
    authorizationId: "authz-1",
  },

  intent: {
    intentId: "intent-1",
    action: "vendor-payment",
  },

  policy: {
    name: "vendor-payment",
    version: "1.0.0",
  },

  signals: {
    amount: 2500,
    riskScore: 15,
  },

  status: BusinessTransactionStatus.RECEIVED,

  createdAt: new Date(),
};
This is the shape used by the runtime example directly (examples/01-hello-world). The REST API and SDK-facing BusinessTransaction model additionally nest metadata.businessTransactionId, correlationId, tenantId, sourceSystem, and submittedBy — see Concepts → Business Transaction for the full model.

3. Execute it

import { ParmanaClient } from "@parmana/sdk";

const client = new ParmanaClient({ endpoint: "http://localhost:3000" });

const trustRecord = await client.execute(transaction);
console.log(trustRecord.trustRecordId);
If the policy evaluation approves the transaction, Parmana returns an ExecutionTrustRecord containing the transaction, the execution, and (once available) verifications and receipts.

4. Verify and replay

const verification = await client.verify(transaction.businessTransactionId);
const replay = await client.replay(transaction.businessTransactionId);
verify confirms the recorded execution matches the trust record hash. replay deterministically re-evaluates the same policy against the same recorded signals and confirms the outcome is reproducible.

Next steps

Concepts

Understand each artifact in the trust chain.

REST API

Full endpoint reference.

Examples

Ten runnable examples, from hello-world to a full vendor payment workflow.

Guides

Task-oriented walkthroughs.