@adcp/sdk API Reference - v17.0.0-rc.0
    Preparing search index...

    Class ReportingClientExperimental

    client.reporting: patch-shaped reporting-subscription writes.

    • subscribe(subscription, { registerDestination }) upserts one subscription and keeps every other entry. subscription_version is optional: it is kept when only active, replace_account_configs or membership (scope.account_ids, exclude_account_ids; adcp#8619) change, and bumped when the selector, the scope kind, the destination (including destination_overrides), reconciliation_mode or operator_domains change.
    • unsubscribe(id) is the only way to deactivate (active: false; obligations are retained).
    • replaceSubscriptions(list, { deactivateOmitted }) replaces the complete set (expert).
    • listSubscriptions() and preview(subscription) (a seller dry run).

    Writes use expected_configuration_version; on CONFLICT the SDK re-reads, re-merges and retries with a fresh idempotency key (3 attempts by default), then throws SUBSCRIPTION_CONFLICT_EXHAUSTED. Every submitted subscription must read back unchanged, or SUBSCRIPTION_READBACK_MISMATCH.

    Reporting subscriptions (AdCP 3.3).

    Index
    • Experimental

      What the seller owes this buyer, period by period: every owed obligation of every subscription on every covered account, with status (delivered, pending, late, missing_obligation, withheld), the coverage reason, the responsible_party and a message. The roster is list_accounts intersected with the subscriptions' scopes, read on every run. grace (default PT1H) is how long after a period ends the seller may take to plan its obligation. includeNotOwed adds not_owed lines with their reasons. Reads only; never writes.

      Parameters

      Returns Promise<ReconcileReport>

    • Experimental

      One batch of events since the last acknowledgement, derived by comparing what the seller reports now (reconcile, the subscription readback, subscription_coverage[]) with the snapshot saved by the last ack(). Handle batch.events, then await batch.ack(); until then the same events come again with the same ids. Serverless-safe with a durable eventStore. baseline: true on a consumer with no snapshot records the present without emitting it.

      Parameters

      Returns Promise<EventBatch>

    • Experimental

      The manual receipts path: a typed wrapper over sync_reporting_receipts for one account. Returns the seller's item results. A receipt states that you verified and committed the data, so send one only after your load committed; the receipts policy on reconcile does this for you. Accepting an adjustment always goes through here: billing never auto-accepts.

      Parameters

      • accountId: string
      • items: {
            receipts?: readonly {
                reporting_receipt_id: string;
                reporting_obligation_id: string;
                reporting_revision_id: string;
                reporting_materialization_id: string;
                supersedes_reporting_receipt_id?: string;
                status: "rejected" | "accepted";
                verification_profile: ReportingVerificationProfile;
                observed_row_count: number;
                observed_control_totals: ReportingControlTotal[];
                observed_canonical_content_digest?: ReportingCanonicalContentDigest;
                observed_manifest_sha256?: string;
                observed_native_version_ref?: string;
                consumer_commit_ref?: string;
                rejection_codes?: [string, ...string[]];
                observed_at: string;
                received_at?: string;
            }[];
            adjustmentReceipts?: readonly {
                reporting_receipt_id: string;
                reporting_adjustment_id: string;
                adjusts_reporting_revision_id: string;
                supersedes_reporting_receipt_id?: string;
                status: "rejected"
                | "accepted";
                observed_adjustment_sha256: string;
                rejection_codes?: [string, ...string[]];
                observed_at: string;
                received_at?: string;
            }[];
        }

      Returns Promise<{ receipts: Json[]; adjustmentReceipts: Json[] }>

    • Experimental

      Replace the complete subscription set (expert). Omitting an active subscription deactivates it, which needs deactivateOmitted: true; an empty list needs deactivateAll: true. Versions are taken as given.

      Parameters

      • subscriptions: readonly {
            subscription_id: string;
            subscription_version: number;
            active: boolean;
            scope: { all_authorized_accounts?: true; account_ids?: string[] };
            exclude_account_ids?: string[];
            operator_domains?: string[];
            selector: {
                feed_purpose: "pacing" | "analytics" | "billing";
                period_duration: string;
                required_finality: ReportingFinality;
                alignment?:
                    | "utc"
                    | "account_timezone"
                    | "source_timezone"
                    | "billing_cycle";
                dimensions?: ReportingDimension[];
                match?: "exact"
                | "all"
                | "finest";
                dimension_systems?: ReportingDimensionSystems;
                period_timezone?: string;
            };
            reconciliation_mode: ReportingReconciliationMode;
            replace_account_configs?: boolean;
            destination?: { destination_id: string; path_template?: string };
            destination_overrides?: {
                account_ids?: [string, ...string[]];
                operator_domains?: [string, ...string[]];
                destination_id: string;
                path_template?: string;
            }[];
        }[]
      • options: {
            deactivateOmitted?: boolean;
            deactivateAll?: boolean;
            reportingDestinations?: readonly Json[];
            allowRevocation?: boolean;
        } = {}

      Returns Promise<ReportingSubscriptionReadback>