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

# Resolve media billing entity

> Preview which configured media billing entity matches an advertiser or account (exactly one of advertiserId/childCustomerId): the advertiser's attachment wins, else its owning account's attachment, else the org PRIMARY entity when one exists, else unresolved. Purely structural; the invoice producer does not consume this result yet.



## OpenAPI

````yaml /v2/buyer-api-v2.yaml get /billing/media-entities/resolve
openapi: 3.0.0
info:
  title: Scope3 Buyer API
  version: 2.0.0
  description: |-
    REST API for advertisers to manage advertisers, campaigns, and reporting.

    ## Authentication

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

    ## Base URL

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

    ## For AI Agents

    AI agents can use the MCP endpoint at `/mcp/v2/buyer` 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/buyer
    description: Production server
security: []
tags:
  - name: Signup
    description: Request reviewed access to Interchange
  - name: Account
    description: Account management, service tokens, and preferences
  - name: Asks
    description: >-
      What you are waiting on Scope3 for — support, product, and supply asks in
      one list
  - name: Advertisers
    description: Manage advertisers
  - name: Product Discovery
    description: Discover and select products
  - name: Campaigns
    description: Manage advertising campaigns
  - name: Creatives
    description: Build, manage, and sync campaign creatives via AdCP Creative Protocol
  - name: Reporting
    description: Access performance metrics
  - name: Event Sources
    description: >-
      Manage event source configurations and log conversion/marketing events for
      attribution
  - name: Property Lists
    description: Validate property lists against AAO registry
  - name: Sales Agents
    description: View and connect sales agents
  - name: Measurement
    description: Measurement sources, records, context, and freshness
  - name: Syndication
    description: Syndicate resources to ADCP agents
  - name: Tasks
    description: Track async operation status
  - name: Buyer Billing
    description: >-
      Consolidated invoicing for buyers — invoices and pending invoice items
      issued by Scope3 across the buyer customer.
  - name: MCP
    description: Model Context Protocol endpoints for AI agents
paths:
  /billing/media-entities/resolve:
    servers:
      - url: https://api.interchange.io/api/v2
        description: Production server
    get:
      tags:
        - Media Billing
      summary: Resolve media billing entity
      description: >-
        Preview which configured media billing entity matches an advertiser or
        account (exactly one of advertiserId/childCustomerId): the advertiser's
        attachment wins, else its owning account's attachment, else the org
        PRIMARY entity when one exists, else unresolved. Purely structural; the
        invoice producer does not consume this result yet.
      operationId: resolveMediaBillingEntity
      parameters:
        - in: query
          name: advertiserId
          schema:
            description: >-
              Resolve the media billing entity for this advertiser. Exactly one
              of advertiserId/childCustomerId must be provided.
            anyOf:
              - type: integer
                format: int64
              - type: string
              - type: number
          description: >-
            Resolve the media billing entity for this advertiser. Exactly one of
            advertiserId/childCustomerId must be provided.
        - in: query
          name: childCustomerId
          schema:
            description: >-
              Resolve the media billing entity for this account (child
              customer). Exactly one of advertiserId/childCustomerId must be
              provided.
            anyOf:
              - type: number
              - type: string
          description: >-
            Resolve the media billing entity for this account (child customer).
            Exactly one of advertiserId/childCustomerId must be provided.
      responses:
        '200':
          description: Resolve media billing entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResolveMediaBillingEntityResponse'
        '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: >-
            ACCESS_DENIED (the advertiser or account is outside your
            organization; for accounts this is also returned when the account
            does not exist, so existence cannot be probed).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: NOT_FOUND (the advertiser does not exist).
          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:
    ResolveMediaBillingEntityResponse:
      type: object
      properties:
        entity:
          nullable: true
          description: >-
            The entity selected by the configuration preview, or null when the
            org has no matching or primary entity.
          allOf:
            - $ref: '#/components/schemas/MediaBillingEntity'
        resolvedVia:
          type: string
          enum:
            - advertiser
            - account
            - org
            - none
          description: >-
            "advertiser" (the advertiser has its own attachment), "account" (its
            owning account does), "org" (the org primary fallback), or "none"
            (the org has no matching or primary entity).
      required:
        - entity
        - resolvedVia
      additionalProperties: false
      description: >-
        Previews which configured media billing entity matches an advertiser or
        account and which hierarchy level supplied it. The invoice producer does
        not consume this result yet.
    ErrorResponse:
      type: object
      properties:
        data:
          type: string
          nullable: true
          enum:
            - null
        error:
          $ref: '#/components/schemas/ApiError'
      required:
        - data
        - error
      additionalProperties: false
      description: Standard error response
    MediaBillingEntity:
      type: object
      properties:
        id:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
          description: Media billing entity ID
        entityName:
          type: string
          minLength: 1
          maxLength: 255
          description: >-
            Legal name of the media billing entity (e.g. "WPP South Africa (Pty)
            Ltd").
        countryCode:
          type: string
          pattern: ^[A-Z]{2}$
          description: >-
            Stored country identity metadata for the billing entity, as an ISO
            3166-1 alpha-2 code. It does not derive currency, tax/address
            behavior, or resolution.
          example: US
        currency:
          type: string
          pattern: ^[A-Z]{3}$
          description: ISO 4217 currency code
          example: USD
        billingEmails:
          minItems: 1
          maxItems: 20
          type: array
          items:
            type: string
            format: email
            pattern: >-
              ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
          description: >-
            Invoicing contact email(s) for this entity. At least one is
            required.
        addressLine1:
          type: string
          minLength: 1
          maxLength: 255
          description: Entity street address, line 1.
        addressLine2:
          nullable: true
          description: Entity street address, line 2 (optional).
          type: string
          maxLength: 255
        city:
          type: string
          minLength: 1
          maxLength: 128
          description: Entity city.
        state:
          nullable: true
          description: Entity state/province/region (optional).
          type: string
          maxLength: 128
        postalCode:
          type: string
          minLength: 1
          maxLength: 32
          description: Entity postal/ZIP code.
        taxId:
          nullable: true
          description: >-
            Tax identifier for this entity (e.g. VAT number, EIN), when
            applicable.
          type: string
          maxLength: 64
        isPrimary:
          type: boolean
          description: >-
            Whether this is the org's PRIMARY media billing entity — the
            fallback in resolution previews when no advertiser or account
            attachment matches. At most one entity per org is primary; an org
            may have no entities at all.
        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))$
          description: Creation timestamp (ISO 8601)
        updatedAt:
          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))$
          description: Last update timestamp (ISO 8601)
      required:
        - id
        - entityName
        - countryCode
        - currency
        - billingEmails
        - addressLine1
        - city
        - postalCode
        - isPrimary
        - createdAt
        - updatedAt
      additionalProperties: false
      description: >-
        A media billing configuration entity used by resolution previews. The
        invoice producer does not consume it yet.
    ApiError:
      type: object
      properties:
        code:
          type: string
          description: Machine-readable error code
        message:
          type: string
          description: Human-readable error message
        field:
          description: Field path associated with the error
          type: string
        details:
          description: Additional error context
          type: object
          additionalProperties: {}
      required:
        - code
        - message
      additionalProperties: false
      description: Structured error object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key or access token

````