> ## 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.

# Preview the agent response (dry-run)

> Run the matcher + LLM reply drafter against a demand signal scoped to the caller's storefront WITHOUT persisting anything. Returns the match score, per-factor breakdown, ranked product candidates, an agent-drafted reply, and the headline CPM. Idempotent — safe to call repeatedly. Use it to preview before calling /respond.



## OpenAPI

````yaml /v2/storefront-api-v2.yaml post /storefronts/{storefrontId}/demand-signals/{signalId}/test-fit
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:
  /storefronts/{storefrontId}/demand-signals/{signalId}/test-fit:
    post:
      tags:
        - Demand Signals
      summary: Preview the agent response (dry-run)
      description: >-
        Run the matcher + LLM reply drafter against a demand signal scoped to
        the caller's storefront WITHOUT persisting anything. Returns the match
        score, per-factor breakdown, ranked product candidates, an agent-drafted
        reply, and the headline CPM. Idempotent — safe to call repeatedly. Use
        it to preview before calling /respond.
      operationId: testFitDemandSignal
      parameters:
        - in: path
          name: storefrontId
          schema:
            type: integer
            maximum: 9007199254740991
            minimum: 1
          required: true
        - in: path
          name: signalId
          schema:
            type: integer
            maximum: 9007199254740991
            minimum: 1
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DemandSignalTestFitBody'
      responses:
        '200':
          description: Preview the agent response (dry-run)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DemandSignalTestFitResult'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Feature not enabled for this customer (PostHog
            `demand-supply-signals`) or caller does not own the 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:
    DemandSignalTestFitBody:
      type: object
      properties:
        overrides:
          allOf:
            - $ref: '#/components/schemas/DemandSignalTestFitOverrides'
    DemandSignalTestFitResult:
      description: >-
        Dry-run result for the test-fit modal. Contains everything needed to
        render the auto-quote score, products, and agent-reply preview. Does NOT
        persist a response — call POST .../respond to send.
      type: object
      properties:
        matchScore:
          type: integer
          minimum: 0
          maximum: 100
        verdict:
          type: string
          enum:
            - AUTO-QUOTE
            - REVIEW
            - PASS
        factors:
          type: array
          items:
            $ref: '#/components/schemas/DemandSignalMatchFactor'
        products:
          type: array
          items:
            $ref: '#/components/schemas/DemandSignalMatchedProduct'
        skippedProducts:
          type: array
          items:
            $ref: '#/components/schemas/DemandSignalMatchedProduct'
        productsConsidered:
          type: integer
          minimum: 0
          maximum: 9007199254740991
        draftReply:
          type: object
          properties:
            text:
              type: string
            source:
              type: string
              enum:
                - gemini
                - template
                - human
          required:
            - text
            - source
          additionalProperties: false
        headlineCpm:
          nullable: true
          type: number
          minimum: 0
          exclusiveMinimum: true
        headlineCurrency:
          nullable: true
          type: string
          minLength: 3
          maxLength: 3
      required:
        - matchScore
        - verdict
        - factors
        - products
        - productsConsidered
        - draftReply
        - headlineCpm
        - headlineCurrency
      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
    DemandSignalTestFitOverrides:
      type: object
      properties:
        includeProductIds:
          minItems: 1
          maxItems: 200
          type: array
          items:
            type: string
            minLength: 1
        excludeProductIds:
          maxItems: 200
          type: array
          items:
            type: string
            minLength: 1
        cpmOverrides:
          type: object
          additionalProperties:
            type: number
            minimum: 0
            exclusiveMinimum: true
        notesOverride:
          type: string
          maxLength: 4000
    DemandSignalMatchFactor:
      type: object
      properties:
        id:
          type: string
        label:
          type: string
        weight:
          type: integer
          minimum: 0
          maximum: 100
        score:
          type: integer
          minimum: 0
          maximum: 100
        detail:
          type: string
      required:
        - id
        - label
        - weight
        - score
        - detail
      additionalProperties: false
    DemandSignalMatchedProduct:
      type: object
      properties:
        productId:
          type: string
        name:
          type: string
        description:
          nullable: true
          type: string
        publisherDomain:
          nullable: true
          type: string
        channel:
          nullable: true
          type: string
        cpm:
          nullable: true
          type: number
        currency:
          nullable: true
          type: string
        estimatedImpressions:
          nullable: true
          type: integer
          minimum: 0
          maximum: 9007199254740991
        fitScore:
          type: integer
          minimum: 0
          maximum: 100
        factors:
          type: array
          items:
            $ref: '#/components/schemas/DemandSignalMatchFactor'
        skipReason:
          nullable: true
          type: string
      required:
        - productId
        - name
        - description
        - publisherDomain
        - channel
        - cpm
        - currency
        - estimatedImpressions
        - fitScore
        - factors
      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

````