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

# Replace inventory property mappings

> Dry-run or atomically replace all seller-authored property and tag mappings for a managed sales-agent inventory source. Use the preview body only with dry_run=true. When dry_run is false or omitted, the replacement body requires confirmed=true and provenance.



## OpenAPI

````yaml /v2/storefront-api-v2.yaml put /inventory-sources/{sourceId}/property-mappings
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:
  /inventory-sources/{sourceId}/property-mappings:
    put:
      tags:
        - Storefront
      summary: Replace inventory property mappings
      description: >-
        Dry-run or atomically replace all seller-authored property and tag
        mappings for a managed sales-agent inventory source. Use the preview
        body only with dry_run=true. When dry_run is false or omitted, the
        replacement body requires confirmed=true and provenance.
      operationId: replaceInventoryPropertyMappings
      parameters:
        - in: query
          name: dry_run
          schema:
            default: 'false'
            type: string
            enum:
              - 'true'
              - 'false'
        - in: path
          name: sourceId
          schema:
            description: Inventory source ID
            type: string
            minLength: 1
          required: true
          description: Inventory source ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              anyOf:
                - description: >-
                    Preview body; valid only when the dry_run query parameter is
                    true
                  type: object
                  properties:
                    mappings:
                      maxItems: 5000
                      type: array
                      items:
                        type: object
                        properties:
                          grain:
                            default: property
                            type: string
                            enum:
                              - property
                              - tag
                          propertyExternalId:
                            type: string
                            minLength: 1
                          publisherDomain:
                            type: string
                            minLength: 1
                          tag:
                            type: string
                            minLength: 1
                          targetKind:
                            default: key_value
                            type: string
                            enum:
                              - key_value
                              - ad_unit
                              - placement
                          signalKey:
                            type: string
                            minLength: 1
                          signalValue:
                            type: string
                            minLength: 1
                          selectorExternalId:
                            type: string
                            minLength: 1
                    provenance:
                      type: object
                      properties:
                        source:
                          type: string
                          enum:
                            - operator
                            - import
                        reference:
                          type: string
                          minLength: 1
                          maxLength: 500
                      required:
                        - source
                      additionalProperties: false
                  required:
                    - mappings
                - description: >-
                    Replacement body; required when dry_run is false or omitted
                    and requires confirmed=true plus provenance
                  type: object
                  properties:
                    mappings:
                      maxItems: 5000
                      type: array
                      items:
                        type: object
                        properties:
                          grain:
                            default: property
                            type: string
                            enum:
                              - property
                              - tag
                          propertyExternalId:
                            type: string
                            minLength: 1
                          publisherDomain:
                            type: string
                            minLength: 1
                          tag:
                            type: string
                            minLength: 1
                          targetKind:
                            default: key_value
                            type: string
                            enum:
                              - key_value
                              - ad_unit
                              - placement
                          signalKey:
                            type: string
                            minLength: 1
                          signalValue:
                            type: string
                            minLength: 1
                          selectorExternalId:
                            type: string
                            minLength: 1
                    provenance:
                      type: object
                      properties:
                        source:
                          type: string
                          enum:
                            - operator
                            - import
                        reference:
                          type: string
                          minLength: 1
                          maxLength: 500
                      required:
                        - source
                      additionalProperties: false
                    confirmed:
                      type: boolean
                      enum:
                        - true
                  required:
                    - mappings
                    - provenance
                    - confirmed
      responses:
        '200':
          description: Replace inventory property mappings
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      dryRun:
                        type: boolean
                        enum:
                          - true
                      valid:
                        type: boolean
                      mapped:
                        type: array
                        items:
                          type: object
                          properties:
                            rowIndex:
                              type: integer
                              maximum: 9007199254740991
                              minimum: 1
                            grain:
                              type: string
                              enum:
                                - property
                                - tag
                            targetKind:
                              type: string
                              enum:
                                - key_value
                                - ad_unit
                                - placement
                            propertyExternalId:
                              nullable: true
                              type: string
                            tag:
                              nullable: true
                              type: string
                            mapped:
                              type: boolean
                            reason:
                              nullable: true
                              type: string
                          required:
                            - rowIndex
                            - grain
                            - targetKind
                            - propertyExternalId
                            - tag
                            - mapped
                            - reason
                          additionalProperties: false
                      unmapped:
                        type: array
                        items:
                          type: object
                          properties:
                            rowIndex:
                              type: integer
                              maximum: 9007199254740991
                              minimum: 1
                            grain:
                              type: string
                              enum:
                                - property
                                - tag
                            targetKind:
                              type: string
                              enum:
                                - key_value
                                - ad_unit
                                - placement
                            propertyExternalId:
                              nullable: true
                              type: string
                            tag:
                              nullable: true
                              type: string
                            mapped:
                              type: boolean
                            reason:
                              nullable: true
                              type: string
                          required:
                            - rowIndex
                            - grain
                            - targetKind
                            - propertyExternalId
                            - tag
                            - mapped
                            - reason
                          additionalProperties: false
                      keyValueValidation:
                        type: array
                        items:
                          type: object
                          properties:
                            rowIndex:
                              type: integer
                              maximum: 9007199254740991
                              minimum: 1
                            signalKey:
                              type: string
                            signalValue:
                              type: string
                            valid:
                              type: boolean
                            reason:
                              nullable: true
                              type: string
                          required:
                            - rowIndex
                            - signalKey
                            - signalValue
                            - valid
                            - reason
                          additionalProperties: false
                      selectorValidation:
                        type: array
                        items:
                          type: object
                          properties:
                            rowIndex:
                              type: integer
                              maximum: 9007199254740991
                              minimum: 1
                            targetKind:
                              type: string
                              enum:
                                - key_value
                                - ad_unit
                                - placement
                            selectorExternalId:
                              type: string
                            valid:
                              type: boolean
                            reason:
                              nullable: true
                              type: string
                          required:
                            - rowIndex
                            - targetKind
                            - selectorExternalId
                            - valid
                            - reason
                          additionalProperties: false
                    required:
                      - dryRun
                      - valid
                      - mapped
                      - unmapped
                      - keyValueValidation
                      - selectorValidation
                    additionalProperties: false
                  - type: object
                    properties:
                      dryRun:
                        type: boolean
                        enum:
                          - false
                      replacedCount:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                      mappings:
                        type: array
                        items:
                          type: object
                          properties:
                            grain:
                              default: property
                              type: string
                              enum:
                                - property
                                - tag
                            propertyExternalId:
                              type: string
                              minLength: 1
                            publisherDomain:
                              type: string
                              minLength: 1
                            tag:
                              type: string
                              minLength: 1
                            targetKind:
                              default: key_value
                              type: string
                              enum:
                                - key_value
                                - ad_unit
                                - placement
                            signalKey:
                              type: string
                              minLength: 1
                            signalValue:
                              type: string
                              minLength: 1
                            selectorExternalId:
                              type: string
                              minLength: 1
                            id:
                              type: string
                            sourceId:
                              type: string
                            provenance:
                              type: object
                              properties:
                                source:
                                  type: string
                                  enum:
                                    - operator
                                    - import
                                reference:
                                  type: string
                                  minLength: 1
                                  maxLength: 500
                              required:
                                - source
                              additionalProperties: false
                            operatorConfirmedAt:
                              nullable: true
                              type: string
                              format: date-time
                              pattern: >-
                                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                            operatorConfirmedBy:
                              nullable: true
                              type: string
                            createdAt:
                              type: string
                              format: date-time
                              pattern: >-
                                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                            lastValidatedAt:
                              nullable: true
                              type: string
                              format: date-time
                              pattern: >-
                                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                          required:
                            - grain
                            - targetKind
                            - id
                            - sourceId
                            - provenance
                            - operatorConfirmedAt
                            - operatorConfirmedBy
                            - createdAt
                            - lastValidatedAt
                          additionalProperties: false
                    required:
                      - dryRun
                      - replacedCount
                      - mappings
                    additionalProperties: false
        '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: Inventory source not found
          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:
    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

````