---
title: "Billing True Up"
method: POST
path: "/api/tasks/billing-true-up"
tags: ["Tasks", "Tasks"]
---

# Billing True Up

`POST /api/tasks/billing-true-up`

M-2 + M-3: true-up and clawback within the 60-day adjustment window.

BILLING_RULES.md Section 4: each prior period is re-pulled and adjusted
via credit/debit line on the next invoice; clawback for invalid traffic
refunds 50%. Period is final after 60 days.

This endpoint is currently a scaffold — it identifies the invoices in
the 60-day window and surfaces the count. The actual YouTube re-pull
+ clawback writer is deferred (see InvoiceGenerator.true_up_and_clawback
docstring for the gating reason and follow-up shape).

Recommended cron: weekly. The work is idempotent; firing it daily is
safe but wasteful.

## Headers

- `x-cloudscheduler-secret` string, nullable
- `x-scheduler-secret` string, nullable
- `authorization` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `401` — Unauthorized
- `422` — Validation Error
- `500` — Internal Server Error

---

[API](https://skmtc.dev/primetime/apis/primetime-media-api.md) · [All operations](https://skmtc.dev/primetime/apis/primetime-media-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/primetime/primetime-media-api/revisions/9da9a9f64e11/schema)
