S3 and Google Cloud Storage exports
Export your production SubHero data daily to your own S3 or GCS bucket, with each object read back and checksum-verified.
Owners/admins can add a destination under Webhooks & integrations → Daily bucket exports. These production-only customer copies are not an operator backup or restore source. Keep a separate bucket and grant only the project prefix needed by this destination.
S3 needs PutObject/GetObject (including overwrite) on <project_id>/*, the actual AWS region, and a credential object { "accessKeyId": "…", "secretAccessKey": "…", "sessionToken": "…" }; sessionToken is optional. Google Cloud Storage needs object create/read/overwrite permissions and { "client_email": "…", "private_key": "-----BEGIN PRIVATE KEY-----…", "project_id": "…" }. Use a service account key, not an executable/external-account credential. Credentials are encrypted and never returned. Standard vendor endpoints are used; custom endpoints are not accepted.
The cookie-authenticated API is PUT /console/projects/:id/exports/new, with provider (s3 or gcs), bucket, S3 region, format (jsonl or csv), enabled, and credentials. Use the returned destination ID for later PUTs, omitting credentials to retain them or supplying the complete object to rotate. Bucket, provider, region and format are immutable; create a new destination to change them.
Daily runs start at 04:00 UTC. Run export now, or POST /console/projects/:id/exports/:destination/run with {} requests the incremental run. The body { "date": "2026-10-30" } explicitly rewrites all four tables for that UTC date without advancing the incremental cursor. Pending runs are serialized per destination. Export history shows run state and verified object SHA-256, size and etag.
Objects are <project_id>/<table>/<date>.jsonl.gz or .csv.gz for transactions, one_time_purchases, subscriptions and raw_events. Purchase time determines charge partitions, creation time subscription partitions, and receipt time raw-event partitions. Sandbox rows never ship. Numeric values/IDs are exact strings; JSON columns are opaque JSON strings so decimal precision survives CSV/JSONL ingestion. Null stays null in JSONL and empty in CSV.
A run reads every uploaded object back before recording success. Corruption or a crash leaves the run pending; retry repairs/reuses verified units and only advances the project/destination change cursor after all partitions verify. Financial/state update triggers, deletion tombstones, rewrite old affected dates after refunds, tax changes or sweeps. Pausing stops future claims; an already running upload may finish.
Test against a disposable partner bucket, run once, inspect all four object keys and hashes, rerun, and check that production-only contents remain identical. Real S3/GCS account access was not available during implementation; the repository regression suite exercises the same streaming runner with a fake bucket, including failed PUTs and corrupted read-back.
Disabled or paused destinations do not collect changes during the pause. On re-enable, select full-history backfill or request specific dates to cover that interval. A partially completed export resumes from its verified objects; repeated timeouts without progress still suspend a failing destination.