---
title: "Trial Window Check"
method: POST
path: "/api/tasks/trial-window-check"
tags: ["Tasks", "Tasks"]
---

# Trial Window Check

`POST /api/tasks/trial-window-check`

T2-4 (BILLING_RULES.md §13.1): flip non-responders to trial_lapsed.

Runs daily. For users in trial_card_pending where the invoice was issued
> 10 days ago (Net 10 due date) and payment_verified is still not true,
transitions:
    trial_card_pending → trial_lapsed
sets trial_lapsed_at = NOW(). After this transition the decision-layer
should_optimize gate (T2-2) blocks new optimizations on those creators
on the next tick. Lapse is payment-based (the creator pays the send_invoice
to stay), matching the invoice.paid graduation.

Idempotent: the WHERE clause only matches rows still in trial_card_pending.

## 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)
