Skip to main content
POST /api/v2/storefront/inventory-sources Creates an inventory source and registers its backing agent. Only external AGENT sources are created here — MANAGED_SALES_AGENT, LINKED_STOREFRONT, and MODULAR_SOURCE rows are created through their own provisioning and linking flows.

Request

Parameters

Treat auth.token and JWT private keys as production secrets. They are encrypted at rest, referenced only by an opaque ref, and never echoed back — responses surface authConfigured: true. Never log or commit raw credentials.
For external-sales-agent:v1, use bearer_token with auth.type: "bearer", basic_auth with auth.type: "basic", or none without auth. The shared contract schema also has typed API-key, OAuth 2.0, JWT, and platform-service-account methods for integrations that register those methods. Authentication is a closed platform-owned set; requests cannot install executable header or request templates.

Response

201 Created with the new InventorySourceResponse:
Every external AGENT source is created in status: "PENDING", including a NO_AUTH source, and proceeds through the normal registration and readiness workflow before activation. Reachability is reported independently by source health and connectivity checks. For a newly registered OAUTH identity, the response includes oauth.authorizationUrl when authorization discovery and flow storage succeed; redirect the operator there to complete consent. If the source is created without that block, start consent with Start agent OAuth. Complete authorization even when oauthAudience was supplied—the override selects the token resource; it is not a credential. If the endpoint reuses an existing identity, create reuses its OAuth configuration and does not reinitialize consent; update an existing source first when the audience or authorization must change. When attachToAgentId is supplied, Interchange creates the Source and attaches it to that exact organization-owned Sales Agent as one operation. The response returns the attached Agent in agentCapabilityUid. If the request response is interrupted, return to that Agent’s Inventory sources section and refresh before sending another create request: a committed Source appears there already. Do not blindly resubmit an ambiguous request. If the Agent declares both product paths, agentProductMode records how this Source participates: Storefront-built catalog (WHOLESALE), Agent-supplied products (COMPOSING), or both (BOTH). The Agent declaration is re-read by the server; the launch payload is only presentation guidance. Connecting checks that the agent’s endpointUrl is registered with the AAO registry. If the agent is not registered, the request is rejected with 400 VALIDATION_ERROR. If the registry cannot be reached to perform the check, the request returns 503 SERVICE_UNAVAILABLE — a transient connectivity problem, not a rejection of the agent, so retrying usually succeeds.
An adagents.json file identifies which agents a publisher authorizes; it is not an agent endpoint. When starting from a publisher domain, resolve its file through AAO and copy the selected agent’s authorized_agents[].url. Do not copy the publisher well-known URL, AAO hosting.resolved_url, or the document’s authoritative_location into endpointUrl.

After connection

Once connected, an external AGENT source can either answer buyer briefs live on the Agent-supplied path — available on any account, including an account with Listing + Distribution that keeps routing briefs through its own agent — or provide cached components for the Storefront-built path, which requires a separate Merchandising entitlement and a source that supports component caching. To support component caching, the agent’s product response must expose stable raw products: ids, names/descriptions, pricing options, formats, publisher properties or other inventory selectors, delivery type, and enough execution metadata to route a selected product later. Murph reports component-cache problems separately from live source-call failures.
Registering the agent is not the same as authorizing it to sell a publisher’s inventory. This connect-time check only confirms the agent is registered in the AAO registry. Whether a publisher’s adagents.json authorizes that agent to sell their inventory is a separate question, surfaced later as an advisory setup/product signal today — not at connect time. A registered agent can be connected and still be unauthorized for a given publisher’s inventory.

Errors

  • 400 VALIDATION_ERROR — missing required field, a non-public endpoint or oauthAudience, auth supplied for an OAUTH/NO_AUTH agent, auth missing for a JWT agent, a malformed attachToAgentId, or the agent’s endpoint is not registered with the AAO registry. An adagents.json or authoritative_location document is also rejected as endpointUrl. (Agent registration is distinct from publisher authorization — see the note above.)
  • 401 UNAUTHORIZED — missing or invalid API key.
  • 403 ACCESS_DENIEDattachToAgentId identifies an Agent owned by another organization or one the caller cannot administer.
  • 404 NOT_FOUNDattachToAgentId is unavailable in this organization, or the Agent workspace is not enabled for the account.
  • 503 SERVICE_UNAVAILABLE — the AAO registry could not be reached to verify the agent’s registration. This is transient; retry the request.
See Errors for the full error contract.

Inventory source tasks

All operations

Inventory sources overview

Concepts and lifecycle

Update inventory source

Change fields or rotate auth

Storefront onboarding

End-to-end seller setup