Reconcile Black Friday video spend per SKU from the run usage receipt

Each finished Format run has a usage object with billable, debited, held and refunded amounts. Sum them per SKU from your own ledger, not the wallet total.

3 min readSume
All posts

The per-SKU cost of a Black Friday batch is the sum of usage over that SKU's runs. Every Format run receipt carries a usage object, so you can attribute spend without waiting for an invoice.

The fields

Format run usage (Sume docs, read 2026-10-05)
FieldMeaning
billable_amount_usd_microsGeneration spend of this run, metered against the cap
generation_spend_cap_usd_microsThe effective cap for this run
debited_usd_microsWhat the wallet really deducted for the run
held_usd_microsAmount currently held
refunded_usd_microsAmount returned
finalWhether the numbers can still change
caplimit, counted and remaining, in the same calculation

Only add finished runs

Wait for final to be true before you book a number. A run in flight can still hold an amount that later settles or is refunded. Join each run to its SKU through the ledger you keep from bulk submit, then add debited_usd_micros and divide by 1,000,000.

def sku_cost(runs):
    # runs: list of {sku, usage} for terminal runs
    out = {}
    for r in runs:
        u = r["usage"]
        if u and u.get("final"):
            out[r["sku"]] = out.get(r["sku"], 0) + u["debited_usd_micros"] / 1_000_000
    return out

Two notes

  • usage is null when the API could not read the spend; treat that as unknown, not zero.
  • Continued runs list the whole conversation's media, but usage stays per run, so a revision adds its own row.

Sources

Related posts

More in Pricing

All Pricing posts

Written by Sume