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

# Quickstart: hold a demo payment

> Add the demo payment tool, apply the Payments template, watch a large payment get held, approve it as a second person, and verify the record offline. No real money moves.

You will send a simulated payment through the gateway, see it **held** for a person's approval, approve it as a second person, and check the record offline. The demo tool server moves no money and keeps no state. For your own payment tool, use [Protect a payment tool](https://docs.tracelane.dev/quickstart-approvals.md).

> [!NOTE]
>
> Approval holds for MCP tool calls are a **Preview** and are turned on per workspace. They are off by default; Step 2 turns them on. The approval record, signed when a signing key is configured, is also a Preview and has not yet been observed with a real approval in production.

## What you need

* A browser and an email address for [app.tracelane.dev](https://app.tracelane.dev/sign-in).
* `curl` and `uuidgen`.
* A second person with their own sign-in. The person who approves must differ from the person who sent the call, from the person who created the API key, and from the person who published the policy. A workspace on a plan with a single seat cannot add one: **Settings → People & access** shows your seat limit.

## Step 1: Create a workspace

Open [app.tracelane.dev/sign-in](https://app.tracelane.dev/sign-in) and sign in. Your first sign-in creates a personal workspace. See [Onboarding](https://docs.tracelane.dev/onboarding.md).

## Step 2: Turn on action control

Open **Settings → Workspace**. Under **Action control (preview)**, choose **Turn on action control** and confirm. Only owners and admins can change it. It applies to this workspace only and usually takes effect within 15 minutes; until then the first call below may not be held.

## Step 3: Create an API key with the MCP scope

Open **Settings → Keys → Agent keys**, choose **Create API key** and give it the **MCP** scope. A key made before scopes existed does not have it. Copy the key once and keep it as `TRACELANE_API_KEY`.

## Step 4: Add the demo tool server

Open **Agents & tools → MCP servers** and choose **Add server**:

| Field | Value |
| - | - |
| Server name | `Demo payments` |
| Endpoint slug | `demo-payments` |
| Upstream URL | `https://app.tracelane.dev/api/demo-mcp` |
| Transport | **Streamable HTTP** |
| Upstream authentication | **No credential** |

The page then shows **Gateway endpoint: `/v1/mcp/demo-payments`**. The demo server lists three tools: `release_payment`, `lookup_customer` and `export_customers`. All three are simulated.

## Step 5: Publish the Payments template

Open **Rules**, choose **Start from a template**, then **Payments**, and set:

| Field | Value |
| - | - |
| Tool server | `Demo payments` |
| Tool name | `release_payment` |
| Currency the tool pays in | `USD` |
| Hold payments above | `5000` |
| The tool's amount is in | `Smallest unit of USD` (an amount of 1500 is 15 dollars) |
| Approved beneficiaries | `acme-ltd` |

Leave the rest as it is, then choose **Publish policy** and confirm. The policy allows a payment up to the limit to an approved beneficiary, holds a larger one for approval of that exact payment, and denies any other beneficiary.

## Step 6: Send a payment above the limit

750000 cents is 7,500 dollars, above the 5,000 dollar limit. A protected tool needs an `Idempotency-Key` header holding a UUID; keep the same one for the retry.

```bash theme={"system"}
export TRACELANE_API_KEY=<the key from Step 3>
KEY=$(uuidgen)

curl -i -X POST https://gateway.tracelane.dev/v1/mcp/demo-payments \
  -H "Authorization: Bearer $TRACELANE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Idempotency-Key: $KEY" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call",
       "params":{"name":"release_payment",
                 "arguments":{"amount":750000,"currency":"USD","beneficiary":"acme-ltd"}}}'
```

The gateway holds the call and answers `409` instead of the tool result:

```json theme={"system"}
{ "error": "approval_required", "approval_id": "<uuid>", "expires_at": "<time>" }
```

That answer is the first held call. The demo server has not been asked to release anything.

## Step 7: Approve as a second person

Invite the second person from **Settings → People & access**. They open **Approvals**, find the pending request in the **Approval queue**, and choose **Approve**. Approving needs a recent sign-in, and a tenant API key cannot approve.

**Deny** is always available. A held call always keeps a minimized preview of its arguments for the approver, so this flow has no blind approve.

If the requester, the key's creator or the policy's publisher tries to approve, the gateway refuses with `403 separation_required`. This separation cannot be turned off for a policy-held call.

## Step 8: Retry the same call

Run the Step 6 command again with the same `$KEY` and the same body, before `expires_at`. An approved request can be used once. The demo server answers with text like:

```text theme={"system"}
Simulated: payment of 7500.00 USD to acme-ltd issued as demo receipt <uuid>. No money moved.
```

A different body under the same key is refused as `idempotency_mismatch`.

## Step 9: Verify offline

Approval decisions on the default path are written to the workspace's hash-chained ledger. Export a range that covers the test, then check it on your own machine with the open-source verifier. There is no pre-built binary yet, so build it from source:

```bash theme={"system"}
git clone https://github.com/tracelane/tracelane.git
cd tracelane
cargo build --release -p tracelane-audit

./target/release/tracelane-audit verify \
  --file ./audit.ndjson \
  --tenant-pubkey <workspace public key>
```

Get the public key from **Evidence → Signing key** or `GET /v1/audit/pubkey`, never from the export you are checking. Only exit code `0` is a pass. Exit code `3` means the chain is consistent but no public anchor covers it yet, which is expected for a new workspace. Details: [Verifier CLI](https://docs.tracelane.dev/audit/verifier-cli.md) and [Audit ledger](https://docs.tracelane.dev/audit-ledger.md).

## Limits

The demo server is public, simulated and stateless. Protected tools need the Streamable HTTP transport and an `Idempotency-Key`. The Payments template takes one currency per tool and never converts between currencies. One retry after approval, and only before `expires_at`. Holds are a Preview.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.