> ## Documentation Index
> Fetch the complete documentation index at: https://docs.manthan.systems/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Run your first Business Transaction against the Parmana Runtime

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:

```bash theme={null}
npm run dev
```

This starts the API server locally (see `packages/api/src/server.ts`). Confirm it's up:

```bash theme={null}
curl http://localhost:3000/health
```

```json theme={null}
{ "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.

```ts theme={null}
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(),
};
```

<Note>
  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](/docs/concepts/business-transaction) for the full model.
</Note>

## 3. Execute it

<CodeGroup>
  ```ts TypeScript SDK theme={null}
  import { ParmanaClient } from "@parmana/sdk";

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

  const trustRecord = await client.execute(transaction);
  console.log(trustRecord.trustRecordId);
  ```

  ```python Python SDK theme={null}
  from parmana import ParmanaClient

  client = ParmanaClient(endpoint="http://localhost:3000")

  trust_record = client.execution.execute(transaction)
  print(trust_record.trust_record_id)
  ```

  ```bash curl theme={null}
  curl -X POST http://localhost:3000/execute \
    -H "Content-Type: application/json" \
    -d @transaction.json
  ```
</CodeGroup>

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

```ts theme={null}
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

<CardGroup cols={2}>
  <Card title="Concepts" href="/docs/concepts/overview" icon="brain">
    Understand each artifact in the trust chain.
  </Card>

  <Card title="REST API" href="/docs/api/overview" icon="server">
    Full endpoint reference.
  </Card>

  <Card title="Examples" href="/docs/examples/overview" icon="flask">
    Ten runnable examples, from hello-world to a full vendor payment workflow.
  </Card>

  <Card title="Guides" href="/docs/guides/basic-execution" icon="map">
    Task-oriented walkthroughs.
  </Card>
</CardGroup>
