> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://docs.navalabs.ai/api/mcp` to find what you need.

# default

## The buyer’s current spending policy, so purchases can be planned within it.

`GET /muse/v1/policy`

### Responses

#### `200`: Policy summary with guidance.

### Example request

```bash
curl https://api.example.navalabs.ai/muse/v1/policy
```

```ts
fetch('https://api.example.navalabs.ai/muse/v1/policy')
```

## Check a proposed basket against the buyer’s policy. Call before checkout and after every basket change.

`POST /muse/v1/assessments`

### Request body (required) (`application/json`)

- `merchant` `string`: Store or merchant name.
- `merchant_domain` `string`: Bare merchant domain, e.g. walmart.com. Required to evaluate a merchant allowlist. Matched exactly after trimming, lowercasing and removing a leading www.; other subdomains are distinct. Connector-reported and unverified.
- `currency` `string`: ISO 4217 code, e.g. USD.
- `items` `object[]`
  - `name` `string`
  - `product_url` `string`: Link to the product page at the store.
  - `product_id` `string`: Store product ID, SKU, or variant ID.
  - `quantity` `integer`
  - `unit_price` `string`: A money amount like "9.50". Strings avoid float drift.
  - `category` `string`: Product category, e.g. "kitchen" or "alcohol".
- `costs` `object`
  - `subtotal` `string`: A money amount like "9.50". Strings avoid float drift.
  - `discount` `string`: A money amount like "9.50". Strings avoid float drift.
  - `shipping` `string`: A money amount like "9.50". Strings avoid float drift.
  - `tax` `string`: A money amount like "9.50". Strings avoid float drift.
  - `total` `string`: A money amount like "9.50". Strings avoid float drift.

### Responses

#### `200`: Assessment result.

Body (`application/json`):

- `assessmentId` `string`
- `guidance` `string`
- `result` `object`: The Guardian purchase assessment. `outcome` drives behavior; findings explain each rule.
  - `outcome` `string`: fits_policy: proceed is consistent with the buyer’s policy. violates_policy: stop; show the findings to the user. needs_information: re-assess with the listed missing inputs before relying on the result. A response is never an authorization to buy.
  - `provisional` `boolean`: True when required inputs were missing or estimated; never treat a provisional result as a pass.
  - `findings` `object[]`
  - `missingInputs` `object[]`
  - `policy` `object`
  - `expiresAt` `string <date-time>`: The assessment is stale after this time or after any basket change.

#### `409`: No Commerce policy is configured yet; the buyer must set one in Nava.

### Example request

```bash
curl https://api.example.navalabs.ai/muse/v1/assessments \
  --request POST \
  --header 'Content-Type: application/json' \
  --data '{
  "merchant": "string",
  "merchant_domain": "string",
  "currency": "string",
  "items": [
    {
      "name": "string",
      "product_url": "string",
      "product_id": "string",
      "quantity": 0,
      "unit_price": "string",
      "category": "string"
    }
  ],
  "costs": {
    "subtotal": "string",
    "discount": "string",
    "shipping": "string",
    "tax": "string",
    "total": "string"
  }
}'
```

```ts
fetch('https://api.example.navalabs.ai/muse/v1/assessments', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    merchant: 'string',
    merchant_domain: 'string',
    currency: 'string',
    items: [
      {
        name: 'string',
        product_url: 'string',
        product_id: 'string',
        quantity: 0,
        unit_price: 'string',
        category: 'string'
      }
    ],
    costs: {
      subtotal: 'string',
      discount: 'string',
      shipping: 'string',
      tax: 'string',
      total: 'string'
    }
  })
})
```

## Retrieve a prior assessment by id, with its findings.

`GET /muse/v1/assessments/{id}`

### Path parameters

- `id` `string` _(required)_

### Responses

#### `200`: The stored assessment.

#### `404`: Unknown assessment id.

### Example request

```bash
curl https://api.example.navalabs.ai/muse/v1/assessments/string
```

```ts
fetch('https://api.example.navalabs.ai/muse/v1/assessments/string')
```

## The buyer’s purchase history through this connector, newest first — like a card statement. All rows are agent-reported and unverified.

`GET /muse/v1/purchases`

### Query parameters

- `limit` `integer`
- `since` `string <date-time>`: Only purchases executed after this time.

### Responses

#### `200`: Statement rows plus per-currency totals for the returned set.

### Example request

```bash
curl 'https://api.example.navalabs.ai/muse/v1/purchases?limit=50&since=1970-01-01T00:00:00.000Z'
```

```ts
fetch('https://api.example.navalabs.ai/muse/v1/purchases?limit=50&since=1970-01-01T00:00:00.000Z')
```

## Report an executed transaction immediately after checkout completes. Include the assessment_id from the pre-purchase check and the final charged total. Reporting never authorizes or blocks anything; it records what happened.

`POST /muse/v1/purchases`

### Request body (required) (`application/json`)

- `assessment_id` `string`: The id returned by assess_purchase for this basket. Always include it when the purchase was assessed first; omit only if no assessment exists.
- `merchant` `string`: Store or merchant name.
- `merchant_domain` `string`: Bare merchant domain, e.g. walmart.com. When valid, the purchase record stores it as a domain identifier; otherwise the merchant name is kept.
- `currency` `string` _(required)_: ISO 4217 code of the charged amount, e.g. USD.
- `items` `object[]`: The purchased line items, as in assess_purchase.
- `costs` `object` _(required)_
  - `total` `string` _(required)_: The final amount charged, including shipping and tax.
- `order_reference` `string`: The merchant’s order or confirmation number, if one was issued.
- `executed_at` `string <date-time>`: When the purchase completed. Defaults to the report time.

### Responses

#### `200`: The recorded purchase. `alreadyRecorded: true` means this assessment was reported before; no duplicate was created.

Body (`application/json`):

- `purchaseId` `string`
- `executedAt` `string <date-time>`
- `merchant` `object`
- `amount` `object`
  - `minorUnits` `string`
  - `currency` `string`
- `amountDisplay` `string`
- `itemCount` `integer`
- `orderReference` `string`
- `assessmentId` `string`
- `unchecked` `boolean`: True when the purchase was reported without a prior assessment.
- `basis` `string`

#### `400`: The report is missing the charged amount (costs.total and currency are required).

#### `404`: Unknown assessment_id for this connector.

### Example request

```bash
curl https://api.example.navalabs.ai/muse/v1/purchases \
  --request POST \
  --header 'Content-Type: application/json' \
  --data '{
  "assessment_id": "string",
  "merchant": "string",
  "merchant_domain": "string",
  "currency": "string",
  "items": [
    {}
  ],
  "costs": {
    "total": "string"
  },
  "order_reference": "string",
  "executed_at": "1970-01-01T00:00:00.000Z"
}'
```

```ts
fetch('https://api.example.navalabs.ai/muse/v1/purchases', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    assessment_id: 'string',
    merchant: 'string',
    merchant_domain: 'string',
    currency: 'string',
    items: [{}],
    costs: {
      total: 'string'
    },
    order_reference: 'string',
    executed_at: '1970-01-01T00:00:00.000Z'
  })
})
```

## A single recorded purchase by id.

`GET /muse/v1/purchases/{id}`

### Path parameters

- `id` `string` _(required)_

### Responses

#### `200`: The purchase record.

#### `404`: Unknown purchase id.

### Example request

```bash
curl https://api.example.navalabs.ai/muse/v1/purchases/string
```

```ts
fetch('https://api.example.navalabs.ai/muse/v1/purchases/string')
```
