@adcp/sdk API Reference - v14.0.0-beta.6
    Preparing search index...

    Type Alias LegacyCreateMediaBuyRequest

    LegacyCreateMediaBuyRequest: (
        | ExplicitPackagesWithFixedAllocation
        | ExplicitPackagesWithSellerOptimizedAllocation
        | CommittedProposalExecution
    ) & {
        adcp_version?: string;
        adcp_major_version?: number;
        governance_context?: string;
        idempotency_key: string;
        plan_id?: string;
        account: AccountReference;
        proposal_id?: string;
        opportunity?: OpportunityContext & { status?: "closed" };
        total_budget?: { amount: number; currency: string };
        daily_budget_cap?: number;
        budget_cap_timezone?: string;
        budget_allocation?: BudgetAllocation;
        packages?: LegacyPackageRequest[];
        brand: BrandReference;
        advertiser_industry?: AdvertiserIndustry;
        invoice_recipient?: BusinessEntity;
        io_acceptance?: {
            io_id: string;
            accepted_at: string;
            signatory: string;
            signature_id?: string;
        };
        po_number?: string;
        name?: string;
        agency_estimate_number?: string;
        start_time: StartTiming;
        end_time: string;
        pacing?: Pacing;
        bidding?: BiddingPolicy;
        paused?: boolean;
        push_notification_config?: PushNotificationConfig;
        reporting_webhook?: ReportingWebhook;
        artifact_webhook?: {
            url: string;
            token?: string;
            authentication: { schemes: AuthenticationScheme[]; credentials: string };
            delivery_mode: "realtime" | "batched";
            batch_frequency?: "hourly" | "daily";
            sampling_rate?: number;
        };
        context?: ContextObject;
        ext?: ExtensionObject;
    }

    Deprecated AdCP 3.x compatibility request for creating a MediaBuy. New 3.2 callers use buy_products for direct published-offer purchases or accept_proposal for proposal execution. Existing package and proposal payloads remain valid throughout 3.x.

    Type Declaration

    • ExplicitPackagesWithFixedAllocation
    • ExplicitPackagesWithSellerOptimizedAllocation
    • CommittedProposalExecution
    • Optionaladcp_version?: string

      Release-precision AdCP version (VERSION.RELEASE, e.g. "3.0", "3.1", "3.1-beta"). On a request: the buyer's release pin — the seller validates against its supported_versions and returns VERSION_UNSUPPORTED on cross-major mismatch, or downshifts to the highest supported release within the same major. On a response: the release the seller actually served — clients SHOULD validate the response against that release's schema, not against their pin. Patches are not negotiated; surface them as build_version on capabilities for operational visibility. When omitted, falls back to adcp_major_version (deprecated) or server default. Buyers SHOULD emit both adcp_version and adcp_major_version through 3.x to remain compatible with sellers that only read the legacy field. NORMALIZATION: SDKs that read full-semver values from bundle metadata (e.g. ComplianceIndex.published_version = "3.1.0-beta.1") MUST normalize to release-precision ("3.1-beta.1") before emitting on the wire — meta-field values are NOT valid wire values.

    • Optionaladcp_major_version?: number

      DEPRECATED in favor of adcp_version (release-precision string). Servers MUST continue to honor this field through 3.x. Removed in 4.0. Original semantics: the AdCP major version the buyer's payloads conform to. Sellers validate against their supported major_versions and return VERSION_UNSUPPORTED if unsupported. When omitted, the seller assumes its highest supported version.

    • Optionalgovernance_context?: string

      Opaque intent authorization for this media-buy commitment. Required when governance applies to the resolved account.

      1

      4096

      ^[\x20-\x7E]+$

    • idempotency_key: string

      Client-generated unique key for this request. If a request with the same idempotency_key and account has already been processed, the seller returns the existing media buy rather than creating a duplicate. MUST be unique per (seller, request) pair to prevent cross-seller correlation. Use a fresh UUID v4 for each request.

      16

      255

      ^[A-Za-z0-9_.:-]{16,255}$

    • Optionalplan_id?: string

      DEPRECATED on seller-facing requests. New buyers send the approved governance_context on the protocol envelope; the seller forwards that opaque context and does not need the plan identifier. If both are present, the governance agent MUST reject a mismatch. Removed in 4.0.

    • account: AccountReference
    • Optionalproposal_id?: string

      ID of the exact committed proposal snapshot to execute. With total_budget, the publisher creates packages using the proposal's fixed percentages or seller-optimized constraints. Mutually exclusive: provide packages or proposal_id, not both. AdCP 3.2 request_proposals and ordinary refine_proposals revisions issue drafts; refine_proposals action finalize creates the executable committed hold. Sellers reject draft, declined, or previously executed snapshots, while exact retries with the original idempotency key replay historical success. Changed commercial terms are issued under a new proposal_id, so no separate proposal version is required.

    • Optionalopportunity?: OpportunityContext & { status?: "closed" }

      Optional planning-cycle closure. Sellers infer successful proposal execution as closed with close_reason accepted_with_seller when status is omitted; when status is present it MUST be closed with that reason. If the proposal was issued under an opportunity_id, a supplied ID MUST match it.

    • Optionaltotal_budget?: { amount: number; currency: string }

      Hard aggregate lifetime budget for the media buy. Required when executing a proposal and for seller-optimized explicit packages. Optional in fixed explicit-package mode; when present there, amount MUST equal the sum of package budgets. For a fixed proposal, the publisher applies allocation percentages to this amount. For a seller-optimized proposal or explicit buy, packages draw dynamically from this shared total.

      • amount: number

        Total budget amount

        0

      • currency: string

        ISO 4217 currency code

        ^[A-Z]{3}$

    • Optionaldaily_budget_cap?: number

      Optional hard aggregate daily spend ceiling in the media-buy currency. It limits total spend without allocating package amounts. Package caps are subordinate and need not sum to it. Requires advertised media_buy budget-capping scope; otherwise rejected with UNSUPPORTED_FEATURE.

      0

    • Optionalbudget_cap_timezone?: string

      Optional shared IANA day boundary override for all caps. Requires buyer_timezone_override; otherwise rejected with UNSUPPORTED_FEATURE. When omitted, budget_capping.timezone_basis selects Account.timezone or the advertised fixed_timezone.

      1

    • Optionalbudget_allocation?: BudgetAllocation

      How budget is allocated across explicit packages. Omit for legacy fixed allocation. In proposal mode the committed proposal supplies this configuration and callers MUST omit it here.

    • Optionalpackages?: LegacyPackageRequest[]

      Array of package configurations. Required when not using proposal_id. Mutually exclusive: provide packages or proposal_id, not both. Fixed allocation requires budget on every package. Seller-optimized allocation permits package budget to be omitted or to act as a hard cap. When executing a proposal, omit packages; the seller derives them from the committed proposal.

    • brand: BrandReference
    • Optionaladvertiser_industry?: AdvertiserIndustry
    • Optionalinvoice_recipient?: BusinessEntity
    • Optionalio_acceptance?: { io_id: string; accepted_at: string; signatory: string; signature_id?: string }

      Acceptance of an insertion order from a committed proposal. Required when the proposal's insertion_order has requires_signature: true. References the io_id from the proposal's insertion_order.

      • io_id: string

        The io_id from the proposal's insertion_order being accepted

      • accepted_at: string

        ISO 8601 timestamp when the IO was accepted

        date-time

      • signatory: string

        Who accepted the IO — agent identifier or human name

        1

        250

      • Optionalsignature_id?: string

        Reference to the electronic signature from the signing service, when signing_url was used

    • Optionalpo_number?: string

      Purchase order number for tracking

    • Optionalname?: string

      Human-readable name for this media buy, shared by buyer and seller for trafficking UI display and operational communication. When supplied, the seller MUST persist it and echo it unchanged on the create success response and subsequent get_media_buys reads. This display label is not an identifier or financial reference.

      1

      255

      \S

    • Optionalagency_estimate_number?: string

      Agency estimate or authorization number. Primary financial reference for broadcast buys — links the order to the agency's media plan and billing system. Travels with the order and creative traffic identifiers through the transaction lifecycle.

      100

    • start_time: StartTiming
    • end_time: string

      Campaign end date/time in ISO 8601 format

      date-time

    • Optionalpacing?: Pacing
    • Optionalbidding?: BiddingPolicy

      Complete media-buy bidding default inherited by packages that omit package.bidding. {automatic:true} records an explicit automatic policy. In seller-optimized mode, cost_per/roas bind to the primary budget_allocation.optimization_goals goal. In fixed mode, inherited cost_per is valid only when inheriting package primary-goal result units are compatible; inherited roas requires value-bearing primary goals. Every monetary field uses total_budget.currency or the single currency derived for the media buy, and every affected pricing option MUST declare that currency. Sellers MUST reject incompatible units, combinations, currency, or overrides before mutation with BIDDING_PLACEMENT_CONFLICT. Media-buy bidding combined with any inheriting package's legacy bid_price or legacy monetary optimization-goal target is ambiguous and MUST be rejected with AMBIGUOUS_BIDDING_POLICY.

    • Optionalpaused?: boolean

      Create the media buy in a paused delivery state. When true, and the buy would otherwise be active because creatives are assigned and the flight has started, the seller returns media_buy_status 'paused'. Setup blockers still take precedence: a buy with no creatives remains 'pending_creatives', and a future-dated buy remains 'pending_start' until its flight can start. Defaults to false.

    • Optionalpush_notification_config?: PushNotificationConfig
    • Optionalreporting_webhook?: ReportingWebhook
    • Optionalartifact_webhook?: {
          url: string;
          token?: string;
          authentication: { schemes: AuthenticationScheme[]; credentials: string };
          delivery_mode: "realtime" | "batched";
          batch_frequency?: "hourly" | "daily";
          sampling_rate?: number;
      }

      Optional webhook configuration for content artifact delivery. Used by governance agents to validate content adjacency. Seller pushes artifacts to this endpoint; orchestrator forwards to governance agent for validation.

      • url: string

        Webhook endpoint URL for artifact delivery

      • Optionaltoken?: string

        Optional client-provided token for webhook validation. Echoed back in webhook payload to validate request authenticity.

        16

      • authentication: { schemes: AuthenticationScheme[]; credentials: string }

        Legacy authentication configuration for webhook delivery (A2A-compatible). Opts the receiver into Bearer or HMAC-SHA256 signing. Both schemes are deprecated; the preferred signing profile for new integrations is RFC 9421, where the seller signs with a key published at its brand.json agents[] entry and the buyer verifies against the seller's JWKS — no shared secret crosses the wire (see docs/building/implementation/security.mdx#webhook-callbacks). This field is required in AdCP 3.x; the requirement is removed in AdCP 4.0 when the default RFC 9421 path becomes the only path.

        • schemes: AuthenticationScheme[]

          Array of authentication schemes. ['Bearer'] for simple token auth, ['HMAC-SHA256'] for legacy shared-secret signing. Both are deprecated; new integrations SHOULD use the RFC 9421 webhook signing profile instead.

        • credentials: string

          Credentials for the legacy scheme. For Bearer: token sent in Authorization header. For HMAC-SHA256: shared secret used to generate signature. Minimum 32 characters. Exchanged out-of-band during onboarding.

          32

      • delivery_mode: "realtime" | "batched"

        How artifacts are delivered. 'realtime' pushes artifacts as impressions occur. 'batched' aggregates artifacts and pushes periodically (see batch_frequency).

      • Optionalbatch_frequency?: "hourly" | "daily"

        For batched delivery, how often to push artifacts. Required when delivery_mode is 'batched'.

      • Optionalsampling_rate?: number

        Fraction of impressions to include (0-1). 1.0 = all impressions, 0.1 = 10% sample. Default: 1.0

        0

        1

    • Optionalcontext?: ContextObject
    • Optionalext?: ExtensionObject