[01/Integration record]

Practice tier purchase and upgrade automation for Stripe

Practice tier purchase and upgrade automation for Stripe is an integration job, not a software purchase. Data Jockey has built one as a Cloudflare Pages Function: it runs in production. This page publishes the calls, reads, writes and safety checks that build used, read out of the code.

What it calls

These are the endpoints this build calls directly, with runtime values replaced by a placeholder.

  • `POST /api/checkout` and `POST /api/stripe-webhook`
  • the app mints its own prices by lookup key at first checkout so no local Stripe write is ever needed

What it reads and writes

Every read and every write this build makes is printed below, as the build sends it, with runtime values replaced by a placeholder.

  • writes `practices` and `events` type `billing_change`

Safety checks

An automation that writes into a system of record has to refuse some cases. These are the checks this build makes before it acts.

fail-closed 503 when `STRIPE_WEBHOOK_SECRET` is unset

HMAC signature verification and event-id dedupe

distinguishes a new purchase from a subscription-item swap so an upgrade cannot double-bill

Where it runs

It runs as a Cloudflare Pages Function.

It also touches Cloudflare D1.

What this record is

Data Jockey is a services firm, so this page is an implementation record. There is no product to buy here and no price on this page.

No customer is named on it either. Data Jockey publishes no customer list, and the calls and checks above are the part a reader can check.

Questions we hear

Is practice tier purchase and upgrade automation for Stripe a product or a project?
It is a project. The queries on this page are specific to how one company had its Stripe set up: which fields carried the human identifier, which documents already existed, and where a human had to stay in the loop. A product cannot know any of that in advance, which is why the integration is the work.
Did this run in production?
Yes. It runs in production today as a Cloudflare Pages Function, and this page is read out of the code that runs.
What happens when the automation is not sure?
It stops. This build carries 3 distinct kinds of check, and every one of them exists to hand the case to a person. Automating the confident cases and routing the rest is what makes an integration safe to leave running.
Can Data Jockey build this for us?
Book a call and we will scope it against the systems you already run. Data Jockey publishes no prices, so there is no figure on this page, and what a build costs depends on what your setup turns out to need.

Where these facts come from

Every call, table, check and setting above comes from the delivery record of this build, and each identifier in it was checked against the file that implements it by tools/capture-proof-of-work.mjs. The capture is committed at data/raw/dj-proof-of-work-capture-2026-09-07.json and records a sha256 of each source file. Generated 2026-09-07. No figure here was rounded, averaged or estimated.

[+/Skip ahead]

Book a 30-minute intro.

Book a call
[06/BOOK A CALL]

30 minutes about your operation.

There is no pitch. We spend the call understanding your pain points, whether that means responsible AI adoption or quantifying where automation will pay off, and providing a plan of attack.