---
title: "Execute Penny guarded revenue recognition pass (Phase 3 writer)"
method: POST
path: "/accountant/companies/{customerId}/agent/revenue/run"
tags: ["Accountant Portal"]
---

# Execute Penny guarded revenue recognition pass (Phase 3 writer)

`POST /accountant/companies/{customerId}/agent/revenue/run`

## Request

- Base URL: `https://api.medianfi.com/api/v1`
- URL: `https://api.medianfi.com/api/v1/accountant/companies/{customerId}/agent/revenue/run`
- Auth: HTTP bearer

Agent principal only (requires verified Google Workload Identity in production, X-Agent-Run-Id, and X-Agent-Evidence-Id with actionType=run_revenue). Enforces the 2026-11-01 floor (422 AGENT_WRITE_BEFORE_FLOOR), books-sound gate, F21/F31 live holds, named agent R5 attribution, and human-only undo via POST .../agent/runs/{runId}/evidence/{evidenceId}/undo.

## Path parameters

- `customerId` string, uuid, required

## Headers

- `X-Agent-Run-Id` string, uuid, required
- `X-Agent-Evidence-Id` string, uuid, required

## Request body

- object
  - `openFrom` string, date
  - `asOfDate` string, date
  - `dryRun` boolean
  - `entries` object[]
    - `entryDate` string, date, required
    - `description` string, required
    - `postingKey` string
    - `lines` object[], required
      - `glAccountId` string, uuid, required
      - `debitCents` integer, required
      - `creditCents` integer, required
      - `memo` string
      - `sourceIds` string[]: Records behind the line (e.g. Stripe balance-transaction ids), at most 5,000 per entry. Shown on a shadow review item; never posted.

## Response `200`

Revenue pass result

- object
  - `success` boolean, required
  - `data` object, required
    - `status` 'applied' | 'dry_run' | 'no_op' | 'shadow' | 'shadow_dry_run', required: shadow / shadow_dry_run only where the capability has an explicit shadow state row: every live check but the live gate ran, nothing was posted, and (shadow) one je_review Inbox item was filed per entry.
    - `capability` 'revenue', required
    - `openFrom` string, date, required
    - `applied` integer, required
    - `queued` integer, required
    - `skipped` integer, required
    - `undoIds` string[], required
    - `journalEntryIds` string[], required
    - `entries` AgentPhase3ShadowEntry[]
      - `entryDate` string, date, required
      - `description` string, required
      - `postingKey` string, nullable, required
      - `lines` object[], required
        - `glAccountId` string, uuid, required
        - `debitCents` integer, required
        - `creditCents` integer, required
        - `memo` string, required
        - `sourceIds` string[], required
      - `totalCents` integer, required
      - `sourceKey` string, required
      - `inboxItemId` string, uuid, nullable, required: The je_review item filed; null in a shadow dry run.
    - `checks` object

## Other responses

- `401`: Authentication required
- `403`: Insufficient permissions or not a company member
- `404`: Resource not found
- `409`: Request conflicts with the durable onboarding state
- `422`: Request failed validation

## Changes

- **2026-11-29** `7a4e50367c49`: 2 warning, 3 info
  - added the new `shadow` enum value to the `data/status` response property for the response status `200`
  - added the new `shadow_dry_run` enum value to the `data/status` response property for the response status `200`
  - added the new optional request property `entries/items/lines/items/sourceIds`
  - added the optional property `data/checks` to the response with the `200` status
  - …1 more
- **2026-11-28** `629ac127e9e4`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/medianfi/apis/median-api/changes/accountant/companies/:customerId/agent/revenue/run/post.md)

---

[API](https://skmtc.dev/medianfi/apis/median-api.md) - [All operations](https://skmtc.dev/medianfi/apis/median-api/llms.txt) - [OpenAPI document](https://skmtc.dev/medianfi/apis/median-api/revisions/4f4c2d34276b?raw)
