@adcp/sdk API Reference - v10.0.1
    Preparing search index...

    Function reportUsageResponse

    • Parameters

      • data: {
            context?: Omit<Omit<{}, "bank">, "authentication"> & {
                authentication?: unknown;
            };
            governance_context?: string;
            accepted: number;
            errors?: {
                code: string;
                message: string;
                field?: string;
                suggestion?: string;
                retry_after?: number;
                issues?: {
                    pointer: string;
                    message: string;
                    keyword: string;
                    schemaPath?: string;
                    schema_id?: string;
                    discriminator?: {
                        property_name: string;
                        value: (...)
                        | (...)
                        | (...)
                        | (...)
                        | (...);
                    }[];
                }[];
                details?: Omit<Omit<{}, "bank">, "authentication"> & {
                    authentication?: unknown;
                };
                recovery?: "transient"
                | "correctable"
                | "terminal";
                source?: "producer" | "sdk";
                sdk_id?: string;
            }[];
            sandbox?: boolean;
            ext?: Omit<Omit<{}, "bank">, "authentication"> & {
                authentication?: unknown;
            };
        }
        • Optionalcontext?: Omit<Omit<{}, "bank">, "authentication"> & { authentication?: unknown }
        • Optionalgovernance_context?: string

          Governance context token issued by the account's governance agent during check_governance. Buyers attach it to governed purchase requests (media buys, rights acquisitions, signal activations, creative services); sellers persist it and include it on all subsequent governance calls for that action's lifecycle. An account binds to one governance agent (see sync_governance); governance is phased across purchase / modification / delivery, not partitioned across specialist agents, so the envelope carries a single token for the full lifecycle.

          Value format: governance agents MUST emit a compact JWS per the AdCP JWS profile (see Security — Signed Governance Context). Sellers MAY verify; sellers that do not verify MUST persist and forward the token unchanged. In 3.1 all sellers MUST verify. Non-JWS values from pre-3.0 governance agents are deprecated.

          This is the primary correlation key for audit and reporting across the governance lifecycle.

        • accepted: number

          Number of usage records successfully stored.

          0

        • Optionalerrors?: {
              code: string;
              message: string;
              field?: string;
              suggestion?: string;
              retry_after?: number;
              issues?: {
                  pointer: string;
                  message: string;
                  keyword: string;
                  schemaPath?: string;
                  schema_id?: string;
                  discriminator?: {
                      property_name: string;
                      value: (...) | (...) | (...) | (...) | (...);
                  }[];
              }[];
              details?: Omit<Omit<{}, "bank">, "authentication"> & {
                  authentication?: unknown;
              };
              recovery?: "transient"
              | "correctable"
              | "terminal";
              source?: "producer" | "sdk";
              sdk_id?: string;
          }[]

          Validation errors for individual records. The field property identifies which record failed (e.g., 'usage[1].pricing_option_id').

        • Optionalsandbox?: boolean

          When true, the account is a sandbox account and no billing occurred.

        • Optionalext?: Omit<Omit<{}, "bank">, "authentication"> & { authentication?: unknown }
      • Optionalsummary: string

      Returns McpToolResponse

      v6: createAdcpServerFromPlatform constructs wire responses from typed platform returns. Direct use is for v5 raw-handler adopters mid-migration only.

    Index

    Methods

    Methods

    • Shortcut for the common case: accept all rows in the request, optionally minus any errors[] the caller computed. Sets accepted = (request.usage?.length ?? 0) - errors.length.

      Use with honest errors — passing no errors when rows failed validation is lying to buyers and the audit trail.

      Parameters

      Returns McpToolResponse