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

# Record demand-inbox ledger annotations

> Record the seller's grade (A–F), buyer feedback, and led-by attribution (agent | human) on one demand-inbox row. Only the fields provided are changed; grade and feedback accept null to clear them. Scoped to the caller's storefront — a run outside it returns 404.



## OpenAPI

````yaml /v2/storefront-api-v2.yaml put /demand-inbox/{runId}/ledger
openapi: 3.0.0
info:
  title: Scope3 Storefront API
  version: 2.0.0
  description: |-
    REST API for partners to manage storefronts, inventory sources, and billing.

    ## Authentication

    All endpoints require a Bearer token in the Authorization header:
    ```
    Authorization: Bearer your-api-key
    ```

    ## Base URL

    `https://api.interchange.io/api/v2/storefront`

    ## For AI Agents

    AI agents can use the MCP endpoint at `/mcp/v2/storefront` with three tools:
    - `initialize`: Start an MCP session
    - `api_call`: Make REST API calls
    - `ask_about_capability`: Learn about API features
servers:
  - url: https://api.interchange.io/api/v2/storefront
    description: Production server
security: []
tags:
  - name: Account
    description: Account management, service tokens, and preferences
  - name: Storefront
    description: Manage storefront and inventory sources
  - name: Storefront Agents
    description: List and manage registered sales, signals, and outcomes agents
  - name: Storefront Activity
    description: Audit log of configuration and inventory changes on the storefront
  - name: Storefront Billing
    description: Payout bank details and billing configuration for storefronts
  - name: AI Usage
    description: Storefront AI token usage visibility by model
  - name: MCP
    description: Model Context Protocol endpoints
paths:
  /demand-inbox/{runId}/ledger:
    put:
      tags:
        - Storefront
      summary: Record demand-inbox ledger annotations
      description: >-
        Record the seller's grade (A–F), buyer feedback, and led-by attribution
        (agent | human) on one demand-inbox row. Only the fields provided are
        changed; grade and feedback accept null to clear them. Scoped to the
        caller's storefront — a run outside it returns 404.
      operationId: recordDemandInboxResult
      parameters:
        - in: path
          name: runId
          schema:
            description: Surrogate id of the chef compose run this ledger row wraps.
            example: 42
            type: integer
            maximum: 9007199254740991
            minimum: 1
          required: true
          description: Surrogate id of the chef compose run this ledger row wraps.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RecordDemandInboxResultBody'
      responses:
        '200':
          description: Record demand-inbox ledger annotations
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DemandInboxRow'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: No demand-inbox row with that id in the calling storefront.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    RecordDemandInboxResultBody:
      description: >-
        Records the seller-authored ledger annotations (grade, buyer feedback,
        led-by attribution) on one demand-inbox row.
      type: object
      properties:
        grade:
          description: Seller's letter grade (A–F) for the proposal. Null clears it.
          nullable: true
          type: string
          enum:
            - A
            - B
            - C
            - D
            - F
        feedback:
          description: Buyer feedback captured against the proposal. Null clears it.
          nullable: true
          type: string
          maxLength: 2000
        ledBy:
          description: >-
            Who led the response: the agent, or a human who took it over. Omit
            to leave the run's current attribution.
          type: string
          enum:
            - agent
            - human
    DemandInboxRow:
      type: object
      properties:
        id:
          type: string
        brief:
          description: The brief text the agent answered (label for the row).
          nullable: true
          type: string
        buyer:
          description: Buyer label derived from the buyer scope (operator or brand domain).
          nullable: true
          type: string
        budgetRange:
          description: >-
            The buyer's stated budget range, exactly as sent in the brief's
            filters.budget_range and captured in the brief artifact. Null when
            the buyer did not state one.
          nullable: true
          type: object
          properties:
            min:
              nullable: true
              type: number
            max:
              nullable: true
              type: number
            currency:
              type: string
          required:
            - min
            - max
            - currency
          additionalProperties: false
        receivedAt:
          type: string
        respondedAt:
          description: When the agent answered. Null while the brief is unanswered.
          nullable: true
          type: string
        ledBy:
          nullable: true
          type: string
          enum:
            - agent
            - human
        feedback:
          nullable: true
          type: string
        result:
          description: >-
            Commercial result derived from this run’s own attributed outcome:
            closed_won (booked/delivered), closed_lost (rejected), else pending.
            A booking attributed to a later refine pass is not rolled up here
            (see the win-rate scope note).
          type: string
          enum:
            - closed_won
            - closed_lost
            - pending
        grade:
          nullable: true
          type: string
          enum:
            - A
            - B
            - C
            - D
            - F
        wonValue:
          description: >-
            Money attributed to this run's won outcome: delivered spend when
            reporting exists, else the booked media-buy budget. Null unless the
            outcome persisted both an amount and its currency.
          nullable: true
          type: object
          properties:
            amount:
              type: number
            currency:
              type: string
          required:
            - amount
            - currency
          additionalProperties: false
        briefArtifactId:
          description: >-
            Canonical brief artifact id (AI-4693) for the build-3 drill-in. Null
            = artifact unavailable (historical pre-capture run).
          nullable: true
          type: string
        proposalArtifactId:
          description: >-
            Canonical proposal artifact id for the build-3 drill-in. Null = no
            proposal artifact captured.
          nullable: true
          type: string
        artifactAvailable:
          description: >-
            False when the brief artifact was not captured; readers must say
            "artifact unavailable" rather than reconstruct it.
          type: boolean
      required:
        - id
        - brief
        - buyer
        - budgetRange
        - receivedAt
        - respondedAt
        - ledBy
        - feedback
        - result
        - grade
        - wonValue
        - briefArtifactId
        - proposalArtifactId
        - artifactAvailable
      additionalProperties: false
    ErrorResponse:
      description: Standard error response
      type: object
      properties:
        data:
          type: string
          nullable: true
          enum:
            - null
        error:
          $ref: '#/components/schemas/ApiError'
      required:
        - data
        - error
      additionalProperties: false
    ApiError:
      description: Structured error object
      type: object
      properties:
        code:
          description: Machine-readable error code
          type: string
        message:
          description: Human-readable error message
          type: string
        field:
          description: Field path associated with the error
          type: string
        details:
          description: Additional error context
          type: object
          additionalProperties: {}
      required:
        - code
        - message
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key or access token

````