@checkbox-site/node 0.1.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/client.d.ts +87 -2
- package/dist/generated/operations.d.ts +208 -28
- package/dist/generated/operations.js +185 -24
- package/dist/generated/types.d.ts +971 -169
- package/dist/generated/types.js +13 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +11 -2
|
@@ -17,6 +17,8 @@ export interface NextAction {
|
|
|
17
17
|
operation_id?: string;
|
|
18
18
|
/** The MCP tool that performs operation_id on the Checkbox MCP server (`call_api` when there is no dedicated tool). */
|
|
19
19
|
mcp_tool?: string;
|
|
20
|
+
/** The HTTP method and path of operation_id, with path parameters in braces. */
|
|
21
|
+
endpoint?: string;
|
|
20
22
|
/** Documentation or dashboard URL for the step, when there is one. */
|
|
21
23
|
url?: string;
|
|
22
24
|
}
|
|
@@ -32,6 +34,8 @@ export interface Error {
|
|
|
32
34
|
message: string;
|
|
33
35
|
/** The parameter the error relates to, when there is one. */
|
|
34
36
|
param?: string;
|
|
37
|
+
/** What is missing or wrong, one entry each (terms_incomplete; and every problem of a parameter_invalid / parameter_missing request, so all can be fixed in one try). */
|
|
38
|
+
problems?: Array<string>;
|
|
35
39
|
/** Link to the documentation of this error code. */
|
|
36
40
|
doc_url: string;
|
|
37
41
|
/** Id of the request (also in the Request-Id header). Quote it to support. */
|
|
@@ -49,10 +53,35 @@ export interface SetupNextAction {
|
|
|
49
53
|
operation_id?: string;
|
|
50
54
|
/** The MCP tool that performs operation_id (`call_api` when there is no dedicated tool). */
|
|
51
55
|
mcp_tool?: string;
|
|
56
|
+
/** The HTTP method and path of operation_id, with path parameters in braces. */
|
|
57
|
+
endpoint?: string;
|
|
52
58
|
/** The equivalent `checkbox` CLI command, when there is one. */
|
|
53
59
|
command?: string;
|
|
54
60
|
/** Documentation or dashboard URL for the step. */
|
|
55
61
|
url?: string;
|
|
62
|
+
/** verify_domain with a started challenge: the DNS TXT record to add. */
|
|
63
|
+
dns?: {
|
|
64
|
+
/** Record type. */
|
|
65
|
+
type: "TXT";
|
|
66
|
+
/** Full record name. */
|
|
67
|
+
name: string;
|
|
68
|
+
/** Record value. */
|
|
69
|
+
value: string;
|
|
70
|
+
};
|
|
71
|
+
/** verify_domain with a started challenge: the file to serve instead of the DNS record. */
|
|
72
|
+
well_known?: {
|
|
73
|
+
/** Where to serve the file. */
|
|
74
|
+
url: string;
|
|
75
|
+
/** The file content. */
|
|
76
|
+
content: string;
|
|
77
|
+
};
|
|
78
|
+
/** verify_domain with a started challenge: or this meta tag on the homepage. The live snippet (install.script_tag) works too: Checkbox verifies the domain when it sees it. */
|
|
79
|
+
meta_tag?: {
|
|
80
|
+
/** The page Checkbox reads (the homepage of the domain). */
|
|
81
|
+
url: string;
|
|
82
|
+
/** The tag to put in its <head>. */
|
|
83
|
+
html: string;
|
|
84
|
+
};
|
|
56
85
|
}
|
|
57
86
|
/** A pending device login (RFC 8628 style). */
|
|
58
87
|
export interface DeviceAuthorization {
|
|
@@ -96,11 +125,11 @@ export interface DeviceAuthorizationParams {
|
|
|
96
125
|
package_manager?: string;
|
|
97
126
|
/** Detected billing platform. */
|
|
98
127
|
billing_platform?: string;
|
|
99
|
-
/** Business name
|
|
128
|
+
/** Business name: names the site and workspace (instead of the host name). */
|
|
100
129
|
merchant_name?: string;
|
|
101
130
|
/** Also ask for live-mode keys (live mode activates after domain verification). */
|
|
102
131
|
live?: boolean;
|
|
103
|
-
/** A HINT of the Stripe TEST key found in the project
|
|
132
|
+
/** A HINT of the Stripe TEST key found in the project, never the key. Format: "sk_test_" or "rk_test_", the ellipsis character "…" (U+2026), then the key's last 4 characters, e.g. "sk_test_…a1b2". The human is asked once whether Checkbox may use it for synthetic test subscriptions. */
|
|
104
133
|
stripe_test_key_hint?: string;
|
|
105
134
|
}
|
|
106
135
|
/** Keys issued after the human approved the device login. Returned exactly once. */
|
|
@@ -132,14 +161,14 @@ export interface DeviceToken {
|
|
|
132
161
|
site: string | null;
|
|
133
162
|
/** What the human approved. */
|
|
134
163
|
consents: {
|
|
135
|
-
/** The human allowed Checkbox to use the project's Stripe TEST key (
|
|
164
|
+
/** The human allowed Checkbox to use the project's Stripe TEST key (store it with createTestCredential; it must be a restricted rk_test_ key). */
|
|
136
165
|
stripe_test_key: boolean;
|
|
137
166
|
/** Live keys were issued. */
|
|
138
167
|
live_keys: boolean;
|
|
139
168
|
};
|
|
140
169
|
next_action: SetupNextAction;
|
|
141
170
|
}
|
|
142
|
-
/** A subscription plan as the merchant sells it. */
|
|
171
|
+
/** A subscription plan as the merchant sells it: name, amount (minor units), currency, interval, interval_count, trial_days and the intro_* promo fields, the same shape the checks accept (plan_name, price and intro_price are accepted as aliases). */
|
|
143
172
|
export interface SetupPlan {
|
|
144
173
|
/** Plan name. */
|
|
145
174
|
name?: string;
|
|
@@ -153,11 +182,83 @@ export interface SetupPlan {
|
|
|
153
182
|
interval_count?: number;
|
|
154
183
|
/** Free-trial days (0 = none). */
|
|
155
184
|
trial_days?: number;
|
|
185
|
+
/** Intro / first-period price in minor units (800 = $8.00 for the first period). Give one of intro_amount, intro_percent_off or intro_amount_off. */
|
|
186
|
+
intro_amount?: number;
|
|
187
|
+
/** Intro discount as a percentage off `amount` (a Stripe coupon's percent_off: 20 for 20% off). */
|
|
188
|
+
intro_percent_off?: number;
|
|
189
|
+
/** Intro discount as an amount off `amount`, in minor units (a Stripe coupon's amount_off). */
|
|
190
|
+
intro_amount_off?: number;
|
|
191
|
+
/** How many billing periods the intro price lasts (default 1). */
|
|
192
|
+
intro_periods?: number;
|
|
193
|
+
/** The billing platform's price id (Stripe price_…), so `amount` is compared with the connected Price. */
|
|
194
|
+
price_id?: string;
|
|
195
|
+
/** Alias of `name` (the name the checks also accept). */
|
|
196
|
+
plan_name?: string;
|
|
197
|
+
/** Alias of `amount` in MAJOR units (19 = $19.00); `amount` (minor units) is the canonical field. */
|
|
198
|
+
price?: number | string;
|
|
199
|
+
/** Alias of `intro_amount` in MAJOR units (8 = $8.00). */
|
|
200
|
+
intro_price?: number | string;
|
|
156
201
|
}
|
|
202
|
+
/** While the domain is not verified: the newest read-only scan of the site's own public pages (labeled "unverified scan": no checkout submitted, not evidence, replaced by the full scan after verification). Null otherwise. */
|
|
203
|
+
export type UnverifiedScan = {
|
|
204
|
+
/** Read-only scan id (uscan_…). */
|
|
205
|
+
id: string;
|
|
206
|
+
/** Object type. */
|
|
207
|
+
object: "unverified_scan";
|
|
208
|
+
/** Always true: read before the domain was verified. Not evidence; no certificate, receipt or monitoring comes from it. */
|
|
209
|
+
unverified: true;
|
|
210
|
+
/** The label every surface shows with these results. */
|
|
211
|
+
label: "unverified scan";
|
|
212
|
+
/** queued, running, completed, failed, or skipped (e.g. the domain got verified first, so the full scan replaces it). */
|
|
213
|
+
status: "queued" | "running" | "completed" | "failed" | "skipped";
|
|
214
|
+
/** When it was queued. Unix timestamp in seconds. */
|
|
215
|
+
created: number;
|
|
216
|
+
/** When it finished. Unix timestamp in seconds. */
|
|
217
|
+
finished: number | null;
|
|
218
|
+
/** Every page considered (at most 20 loaded). */
|
|
219
|
+
pages: Array<{
|
|
220
|
+
/** Page URL. */
|
|
221
|
+
url: string;
|
|
222
|
+
/** home, pricing, terms, privacy, refund, cancellation, account or checkout. */
|
|
223
|
+
kind: string;
|
|
224
|
+
/** captured; skipped (robots.txt, not on the site's own domain, page limit, action link); failed. */
|
|
225
|
+
status: "captured" | "skipped" | "failed";
|
|
226
|
+
/** Why it was skipped or failed. */
|
|
227
|
+
reason?: string;
|
|
228
|
+
}>;
|
|
229
|
+
/** Checks on the loaded pages, in memory (not findings of the site). */
|
|
230
|
+
findings: Array<{
|
|
231
|
+
/** Check id. */
|
|
232
|
+
check_id: string;
|
|
233
|
+
/** Verdict on the loaded pages alone. */
|
|
234
|
+
status: "pass" | "fail" | "needs_review";
|
|
235
|
+
/** critical, high, medium or low. */
|
|
236
|
+
severity: string;
|
|
237
|
+
/** The check, in one line. */
|
|
238
|
+
title: string;
|
|
239
|
+
}>;
|
|
240
|
+
/** Counts. */
|
|
241
|
+
counts: {
|
|
242
|
+
/** Pages captured. */
|
|
243
|
+
pages_captured: number;
|
|
244
|
+
/** Pages skipped. */
|
|
245
|
+
pages_skipped: number;
|
|
246
|
+
/** Failing checks. */
|
|
247
|
+
failing: number;
|
|
248
|
+
/** Checks to review. */
|
|
249
|
+
needs_review: number;
|
|
250
|
+
/** Passing checks. */
|
|
251
|
+
passing: number;
|
|
252
|
+
};
|
|
253
|
+
/** Why it failed or was skipped. */
|
|
254
|
+
error: string | null;
|
|
255
|
+
/** What an unverified scan is (show it with the results). */
|
|
256
|
+
note: string;
|
|
257
|
+
} | null;
|
|
157
258
|
/** One step of the setup checklist. */
|
|
158
259
|
export interface SetupStep {
|
|
159
260
|
/** Stable step key. */
|
|
160
|
-
key: "account" | "site" | "snippet" | "policies" | "checks" | "lifecycle_test" | "fixes" | "domain" | "owner_notified";
|
|
261
|
+
key: "account" | "site" | "snippet" | "policies" | "checks" | "connect_billing" | "lifecycle_test" | "fixes" | "domain" | "owner_notified";
|
|
161
262
|
/** Human-readable title. */
|
|
162
263
|
title: string;
|
|
163
264
|
/** done; pending (waiting on Checkbox or a deploy); action_required (the agent must act: see next_action); skipped; failed. */
|
|
@@ -222,22 +323,35 @@ export interface SetupSession {
|
|
|
222
323
|
/** Plans. */
|
|
223
324
|
plans: Array<SetupPlan>;
|
|
224
325
|
};
|
|
326
|
+
/** Notes about this request's input (createSetupSession / updateSetupSession only; never stored): plan amounts below 100 minor units or different from the connected Stripe Price. */
|
|
327
|
+
warnings?: Array<{
|
|
328
|
+
/** Stable warning code. */
|
|
329
|
+
code: "plan_amount_looks_like_major_units" | "plan_amount_mismatch_stripe_price";
|
|
330
|
+
/** What looks wrong and what to send. */
|
|
331
|
+
message: string;
|
|
332
|
+
/** The parameter. */
|
|
333
|
+
param: string;
|
|
334
|
+
}>;
|
|
225
335
|
/** Policy / pricing links Checkbox found in the site's HTML (terms_url, privacy_url, refund_url, cancellation_url, pricing_url, account_url). */
|
|
226
336
|
discovered: Record<string, string>;
|
|
227
337
|
/** Install details. */
|
|
228
338
|
install: {
|
|
229
339
|
/** The exact tag to put in <head> on every page. */
|
|
230
340
|
script_tag: string | null;
|
|
231
|
-
/**
|
|
341
|
+
/** The site's public snippet key: the data-key of script_tag (and the local part of inbound_email). Use only this key in the snippet tag. */
|
|
232
342
|
snippet_key: string | null;
|
|
233
|
-
/**
|
|
343
|
+
/** A different key: the account's test-mode publishable key (pk_test_…) for Checkbox Elements (<checkbox-disclosure>) and consent receipts (data-publishable-key). Not the snippet's data-key. */
|
|
234
344
|
publishable_key: string | null;
|
|
235
345
|
/** BCC this address on subscription emails (acknowledgment, reminders) so they are checked. */
|
|
236
346
|
inbound_email: string | null;
|
|
237
347
|
/** File the agent added the snippet to. */
|
|
238
348
|
installed_in: string | null;
|
|
239
|
-
/** Whether
|
|
349
|
+
/** Whether the snippet is live on the site: seen in the homepage at the last verify, or a capture it sent from a page of the site's verified domain (null: not checked). */
|
|
240
350
|
detected_on_site: boolean | null;
|
|
351
|
+
/** How Checkbox knows the snippet is live: the tag in the homepage HTML, or its first capture from the site's domain. */
|
|
352
|
+
detected_via: "homepage" | "capture" | null;
|
|
353
|
+
/** The page of the snippet's first capture from the site's domain (detected_via capture). */
|
|
354
|
+
first_capture_url: string | null;
|
|
241
355
|
};
|
|
242
356
|
/** Policy documents Checkbox fetched (checked by terms.* checks). */
|
|
243
357
|
policies: Array<{
|
|
@@ -245,14 +359,32 @@ export interface SetupSession {
|
|
|
245
359
|
kind: string;
|
|
246
360
|
/** URL fetched. */
|
|
247
361
|
url: string;
|
|
248
|
-
/** Fetch result. */
|
|
249
|
-
status: "fetched" | "failed";
|
|
362
|
+
/** Fetch result. preview: read before the site's domain was verified (unverified preview): nothing was stored as evidence and only the Terms checks ran, in memory; it is fetched and stored once the domain is verified. */
|
|
363
|
+
status: "fetched" | "failed" | "preview";
|
|
250
364
|
/** When it was fetched. Unix timestamp in seconds. */
|
|
251
365
|
fetched: number;
|
|
252
366
|
/** Why the fetch failed. */
|
|
253
367
|
error: string | null;
|
|
254
368
|
/** Evidence record of the stored page (ev_…). */
|
|
255
369
|
evidence: string | null;
|
|
370
|
+
/** Not read (or only previewed) because the site's domain is not verified yet. */
|
|
371
|
+
held: boolean;
|
|
372
|
+
/** Unverified preview result (status preview), else null. */
|
|
373
|
+
preview: {
|
|
374
|
+
/** Always true: read before the domain was verified; nothing stored. */
|
|
375
|
+
unverified: true;
|
|
376
|
+
/** Terms checks on this page (none for a privacy policy). */
|
|
377
|
+
checks: Array<{
|
|
378
|
+
/** Check id. */
|
|
379
|
+
check_id: string;
|
|
380
|
+
/** Verdict on this page alone. */
|
|
381
|
+
status: "pass" | "fail" | "needs_review";
|
|
382
|
+
/** The check, in one line. */
|
|
383
|
+
summary: string;
|
|
384
|
+
/** One-sentence fix. */
|
|
385
|
+
fix?: string;
|
|
386
|
+
}>;
|
|
387
|
+
} | null;
|
|
256
388
|
}>;
|
|
257
389
|
/** Stripe test mode for lifecycle test runs. */
|
|
258
390
|
stripe: {
|
|
@@ -266,18 +398,20 @@ export interface SetupSession {
|
|
|
266
398
|
checkout_configs: number;
|
|
267
399
|
/** Restricted-key recommendation. */
|
|
268
400
|
restricted_key: {
|
|
269
|
-
/** true while no restricted (rk_test_) key is stored. */
|
|
401
|
+
/** true while no restricted (rk_test_) key is stored. The agent stores it with createTestCredential. */
|
|
270
402
|
recommended: boolean;
|
|
271
403
|
/** Why. */
|
|
272
404
|
reason: string;
|
|
273
405
|
/** Where to create it. */
|
|
274
406
|
create_url: string;
|
|
275
|
-
/**
|
|
407
|
+
/** The one key checklist: every permission Checkbox uses (checks, fixes after the human approves, test runs). */
|
|
276
408
|
permissions: Array<{
|
|
277
|
-
/** Stripe resource. */
|
|
409
|
+
/** Stripe resource, as the restricted-key screen names it. */
|
|
278
410
|
resource: string;
|
|
279
|
-
/** Access. */
|
|
411
|
+
/** Access to tick (write includes read). */
|
|
280
412
|
access: "read" | "write";
|
|
413
|
+
/** One line: why Checkbox needs it. */
|
|
414
|
+
why?: string;
|
|
281
415
|
}>;
|
|
282
416
|
};
|
|
283
417
|
};
|
|
@@ -287,20 +421,61 @@ export interface SetupSession {
|
|
|
287
421
|
id: string;
|
|
288
422
|
/** queued, running, succeeded, failed or canceled. */
|
|
289
423
|
status: string;
|
|
424
|
+
/** The result in plain words, as the test run says it ("Finished with 2 warnings to review"). succeeded with warnings is not a clean pass. */
|
|
425
|
+
status_label?: string;
|
|
290
426
|
/** When it started. Unix timestamp in seconds. */
|
|
291
427
|
created: number;
|
|
292
428
|
} | null;
|
|
429
|
+
/** The plans Checkbox judges the site against: the declared plans as reconciled with the connected Stripe Prices (Stripe wins), the plans the pay buttons sell and the account's Prices of a declared plan. Empty until a plan is known (updateSetupSession plans[], or connect Stripe). */
|
|
430
|
+
site_plans: Array<{
|
|
431
|
+
/** Plan name (or its price and interval). */
|
|
432
|
+
name: string;
|
|
433
|
+
/** The recurring price, formatted. */
|
|
434
|
+
price: string;
|
|
435
|
+
/** The recurring price in minor units (cents). */
|
|
436
|
+
amount: number;
|
|
437
|
+
/** Currency (lowercase ISO code). */
|
|
438
|
+
currency: string;
|
|
439
|
+
/** day, week, month or year. */
|
|
440
|
+
interval: string;
|
|
441
|
+
/** Intervals between charges. */
|
|
442
|
+
interval_count: number;
|
|
443
|
+
/** Free trial days on this plan (0: none). */
|
|
444
|
+
trial_days: number;
|
|
445
|
+
/** A lower first-period price, if any. */
|
|
446
|
+
intro_price: {
|
|
447
|
+
/** Intro price in minor units. */
|
|
448
|
+
amount: number;
|
|
449
|
+
/** Billing periods at the intro price. */
|
|
450
|
+
periods: number | null;
|
|
451
|
+
} | null;
|
|
452
|
+
/** Every Stripe Price id that names this plan. */
|
|
453
|
+
stripe_price_ids: Array<string>;
|
|
454
|
+
/** declared in setup, chosen in site facts, sold by the pay buttons, or read from the connected Stripe account. */
|
|
455
|
+
source: "declared" | "chosen" | "sold" | "stripe";
|
|
456
|
+
}>;
|
|
293
457
|
/** Latest verdict of the test-mode site. */
|
|
294
458
|
compliance: {
|
|
295
|
-
/** 0-100. */
|
|
296
|
-
score: number;
|
|
297
459
|
/** When it was evaluated. Unix timestamp in seconds. */
|
|
298
460
|
evaluated: number;
|
|
299
|
-
/**
|
|
461
|
+
/**
|
|
462
|
+
* Deprecated: open failing findings (per check). Read `label` (counted in tasks) and `todo` instead.
|
|
463
|
+
* @deprecated
|
|
464
|
+
*/
|
|
300
465
|
failing: number;
|
|
301
|
-
/**
|
|
466
|
+
/**
|
|
467
|
+
* Deprecated: open needs-review findings (per check). Read `label` (counted in tasks) and `todo` instead.
|
|
468
|
+
* @deprecated
|
|
469
|
+
*/
|
|
302
470
|
needs_review: number;
|
|
303
|
-
/**
|
|
471
|
+
/** The site roll-up label, the same everywhere (dashboard, plan, emails): "2 fixes needed · 1 your call", "Checks pass · 2 live checks pending". */
|
|
472
|
+
label: string | null;
|
|
473
|
+
/** The site roll-up status: needs_fix, your_call, incomplete, compliant or not_checked. */
|
|
474
|
+
status: string | null;
|
|
475
|
+
/**
|
|
476
|
+
* Deprecated: open findings (evidence). The to-do list is `todo` (the compliance plan's ordered open tasks).
|
|
477
|
+
* @deprecated
|
|
478
|
+
*/
|
|
304
479
|
top_findings: Array<{
|
|
305
480
|
/** Unique identifier of the finding (fnd_…). */
|
|
306
481
|
id: string;
|
|
@@ -313,14 +488,37 @@ export interface SetupSession {
|
|
|
313
488
|
/** What is wrong. */
|
|
314
489
|
title: string;
|
|
315
490
|
}>;
|
|
491
|
+
/** The to-do list: the compliance plan's ordered open required tasks (same titles, order and counts as the dashboard, MCP get_site_status and the summary email). */
|
|
492
|
+
todo?: Array<{
|
|
493
|
+
/** Plan task id (task_…); its findings are the evidence. */
|
|
494
|
+
task: string;
|
|
495
|
+
/** Task key. */
|
|
496
|
+
key: string;
|
|
497
|
+
/** Task title, the same as in the plan. */
|
|
498
|
+
title: string;
|
|
499
|
+
/** The status the site roll-up counts the task under. */
|
|
500
|
+
status: "needs_fix" | "not_set_up" | "your_call" | "not_checked";
|
|
501
|
+
/** Needs a fix, Not set up yet, Your call or Not checked yet. */
|
|
502
|
+
label: string;
|
|
503
|
+
}>;
|
|
316
504
|
} | null;
|
|
505
|
+
unverified_scan: UnverifiedScan;
|
|
317
506
|
/** The setup checklist, in order. */
|
|
318
507
|
steps: Array<SetupStep>;
|
|
319
508
|
next_action: SetupNextAction;
|
|
320
509
|
/** Whether the human got the summary email. */
|
|
321
510
|
owner_notified: boolean;
|
|
322
|
-
/** The summary email: sent, or not_configured when this deployment has no SMTP
|
|
323
|
-
owner_email: "sent" | "not_configured" | null;
|
|
511
|
+
/** The summary email, sent only by completeSetupSession and built from the plan at that moment: sent (the mail server accepted it; see owner_email_detail.at), failed (not delivered; owner_email_detail.error says why, and the next completeSetupSession retries), or not_configured when this deployment has no SMTP. Null before completeSetupSession. */
|
|
512
|
+
owner_email: "sent" | "not_configured" | "failed" | null;
|
|
513
|
+
/** Delivery details of the summary email (null before completeSetupSession). */
|
|
514
|
+
owner_email_detail: {
|
|
515
|
+
/** When the summary was handed to the mail server (or failed), unix seconds. */
|
|
516
|
+
at: number | null;
|
|
517
|
+
/** Who it was sent to. */
|
|
518
|
+
to: string | null;
|
|
519
|
+
/** Why it failed (failed only). */
|
|
520
|
+
error: string | null;
|
|
521
|
+
} | null;
|
|
324
522
|
/** Dashboard page with the setup timeline (for the human). */
|
|
325
523
|
review_url: string;
|
|
326
524
|
}
|
|
@@ -341,22 +539,22 @@ export interface SetupSessionUpdate {
|
|
|
341
539
|
site_url?: string;
|
|
342
540
|
/** Page where customers subscribe (pricing page or checkout). */
|
|
343
541
|
checkout_url?: string;
|
|
344
|
-
/** Account page where subscribers manage / cancel. */
|
|
345
|
-
account_url?: string;
|
|
346
|
-
/** Terms of service page. Checkbox fetches and checks it. */
|
|
347
|
-
terms_url?: string;
|
|
348
|
-
/** Privacy policy page. */
|
|
349
|
-
privacy_url?: string;
|
|
350
|
-
/** Refund policy page. */
|
|
351
|
-
refund_url?: string;
|
|
352
|
-
/** Cancellation policy page (if separate from the Terms). */
|
|
353
|
-
cancellation_url?: string;
|
|
542
|
+
/** Account page where subscribers manage / cancel. null clears it. */
|
|
543
|
+
account_url?: string | null;
|
|
544
|
+
/** Terms of service page. Checkbox fetches and checks it. null clears it. */
|
|
545
|
+
terms_url?: string | null;
|
|
546
|
+
/** Privacy policy page. null clears it. */
|
|
547
|
+
privacy_url?: string | null;
|
|
548
|
+
/** Refund policy page. null clears it. */
|
|
549
|
+
refund_url?: string | null;
|
|
550
|
+
/** Cancellation policy page (if separate from the Terms). null clears it. */
|
|
551
|
+
cancellation_url?: string | null;
|
|
354
552
|
/** Support address subscribers can write to. */
|
|
355
553
|
support_email?: string;
|
|
356
554
|
/** The brand subscribers know (it names the seller in generated disclosures and emails). Default: the site's host name, which the plan asks you to replace. */
|
|
357
555
|
merchant_name?: string;
|
|
358
|
-
/** Billing platform. */
|
|
359
|
-
billing_platform?: "stripe" | "shopify" | "recharge" | "chargebee" | "recurly" | "paddle" | "woocommerce" | "custom";
|
|
556
|
+
/** Billing platform. lemon_squeezy: Checkbox checks your pages and emails (no billing connection). */
|
|
557
|
+
billing_platform?: "stripe" | "shopify" | "recharge" | "chargebee" | "recurly" | "paddle" | "lemon_squeezy" | "woocommerce" | "custom";
|
|
360
558
|
/** Plans and prices (sets the free-trial and term facts the law depends on). */
|
|
361
559
|
plans?: Array<SetupPlan>;
|
|
362
560
|
/** Facts about the builder's codebase. */
|
|
@@ -375,7 +573,7 @@ export interface SetupSessionUpdate {
|
|
|
375
573
|
env_file?: string;
|
|
376
574
|
/** Static files directory (for /.well-known). */
|
|
377
575
|
public_dir?: string;
|
|
378
|
-
/** Where checkout sessions / payment links are created. */
|
|
576
|
+
/** Where checkout sessions / payment links are created: an ARRAY of { file, kind, line?, snippet? } objects, one per place (not a string), e.g. [{"file": "app.py", "line": 40, "kind": "stripe_checkout_session"}]. */
|
|
379
577
|
checkout_code?: Array<SetupCodeRef>;
|
|
380
578
|
/** Where the subscribe / pay buttons are rendered. */
|
|
381
579
|
pay_buttons?: Array<SetupCodeRef>;
|
|
@@ -413,6 +611,8 @@ export interface SetupVerification {
|
|
|
413
611
|
snippet_detected: boolean | null;
|
|
414
612
|
/** Why the site could not be loaded. */
|
|
415
613
|
error: string | null;
|
|
614
|
+
/** Read as an unverified preview (domain not verified yet): one plain GET of the homepage for links and the snippet, nothing stored as evidence. */
|
|
615
|
+
preview: boolean;
|
|
416
616
|
};
|
|
417
617
|
/** Policies fetched now. */
|
|
418
618
|
policies: Array<{
|
|
@@ -422,20 +622,64 @@ export interface SetupVerification {
|
|
|
422
622
|
ok: boolean;
|
|
423
623
|
/** Error. */
|
|
424
624
|
error: string | null;
|
|
625
|
+
/** Read as an unverified preview (domain not verified yet): nothing stored. */
|
|
626
|
+
preview: boolean;
|
|
425
627
|
}>;
|
|
426
628
|
/** Synthetic-shopper scan. */
|
|
427
629
|
scan: {
|
|
428
630
|
/** Whether a scan was queued now. */
|
|
429
631
|
queued: boolean;
|
|
430
|
-
/** The queued scan (scan_…). */
|
|
632
|
+
/** The queued scan (scan_…); with a reason, the scan still in progress ("a scan is running/queued": wait for it) or, with "already scanned", the newest scan (read it with retrieveScan). */
|
|
431
633
|
scan: string | null;
|
|
432
634
|
/** Why not. */
|
|
433
635
|
reason: string | null;
|
|
434
636
|
};
|
|
435
637
|
/** Whether compliance was re-evaluated now. */
|
|
436
638
|
evaluated: boolean;
|
|
639
|
+
/** The site's domain got verified during this call (e.g. the snippet is live on the homepage). */
|
|
640
|
+
domain_verified: {
|
|
641
|
+
/** The domain. */
|
|
642
|
+
domain: string;
|
|
643
|
+
/** snippet, meta_tag, dns_txt or well_known. */
|
|
644
|
+
method: string;
|
|
645
|
+
} | null;
|
|
646
|
+
/** While the domain is not verified: the read-only scan of the site's own public pages (no checkout submitted). */
|
|
647
|
+
unverified_scan: {
|
|
648
|
+
/** Whether a read-only (unverified) scan was queued now. */
|
|
649
|
+
queued: boolean;
|
|
650
|
+
/** Why not (limits: one per site per 24 h, three unverified sites per account in 30 days). */
|
|
651
|
+
reason: string | null;
|
|
652
|
+
} | null;
|
|
437
653
|
setup_session: SetupSession;
|
|
438
654
|
}
|
|
655
|
+
/** Account default retention (sites without their own setting use it). */
|
|
656
|
+
export interface Retention {
|
|
657
|
+
/** Years records are kept (consent receipts, disclosures as shown, passing check results, certificates, emails sent, confirmed cancellations, evidence-chain entries). Default 7. */
|
|
658
|
+
records_years: number;
|
|
659
|
+
/** Days superseded check results are kept after a later check replaces them (with their page captures and change history); only summary counts stay. Current results are not deleted. Default 30. */
|
|
660
|
+
superseded_results_days: number;
|
|
661
|
+
/**
|
|
662
|
+
* Deprecated: same as records_years.
|
|
663
|
+
* @deprecated
|
|
664
|
+
*/
|
|
665
|
+
good_practice_years: number;
|
|
666
|
+
/**
|
|
667
|
+
* Deprecated: same as superseded_results_days.
|
|
668
|
+
* @deprecated
|
|
669
|
+
*/
|
|
670
|
+
problem_history_days: number;
|
|
671
|
+
}
|
|
672
|
+
/** Account-wide legal hold: while active, nothing of this mode's data is deleted. */
|
|
673
|
+
export interface LegalHold {
|
|
674
|
+
/** A legal hold suspends every automatic deletion and refuses deletions and retention shortening. */
|
|
675
|
+
active: boolean;
|
|
676
|
+
/** What the active hold was set on (an account hold covers every site). */
|
|
677
|
+
scope: "site" | "account" | null;
|
|
678
|
+
/** When the hold was turned on. Unix timestamp in seconds. */
|
|
679
|
+
set: number | null;
|
|
680
|
+
/** Note recorded with the hold. */
|
|
681
|
+
reason: string | null;
|
|
682
|
+
}
|
|
439
683
|
/** The Checkbox account behind the API key. */
|
|
440
684
|
export interface Account {
|
|
441
685
|
/** Unique identifier of the account (acct_…). */
|
|
@@ -488,10 +732,49 @@ export interface Account {
|
|
|
488
732
|
/** Checkbox is free to use. */
|
|
489
733
|
plan: "free";
|
|
490
734
|
};
|
|
735
|
+
retention: Retention;
|
|
736
|
+
legal_hold: LegalHold;
|
|
491
737
|
/** When the account was created. Unix timestamp in seconds. */
|
|
492
738
|
created: number;
|
|
493
739
|
next_action: NextAction | null;
|
|
494
740
|
}
|
|
741
|
+
/** Default retention for every site without its own setting. A longer period for superseded check results keeps a fuller timeline of changes to your site. */
|
|
742
|
+
export interface RetentionParams {
|
|
743
|
+
/** Years records are kept (1-10). On a site, null returns to the account default. */
|
|
744
|
+
records_years?: number | null;
|
|
745
|
+
/** Days superseded check results are kept (7-730). On a site, null returns to the account default. */
|
|
746
|
+
superseded_results_days?: number | null;
|
|
747
|
+
/**
|
|
748
|
+
* Deprecated: use records_years.
|
|
749
|
+
* @deprecated
|
|
750
|
+
*/
|
|
751
|
+
good_practice_years?: number | null;
|
|
752
|
+
/**
|
|
753
|
+
* Deprecated: use superseded_results_days.
|
|
754
|
+
* @deprecated
|
|
755
|
+
*/
|
|
756
|
+
problem_history_days?: number | null;
|
|
757
|
+
}
|
|
758
|
+
/** Account-wide legal hold: suspends every deletion of the account's records until turned off. */
|
|
759
|
+
export interface LegalHoldParams {
|
|
760
|
+
/** true turns the hold on, false turns it off. */
|
|
761
|
+
active: boolean;
|
|
762
|
+
/** Note stored with the hold (who asked, matter). */
|
|
763
|
+
reason?: string;
|
|
764
|
+
}
|
|
765
|
+
/** An introductory price or coupon for one billing price (the same as Site settings → Your offer → Introductory price or coupon). */
|
|
766
|
+
export interface SiteIntroOffer {
|
|
767
|
+
/** The billing-platform price the intro applies to (e.g. a Stripe price id). */
|
|
768
|
+
price_id: string;
|
|
769
|
+
/** The intro price per billing period, in minor units (900 = $9.00). Give exactly one of intro_amount, intro_percent_off or intro_amount_off. */
|
|
770
|
+
intro_amount?: number;
|
|
771
|
+
/** A coupon: percent off the regular price. */
|
|
772
|
+
intro_percent_off?: number;
|
|
773
|
+
/** A coupon: amount off per billing period, in minor units. */
|
|
774
|
+
intro_amount_off?: number;
|
|
775
|
+
/** How many billing periods the intro price lasts (default 1). */
|
|
776
|
+
intro_periods?: number;
|
|
777
|
+
}
|
|
495
778
|
/** Business facts that decide which legal requirements apply. */
|
|
496
779
|
export interface SiteFacts {
|
|
497
780
|
/** The offer starts with a free trial. */
|
|
@@ -512,6 +795,10 @@ export interface SiteFacts {
|
|
|
512
795
|
plan_price_id?: string;
|
|
513
796
|
/** Accepted payment methods (debit / ACH bring in Reg E). */
|
|
514
797
|
payment_methods?: Array<"card" | "debit" | "ach" | "wallet" | "other">;
|
|
798
|
+
/** Where shoppers pay and consent. stripe_checkout / payment_link: your pages redirect to a Stripe-hosted page, so consent is checked on Stripe (consent_collection and custom_text of your registered Checkout configs or Payment Links), and your pricing page needs no checkbox of its own. Unset: detected from pay buttons that link to checkout.stripe.com / buy.stripe.com. */
|
|
799
|
+
checkout_type?: "own_page" | "stripe_checkout" | "payment_link";
|
|
800
|
+
/** Introductory prices or coupons per billing price (Site settings → Your offer). Every check, the plan, the Emails-tab templates and generated disclosures compare stated promos with them. Omit to keep the stored ones; [] clears them. A coupon must also exist in your live Stripe account before live sales. */
|
|
801
|
+
intro_offers?: Array<SiteIntroOffer>;
|
|
515
802
|
}
|
|
516
803
|
/** Scheduled monitoring. */
|
|
517
804
|
export interface SiteMonitoring {
|
|
@@ -528,6 +815,11 @@ export interface SiteMonitoring {
|
|
|
528
815
|
/** Domains to verify before Checkbox scans the site (first: createDomainVerification for the site's own domain). */
|
|
529
816
|
verify_domains: Array<string>;
|
|
530
817
|
}
|
|
818
|
+
/** The retention in effect for the site. */
|
|
819
|
+
export type SiteRetention = Retention & {
|
|
820
|
+
/** Both values come from the account default (no site override). */
|
|
821
|
+
inherited: boolean;
|
|
822
|
+
};
|
|
531
823
|
/** A live check Checkbox has not observed yet, and how it completes. */
|
|
532
824
|
export interface PendingLiveCheck {
|
|
533
825
|
/** What has not been observed yet. */
|
|
@@ -539,9 +831,31 @@ export interface PendingLiveCheck {
|
|
|
539
831
|
/** ISO date when it completes on its own (a reminder window), when known. */
|
|
540
832
|
due: string | null;
|
|
541
833
|
}
|
|
834
|
+
/** One plan / checkout of the site and its sign-up verdict. */
|
|
835
|
+
export interface CheckoutVerdict {
|
|
836
|
+
/** Plan name, or the checkout when no plan was matched. */
|
|
837
|
+
name: string;
|
|
838
|
+
/** Where the purchase happens: own_page, stripe_checkout (your page → Stripe Checkout), payment_link, checkout_config (a registered Checkout Session config), stripe_hosted. */
|
|
839
|
+
kind: "own_page" | "stripe_checkout" | "payment_link" | "checkout_config" | "stripe_hosted";
|
|
840
|
+
/** The declared plan this checkout sells, when matched. */
|
|
841
|
+
plan: string | null;
|
|
842
|
+
/** User-facing status. needs_fix (a requirement is clearly not met: `compliance.fix` is the one change), pending_live_check (everything Checkbox can see is right; the live event has not been observed yet — counts as passing the checks), verified_live (observed live: proof run, real BCC'd send, Stripe-confirmed cancellation), your_call (a real decision for a person: `compliance.question`), compliant (passes; grey areas carry a `compliance.note`), not_applicable, not_set_up (no sign the email or setting exists yet: `compliance.fix` is the one-click way to set it up; never counts as passing the checks), not_checked (Checkbox has not tried it yet, e.g. the cancel flow: `compliance.fix` says how; never counts as passing the checks). */
|
|
843
|
+
status: "needs_fix" | "pending_live_check" | "verified_live" | "your_call" | "compliant" | "not_applicable" | "not_set_up" | "not_checked";
|
|
844
|
+
/** Label to show. */
|
|
845
|
+
label: string;
|
|
846
|
+
/** Sign-up checks still open on this checkout. */
|
|
847
|
+
open: Array<{
|
|
848
|
+
/** Check id. */
|
|
849
|
+
check_id: string;
|
|
850
|
+
/** Short check title. */
|
|
851
|
+
title: string;
|
|
852
|
+
/** User-facing status. needs_fix (a requirement is clearly not met: `compliance.fix` is the one change), pending_live_check (everything Checkbox can see is right; the live event has not been observed yet — counts as passing the checks), verified_live (observed live: proof run, real BCC'd send, Stripe-confirmed cancellation), your_call (a real decision for a person: `compliance.question`), compliant (passes; grey areas carry a `compliance.note`), not_applicable, not_set_up (no sign the email or setting exists yet: `compliance.fix` is the one-click way to set it up; never counts as passing the checks), not_checked (Checkbox has not tried it yet, e.g. the cancel flow: `compliance.fix` says how; never counts as passing the checks). */
|
|
853
|
+
status: "needs_fix" | "pending_live_check" | "verified_live" | "your_call" | "compliant" | "not_applicable" | "not_set_up" | "not_checked";
|
|
854
|
+
}>;
|
|
855
|
+
}
|
|
542
856
|
/** Roll-up of the user-facing statuses of the required checks. */
|
|
543
857
|
export interface ComplianceRollup {
|
|
544
|
-
/** needs_fix (a required check needs a fix or something is not set up yet), your_call (a decision is needed), incomplete (only "not checked yet" items are left, e.g. the cancel flow was never tried), compliant (pending live checks count as
|
|
858
|
+
/** needs_fix (a required check needs a fix or something is not set up yet), your_call (a decision is needed), incomplete (only "not checked yet" items are left, e.g. the cancel flow was never tried), compliant (every required check passes; pending live checks count as passing), not_checked (never evaluated). */
|
|
545
859
|
status: "needs_fix" | "your_call" | "incomplete" | "compliant" | "not_checked";
|
|
546
860
|
/** Label to show. */
|
|
547
861
|
label: string;
|
|
@@ -551,11 +865,11 @@ export interface ComplianceRollup {
|
|
|
551
865
|
needs_fix: number;
|
|
552
866
|
/** Decisions for a person. */
|
|
553
867
|
your_call: number;
|
|
554
|
-
/**
|
|
868
|
+
/** Checks pass, live check pending. */
|
|
555
869
|
pending_live_check: number;
|
|
556
870
|
/** Verified live. */
|
|
557
871
|
verified_live: number;
|
|
558
|
-
/**
|
|
872
|
+
/** Checks pass. */
|
|
559
873
|
compliant: number;
|
|
560
874
|
/** Not applicable. */
|
|
561
875
|
not_applicable: number;
|
|
@@ -569,20 +883,20 @@ export interface ComplianceRollup {
|
|
|
569
883
|
/** Check id. */
|
|
570
884
|
check_id: string;
|
|
571
885
|
}>;
|
|
572
|
-
/** Recommended / extra items open (never block
|
|
886
|
+
/** Recommended / extra items open (never block the checks from passing). */
|
|
573
887
|
suggestions: number;
|
|
888
|
+
/** Per-plan / per-checkout verdicts, in the same vocabulary as the roll-up. Present when the site has two or more checkouts, or one on Stripe. */
|
|
889
|
+
checkouts?: Array<CheckoutVerdict>;
|
|
574
890
|
}
|
|
575
891
|
/** Latest verdict; null until the first evaluation. */
|
|
576
892
|
export type SiteCompliance = {
|
|
577
|
-
/** Compliance score 0-100 (one decimal place). */
|
|
578
|
-
score: number;
|
|
579
893
|
/** When the latest evaluation ran. Unix timestamp in seconds. */
|
|
580
894
|
evaluated: number;
|
|
581
895
|
/** Open findings whose latest status is fail. */
|
|
582
896
|
open_findings: number;
|
|
583
897
|
/** Open findings waiting for a human look. */
|
|
584
898
|
needs_review: number;
|
|
585
|
-
/** User-facing roll-up of the required checks: needs_fix > your_call > compliant (pending live checks count as
|
|
899
|
+
/** User-facing roll-up of the required checks: needs_fix > your_call > compliant (every required check passes; pending live checks count as passing). */
|
|
586
900
|
status: "needs_fix" | "your_call" | "incomplete" | "compliant" | "not_checked";
|
|
587
901
|
/** Label to show. */
|
|
588
902
|
label: string;
|
|
@@ -599,6 +913,33 @@ export interface SiteInstall {
|
|
|
599
913
|
/** Billing-platform webhook URLs (platform -> URL). */
|
|
600
914
|
webhook_urls: Record<string, string>;
|
|
601
915
|
}
|
|
916
|
+
/** The site's Shopify store connection; null when the site neither uses platform shopify nor has a Shopify connection. */
|
|
917
|
+
export type SiteShopify = {
|
|
918
|
+
/** How the store is connected. app: through the Checkbox Shopify app (Checkbox can publish the verified terms to the app block: publishShopifyTerms). own_app: with the store's own custom-app access token (read-only; use the standalone theme snippet). none: not connected (only the merchant can install the Checkbox app from the Shopify admin). */
|
|
919
|
+
connection: "app" | "own_app" | "none";
|
|
920
|
+
/** The store's myshopify.com domain, when connected. */
|
|
921
|
+
shop: string | null;
|
|
922
|
+
/** Status of the Shopify connection (connected, error, disconnected); null without one. */
|
|
923
|
+
status: string | null;
|
|
924
|
+
/** The newest publish of the verified renewal terms to the Checkbox app block; null when never published. Whether the block is placed on the theme shows in the scans (Checkbox does not read the theme). */
|
|
925
|
+
terms_published: {
|
|
926
|
+
/** The fix application that recorded the publish. */
|
|
927
|
+
application: string;
|
|
928
|
+
/** When the text was published. Unix timestamp in seconds. */
|
|
929
|
+
published: number;
|
|
930
|
+
/** sha256 of the published texts (disclosure + newline + consent label). */
|
|
931
|
+
sha256: string;
|
|
932
|
+
} | null;
|
|
933
|
+
/** Theme editor link that adds the "Renewal terms + consent" block to the product page (the merchant opens it once and clicks Save). Null without a connected store. */
|
|
934
|
+
theme_editor_url: string | null;
|
|
935
|
+
} | null;
|
|
936
|
+
/** The compliance status of the evaluation this scan produced (null until evaluated). Retrieve the evaluation for the checks and counts. */
|
|
937
|
+
export type ScanCompliance = {
|
|
938
|
+
/** Roll-up status of that evaluation: needs_fix, your_call, incomplete, compliant or not_checked. */
|
|
939
|
+
status: "needs_fix" | "your_call" | "incomplete" | "compliant" | "not_checked";
|
|
940
|
+
/** The status label to show, counted in tasks ("2 fixes needed", "Checks pass"). */
|
|
941
|
+
label: string;
|
|
942
|
+
} | null;
|
|
602
943
|
/** Most recent scan (only with expand[]=latest_scan). */
|
|
603
944
|
export interface Scan {
|
|
604
945
|
/** Unique identifier of the scan (scan_…). */
|
|
@@ -621,8 +962,7 @@ export interface Scan {
|
|
|
621
962
|
warnings: Array<string>;
|
|
622
963
|
/** The evaluation this scan produced (null until evaluated). */
|
|
623
964
|
evaluation: string | null;
|
|
624
|
-
|
|
625
|
-
score: number | null;
|
|
965
|
+
compliance: ScanCompliance;
|
|
626
966
|
/** When the scan started. Unix timestamp in seconds. */
|
|
627
967
|
started: number | null;
|
|
628
968
|
/** When the scan finished. Unix timestamp in seconds. */
|
|
@@ -640,10 +980,10 @@ export interface DomainVerification {
|
|
|
640
980
|
site: string;
|
|
641
981
|
/** Domain of the site URL. */
|
|
642
982
|
domain: string | null;
|
|
643
|
-
/** not_started until createDomainVerification; verified once the TXT record
|
|
983
|
+
/** not_started until createDomainVerification; verified once the TXT record, the file, the live snippet or the meta tag was found. */
|
|
644
984
|
status: "not_started" | "pending" | "verified";
|
|
645
|
-
/** How control was proven. */
|
|
646
|
-
method: "dns_txt" | "well_known" | null;
|
|
985
|
+
/** How control was proven: dns_txt, well_known, snippet (the site's Checkbox snippet live on https://<domain>/), meta_tag (<meta name="checkbox-verify"> on https://<domain>/) or shopify_install (the domain is the primary domain of a Shopify store that installed the Checkbox app and is connected to this site). */
|
|
986
|
+
method: "dns_txt" | "well_known" | "snippet" | "meta_tag" | "shopify_install" | null;
|
|
647
987
|
/** When it was verified. Unix timestamp in seconds. */
|
|
648
988
|
verified_at: number | null;
|
|
649
989
|
/** Last check. Unix timestamp in seconds. */
|
|
@@ -666,6 +1006,13 @@ export interface DomainVerification {
|
|
|
666
1006
|
/** Exact file contents. */
|
|
667
1007
|
contents: string;
|
|
668
1008
|
} | null;
|
|
1009
|
+
/** Or add this meta tag to the homepage (option 3). Option 4: install the site's Checkbox snippet (install.script_tag) on the homepage; Checkbox verifies the domain when it sees it live. */
|
|
1010
|
+
meta_tag: {
|
|
1011
|
+
/** The page Checkbox reads (the site's homepage, redirects only within the domain). */
|
|
1012
|
+
url: string;
|
|
1013
|
+
/** Put this tag in the <head> of that page. */
|
|
1014
|
+
html: string;
|
|
1015
|
+
} | null;
|
|
669
1016
|
/** Configured scan URLs outside the verified domain (certificates cover only the domain). */
|
|
670
1017
|
scan_target_problems: Array<string>;
|
|
671
1018
|
/** Whether live mode is activated for the account. */
|
|
@@ -680,6 +1027,8 @@ export interface DomainVerification {
|
|
|
680
1027
|
operation_id?: string;
|
|
681
1028
|
/** The MCP tool that performs operation_id (`call_api` when there is no dedicated tool). */
|
|
682
1029
|
mcp_tool?: string;
|
|
1030
|
+
/** The HTTP method and path of operation_id. */
|
|
1031
|
+
endpoint?: string;
|
|
683
1032
|
} | null;
|
|
684
1033
|
}
|
|
685
1034
|
/** A subscription business Checkbox monitors. */
|
|
@@ -719,6 +1068,8 @@ export interface Site {
|
|
|
719
1068
|
login_url: string;
|
|
720
1069
|
/** Test subscriber email. */
|
|
721
1070
|
email: string;
|
|
1071
|
+
/** The page that re-activates the test subscription before each cancellation test (null when none is set). */
|
|
1072
|
+
reactivate_url: string | null;
|
|
722
1073
|
} | null;
|
|
723
1074
|
/** Number of explicit cancellation steps. */
|
|
724
1075
|
cancel_steps: number;
|
|
@@ -729,16 +1080,35 @@ export interface Site {
|
|
|
729
1080
|
/** The checkout page is the home page (checkout_url was omitted or set to the site root). Sign-up checks then judge the home page: set checkout_url to the page with the subscribe button unless the home page really has it. */
|
|
730
1081
|
homepage_as_checkout: boolean;
|
|
731
1082
|
};
|
|
1083
|
+
/** Same as checkout.url, under the name updateSite / createSite take. */
|
|
1084
|
+
checkout_url: string;
|
|
1085
|
+
/** Same as checkout.account_url, under the name updateSite takes. */
|
|
1086
|
+
account_url: string | null;
|
|
1087
|
+
/** Same as checkout.terms_url, under the name updateSite takes. */
|
|
1088
|
+
terms_url: string | null;
|
|
1089
|
+
/** Same as checkout.test_account: the test account as saved (the password is write-only and never returned); null when none is set. */
|
|
1090
|
+
test_account: {
|
|
1091
|
+
/** Login page. */
|
|
1092
|
+
login_url: string;
|
|
1093
|
+
/** Test subscriber email. */
|
|
1094
|
+
email: string;
|
|
1095
|
+
/** The re-activation page (null when none is set). */
|
|
1096
|
+
reactivate_url: string | null;
|
|
1097
|
+
} | null;
|
|
732
1098
|
monitoring: SiteMonitoring;
|
|
733
1099
|
/** Which requirement tiers Checkbox shows (minimum: required only; balanced: + recommended suggestions; maximum: + extras). Only required items affect compliance. */
|
|
734
1100
|
protection_level: "minimum" | "balanced" | "maximum";
|
|
1101
|
+
retention: SiteRetention;
|
|
1102
|
+
legal_hold: LegalHold;
|
|
735
1103
|
compliance: SiteCompliance;
|
|
736
1104
|
install: SiteInstall;
|
|
1105
|
+
shopify: SiteShopify;
|
|
737
1106
|
/** Archived (soft-deleted); evidence is retained. */
|
|
738
1107
|
archived: boolean;
|
|
739
1108
|
/** When the site was created. Unix timestamp in seconds. */
|
|
740
1109
|
created: number;
|
|
741
1110
|
latest_scan?: Scan;
|
|
1111
|
+
unverified_scan: UnverifiedScan;
|
|
742
1112
|
domain_verification?: DomainVerification;
|
|
743
1113
|
}
|
|
744
1114
|
/** A page of sites, newest first. */
|
|
@@ -804,7 +1174,7 @@ export interface SiteTestAccount {
|
|
|
804
1174
|
password: string;
|
|
805
1175
|
/** Custom login steps. */
|
|
806
1176
|
login_steps?: Array<ScanStep>;
|
|
807
|
-
/** Optional page on your site that RE-ACTIVATES the test subscription (a test-only route). The cancellation test really cancels the test account; the scanner opens this page after logging in, before cancelling, so every scan starts subscribed. Without it, a scan after a completed cancellation reports "not observed: the test account has no active subscription" (needs review). (
|
|
1177
|
+
/** Optional page on your site that RE-ACTIVATES the test subscription (a test-only route). The cancellation test really cancels the test account; the scanner opens this page after logging in, before cancelling, so every scan starts subscribed. Without it, a scan after a completed cancellation reports "not observed: the test account has no active subscription" (needs review). (Replaces reset_url, now a deprecated alias.) */
|
|
808
1178
|
reactivate_url?: string;
|
|
809
1179
|
/** Deprecated alias of reactivate_url. */
|
|
810
1180
|
reset_url?: string;
|
|
@@ -837,7 +1207,7 @@ export interface CreateSiteParams {
|
|
|
837
1207
|
devices?: Array<"desktop" | "mobile">;
|
|
838
1208
|
/** Scheduled re-scan interval (0 = off, minimum 60). Default 1440 in live mode, 0 in test mode. */
|
|
839
1209
|
monitoring_interval_minutes?: number;
|
|
840
|
-
/** Which requirement tiers Checkbox shows. minimum: the legal floor only (required items). balanced (default): required items plus recommended suggestions (consent receipts, a cancellation confirmation email…), collapsed and never blocking "
|
|
1210
|
+
/** Which requirement tiers Checkbox shows. minimum: the legal floor only (required items). balanced (default): required items plus recommended suggestions (consent receipts, a cancellation confirmation email…), collapsed and never blocking "Checks pass". maximum: everything, including extra protections (a separate checkbox per term, a pre-purchase summary). Only required items can keep a site's checks from passing, at every level. */
|
|
841
1211
|
protection_level?: "minimum" | "balanced" | "maximum";
|
|
842
1212
|
}
|
|
843
1213
|
export interface UpdateSiteParams {
|
|
@@ -868,8 +1238,19 @@ export interface UpdateSiteParams {
|
|
|
868
1238
|
devices?: Array<"desktop" | "mobile">;
|
|
869
1239
|
/** Scheduled re-scan interval (0 = off, minimum 60). Default 1440 in live mode, 0 in test mode. */
|
|
870
1240
|
monitoring_interval_minutes?: number;
|
|
871
|
-
/** Which requirement tiers Checkbox shows. minimum: the legal floor only (required items). balanced (default): required items plus recommended suggestions (consent receipts, a cancellation confirmation email…), collapsed and never blocking "
|
|
1241
|
+
/** Which requirement tiers Checkbox shows. minimum: the legal floor only (required items). balanced (default): required items plus recommended suggestions (consent receipts, a cancellation confirmation email…), collapsed and never blocking "Checks pass". maximum: everything, including extra protections (a separate checkbox per term, a pre-purchase summary). Only required items can keep a site's checks from passing, at every level. */
|
|
872
1242
|
protection_level?: "minimum" | "balanced" | "maximum";
|
|
1243
|
+
/** The URLs nested as the site object returns them (checkout.url, checkout.account_url, checkout.terms_url); the flat fields win when both are given. */
|
|
1244
|
+
checkout?: {
|
|
1245
|
+
/** Same as checkout_url. */
|
|
1246
|
+
url?: string;
|
|
1247
|
+
/** Same as account_url. */
|
|
1248
|
+
account_url?: string | null;
|
|
1249
|
+
/** Same as terms_url. */
|
|
1250
|
+
terms_url?: string | null;
|
|
1251
|
+
};
|
|
1252
|
+
retention?: RetentionParams;
|
|
1253
|
+
legal_hold?: LegalHoldParams;
|
|
873
1254
|
}
|
|
874
1255
|
/** A billing-platform connection of a site. */
|
|
875
1256
|
export interface Integration {
|
|
@@ -887,12 +1268,56 @@ export interface Integration {
|
|
|
887
1268
|
last_synced: number | null;
|
|
888
1269
|
/** A problem worth fixing, e.g. a test-mode key on a live site. */
|
|
889
1270
|
warning: string | null;
|
|
1271
|
+
/** Chargebee, Recurly and Paddle: the webhook to add by hand (Chargebee: Settings › Configure Chargebee › API Keys and Webhooks › Webhooks; Recurly: Integrations › Webhooks; Paddle: Events › Notifications › New destination, under Developer tools in older dashboards). Null for platforms whose webhook Checkbox registers itself. */
|
|
1272
|
+
webhook_setup: {
|
|
1273
|
+
/** Webhook URL to add in the platform. */
|
|
1274
|
+
url: string;
|
|
1275
|
+
/** Authentication the webhook uses: basic (enter the username and password below; Chargebee, Recurly) or signature (the platform signs deliveries with a secret key it makes, which you paste into Checkbox; Paddle). */
|
|
1276
|
+
auth: "basic" | "signature";
|
|
1277
|
+
/** Basic-auth username to enter. Null for signature auth. */
|
|
1278
|
+
username: string | null;
|
|
1279
|
+
/** Basic-auth password to enter. Treat it as a secret. Null for signature auth. */
|
|
1280
|
+
password: string | null;
|
|
1281
|
+
/** Events to select. */
|
|
1282
|
+
events: Array<string>;
|
|
1283
|
+
/** Webhook API version to choose. */
|
|
1284
|
+
api_version: string | null;
|
|
1285
|
+
/** Payload format to choose on the endpoint (Recurly: JSON). Null when the platform has no choice. */
|
|
1286
|
+
payload_format: "json" | null;
|
|
1287
|
+
/** Recurly and Paddle: whether the endpoint’s secret key is saved in Checkbox (dashboard › Billing connection › webhook), so every delivery’s signature is checked. Paddle deliveries are refused until it is. Null for platforms without signatures. */
|
|
1288
|
+
signing_key_configured: boolean | null;
|
|
1289
|
+
/** Paddle: whether a notification destination with this URL exists in Paddle (from the settings Checkbox last read; needs the Notification settings: Read permission). Null when unknown or for other platforms. */
|
|
1290
|
+
destination_status: "found" | "inactive" | "missing" | null;
|
|
1291
|
+
/** Paddle: events the destination does not send yet. Null when unknown or for other platforms. */
|
|
1292
|
+
missing_events: Array<string> | null;
|
|
1293
|
+
} | null;
|
|
890
1294
|
}
|
|
891
1295
|
export interface ConnectBillingPlatformParams {
|
|
892
1296
|
/** Billing platform. */
|
|
893
|
-
platform: "stripe" | "recharge" | "shopify";
|
|
894
|
-
/**
|
|
1297
|
+
platform: "stripe" | "recharge" | "shopify" | "chargebee" | "recurly" | "paddle";
|
|
1298
|
+
/** Credentials, in snake_case like the rest of the API (the camelCase spellings, secretKey / apiToken / accessToken / apiKey, are accepted too). Stripe: { "secret_key": "rk_test_…" } (rk_test_ in test mode). One Stripe restricted key per site: Read permissions for the checks, and Write permissions that Checkbox uses only after you click Approve on a fix, or in test mode (the one exception: Webhook Endpoints, used once to add Checkbox's webhook endpoint when you connect the key). The checklist: Customers: Write, Products: Read, Prices: Read, Coupons: Read, Subscriptions: Write, Test clocks: Write, Customer portal: Write, Checkout Sessions: Write, Payment Links: Write, Webhook Endpoints: Write (https://checkbox.site/docs/guides/stripe-key). Recharge: { "api_token": "…" }. Shopify: { "shop": "store.myshopify.com", "access_token": "shpat_…" }. Chargebee: { "site": "acme", "api_key": "live_…" } (the site name before .chargebee.com and a read-only API key). Recurly: { "api_key": "…", "region": "us" } (a private API key of the site; region "eu" for sites hosted in Recurly’s EU data centre, default "us"). Paddle: { "api_key": "pdl_live_apikey_…" } (a Paddle Billing API key with read permissions; sandbox keys, pdl_sdbx_…, read the sandbox; "environment": "live" or "sandbox" only for older keys without that prefix). For the platforms other than Stripe, Checkbox only reads. */
|
|
895
1299
|
credentials: Record<string, string>;
|
|
1300
|
+
/** Set true only after the human confirmed it: connect the key even though its Stripe account looks like another site’s (the billing_account_mismatch error asks "This looks like <other site>’s Stripe account. Use it anyway?"). Default false: such a key is not connected and nothing is evaluated. */
|
|
1301
|
+
confirm_account_mismatch?: boolean;
|
|
1302
|
+
}
|
|
1303
|
+
/** A queued re-read of the site's billing-platform settings, followed by a re-evaluation. */
|
|
1304
|
+
export interface BillingSync {
|
|
1305
|
+
/** String representing the object's type. Always "billing_sync". */
|
|
1306
|
+
object: "billing_sync";
|
|
1307
|
+
/** The site whose billing settings are re-read. */
|
|
1308
|
+
site: string;
|
|
1309
|
+
/** One entry per connected billing platform. */
|
|
1310
|
+
platforms: Array<{
|
|
1311
|
+
/** The connected billing platform. */
|
|
1312
|
+
platform: "stripe" | "shopify" | "recharge" | "chargebee" | "recurly" | "paddle" | "woocommerce" | "custom";
|
|
1313
|
+
/** The re-read is queued; settings refresh within a minute. */
|
|
1314
|
+
status: "queued";
|
|
1315
|
+
/** When the settings were last read successfully. Unix timestamp in seconds. */
|
|
1316
|
+
last_synced: number | null;
|
|
1317
|
+
/** Why the last read failed, if it did. */
|
|
1318
|
+
last_error: string | null;
|
|
1319
|
+
}>;
|
|
1320
|
+
next_action: NextAction;
|
|
896
1321
|
}
|
|
897
1322
|
/** A page of scans, newest first. */
|
|
898
1323
|
export interface ScanList {
|
|
@@ -917,8 +1342,10 @@ export interface CheckSummary {
|
|
|
917
1342
|
severity: "critical" | "high" | "medium" | "low";
|
|
918
1343
|
/** Lifecycle stage. */
|
|
919
1344
|
stage: "signup" | "confirmation" | "reminder" | "cancellation" | "config";
|
|
920
|
-
/** User-facing status. needs_fix (a
|
|
1345
|
+
/** User-facing status. needs_fix (a requirement is clearly not met: `compliance.fix` is the one change), pending_live_check (everything Checkbox can see is right; the live event has not been observed yet — counts as passing the checks), verified_live (observed live: proof run, real BCC'd send, Stripe-confirmed cancellation), your_call (a real decision for a person: `compliance.question`), compliant (passes; grey areas carry a `compliance.note`), not_applicable, not_set_up (no sign the email or setting exists yet: `compliance.fix` is the one-click way to set it up; never counts as passing the checks), not_checked (Checkbox has not tried it yet, e.g. the cancel flow: `compliance.fix` says how; never counts as passing the checks). */
|
|
921
1346
|
compliance_status: "needs_fix" | "pending_live_check" | "verified_live" | "your_call" | "compliant" | "not_applicable" | "not_set_up" | "not_checked";
|
|
1347
|
+
/** The status in words to show a person ("Needs a fix", "Your call", "Not set up yet", "Not checked yet", "Checks pass"…). Show this, never the machine value. */
|
|
1348
|
+
compliance_status_label: string;
|
|
922
1349
|
}
|
|
923
1350
|
/** A compliance verdict for a site at a point in time. */
|
|
924
1351
|
export interface Evaluation {
|
|
@@ -932,8 +1359,6 @@ export interface Evaluation {
|
|
|
932
1359
|
site: string;
|
|
933
1360
|
/** The scan row this evaluation belongs to. */
|
|
934
1361
|
scan: string;
|
|
935
|
-
/** Compliance score 0-100 (severity-weighted, one decimal place, e.g. 82.5). */
|
|
936
|
-
score: number;
|
|
937
1362
|
/** Legal catalog / rules version used. */
|
|
938
1363
|
rules_version: string;
|
|
939
1364
|
/** When it was evaluated. Unix timestamp in seconds. */
|
|
@@ -1036,6 +1461,8 @@ export interface EvidenceItem {
|
|
|
1036
1461
|
screenshot_ref?: string;
|
|
1037
1462
|
/** When it was captured / received. */
|
|
1038
1463
|
at?: string;
|
|
1464
|
+
/** Set when a Checkbox test run recorded this page view (not a scan of your site). */
|
|
1465
|
+
test_run_id?: string;
|
|
1039
1466
|
}
|
|
1040
1467
|
/** What a verdict was based on. Never a pass without it; needs_review says what is missing. */
|
|
1041
1468
|
export interface VerdictEvidence {
|
|
@@ -1048,13 +1475,13 @@ export interface VerdictEvidence {
|
|
|
1048
1475
|
}
|
|
1049
1476
|
/** What a person should do about one check (the user-facing layer over `status`). */
|
|
1050
1477
|
export interface ComplianceInfo {
|
|
1051
|
-
/** User-facing status. needs_fix (a
|
|
1478
|
+
/** User-facing status. needs_fix (a requirement is clearly not met: `compliance.fix` is the one change), pending_live_check (everything Checkbox can see is right; the live event has not been observed yet — counts as passing the checks), verified_live (observed live: proof run, real BCC'd send, Stripe-confirmed cancellation), your_call (a real decision for a person: `compliance.question`), compliant (passes; grey areas carry a `compliance.note`), not_applicable, not_set_up (no sign the email or setting exists yet: `compliance.fix` is the one-click way to set it up; never counts as passing the checks), not_checked (Checkbox has not tried it yet, e.g. the cancel flow: `compliance.fix` says how; never counts as passing the checks). */
|
|
1052
1479
|
status: "needs_fix" | "pending_live_check" | "verified_live" | "your_call" | "compliant" | "not_applicable" | "not_set_up" | "not_checked";
|
|
1053
|
-
/** Label to show: "Needs a fix", "Not set up yet", "Not checked yet", "
|
|
1480
|
+
/** Label to show: "Needs a fix", "Not set up yet", "Not checked yet", "Checks pass · live check pending", "Verified live", "Your call", "Checks pass", "Checks pass with a note", "Not applicable". */
|
|
1054
1481
|
label: string;
|
|
1055
1482
|
/** Stable code of the mapping rule (docs/ACCURACY.md). */
|
|
1056
1483
|
reason: string;
|
|
1057
|
-
/** required (legal floor: the only tier that can
|
|
1484
|
+
/** required (legal floor: the only tier that can keep a site's checks from passing), recommended (clearer records beyond the legal floor, conversion-neutral), extra (maximum protection). */
|
|
1058
1485
|
tier: "required" | "recommended" | "extra";
|
|
1059
1486
|
/** needs_fix: the one change that fixes it. */
|
|
1060
1487
|
fix: string | null;
|
|
@@ -1109,7 +1536,7 @@ export interface Finding {
|
|
|
1109
1536
|
/** Check-specific details (failing regions/devices/URLs, measurements, quotes). */
|
|
1110
1537
|
details: Record<string, unknown>;
|
|
1111
1538
|
evidence: VerdictEvidence;
|
|
1112
|
-
/** User-facing status. needs_fix (a
|
|
1539
|
+
/** User-facing status. needs_fix (a requirement is clearly not met: `compliance.fix` is the one change), pending_live_check (everything Checkbox can see is right; the live event has not been observed yet — counts as passing the checks), verified_live (observed live: proof run, real BCC'd send, Stripe-confirmed cancellation), your_call (a real decision for a person: `compliance.question`), compliant (passes; grey areas carry a `compliance.note`), not_applicable, not_set_up (no sign the email or setting exists yet: `compliance.fix` is the one-click way to set it up; never counts as passing the checks), not_checked (Checkbox has not tried it yet, e.g. the cancel flow: `compliance.fix` says how; never counts as passing the checks). */
|
|
1113
1540
|
compliance_status: "needs_fix" | "pending_live_check" | "verified_live" | "your_call" | "compliant" | "not_applicable" | "not_set_up" | "not_checked";
|
|
1114
1541
|
compliance: ComplianceInfo;
|
|
1115
1542
|
/** Scan that produced the latest result. */
|
|
@@ -1163,7 +1590,7 @@ export interface PlanEdit {
|
|
|
1163
1590
|
}
|
|
1164
1591
|
/** What the caller (usually an AI coding agent) should do next. */
|
|
1165
1592
|
export interface PlanNextAction {
|
|
1166
|
-
/** Stable action type: apply_task, provide_facts, verify_task, answer_question, ask_human_to_confirm, connect_billing_in_dashboard, wait_for_verification, run_first_check, review_wont_fix, done. */
|
|
1593
|
+
/** Stable action type: apply_task, provide_facts, verify_task, answer_question, ask_human_to_confirm, connect_billing_in_dashboard, store_stripe_test_key, wait_for_verification, run_first_check, review_wont_fix, done_for_now (nothing left an agent can do in code now: the rest waits for a deploy / real send, and maybe the owner; the description lists both; finish the change), done. */
|
|
1167
1594
|
type: string;
|
|
1168
1595
|
/** One or two sentences telling the agent exactly what to do now. */
|
|
1169
1596
|
description: string;
|
|
@@ -1192,14 +1619,16 @@ export interface Task {
|
|
|
1192
1619
|
key: string;
|
|
1193
1620
|
/** Short imperative title. */
|
|
1194
1621
|
title: string;
|
|
1195
|
-
/** open (apply the change), in_progress (an agent claimed it), verifying (a verification is waiting for a confirming observation), done, wont_fix (the merchant declined, with a reason), manual (needs a human answer: see question), pending_live_check (everything Checkbox can see is right; it waits for a live observation — see change for how it completes. Counts as
|
|
1622
|
+
/** open (apply the change), in_progress (an agent claimed it), verifying (a verification is waiting for a confirming observation), done, wont_fix (the merchant declined, with a reason), manual (needs a human answer: see question), pending_live_check (everything Checkbox can see is right; it waits for a live observation — see change for how it completes. Counts as passing the checks and never blocks the plan). */
|
|
1196
1623
|
status: "open" | "in_progress" | "verifying" | "done" | "wont_fix" | "manual" | "pending_live_check";
|
|
1197
1624
|
/** Strictest severity among the task's legal checks. */
|
|
1198
1625
|
priority: "critical" | "high" | "medium" | "low";
|
|
1199
|
-
/** required (the legal floor: the only tier that can keep the site from
|
|
1626
|
+
/** required (the legal floor: the only tier that can keep the site's checks from passing), recommended (clearer records beyond the legal floor, conversion-neutral; shown at protection level balanced and maximum, never blocks), extra (maximum protection only). Always present on API responses. */
|
|
1200
1627
|
tier?: "required" | "recommended" | "extra";
|
|
1201
|
-
/** User-facing status. needs_fix (a
|
|
1628
|
+
/** User-facing status. needs_fix (a requirement is clearly not met: `compliance.fix` is the one change), pending_live_check (everything Checkbox can see is right; the live event has not been observed yet — counts as passing the checks), verified_live (observed live: proof run, real BCC'd send, Stripe-confirmed cancellation), your_call (a real decision for a person: `compliance.question`), compliant (passes; grey areas carry a `compliance.note`), not_applicable, not_set_up (no sign the email or setting exists yet: `compliance.fix` is the one-click way to set it up; never counts as passing the checks), not_checked (Checkbox has not tried it yet, e.g. the cancel flow: `compliance.fix` says how; never counts as passing the checks). */
|
|
1202
1629
|
compliance_status?: "needs_fix" | "pending_live_check" | "verified_live" | "your_call" | "compliant" | "not_applicable" | "not_set_up" | "not_checked";
|
|
1630
|
+
/** The status in words to show a person ("Needs a fix", "Your call", "Not set up yet", "Not checked yet", "Checks pass"…). Show this, never the machine value. */
|
|
1631
|
+
compliance_status_label?: string;
|
|
1203
1632
|
/** Position in the plan (1 = do first). Dependency-aware. */
|
|
1204
1633
|
order: number;
|
|
1205
1634
|
/** Legal checks this task makes pass. */
|
|
@@ -1223,7 +1652,7 @@ export interface Task {
|
|
|
1223
1652
|
where: {
|
|
1224
1653
|
/** Where the change is made. */
|
|
1225
1654
|
kind: "code" | "stripe_setting" | "email_template" | "policy_page" | "dns" | "checkbox_setting" | "billing_platform";
|
|
1226
|
-
/**
|
|
1655
|
+
/** Source file reported by `checkbox init` / updateSetupSession (null when none was reported: Checkbox does not guess file names; the root layout of a file-system router is named). */
|
|
1227
1656
|
file_hint: string | null;
|
|
1228
1657
|
/** Page (or settings page) where the problem was observed / the change is made. */
|
|
1229
1658
|
url: string | null;
|
|
@@ -1308,6 +1737,15 @@ export interface Task {
|
|
|
1308
1737
|
/** When it was requested. Unix timestamp in seconds. */
|
|
1309
1738
|
created: number;
|
|
1310
1739
|
} | null;
|
|
1740
|
+
/** Email tasks on a site with several plans: the result of each plan's own email copy (verifyTask with plan). The copy check passes only when every plan passes; one plan's copy never covers another plan. */
|
|
1741
|
+
plan_coverage?: Array<{
|
|
1742
|
+
/** The plan, by name. */
|
|
1743
|
+
plan: string;
|
|
1744
|
+
/** That plan's copy: pass, fail, needs_review, or not_checked (no copy for this plan was verified yet). */
|
|
1745
|
+
verdict: "pass" | "fail" | "needs_review" | "not_checked";
|
|
1746
|
+
/** When that plan's copy was checked. Unix timestamp in seconds. */
|
|
1747
|
+
checked_at: number | null;
|
|
1748
|
+
}>;
|
|
1311
1749
|
next_action: PlanNextAction;
|
|
1312
1750
|
/** Email tasks only (null otherwise): what Checkbox has seen of this email. not_seen (nothing yet), template_checked (a template or sample passed the email checks, but Checkbox has not seen it sent for a real event: the task stays open), delivery_seen (captured from a real event: a test run, a notice for a real subscriber, or a BCC copy matching that subscriber's billing event). Only delivery_seen satisfies the task. */
|
|
1313
1751
|
verification_level: "not_seen" | "template_checked" | "delivery_seen" | null;
|
|
@@ -1316,7 +1754,7 @@ export interface Task {
|
|
|
1316
1754
|
/** When it was done. Unix timestamp in seconds. */
|
|
1317
1755
|
done_at: number | null;
|
|
1318
1756
|
}
|
|
1319
|
-
/** The ordered, machine-readable list of changes that makes a site
|
|
1757
|
+
/** The ordered, machine-readable list of changes that makes a site's checks pass, recomputed from its latest evaluation. */
|
|
1320
1758
|
export interface CompliancePlan {
|
|
1321
1759
|
/** Unique identifier of the compliance plan (plan_…). */
|
|
1322
1760
|
id: string;
|
|
@@ -1328,14 +1766,16 @@ export interface CompliancePlan {
|
|
|
1328
1766
|
site: string;
|
|
1329
1767
|
/** action_required (an agent can apply open tasks now), verifying (changes applied; waiting for confirming observations), compliant (every required check passes or only waits for a live check — an automated assessment, not a legal determination; see compliance.pending_live_checks and coverage), blocked (only human answers ("Your call") or declined critical tasks remain). */
|
|
1330
1768
|
status: "action_required" | "verifying" | "compliant" | "blocked";
|
|
1331
|
-
/**
|
|
1332
|
-
|
|
1769
|
+
/** The plan status in words to show a person: action_required "Fixes needed", verifying "Checking your changes", compliant "Checks pass", blocked "Your call"; while an agent works the site and everything left waits for a deploy or the owner (next_action done_for_now): "Waiting on deploy and you" or "Waiting on deploy". Show this, never the machine value (`compliant` is a status name, not a legal conclusion). */
|
|
1770
|
+
status_label?: string;
|
|
1333
1771
|
/** The evaluation the plan was built from (null before the first check). */
|
|
1334
1772
|
evaluation: string | null;
|
|
1335
1773
|
/** When that evaluation ran. Unix timestamp in seconds. */
|
|
1336
1774
|
evaluated: number | null;
|
|
1337
1775
|
/** Two or three sentences for an LLM: where the site stands and what comes next. */
|
|
1338
1776
|
summary: string;
|
|
1777
|
+
/** Declared plans (setup plans, i.e. your code) whose price, interval or trial differ from the billing platform's Price they map to. Checkbox checks and writes every fix from the Price, and the page task names the difference; update the page and setup plans, or the Price, so they agree. Absent when none. */
|
|
1778
|
+
plan_terms_conflicts?: Array<string>;
|
|
1339
1779
|
/** Tasks per status. */
|
|
1340
1780
|
counts: {
|
|
1341
1781
|
/** Open tasks. */
|
|
@@ -1346,7 +1786,7 @@ export interface CompliancePlan {
|
|
|
1346
1786
|
verifying: number;
|
|
1347
1787
|
/** Tasks waiting for a human answer. */
|
|
1348
1788
|
manual: number;
|
|
1349
|
-
/** Tasks that only wait for a live observation (count as
|
|
1789
|
+
/** Tasks that only wait for a live observation (count as passing the checks). */
|
|
1350
1790
|
pending_live_check?: number;
|
|
1351
1791
|
/** Done tasks. */
|
|
1352
1792
|
done: number;
|
|
@@ -1361,13 +1801,13 @@ export interface CompliancePlan {
|
|
|
1361
1801
|
groups: {
|
|
1362
1802
|
/** Required tasks (the legal floor). */
|
|
1363
1803
|
required: Array<string>;
|
|
1364
|
-
/** Recommended suggestions (never block
|
|
1804
|
+
/** Recommended suggestions (never block the checks from passing). */
|
|
1365
1805
|
recommended: Array<string>;
|
|
1366
1806
|
/** Extra protections (maximum only). */
|
|
1367
1807
|
extra: Array<string>;
|
|
1368
1808
|
};
|
|
1369
1809
|
compliance: ComplianceRollup | null;
|
|
1370
|
-
/** What the assessment rests on. Tell the human about not_observed and attested items; never
|
|
1810
|
+
/** What the assessment rests on. Tell the human about not_observed and attested items; never tell them the site "is compliant". */
|
|
1371
1811
|
coverage: {
|
|
1372
1812
|
/** Lifecycle stages Checkbox observed (signup, acknowledgment_email, reminders, cancellation, policies, billing_settings). */
|
|
1373
1813
|
observed: Array<string>;
|
|
@@ -1379,11 +1819,29 @@ export interface CompliancePlan {
|
|
|
1379
1819
|
billing_connected: boolean;
|
|
1380
1820
|
};
|
|
1381
1821
|
next_action: PlanNextAction;
|
|
1382
|
-
/**
|
|
1822
|
+
/** Every open owner choice as ONE batched question (who sends the required emails, plus each question task such as the New York notice channel). Ask it once, early, in one message; the plan's next_action says the same. Absent when there is none. */
|
|
1823
|
+
owner_questions?: {
|
|
1824
|
+
/** How to ask them: once, in one message, while the fixes go on. */
|
|
1825
|
+
description: string;
|
|
1826
|
+
/** Every choice only the owner makes, together. */
|
|
1827
|
+
questions: Array<{
|
|
1828
|
+
/** "email_sender" (who sends the required emails), or the id of the task whose question it is. */
|
|
1829
|
+
id: string;
|
|
1830
|
+
/** The question, in plain words for the owner. */
|
|
1831
|
+
text: string;
|
|
1832
|
+
/** The answers. */
|
|
1833
|
+
options: Array<string>;
|
|
1834
|
+
/** The tasks the answer settles. */
|
|
1835
|
+
tasks: Array<string>;
|
|
1836
|
+
/** What the agent does with each answer. */
|
|
1837
|
+
on_answer: Record<string, string>;
|
|
1838
|
+
}>;
|
|
1839
|
+
};
|
|
1840
|
+
/** Evidence level per required email kind. A plan never reaches status compliant on template_checked emails. */
|
|
1383
1841
|
email_verification: Array<{
|
|
1384
1842
|
/** Email kind (acknowledgment, trial_ending, renewal_reminder, annual_terms, charge_notice, price_change, cancellation_confirmation). */
|
|
1385
1843
|
kind: string;
|
|
1386
|
-
/** not_seen, template_checked (template or sample only: never counted as
|
|
1844
|
+
/** not_seen, template_checked (template or sample only: never counted as passing) or delivery_seen (sent for a real event). */
|
|
1387
1845
|
verification_level: "not_seen" | "template_checked" | "delivery_seen";
|
|
1388
1846
|
/** Why this level, in plain words. */
|
|
1389
1847
|
reason: string;
|
|
@@ -1398,15 +1856,16 @@ export interface CompliancePlan {
|
|
|
1398
1856
|
disclaimer: string;
|
|
1399
1857
|
/** When the plan was computed. Unix timestamp in seconds. */
|
|
1400
1858
|
generated: number;
|
|
1859
|
+
unverified_scan?: UnverifiedScan;
|
|
1401
1860
|
/** Optional improvements beyond compliance. Never tasks, never blocking, never counted toward compliance. */
|
|
1402
1861
|
optional_improvements?: {
|
|
1403
|
-
/**
|
|
1862
|
+
/** Conversion suggestions for this site that keep the checks passing. */
|
|
1404
1863
|
conversion_suggestions: {
|
|
1405
1864
|
/** What they are. */
|
|
1406
1865
|
description: string;
|
|
1407
1866
|
/** Always false. */
|
|
1408
1867
|
blocking: false;
|
|
1409
|
-
/** Always false: they never change status
|
|
1868
|
+
/** Always false: they never change the status or the tasks. */
|
|
1410
1869
|
counts_toward_compliance: false;
|
|
1411
1870
|
/** Operation that lists them. */
|
|
1412
1871
|
operation_id: string;
|
|
@@ -1418,11 +1877,16 @@ export interface CompliancePlan {
|
|
|
1418
1877
|
};
|
|
1419
1878
|
}
|
|
1420
1879
|
export interface UpdateTaskParams {
|
|
1421
|
-
/** in_progress claims the task (other agents see it), wont_fix declines it (needs reason; a declined critical/high task keeps the plan from
|
|
1880
|
+
/** in_progress claims the task (other agents see it), wont_fix declines it (needs reason; a declined critical/high task keeps the plan from reaching status compliant), not_applicable records that the task does not apply to this business (needs reason, e.g. "no price changes are planned"; the task closes as no_longer_applicable and does not block the plan), open clears any of them. */
|
|
1422
1881
|
status: "open" | "in_progress" | "wont_fix" | "not_applicable";
|
|
1423
1882
|
/** Why (required for wont_fix). */
|
|
1424
1883
|
reason?: string;
|
|
1425
1884
|
}
|
|
1885
|
+
/** The task after answerTask, with the confirmation link at the top level when the human must confirm. */
|
|
1886
|
+
export type AnsweredTask = Task & {
|
|
1887
|
+
/** When the answer waits for the human: the link they open (signed in to Checkbox) to confirm it. Same as answer.pending_confirmation_url; null when nothing waits for confirmation. */
|
|
1888
|
+
confirmation_url: string | null;
|
|
1889
|
+
};
|
|
1426
1890
|
export interface AnswerTaskParams {
|
|
1427
1891
|
/** One of the task's question.options (yes / no, or confirmed / needs_change). */
|
|
1428
1892
|
answer: string;
|
|
@@ -1456,13 +1920,17 @@ export interface Verification {
|
|
|
1456
1920
|
task: string | null;
|
|
1457
1921
|
/** One task or the whole site. */
|
|
1458
1922
|
scope: "task" | "site";
|
|
1459
|
-
/** pending (waiting for the confirming scan / re-evaluation), passed (Checkbox observed the expected result), passed_with_gaps (nothing observed fails, but some checks could not be observed: observed missing_data — not verified), failed (it did not: see diff). */
|
|
1460
|
-
status: "pending" | "passed" | "passed_with_gaps" | "failed";
|
|
1923
|
+
/** pending (waiting for the confirming scan / re-evaluation), passed (Checkbox observed the expected result: every check passes or does not apply), passed_with_gaps (nothing observed fails, but some checks could not be observed: observed missing_data — not verified), passed_with_notes (nothing observed fails and the task counts as passing, but a check is still needs_review on a part that is not yours to change, such as Stripe's own page layout: see checks), not_checked (a task whose checks could only not be observed yet: nothing to change in the code; next_action says what evidence to provide), pending_live_check (an email whose content passes but that Checkbox has not seen sent for a real event yet: nothing to change; it completes on the first real send or a proof run), failed (it did not: see diff). */
|
|
1924
|
+
status: "pending" | "passed" | "passed_with_gaps" | "passed_with_notes" | "not_checked" | "pending_live_check" | "failed";
|
|
1461
1925
|
/** How it was re-checked. */
|
|
1462
1926
|
method: "page_fetch" | "policy_refetch" | "stripe_params" | "email_copy" | "platform_sync" | "attestation" | "evaluation" | "test_run";
|
|
1927
|
+
/** What this verification checked, in words: "the params you sent", "Checkout Sessions read from Stripe", "registered configs", "the HTML you sent", "the email copy you sent (plan …)", "the live page …, fetched now"… */
|
|
1928
|
+
checked: string;
|
|
1463
1929
|
/** The fast pre-check run immediately (seconds). A failing pre-check fails the verification at once. */
|
|
1464
1930
|
precheck: {
|
|
1465
|
-
/**
|
|
1931
|
+
/** What the pre-check judged (as `checked`). */
|
|
1932
|
+
checked: string;
|
|
1933
|
+
/** static_fetch, html, stripe_params, email, policy_fetch, or billing_sync (Stripe was re-read before judging; its verdict is always needs_review and only carries the note: the re-evaluation decides). */
|
|
1466
1934
|
source: string;
|
|
1467
1935
|
/** Pre-check verdict for the task's checks. */
|
|
1468
1936
|
verdict: "pass" | "fail" | "needs_review";
|
|
@@ -1470,6 +1938,26 @@ export interface Verification {
|
|
|
1470
1938
|
url: string | null;
|
|
1471
1939
|
/** What the pre-check can and cannot confirm. */
|
|
1472
1940
|
note: string;
|
|
1941
|
+
/** Email tasks on a site with several plans: each plan's copy result. A later verification only replaces the result of the plan it judged. */
|
|
1942
|
+
plans?: Array<{
|
|
1943
|
+
/** The plan, by name. */
|
|
1944
|
+
plan: string;
|
|
1945
|
+
/** That plan's copy: pass, fail, needs_review, or not_checked (no copy for this plan was verified yet). */
|
|
1946
|
+
verdict: "pass" | "fail" | "needs_review" | "not_checked";
|
|
1947
|
+
/** When that plan's copy was checked. Unix timestamp in seconds. */
|
|
1948
|
+
checked_at: number | null;
|
|
1949
|
+
}>;
|
|
1950
|
+
/** Each pre-checked check of the task, compact (empty when the pre-check ran no engine check). */
|
|
1951
|
+
checks: Array<{
|
|
1952
|
+
/** Check id. */
|
|
1953
|
+
check_id: string;
|
|
1954
|
+
/** Pre-check result: pass, fail, needs_review or not_applicable. */
|
|
1955
|
+
status: string;
|
|
1956
|
+
/** What the pre-check found, in one line. */
|
|
1957
|
+
reason: string;
|
|
1958
|
+
/** How to fix it, in one line (absent when it passes). */
|
|
1959
|
+
fix?: string;
|
|
1960
|
+
}>;
|
|
1473
1961
|
} | null;
|
|
1474
1962
|
/** Confirming scan queued by the verification. */
|
|
1475
1963
|
scan: string | null;
|
|
@@ -1479,6 +1967,8 @@ export interface Verification {
|
|
|
1479
1967
|
diff: Array<VerificationCheck>;
|
|
1480
1968
|
/** Plan status after this verification (null while pending). */
|
|
1481
1969
|
plan_status: "action_required" | "verifying" | "compliant" | "blocked" | null;
|
|
1970
|
+
/** The plan status in words to show a person: action_required "Fixes needed", verifying "Checking your changes", compliant "Checks pass", blocked "Your call"; while an agent works the site and everything left waits for a deploy or the owner (next_action done_for_now): "Waiting on deploy and you" or "Waiting on deploy". Show this, never the machine value (`compliant` is a status name, not a legal conclusion). */
|
|
1971
|
+
plan_status_label?: string | null;
|
|
1482
1972
|
next_action: PlanNextAction;
|
|
1483
1973
|
/** When it was requested. Unix timestamp in seconds. */
|
|
1484
1974
|
created: number;
|
|
@@ -1490,11 +1980,11 @@ export interface Verification {
|
|
|
1490
1980
|
export interface VerifyTaskParams {
|
|
1491
1981
|
/** page_fetch tasks: the rendered page HTML before you deploy, at most ~900 KB (request bodies are limited to 1 MB). Pre-check only; the confirming scan runs on the live page. */
|
|
1492
1982
|
html?: string;
|
|
1493
|
-
/** stripe_params tasks: exactly what your code now passes to stripe.checkout.sessions.create. */
|
|
1983
|
+
/** stripe_params tasks and the sign-up tasks (signup_disclosure): exactly what your code now passes to stripe.checkout.sessions.create. Judged together with the page (any failing check fails the verification). A task that does not use it refuses it (parameter_invalid, naming the task that takes it). */
|
|
1494
1984
|
stripe_checkout_session?: Record<string, unknown>;
|
|
1495
1985
|
/** stripe_params tasks with several Checkout code paths (one per plan, e.g. monthly and annual-with-trial): every params object your code passes to stripe.checkout.sessions.create. The pre-check fails when any of them fails. Without either field, every registered config (newest per name) is checked. */
|
|
1496
1986
|
stripe_checkout_sessions?: Array<Record<string, unknown>>;
|
|
1497
|
-
/** email_copy tasks: the new email template (pre-check; the real email confirms). */
|
|
1987
|
+
/** email_copy tasks: the new email template (pre-check; the real email confirms). On a site with several plans it is checked against every plan and passes when it matches one plan fully (pass plan or price_id to check one plan). */
|
|
1498
1988
|
email?: {
|
|
1499
1989
|
/** Email kind (default: from the task). */
|
|
1500
1990
|
kind?: "acknowledgment" | "trial_reminder" | "renewal_reminder" | "price_change" | "annual_terms" | "charge_notice" | "cancellation_confirmation";
|
|
@@ -1505,6 +1995,10 @@ export interface VerifyTaskParams {
|
|
|
1505
1995
|
/** HTML body. */
|
|
1506
1996
|
html?: string;
|
|
1507
1997
|
};
|
|
1998
|
+
/** email_copy tasks: check the email against this plan only (its name, e.g. "Annual"). */
|
|
1999
|
+
plan?: string;
|
|
2000
|
+
/** email_copy tasks: check the email against the plan with this Stripe Price id only. */
|
|
2001
|
+
price_id?: string;
|
|
1508
2002
|
/** Re-check a task that is already done (or declined) instead of returning its last result: Checkbox evaluates the site again now and queues a confirming scan, so a regression shows up (pilot: a cancel page switched to phone-only stayed "passed"). */
|
|
1509
2003
|
recheck?: boolean;
|
|
1510
2004
|
}
|
|
@@ -1571,6 +2065,7 @@ export interface Fix {
|
|
|
1571
2065
|
/** Why parts of the fix could not be generated (e.g. plan terms unknown). */
|
|
1572
2066
|
problems: Array<string>;
|
|
1573
2067
|
remediation: Remediation;
|
|
2068
|
+
next_action: NextAction | null;
|
|
1574
2069
|
}
|
|
1575
2070
|
/** A page of fix plans. */
|
|
1576
2071
|
export interface FixList {
|
|
@@ -1583,6 +2078,38 @@ export interface FixList {
|
|
|
1583
2078
|
/** The URL of this list. */
|
|
1584
2079
|
url: string;
|
|
1585
2080
|
}
|
|
2081
|
+
/** The verified renewal terms published to the Checkbox Shopify app block (an app-owned metafield; nothing else in the store changes). */
|
|
2082
|
+
export interface ShopifyTermsPublication {
|
|
2083
|
+
/** Id of the recorded fix application (the evidence trail of this publish). */
|
|
2084
|
+
id: string;
|
|
2085
|
+
/** String representing the object's type. Always "shopify_terms_publication". */
|
|
2086
|
+
object: "shopify_terms_publication";
|
|
2087
|
+
/** true for live-mode objects, false for test mode (ck_test_ keys act on an isolated sandbox). */
|
|
2088
|
+
livemode: boolean;
|
|
2089
|
+
/** The site. */
|
|
2090
|
+
site: string;
|
|
2091
|
+
/** The Shopify store (myshopify.com domain) the text was published to. */
|
|
2092
|
+
shop: string;
|
|
2093
|
+
/** The renewal disclosure the "Renewal terms + consent" block now shows (engine-verified). */
|
|
2094
|
+
disclosure: string;
|
|
2095
|
+
/** Label of the unchecked, required consent checkbox the block shows. */
|
|
2096
|
+
consent_label: string;
|
|
2097
|
+
/** sha256 of the published texts (disclosure + newline + consent label). */
|
|
2098
|
+
sha256: string;
|
|
2099
|
+
/** Sign-up checks the published text was verified against. */
|
|
2100
|
+
check_ids: Array<string>;
|
|
2101
|
+
/** When the text was published. Unix timestamp in seconds. */
|
|
2102
|
+
published: number;
|
|
2103
|
+
/** Theme editor link that adds the "Renewal terms + consent" block to the product page. The merchant opens it once and clicks Save (Checkbox never edits the theme). */
|
|
2104
|
+
theme_editor_url: string;
|
|
2105
|
+
next_action: NextAction;
|
|
2106
|
+
}
|
|
2107
|
+
export interface PublishShopifyTermsParams {
|
|
2108
|
+
/** Billing-platform plan / price id to write the terms for (default: the plan Checkbox resolved for the site). */
|
|
2109
|
+
plan?: string;
|
|
2110
|
+
/** Cancellation URL to state (default: the hosted cancellation page or the declared account page). */
|
|
2111
|
+
cancel_url?: string;
|
|
2112
|
+
}
|
|
1586
2113
|
/** A record in the tamper-evident evidence vault. */
|
|
1587
2114
|
export interface Evidence {
|
|
1588
2115
|
/** Unique identifier of the evidence (ev_…). */
|
|
@@ -1687,6 +2214,54 @@ export interface CertificateList {
|
|
|
1687
2214
|
/** The URL of this list. */
|
|
1688
2215
|
url: string;
|
|
1689
2216
|
}
|
|
2217
|
+
/** One email Checkbox Notices sent (or tried to send) for the site. */
|
|
2218
|
+
export interface NoticeSend {
|
|
2219
|
+
/** Unique identifier of the notice (ntc_…). */
|
|
2220
|
+
id: string;
|
|
2221
|
+
/** String representing the object's type. Always "notice_send". */
|
|
2222
|
+
object: "notice_send";
|
|
2223
|
+
/** The site. */
|
|
2224
|
+
site: string;
|
|
2225
|
+
/** Notice kind. */
|
|
2226
|
+
kind: "acknowledgment" | "trial_ending" | "renewal_reminder" | "annual_terms" | "price_change" | "cancellation_confirmation" | "charge_notice";
|
|
2227
|
+
/** sent: the provider accepted it; failed: will be retried while its window is open; skipped: not sent, error says why; bounced; claimed: being sent. */
|
|
2228
|
+
status: "claimed" | "sent" | "failed" | "bounced" | "skipped";
|
|
2229
|
+
/** A "Send a test" sample (never counts toward a check). */
|
|
2230
|
+
sample: boolean;
|
|
2231
|
+
/** Billing platform of the subscription. */
|
|
2232
|
+
platform: string;
|
|
2233
|
+
/** Billing-platform subscription id (null for a sample). */
|
|
2234
|
+
subscription: string | null;
|
|
2235
|
+
/** Masked recipient address. */
|
|
2236
|
+
recipient: string | null;
|
|
2237
|
+
/** Subject line. */
|
|
2238
|
+
subject: string | null;
|
|
2239
|
+
/** Sent after its window opened late. */
|
|
2240
|
+
late: boolean;
|
|
2241
|
+
/** Why it failed or was skipped. */
|
|
2242
|
+
error: string | null;
|
|
2243
|
+
/** Send attempts. */
|
|
2244
|
+
attempts: number;
|
|
2245
|
+
/** When it was due. Unix timestamp in seconds. */
|
|
2246
|
+
due: number | null;
|
|
2247
|
+
/** When it was sent. Unix timestamp in seconds. */
|
|
2248
|
+
sent: number | null;
|
|
2249
|
+
/** When the send was first claimed. Unix timestamp in seconds. */
|
|
2250
|
+
created: number;
|
|
2251
|
+
/** Evidence record of the sent email. */
|
|
2252
|
+
evidence: string | null;
|
|
2253
|
+
}
|
|
2254
|
+
/** A page of checkbox notices sends, newest first. */
|
|
2255
|
+
export interface NoticeSendList {
|
|
2256
|
+
/** String representing the object's type. Always "list". */
|
|
2257
|
+
object: "list";
|
|
2258
|
+
/** Checkbox Notices sends, newest first. */
|
|
2259
|
+
data: Array<NoticeSend>;
|
|
2260
|
+
/** Whether more items exist after this page. Pass the last id as starting_after to fetch them. */
|
|
2261
|
+
has_more: boolean;
|
|
2262
|
+
/** The URL of this list. */
|
|
2263
|
+
url: string;
|
|
2264
|
+
}
|
|
1690
2265
|
/** Checkbox Notices for a site: the legally required emails Checkbox sends on the merchant's behalf. */
|
|
1691
2266
|
export interface NoticeSettings {
|
|
1692
2267
|
/** Unique identifier of the notice settings (ntcs_…). */
|
|
@@ -1709,8 +2284,12 @@ export interface NoticeSettings {
|
|
|
1709
2284
|
product_name: string | null;
|
|
1710
2285
|
/** Logo URL (https). */
|
|
1711
2286
|
logo_url: string | null;
|
|
1712
|
-
/** Reply-to / support address. */
|
|
2287
|
+
/** Reply-to / support address every notice names as the business's contact. null until one is set (or while support_email_to_confirm waits for a person). */
|
|
1713
2288
|
support_email: string | null;
|
|
2289
|
+
/** The Checkbox account's login address (the owner's), offered as the support email but not used: Checkbox sends nothing with it, and does not save it, until a person confirms it once in the dashboard (Notices › Branding). Agents cannot confirm it; ask the human, or set a different support_email they chose. The Stripe account's public support email is used without asking. */
|
|
2290
|
+
support_email_to_confirm: string | null;
|
|
2291
|
+
/** Whether Checkbox Notices emails the site's real subscribers. test_mode: never (test-mode sites email only test-run inboxes and send the owner marked test copies). needs_confirmation: Notices are on, but nothing goes to real subscribers until a person confirms it once in the dashboard (Notices tab, after a preview); an API key or agent cannot confirm it. confirmed: they are emailed. off: Checkbox sends nothing. */
|
|
2292
|
+
real_sends: "test_mode" | "confirmed" | "needs_confirmation" | "off";
|
|
1714
2293
|
/** Where subscribers cancel online (site domain, hosted cancellation page or billing portal). */
|
|
1715
2294
|
cancel_url: string | null;
|
|
1716
2295
|
/** Hex brand colour. */
|
|
@@ -1721,7 +2300,7 @@ export interface NoticeSettings {
|
|
|
1721
2300
|
subscribers: {
|
|
1722
2301
|
/** Active subscriptions Checkbox knows from the billing platform. */
|
|
1723
2302
|
active: number;
|
|
1724
|
-
/** Of those, how many
|
|
2303
|
+
/** Of those, how many Checkbox can email: an address on file, or a Stripe customer whose address it reads when sending. */
|
|
1725
2304
|
with_email: number;
|
|
1726
2305
|
} | null;
|
|
1727
2306
|
/** Confirmed cancellation policy (required before notices go out). */
|
|
@@ -1767,15 +2346,19 @@ export interface NoticeSettings {
|
|
|
1767
2346
|
export interface UpdateNoticeSettingsParams {
|
|
1768
2347
|
/** merchant: you send the emails (Checkbox tracks them); checkbox: Checkbox sends them. Turning an enabled_kinds notice on implies checkbox. */
|
|
1769
2348
|
mode?: "merchant" | "checkbox";
|
|
1770
|
-
/**
|
|
2349
|
+
/** The full list of notices Checkbox sends: replaces the current list, so a kind left out is turned off. To turn one on or off without touching the others, use add_kinds / remove_kinds. Turning one on needs cancel_url, a confirmed policy and a connected Stripe, Recharge, Chargebee, Recurly or Paddle account. trial_reminder is accepted as an alias of trial_ending. */
|
|
1771
2350
|
enabled_kinds?: Array<"acknowledgment" | "trial_ending" | "renewal_reminder" | "annual_terms" | "price_change" | "cancellation_confirmation" | "charge_notice" | "trial_reminder">;
|
|
2351
|
+
/** Notices to turn on, added to the ones already on (the others stay as they are). Same prerequisites as enabled_kinds. */
|
|
2352
|
+
add_kinds?: Array<"acknowledgment" | "trial_ending" | "renewal_reminder" | "annual_terms" | "price_change" | "cancellation_confirmation" | "charge_notice" | "trial_reminder">;
|
|
2353
|
+
/** Notices to turn off; the others stay as they are. */
|
|
2354
|
+
remove_kinds?: Array<"acknowledgment" | "trial_ending" | "renewal_reminder" | "annual_terms" | "price_change" | "cancellation_confirmation" | "charge_notice" | "trial_reminder">;
|
|
1772
2355
|
/** Brand name. */
|
|
1773
2356
|
brand_name?: string | null;
|
|
1774
2357
|
/** Product name. */
|
|
1775
2358
|
product_name?: string | null;
|
|
1776
2359
|
/** Logo URL (https). */
|
|
1777
2360
|
logo_url?: string | null;
|
|
1778
|
-
/** Support address. */
|
|
2361
|
+
/** Support address every notice names (required before Checkbox sends). Turning a notice on without one uses the Checkbox cancellation page's or the Stripe account's public support email. The Checkbox account's login address is never used without a person: setting it here answers resource_conflict (next_action confirm_support_email) until the human confirms it once in the dashboard (Notices › Branding). */
|
|
1779
2362
|
support_email?: string | null;
|
|
1780
2363
|
/** Online cancellation URL. */
|
|
1781
2364
|
cancel_url?: string | null;
|
|
@@ -1897,9 +2480,9 @@ export interface DueNoticeList {
|
|
|
1897
2480
|
export interface NoticeTemplate {
|
|
1898
2481
|
/** Template id (`<variant>.v1`); due notices name the one they were rendered from. */
|
|
1899
2482
|
id: string;
|
|
1900
|
-
/** Notice kind. */
|
|
1901
|
-
kind: "acknowledgment" | "trial_ending" | "renewal_reminder" | "annual_terms" | "price_change" | "cancellation_confirmation";
|
|
1902
|
-
/** Variant within the kind (acknowledgment vs acknowledgment_trial, cancellation_confirmation vs _immediate). */
|
|
2483
|
+
/** Notice kind (charge_notice: sent by you with each renewal charge; Checkbox does not schedule it). */
|
|
2484
|
+
kind: "acknowledgment" | "trial_ending" | "renewal_reminder" | "annual_terms" | "price_change" | "cancellation_confirmation" | "charge_notice";
|
|
2485
|
+
/** Variant within the kind (acknowledgment vs acknowledgment_trial, cancellation_confirmation vs _immediate, charge_notice_upcoming before a charge vs charge_notice after it). */
|
|
1903
2486
|
variant: string;
|
|
1904
2487
|
/** Human label. */
|
|
1905
2488
|
label: string;
|
|
@@ -1917,7 +2500,7 @@ export interface NoticeTemplate {
|
|
|
1917
2500
|
merge_fields: Array<string>;
|
|
1918
2501
|
/** The kind to pass to checkEmail (/v1/checks/email) for this template. */
|
|
1919
2502
|
check_kind: string;
|
|
1920
|
-
/** BCC address for this kind (when ?site= is given). */
|
|
2503
|
+
/** BCC address for this kind (when ?site= is given): the same address the plan's email task gives. A copy sent to it with the subscriber in To also confirms that subscriber's due notice of this kind. */
|
|
1921
2504
|
bcc?: string;
|
|
1922
2505
|
}
|
|
1923
2506
|
/** Copy-ready templates for every required notice. */
|
|
@@ -1943,7 +2526,7 @@ export interface NoticeTemplateCheck {
|
|
|
1943
2526
|
/** Always "notice_template_check". */
|
|
1944
2527
|
object: "notice_template_check";
|
|
1945
2528
|
/** Notice kind checked. */
|
|
1946
|
-
kind: "acknowledgment" | "trial_ending" | "renewal_reminder" | "annual_terms" | "price_change" | "cancellation_confirmation";
|
|
2529
|
+
kind: "acknowledgment" | "trial_ending" | "renewal_reminder" | "annual_terms" | "price_change" | "cancellation_confirmation" | "charge_notice";
|
|
1947
2530
|
/** pass, fail or needs_review. */
|
|
1948
2531
|
verdict: string;
|
|
1949
2532
|
/** Verdict per engine check. */
|
|
@@ -1980,7 +2563,7 @@ export interface CheckNoticeTemplateParams {
|
|
|
1980
2563
|
/** Site whose plan, brand, cancel URL and jurisdictions fill the merge fields and scope the check. */
|
|
1981
2564
|
site: string;
|
|
1982
2565
|
/** Which notice the template is for. */
|
|
1983
|
-
kind: "acknowledgment" | "trial_ending" | "renewal_reminder" | "annual_terms" | "price_change" | "cancellation_confirmation";
|
|
2566
|
+
kind: "acknowledgment" | "trial_ending" | "renewal_reminder" | "annual_terms" | "price_change" | "cancellation_confirmation" | "charge_notice";
|
|
1984
2567
|
/** Your subject (merge fields allowed). */
|
|
1985
2568
|
subject: string;
|
|
1986
2569
|
/** Your plain-text body (merge fields allowed). */
|
|
@@ -2025,10 +2608,6 @@ export interface LawSiteImpact {
|
|
|
2025
2608
|
site: string;
|
|
2026
2609
|
/** What changed for the site. */
|
|
2027
2610
|
summary: string;
|
|
2028
|
-
/** Score before the change (0-100, one decimal place). */
|
|
2029
|
-
score_before: number | null;
|
|
2030
|
-
/** Score after re-evaluation (0-100, one decimal place). */
|
|
2031
|
-
score_after: number | null;
|
|
2032
2611
|
/** Checks whose result changed or that the change touches. */
|
|
2033
2612
|
affected_checks: Array<{
|
|
2034
2613
|
/** Check id. */
|
|
@@ -2113,7 +2692,7 @@ export interface CheckVerdict {
|
|
|
2113
2692
|
/** Page checks on static HTML: the engine status on the estimated layout. */
|
|
2114
2693
|
static_estimate?: "pass" | "fail" | "needs_review" | "not_applicable";
|
|
2115
2694
|
evidence: VerdictEvidence;
|
|
2116
|
-
/** User-facing status. needs_fix (a
|
|
2695
|
+
/** User-facing status. needs_fix (a requirement is clearly not met: `compliance.fix` is the one change), pending_live_check (everything Checkbox can see is right; the live event has not been observed yet — counts as passing the checks), verified_live (observed live: proof run, real BCC'd send, Stripe-confirmed cancellation), your_call (a real decision for a person: `compliance.question`), compliant (passes; grey areas carry a `compliance.note`), not_applicable, not_set_up (no sign the email or setting exists yet: `compliance.fix` is the one-click way to set it up; never counts as passing the checks), not_checked (Checkbox has not tried it yet, e.g. the cancel flow: `compliance.fix` says how; never counts as passing the checks). */
|
|
2117
2696
|
compliance_status: "needs_fix" | "pending_live_check" | "verified_live" | "your_call" | "compliant" | "not_applicable" | "not_set_up" | "not_checked";
|
|
2118
2697
|
compliance: ComplianceInfo;
|
|
2119
2698
|
}
|
|
@@ -2133,16 +2712,24 @@ export interface CheckWarning {
|
|
|
2133
2712
|
/** Related parameter. */
|
|
2134
2713
|
param?: string;
|
|
2135
2714
|
}
|
|
2136
|
-
/** A
|
|
2715
|
+
/** A suggested replacement that passes the checks, verified by the engine. */
|
|
2137
2716
|
export interface CheckReplacement {
|
|
2138
|
-
/**
|
|
2717
|
+
/** Disclosure generated from the plan terms that passes the checks (locked wording). */
|
|
2139
2718
|
disclosure_text: string;
|
|
2719
|
+
/** The same terms as one short line, verified by the engine like disclosure_text (present only when it passes every targeted check); disclosure_text is then the fuller version. */
|
|
2720
|
+
short_disclosure_text?: string;
|
|
2140
2721
|
/** Label for the unchecked, required consent checkbox. */
|
|
2141
2722
|
consent_label: string;
|
|
2142
2723
|
/** Purchase button label that itself states the renewal. */
|
|
2143
2724
|
button_text: string;
|
|
2144
|
-
/** Drop-in markup: disclosure
|
|
2725
|
+
/** Drop-in markup: disclosure + unchecked required checkbox + button. When consent_on is set (the purchase completes on a Stripe Payment Link or Stripe Checkout), the terms only: no checkbox, no button. */
|
|
2145
2726
|
html: string;
|
|
2727
|
+
/** Set when consent is collected on the Stripe-hosted page, not on this page: html is then the terms only. */
|
|
2728
|
+
consent_on?: "payment_link" | "stripe_checkout";
|
|
2729
|
+
/** What html contains and what is still needed elsewhere (set with consent_on). */
|
|
2730
|
+
note?: string;
|
|
2731
|
+
/** The same markup as JSX for React / Next.js components (className, htmlFor, style objects, self-closed inputs); the text is unchanged. */
|
|
2732
|
+
jsx?: string;
|
|
2146
2733
|
/** Placeholders left to fill (e.g. {{cancel_url}}). */
|
|
2147
2734
|
placeholders: Array<string>;
|
|
2148
2735
|
/** The engine passes every targeted sign-up check on a page using this replacement. */
|
|
@@ -2196,17 +2783,19 @@ export interface DisclosureCheckResult {
|
|
|
2196
2783
|
/** Not legal advice. */
|
|
2197
2784
|
disclaimer: string;
|
|
2198
2785
|
next_action: NextAction;
|
|
2199
|
-
/** User-facing roll-up: needs_fix > your_call > incomplete > compliant (pending live checks count as
|
|
2786
|
+
/** User-facing roll-up: needs_fix > your_call > incomplete > compliant (every required check passes; pending live checks count as passing). `verdict` keeps the machine value. */
|
|
2200
2787
|
compliance_status: "needs_fix" | "your_call" | "incomplete" | "compliant" | "not_checked";
|
|
2201
2788
|
compliance: ComplianceRollup;
|
|
2202
2789
|
replacement: CheckReplacement;
|
|
2203
2790
|
}
|
|
2204
|
-
/** A checkout disclosure to check before it ships. */
|
|
2791
|
+
/** A checkout disclosure to check before it ships. The plan fields (price, interval, cancel_url…) may also be nested under `terms` or `merchant`, as in the other checks. */
|
|
2205
2792
|
export interface DisclosureCheckParams {
|
|
2206
2793
|
/** The disclosure shown next to the purchase button, exactly as rendered. */
|
|
2207
2794
|
text: string;
|
|
2208
2795
|
/** Brand shown to subscribers; used in generated text. */
|
|
2209
2796
|
merchant_name?: string;
|
|
2797
|
+
/** Alias of merchant_name (the {{brand_name}} merge field). Send one of the two. */
|
|
2798
|
+
brand_name?: string;
|
|
2210
2799
|
/** Plan / product name. */
|
|
2211
2800
|
plan_name?: string;
|
|
2212
2801
|
/** Recurring price in major units (19.99). Or give `amount` in minor units. */
|
|
@@ -2215,12 +2804,22 @@ export interface DisclosureCheckParams {
|
|
|
2215
2804
|
amount?: number;
|
|
2216
2805
|
/** Three-letter ISO currency (default usd). */
|
|
2217
2806
|
currency?: string;
|
|
2218
|
-
/** Billing interval: day, week, month or year (required). */
|
|
2219
|
-
interval
|
|
2807
|
+
/** Billing interval: day, week, month or year (required unless `site` gives the plan). */
|
|
2808
|
+
interval?: string;
|
|
2220
2809
|
/** Number of intervals between charges (default 1). */
|
|
2221
2810
|
interval_count?: number;
|
|
2222
2811
|
/** Free-trial length in days (0 or absent = no trial). */
|
|
2223
2812
|
trial_days?: number;
|
|
2813
|
+
/** Intro / first-period price in major units ("$34.50 for your first box, then $69 every 2 weeks"). Or give `intro_amount` in minor units. */
|
|
2814
|
+
intro_price?: number | string;
|
|
2815
|
+
/** Intro / first-period price in minor units. */
|
|
2816
|
+
intro_amount?: number;
|
|
2817
|
+
/** How many billing periods the intro price lasts (default 1). */
|
|
2818
|
+
intro_periods?: number;
|
|
2819
|
+
/** Intro discount as a percentage off the recurring price (a Stripe coupon's percent_off: 20 for "20% off your first month"). Lasts `intro_periods` billing periods. Give one of intro_price / intro_amount, intro_percent_off or intro_amount_off. */
|
|
2820
|
+
intro_percent_off?: number;
|
|
2821
|
+
/** Intro discount as an amount off in minor units (a Stripe coupon's amount_off: 200 for $2.00 off). Lasts `intro_periods` billing periods. */
|
|
2822
|
+
intro_amount_off?: number;
|
|
2224
2823
|
/** https URL where subscribers cancel online (used in generated text; a {{cancel_url}} placeholder otherwise). */
|
|
2225
2824
|
cancel_url?: string;
|
|
2226
2825
|
/** When a cancellation takes effect (default period_end). */
|
|
@@ -2261,6 +2860,10 @@ export interface DisclosureCheckParams {
|
|
|
2261
2860
|
};
|
|
2262
2861
|
/** Evaluate the law as of this date (YYYY-MM-DD, default today). */
|
|
2263
2862
|
as_of?: string;
|
|
2863
|
+
/** Round 23: a site of yours (site_…): the disclosure is judged against the plan it states among the site's plans (the connected Stripe Prices win over plans typed in setup), with the site's merchant name, cancellation URL and jurisdictions, as verifyTask judges it. Plan fields you send are replaced by the plan's. "none" judges only what you send. */
|
|
2864
|
+
site?: string;
|
|
2865
|
+
/** With a site: judge the disclosure against this plan (name or Stripe Price id). An unknown plan is refused with the list of plans. */
|
|
2866
|
+
plan?: string;
|
|
2264
2867
|
}
|
|
2265
2868
|
/** RFC 6902 operation. */
|
|
2266
2869
|
export interface JsonPatchOperation {
|
|
@@ -2315,7 +2918,7 @@ export interface StripeCheckoutSessionCheckResult {
|
|
|
2315
2918
|
/** Not legal advice. */
|
|
2316
2919
|
disclaimer: string;
|
|
2317
2920
|
next_action: NextAction;
|
|
2318
|
-
/** User-facing roll-up: needs_fix > your_call > incomplete > compliant (pending live checks count as
|
|
2921
|
+
/** User-facing roll-up: needs_fix > your_call > incomplete > compliant (every required check passes; pending live checks count as passing). `verdict` keeps the machine value. */
|
|
2319
2922
|
compliance_status: "needs_fix" | "your_call" | "incomplete" | "compliant" | "not_checked";
|
|
2320
2923
|
compliance: ComplianceRollup;
|
|
2321
2924
|
/** The fix. */
|
|
@@ -2346,10 +2949,12 @@ export interface StripeCheckoutSessionCheckResult {
|
|
|
2346
2949
|
placeholders: Array<string>;
|
|
2347
2950
|
};
|
|
2348
2951
|
}
|
|
2349
|
-
/** What Stripe params do not say: merchant_name, cancel_url, and price / interval when line_items reference a Price id. */
|
|
2952
|
+
/** What Stripe params do not say: merchant_name, cancel_url, and price / interval when line_items reference a Price id. Also accepted as `terms`. Optional with `site`. */
|
|
2350
2953
|
export interface CheckPlanTerms {
|
|
2351
2954
|
/** Brand shown to subscribers; used in generated text. */
|
|
2352
2955
|
merchant_name?: string;
|
|
2956
|
+
/** Alias of merchant_name (the {{brand_name}} merge field). Send one of the two. */
|
|
2957
|
+
brand_name?: string;
|
|
2353
2958
|
/** Plan / product name. */
|
|
2354
2959
|
plan_name?: string;
|
|
2355
2960
|
/** Recurring price in major units (19.99). Or give `amount` in minor units. */
|
|
@@ -2364,6 +2969,16 @@ export interface CheckPlanTerms {
|
|
|
2364
2969
|
interval_count?: number;
|
|
2365
2970
|
/** Free-trial length in days (0 or absent = no trial). */
|
|
2366
2971
|
trial_days?: number;
|
|
2972
|
+
/** Intro / first-period price in major units ("$34.50 for your first box, then $69 every 2 weeks"). Or give `intro_amount` in minor units. */
|
|
2973
|
+
intro_price?: number | string;
|
|
2974
|
+
/** Intro / first-period price in minor units. */
|
|
2975
|
+
intro_amount?: number;
|
|
2976
|
+
/** How many billing periods the intro price lasts (default 1). */
|
|
2977
|
+
intro_periods?: number;
|
|
2978
|
+
/** Intro discount as a percentage off the recurring price (a Stripe coupon's percent_off: 20 for "20% off your first month"). Lasts `intro_periods` billing periods. Give one of intro_price / intro_amount, intro_percent_off or intro_amount_off. */
|
|
2979
|
+
intro_percent_off?: number;
|
|
2980
|
+
/** Intro discount as an amount off in minor units (a Stripe coupon's amount_off: 200 for $2.00 off). Lasts `intro_periods` billing periods. */
|
|
2981
|
+
intro_amount_off?: number;
|
|
2367
2982
|
/** https URL where subscribers cancel online (used in generated text; a {{cancel_url}} placeholder otherwise). */
|
|
2368
2983
|
cancel_url?: string;
|
|
2369
2984
|
/** When a cancellation takes effect (default period_end). */
|
|
@@ -2374,6 +2989,10 @@ export interface StripeCheckParams {
|
|
|
2374
2989
|
/** Exactly the object your code passes to Stripe (checkout.sessions.create / paymentLinks.create), or a retrieved Payment Link. */
|
|
2375
2990
|
params: Record<string, unknown>;
|
|
2376
2991
|
merchant?: CheckPlanTerms;
|
|
2992
|
+
/** A site of yours (site_…): the params are judged as verifyTask judges them — the plan each line_items Price sells (the connected Stripe Prices win over plans typed in setup), the site's merchant name, cancellation URL and jurisdictions; merchant fields you send other than the plan's price / interval / trial are kept. Without it, the params are judged with merchant only (or the one site of the account with Stripe connected when you pass plan). "none" judges only what you send. */
|
|
2993
|
+
site?: string;
|
|
2994
|
+
/** With a site: judge the params against this plan (name or Stripe Price id) instead of the plan their Price id sells. An unknown plan is refused with the list of plans. */
|
|
2995
|
+
plan?: string;
|
|
2377
2996
|
/** Where you sell: "all" (default) or state codes ("US-CA", "CA", "US-NY"; "US-FED" is always included). */
|
|
2378
2997
|
jurisdictions?: "all" | Array<string>;
|
|
2379
2998
|
/** Evaluate the law as of this date (YYYY-MM-DD, default today). */
|
|
@@ -2423,7 +3042,7 @@ export interface StripePaymentLinkCheckResult {
|
|
|
2423
3042
|
/** Not legal advice. */
|
|
2424
3043
|
disclaimer: string;
|
|
2425
3044
|
next_action: NextAction;
|
|
2426
|
-
/** User-facing roll-up: needs_fix > your_call > incomplete > compliant (pending live checks count as
|
|
3045
|
+
/** User-facing roll-up: needs_fix > your_call > incomplete > compliant (every required check passes; pending live checks count as passing). `verdict` keeps the machine value. */
|
|
2427
3046
|
compliance_status: "needs_fix" | "your_call" | "incomplete" | "compliant" | "not_checked";
|
|
2428
3047
|
compliance: ComplianceRollup;
|
|
2429
3048
|
/** The fix. */
|
|
@@ -2502,20 +3121,22 @@ export interface EmailCheckResult {
|
|
|
2502
3121
|
/** Not legal advice. */
|
|
2503
3122
|
disclaimer: string;
|
|
2504
3123
|
next_action: NextAction;
|
|
2505
|
-
/** User-facing roll-up: needs_fix > your_call > incomplete > compliant (pending live checks count as
|
|
3124
|
+
/** User-facing roll-up: needs_fix > your_call > incomplete > compliant (every required check passes; pending live checks count as passing). `verdict` keeps the machine value. */
|
|
2506
3125
|
compliance_status: "needs_fix" | "your_call" | "incomplete" | "compliant" | "not_checked";
|
|
2507
3126
|
compliance: ComplianceRollup;
|
|
2508
3127
|
/** The email kind checked. */
|
|
2509
3128
|
email_kind: string;
|
|
3129
|
+
/** With a site: the site's plan the email was judged against. */
|
|
3130
|
+
plan?: string;
|
|
2510
3131
|
/** Always template_checked: this checks the wording you send in, not that your system sends it. On the site, the email only counts once Checkbox sees it sent for a real event (delivery_seen: a test run, a notice for a real subscriber, or a BCC copy matching that subscriber's billing event). */
|
|
2511
3132
|
verification_level: "template_checked";
|
|
2512
3133
|
/** Requirements that make this email mandatory for this plan (empty: not legally required). */
|
|
2513
3134
|
required_by: Array<string>;
|
|
2514
|
-
/** A
|
|
3135
|
+
/** A template generated from the plan terms that passes the checks. */
|
|
2515
3136
|
template: {
|
|
2516
|
-
/**
|
|
3137
|
+
/** Subject that passes the checks. */
|
|
2517
3138
|
subject: string;
|
|
2518
|
-
/**
|
|
3139
|
+
/** Plain-text body that passes the checks. */
|
|
2519
3140
|
text: string;
|
|
2520
3141
|
/** The same body as HTML. */
|
|
2521
3142
|
html: string;
|
|
@@ -2539,8 +3160,8 @@ export interface EmailCheckParams {
|
|
|
2539
3160
|
text?: string;
|
|
2540
3161
|
/** HTML body. */
|
|
2541
3162
|
html?: string;
|
|
2542
|
-
/** The plan the email is about (price, interval and cancel_url at least). */
|
|
2543
|
-
terms
|
|
3163
|
+
/** The plan the email is about (price, interval and cancel_url at least). Also accepted as `merchant`. Required unless a site with plan terms is used (`site`, or the one site of the account with Stripe connected): then the plan fields come from the price Stripe charges and the other fields (cancel_url, previous_price, support_contact) are kept. A price_change notice always takes the NEW price from here. */
|
|
3164
|
+
terms?: CheckPlanTerms & {
|
|
2544
3165
|
/** price_change only: the OLD price before the change, major units. price / amount is the NEW price the email announces. */
|
|
2545
3166
|
previous_price?: number | string;
|
|
2546
3167
|
/** Price before a price change, minor units. */
|
|
@@ -2548,6 +3169,10 @@ export interface EmailCheckParams {
|
|
|
2548
3169
|
/** Support email / URL shown in the generated template. */
|
|
2549
3170
|
support_contact?: string;
|
|
2550
3171
|
};
|
|
3172
|
+
/** A site of yours (site_…): the email is judged as verifyTask judges it, against the plan it names ("Annual") among the site's plans (the connected Stripe Prices win over plans typed in setup), with the site's jurisdictions. Without it, the one site of the account with Stripe connected is used when there is exactly one (the result says so in warnings, code site_from_stripe). "none" judges only the terms you send. */
|
|
3173
|
+
site?: string;
|
|
3174
|
+
/** With a site: the plan (name or Stripe Price id) the email is for, instead of the plan the email names. */
|
|
3175
|
+
plan?: string;
|
|
2551
3176
|
/** Where you sell: "all" (default) or state codes ("US-CA", "CA", "US-NY"; "US-FED" is always included). */
|
|
2552
3177
|
jurisdictions?: "all" | Array<string>;
|
|
2553
3178
|
/** Evaluate the law as of this date (YYYY-MM-DD, default today). */
|
|
@@ -2597,7 +3222,7 @@ export interface PageCheckResult {
|
|
|
2597
3222
|
/** Not legal advice. */
|
|
2598
3223
|
disclaimer: string;
|
|
2599
3224
|
next_action: NextAction;
|
|
2600
|
-
/** User-facing roll-up: needs_fix > your_call > incomplete > compliant (pending live checks count as
|
|
3225
|
+
/** User-facing roll-up: needs_fix > your_call > incomplete > compliant (every required check passes; pending live checks count as passing). `verdict` keeps the machine value. */
|
|
2601
3226
|
compliance_status: "needs_fix" | "your_call" | "incomplete" | "compliant" | "not_checked";
|
|
2602
3227
|
compliance: ComplianceRollup;
|
|
2603
3228
|
/** Whether html was given or fetched from url. */
|
|
@@ -2606,8 +3231,8 @@ export interface PageCheckResult {
|
|
|
2606
3231
|
extraction: {
|
|
2607
3232
|
/** How the page was read. */
|
|
2608
3233
|
mode: "static_html";
|
|
2609
|
-
/** Page URL used. */
|
|
2610
|
-
url: string;
|
|
3234
|
+
/** Page URL used (null when only html was sent: the page is built from the HTML you sent). */
|
|
3235
|
+
url: string | null;
|
|
2611
3236
|
/** Purchase buttons found (primary first). */
|
|
2612
3237
|
purchase_buttons: Array<string>;
|
|
2613
3238
|
/** Text blocks that read like subscription terms. */
|
|
@@ -2632,6 +3257,11 @@ export interface PageCheckResult {
|
|
|
2632
3257
|
limitations: Array<string>;
|
|
2633
3258
|
};
|
|
2634
3259
|
replacement?: CheckReplacement;
|
|
3260
|
+
/** With two or more plans: one verified replacement per plan, for that plan's own purchase button (never another plan's). */
|
|
3261
|
+
plan_replacements?: Array<CheckReplacement & {
|
|
3262
|
+
/** The plan this replacement is for (name, price, interval, trial). */
|
|
3263
|
+
plan: string;
|
|
3264
|
+
}>;
|
|
2635
3265
|
}
|
|
2636
3266
|
/** A checkout page to check. */
|
|
2637
3267
|
export interface PageCheckParams {
|
|
@@ -2642,6 +3272,17 @@ export interface PageCheckParams {
|
|
|
2642
3272
|
/** What the page is (default checkout). */
|
|
2643
3273
|
page_kind?: "checkout" | "pricing";
|
|
2644
3274
|
terms?: CheckPlanTerms;
|
|
3275
|
+
/** Every plan a multi-plan pricing page sells (price or amount, interval, trial_days each; the same plan fields as setup plans[] in updateSetupSession). Each plan card / button is judged against its own plan; only a price no listed plan charges is a mismatch. Without it, one plan's `terms` leaves other plan cards' prices at needs_review (warning plans_partial). */
|
|
3276
|
+
plans?: Array<CheckPlanTerms & {
|
|
3277
|
+
/** Plan name, as in setup plans[] (updateSetupSession; alias of plan_name). */
|
|
3278
|
+
name?: string;
|
|
3279
|
+
}>;
|
|
3280
|
+
/** Where the shopper pays: own_page (a form on this page), stripe_checkout or payment_link (a Stripe-hosted page that collects consent, so no checkbox is needed here). Inferred from a purchase link to buy.stripe.com / checkout.stripe.com, or to one of payment_links, when absent. */
|
|
3281
|
+
checkout_type?: "own_page" | "stripe_checkout" | "payment_link";
|
|
3282
|
+
/** Your Stripe Payment Link URLs (buy.stripe.com or your own domain). A link to one of them is the purchase button, and the purchase and consent complete on Stripe, so no checkbox is added on this page. With site, the Payment Links read from your connected Stripe account are added. */
|
|
3283
|
+
payment_links?: Array<string>;
|
|
3284
|
+
/** A site of yours (site_…): the page is judged exactly as verifyTask judges it — against the site's plans (the connected Stripe Prices win over plans typed in setup), its jurisdictions and its checkout type. These replace terms, plans, jurisdictions and checkout_type when the site knows them. Without it, the one site of the account with Stripe connected gives the plans when there is exactly one (warning site_from_stripe says so). "none" judges only what you send. */
|
|
3285
|
+
site?: string;
|
|
2645
3286
|
/** Where you sell: "all" (default) or state codes ("US-CA", "CA", "US-NY"; "US-FED" is always included). */
|
|
2646
3287
|
jurisdictions?: "all" | Array<string>;
|
|
2647
3288
|
/** Evaluate the law as of this date (YYYY-MM-DD, default today). */
|
|
@@ -2659,9 +3300,9 @@ export interface ScheduledNotice {
|
|
|
2659
3300
|
send_date: string;
|
|
2660
3301
|
/** Recommended send time. Unix timestamp in seconds. */
|
|
2661
3302
|
send_at: number;
|
|
2662
|
-
/** Earliest
|
|
3303
|
+
/** Earliest send time that meets the notice timing. Unix seconds. */
|
|
2663
3304
|
window_opens_at: number;
|
|
2664
|
-
/** Latest
|
|
3305
|
+
/** Latest send time that meets the notice timing. Unix seconds. */
|
|
2665
3306
|
window_closes_at: number;
|
|
2666
3307
|
/** Days before the event (0 = right away). */
|
|
2667
3308
|
days_before: number;
|
|
@@ -2673,6 +3314,8 @@ export interface ScheduledNotice {
|
|
|
2673
3314
|
citations: Array<string>;
|
|
2674
3315
|
/** No requirement states a window; Checkbox’s default window was used. */
|
|
2675
3316
|
default_window: boolean;
|
|
3317
|
+
/** Why the window is what it is when the states narrow it to a single day, and when to send. */
|
|
3318
|
+
timing_note?: string;
|
|
2676
3319
|
}
|
|
2677
3320
|
/** When each legally required notice must be sent. */
|
|
2678
3321
|
export interface NoticeScheduleResult {
|
|
@@ -2686,8 +3329,14 @@ export interface NoticeScheduleResult {
|
|
|
2686
3329
|
created: number;
|
|
2687
3330
|
/** Sign-up date planned for. */
|
|
2688
3331
|
start_date: string;
|
|
3332
|
+
/** With a site: the site's plan the notices were scheduled for. */
|
|
3333
|
+
plan?: string;
|
|
2689
3334
|
/** Every legally required notice, in send order. */
|
|
2690
3335
|
notices: Array<ScheduledNotice>;
|
|
3336
|
+
/** Notes about the input (e.g. an amount that looks like the wrong unit). */
|
|
3337
|
+
warnings?: Array<CheckWarning>;
|
|
3338
|
+
/** How days before are counted when Checkbox judges a send (the email checks, test runs and Notices use the same rule). */
|
|
3339
|
+
rounding_rule: string;
|
|
2691
3340
|
/** Notice kinds no applicable requirement demands for this plan. */
|
|
2692
3341
|
not_required: Array<{
|
|
2693
3342
|
/** Notice kind. */
|
|
@@ -2711,7 +3360,11 @@ export interface NoticeScheduleResult {
|
|
|
2711
3360
|
}
|
|
2712
3361
|
/** A subscription to plan the legally required notices for. */
|
|
2713
3362
|
export interface NoticeScheduleParams {
|
|
2714
|
-
terms
|
|
3363
|
+
terms?: CheckPlanTerms;
|
|
3364
|
+
/** A site of yours (site_…): the plan's terms (Stripe Prices win over plans typed in setup) and jurisdictions come from the site. With several plans, name one with plan (or send terms). */
|
|
3365
|
+
site?: string;
|
|
3366
|
+
/** With a site: the plan (name or Stripe Price id) to schedule the notices for. An unknown plan is refused with the list of plans. */
|
|
3367
|
+
plan?: string;
|
|
2715
3368
|
/** Sign-up date of the subscription to plan for (default today). */
|
|
2716
3369
|
start_date?: string;
|
|
2717
3370
|
/** A planned price change to schedule the notice for. */
|
|
@@ -2746,7 +3399,7 @@ export interface SuggestionGuardrail {
|
|
|
2746
3399
|
/** Catalog requirement ids the rule comes from. */
|
|
2747
3400
|
requirement_ids: Array<string>;
|
|
2748
3401
|
}
|
|
2749
|
-
/** One optional
|
|
3402
|
+
/** One optional conversion suggestion that keeps the checks passing. */
|
|
2750
3403
|
export interface Suggestion {
|
|
2751
3404
|
/** Stable id of the suggestion in Checkbox’s library. */
|
|
2752
3405
|
key: string;
|
|
@@ -2768,6 +3421,8 @@ export interface Suggestion {
|
|
|
2768
3421
|
label: string;
|
|
2769
3422
|
/** Your current copy (or a typical example). */
|
|
2770
3423
|
text: string;
|
|
3424
|
+
/** your_copy: the text is your own copy (captured by Checkbox or sent by you); example: typical copy, not yours (label it “Example”). */
|
|
3425
|
+
source: "your_copy" | "example";
|
|
2771
3426
|
};
|
|
2772
3427
|
/** After. */
|
|
2773
3428
|
after: {
|
|
@@ -2803,7 +3458,7 @@ export interface Suggestion {
|
|
|
2803
3458
|
verified: boolean;
|
|
2804
3459
|
/** Checks that did not pass (empty when verified). */
|
|
2805
3460
|
open_checks: Array<string>;
|
|
2806
|
-
/** The after-example's status roll-up (the same labels as compliance on sites and check results): compliant for every offered suggestion. */
|
|
3461
|
+
/** The after-example's status roll-up (the same labels as compliance on sites and check results): compliant (checks pass) for every offered suggestion. */
|
|
2807
3462
|
compliance_status: "needs_fix" | "your_call" | "incomplete" | "compliant" | "not_checked";
|
|
2808
3463
|
/** Its label. */
|
|
2809
3464
|
compliance_label: string;
|
|
@@ -2815,7 +3470,7 @@ export interface Suggestion {
|
|
|
2815
3470
|
/** Placeholders you must fill (e.g. {{cancel_url}}). */
|
|
2816
3471
|
placeholders: Array<string>;
|
|
2817
3472
|
}
|
|
2818
|
-
/** Optional
|
|
3473
|
+
/** Optional conversion suggestions that keep the checks passing, for a checkout, Stripe Checkout, lifecycle emails and the cancellation flow. Never a compliance task. */
|
|
2819
3474
|
export interface SuggestionReport {
|
|
2820
3475
|
/** Id of this report (sugr_…). Reports are computed on request and not stored. */
|
|
2821
3476
|
id: string;
|
|
@@ -2829,7 +3484,7 @@ export interface SuggestionReport {
|
|
|
2829
3484
|
site: string | null;
|
|
2830
3485
|
/** Always true: suggestions are optional and never block anything. */
|
|
2831
3486
|
optional: true;
|
|
2832
|
-
/** Always false: suggestions never count for or against compliance
|
|
3487
|
+
/** Always false: suggestions never count for or against compliance or the plan status. */
|
|
2833
3488
|
counts_toward_compliance: false;
|
|
2834
3489
|
/** One paragraph for an LLM or a human. */
|
|
2835
3490
|
summary: string;
|
|
@@ -2853,7 +3508,7 @@ export interface SuggestionReport {
|
|
|
2853
3508
|
observed: boolean;
|
|
2854
3509
|
/** Failing checks that hold it. */
|
|
2855
3510
|
held_by: Array<string>;
|
|
2856
|
-
/** The status label of those checks ("
|
|
3511
|
+
/** The status label of those checks ("1 fix needed", "2 fixes needed"), or null. */
|
|
2857
3512
|
held_label: string | null;
|
|
2858
3513
|
/** Suggestions offered for it. */
|
|
2859
3514
|
offered: number;
|
|
@@ -2881,6 +3536,8 @@ export interface SuggestionReport {
|
|
|
2881
3536
|
operation_id?: string;
|
|
2882
3537
|
/** The MCP tool for operation_id. */
|
|
2883
3538
|
mcp_tool?: string;
|
|
3539
|
+
/** The HTTP method and path of operation_id. */
|
|
3540
|
+
endpoint?: string;
|
|
2884
3541
|
};
|
|
2885
3542
|
/** Not legal advice; optional; results vary. */
|
|
2886
3543
|
disclaimer: string;
|
|
@@ -2890,8 +3547,8 @@ export interface SuggestionsParams {
|
|
|
2890
3547
|
terms?: CheckPlanTerms;
|
|
2891
3548
|
/** Other plans you sell (enables “point to a cheaper plan” and plan-choice suggestions). */
|
|
2892
3549
|
other_plans?: Array<CheckPlanTerms & {
|
|
2893
|
-
/** Plan name shown to subscribers. */
|
|
2894
|
-
name
|
|
3550
|
+
/** Plan name shown to subscribers (or give plan_name, as in the checks). */
|
|
3551
|
+
name?: string;
|
|
2895
3552
|
}>;
|
|
2896
3553
|
/** Where you sell: "all" (default) or state codes ("US-CA", "CA", "US-NY"; "US-FED" is always included). */
|
|
2897
3554
|
jurisdictions?: "all" | Array<string>;
|
|
@@ -2979,6 +3636,10 @@ export interface SuggestionsParams {
|
|
|
2979
3636
|
trial_reminders?: boolean;
|
|
2980
3637
|
/** Your site’s base URL (used in example links). */
|
|
2981
3638
|
site_url?: string;
|
|
3639
|
+
/** Where subscribers manage their subscription (restart and switch-plan links; never the cancel step). Default: derived from terms.cancel_url. */
|
|
3640
|
+
account_url?: string;
|
|
3641
|
+
/** You ship physical goods (boxes, deliveries): examples talk about the next box instead of access. Default: inferred from your plan names and copy. */
|
|
3642
|
+
sells_goods?: boolean;
|
|
2982
3643
|
}
|
|
2983
3644
|
export interface ElementsRelease {
|
|
2984
3645
|
/** Semver of the bundle. */
|
|
@@ -3066,6 +3727,12 @@ export interface DisclosureTerms {
|
|
|
3066
3727
|
interval_count?: number;
|
|
3067
3728
|
/** Free-trial length in days (0 or absent: no trial). */
|
|
3068
3729
|
trial_days?: number;
|
|
3730
|
+
/** Intro / first-period charge in minor units, stated before the regular price ("$34.50 for your first 2 weeks, then $69.00 every 2 weeks"). Must be below amount. */
|
|
3731
|
+
intro_amount?: number;
|
|
3732
|
+
/** How many billing periods the intro price lasts (default 1). */
|
|
3733
|
+
intro_periods?: number;
|
|
3734
|
+
/** The intro price as a percentage off amount (a coupon's percent_off), instead of intro_amount. Needs amount. */
|
|
3735
|
+
intro_percent_off?: number;
|
|
3069
3736
|
/** https address where subscribers cancel online. */
|
|
3070
3737
|
cancel_url?: string;
|
|
3071
3738
|
/** When a cancellation takes effect (default period_end). */
|
|
@@ -3134,7 +3801,7 @@ export interface Consent {
|
|
|
3134
3801
|
client_timestamp: number | null;
|
|
3135
3802
|
/** On-screen measurement summary (null for server-recorded consents). */
|
|
3136
3803
|
presentation: {
|
|
3137
|
-
/** Guard-rail
|
|
3804
|
+
/** Guard-rail issues measured on screen. */
|
|
3138
3805
|
violations: Array<string>;
|
|
3139
3806
|
/** Safe styles replaced the theme. */
|
|
3140
3807
|
fallback_applied: boolean;
|
|
@@ -3225,7 +3892,7 @@ export interface ConsentPresentationInput {
|
|
|
3225
3892
|
/** Viewport height (CSS px). */
|
|
3226
3893
|
height: number;
|
|
3227
3894
|
} | null;
|
|
3228
|
-
/** Guard-rail
|
|
3895
|
+
/** Guard-rail issues the element detected. */
|
|
3229
3896
|
violations?: Array<string>;
|
|
3230
3897
|
/** The element replaced the theme with safe styles. */
|
|
3231
3898
|
fallback_applied?: boolean;
|
|
@@ -3480,7 +4147,7 @@ export interface Receipt {
|
|
|
3480
4147
|
/** When it was signed (unix seconds). */
|
|
3481
4148
|
signed: number | null;
|
|
3482
4149
|
};
|
|
3483
|
-
/** When the receipt is deleted
|
|
4150
|
+
/** When the receipt is deleted: consent time plus your retention setting, pushed out to one year after its subscription ends when that is later (Cal. Bus. & Prof. Code § 17602(a)(6)). Unix timestamp in seconds. */
|
|
3484
4151
|
retain_until: number;
|
|
3485
4152
|
/** PNG of what the subscriber saw, re-rendered from the snapshot (renderReceipt, same auth). */
|
|
3486
4153
|
render_url: string;
|
|
@@ -3590,7 +4257,7 @@ export interface ReceiptSettings {
|
|
|
3590
4257
|
livemode: boolean;
|
|
3591
4258
|
/** Receipts are collected. Off by default: turn on after adding the receipts paragraph to your privacy policy (browser receipts answer 403 receipts_disabled when off; Elements consents are recorded without a receipt). */
|
|
3592
4259
|
enabled: boolean;
|
|
3593
|
-
/** Days a receipt is kept (default 1461 = 4 years: the California Unfair Competition Law limitation period;
|
|
4260
|
+
/** Days a receipt is kept (default 1461 = 4 years: the California Unfair Competition Law limitation period; adjust to your counsel's advice). */
|
|
3594
4261
|
retention_days: number;
|
|
3595
4262
|
/** Last change. Unix timestamp in seconds. */
|
|
3596
4263
|
updated: number | null;
|
|
@@ -3598,7 +4265,7 @@ export interface ReceiptSettings {
|
|
|
3598
4265
|
export interface ReceiptSettingsUpdateParams {
|
|
3599
4266
|
/** Turn receipt collection on or off. */
|
|
3600
4267
|
enabled?: boolean;
|
|
3601
|
-
/** Days to keep receipts (
|
|
4268
|
+
/** Days to keep receipts (1096–3653, i.e. 3 to 10 years; California requires verification of consent to be kept at least three years, Cal. Bus. & Prof. Code § 17602(a)(6)). Applies to new receipts. */
|
|
3602
4269
|
retention_days?: number;
|
|
3603
4270
|
}
|
|
3604
4271
|
/** A billing-platform TEST-mode key Checkbox uses for synthetic test subscriptions. Stored encrypted; never live mode. */
|
|
@@ -3623,6 +4290,7 @@ export interface TestCredential {
|
|
|
3623
4290
|
last_error: string | null;
|
|
3624
4291
|
/** When the key was stored. Unix timestamp in seconds. */
|
|
3625
4292
|
created: number;
|
|
4293
|
+
next_action?: NextAction;
|
|
3626
4294
|
}
|
|
3627
4295
|
/** A page of stored test-mode keys. */
|
|
3628
4296
|
export interface TestCredentialList {
|
|
@@ -3662,10 +4330,15 @@ export interface StripeCheckoutConfig {
|
|
|
3662
4330
|
params_hash: string;
|
|
3663
4331
|
/** Parameters that were dropped because they are not mirrored (customer, URLs, metadata…). */
|
|
3664
4332
|
ignored_params: Array<string>;
|
|
4333
|
+
/** What Checkbox did not store or judge (ignored_params in words), and on registration which older configs this one replaced. */
|
|
4334
|
+
warnings: Array<string>;
|
|
4335
|
+
/** Registration only: older configs with the same name, or for the same Price ids, that this one replaced (deleted). */
|
|
4336
|
+
replaced?: Array<string>;
|
|
3665
4337
|
/** Up to 20 key/value string pairs you can attach to the object. */
|
|
3666
4338
|
metadata: Record<string, string>;
|
|
3667
4339
|
/** When the config was registered. Unix timestamp in seconds. */
|
|
3668
4340
|
created: number;
|
|
4341
|
+
next_action?: NextAction;
|
|
3669
4342
|
}
|
|
3670
4343
|
/** A page of registered checkout configs, newest first. */
|
|
3671
4344
|
export interface StripeCheckoutConfigList {
|
|
@@ -3693,7 +4366,7 @@ export type TestRunRemediation = {
|
|
|
3693
4366
|
summary: string;
|
|
3694
4367
|
/** Steps to fix it. */
|
|
3695
4368
|
steps: Array<string>;
|
|
3696
|
-
/**
|
|
4369
|
+
/** Suggested copy that passes the checks, when there is one. */
|
|
3697
4370
|
suggested_copy: string | null;
|
|
3698
4371
|
/** Code that applies the fix, when there is one. */
|
|
3699
4372
|
snippet: {
|
|
@@ -3726,8 +4399,8 @@ export interface TestRunStep {
|
|
|
3726
4399
|
key: string;
|
|
3727
4400
|
/** Human-readable step title. */
|
|
3728
4401
|
title: string;
|
|
3729
|
-
/** passed: observed, with evidence, and every judged check passed (never on an assumption); failed: a check failed or the step broke the run; warning: needs review — could not be fully observed or proven (see code and fix); skipped: not applicable or turned off. */
|
|
3730
|
-
status: "pending" | "running" | "passed" | "failed" | "warning" | "skipped";
|
|
4402
|
+
/** passed: observed, with evidence, and every judged check passed (never on an assumption); failed: a check failed or the step broke the run; warning: needs review — could not be fully observed or proven (see code and fix); skipped: not applicable or turned off; info: informational only (e.g. a bare Stripe-hosted test checkout that is not your checkout): its checks are listed but not counted and need no fix. */
|
|
4403
|
+
status: "pending" | "running" | "passed" | "failed" | "warning" | "skipped" | "info";
|
|
3731
4404
|
/** What was observed, in one or two sentences. */
|
|
3732
4405
|
summary: string | null;
|
|
3733
4406
|
/** When the step started. Unix timestamp in seconds. */
|
|
@@ -3770,10 +4443,29 @@ export interface TestRun {
|
|
|
3770
4443
|
type: "stripe" | "generic";
|
|
3771
4444
|
/** Stripe runs: mirror (Checkbox mirrors your checkout into test mode and moves a test clock through trial and renewal) or real_checkout (the shopper buys through YOUR checkout on your test deployment, so your own webhook handlers and email code fire: the proof that your real system works). null for generic runs. */
|
|
3772
4445
|
mode: "mirror" | "real_checkout" | null;
|
|
3773
|
-
/** succeeded means the run finished (steps may still have
|
|
4446
|
+
/** succeeded means the run finished and no step failed (steps may still have warnings to review); failed means it stopped early, or finished with a failed step (see failure and steps[].fix). */
|
|
3774
4447
|
status: "queued" | "running" | "succeeded" | "failed" | "canceled";
|
|
4448
|
+
/** The status in plain words, counting steps: "Finished with 6 warnings to review", "Finished with 1 failed step", "Finished: every observed step passed". succeeded with warnings is not a clean pass. */
|
|
4449
|
+
status_label: string;
|
|
3775
4450
|
/** Internal phase (prepare, checkout, await_ack, advance, settle, cancel, await_cancel_email, finalize, done). */
|
|
3776
4451
|
phase: string;
|
|
4452
|
+
/** While the run is queued or running: what it waits for and until when. null once it finished. */
|
|
4453
|
+
waiting_for: {
|
|
4454
|
+
/** What the run is waiting for, in plain words. */
|
|
4455
|
+
what: string;
|
|
4456
|
+
/** When the run stops waiting for it at the latest (null: unknown). Unix timestamp in seconds. */
|
|
4457
|
+
until: number | null;
|
|
4458
|
+
/** Test-clock time the run is at, or moving to (null without a test clock). Unix timestamp in seconds. */
|
|
4459
|
+
clock_time: number | null;
|
|
4460
|
+
/** The step the run is on (1-based), of steps_total steps that will run (skipped steps not counted). */
|
|
4461
|
+
step: number | null;
|
|
4462
|
+
/** Steps that will run. */
|
|
4463
|
+
steps_total: number | null;
|
|
4464
|
+
/** When the whole run is expected to be done, from typical step times (an estimate; a wait that runs long moves it later; null: none). Unix timestamp in seconds. */
|
|
4465
|
+
eta: number | null;
|
|
4466
|
+
/** Whole minutes until eta, from typical step times (null: no estimate). */
|
|
4467
|
+
minutes_left: number | null;
|
|
4468
|
+
} | null;
|
|
3777
4469
|
/** Always true: runs use the billing platform's test mode; nothing is charged. */
|
|
3778
4470
|
test_mode: true;
|
|
3779
4471
|
/** Email address of the synthetic test subscriber; mail sent there is captured as evidence. */
|
|
@@ -3798,8 +4490,6 @@ export interface TestRun {
|
|
|
3798
4490
|
} | null;
|
|
3799
4491
|
/** Outcome of a finished run. */
|
|
3800
4492
|
result: {
|
|
3801
|
-
/** Compliance score (0-100) of the observed steps alone. */
|
|
3802
|
-
score: number | null;
|
|
3803
4493
|
/** Counts. */
|
|
3804
4494
|
summary: {
|
|
3805
4495
|
/** Checks that passed. */
|
|
@@ -3844,8 +4534,8 @@ export interface TestRun {
|
|
|
3844
4534
|
subscription: string | null;
|
|
3845
4535
|
/** Mirrored test-mode Checkout Session. */
|
|
3846
4536
|
checkout_session: string | null;
|
|
3847
|
-
/** Where the checkout configuration came from (mirror mode). */
|
|
3848
|
-
mirrored_from: "registered" | "live" | "request" | "payment_link" | null;
|
|
4537
|
+
/** Where the checkout configuration came from (mirror mode). stripe_session: the newest Checkout Session your code created, read with a test-mode monitoring key. */
|
|
4538
|
+
mirrored_from: "registered" | "live" | "request" | "payment_link" | "stripe_session" | null;
|
|
3849
4539
|
/** Registered config used (scc_…). */
|
|
3850
4540
|
checkout_config: string | null;
|
|
3851
4541
|
/** Compliance fingerprint of the mirrored checkout. */
|
|
@@ -3891,8 +4581,10 @@ export interface TestRun {
|
|
|
3891
4581
|
cancellation: {
|
|
3892
4582
|
/** Where the shopper cancelled. */
|
|
3893
4583
|
via: "merchant_flow" | "stripe_portal" | "cancel_url";
|
|
3894
|
-
/** false: nothing told Checkbox how customers cancel, so it used the Stripe portal (step warning cancel_flow_not_configured). */
|
|
4584
|
+
/** false: nothing told Checkbox how customers cancel, so it used the Stripe portal (step warning cancel_flow_not_configured: the cancel itself worked). true also when inferred (inferred_from). */
|
|
3895
4585
|
declared_by_merchant: boolean;
|
|
4586
|
+
/** How the cancel path was chosen when none was passed. site_portal_link: Stripe has cancellation on in the customer portal and your site links to it, so the portal was used as declared. registered_url: the account or cancellation page you registered (account_url / cancellation_url) redirects or links to the Stripe customer portal. site_cancel_control: the cancel button or link the last scan found on a public page of your site was used. portal_default: no test account and no other cancel flow is set, and Stripe has cancellation on in the customer portal, so the portal was used (and remembered for this site). site_setting: an earlier run remembered the portal for this site. */
|
|
4587
|
+
inferred_from?: "site_portal_link" | "registered_url" | "site_cancel_control" | "portal_default" | "site_setting" | null;
|
|
3896
4588
|
/** Stripe showed a subscription set to cancel after the shopper's flow. */
|
|
3897
4589
|
confirmed_in_stripe: boolean;
|
|
3898
4590
|
/** The subscription Stripe showed canceled. */
|
|
@@ -3965,7 +4657,7 @@ export interface Event {
|
|
|
3965
4657
|
id: string;
|
|
3966
4658
|
/** String representing the object's type. Always "event". */
|
|
3967
4659
|
object: "event";
|
|
3968
|
-
/** Event type: site.
|
|
4660
|
+
/** Event type: site.compliance_changed, finding.created, finding.resolved, scan.completed, scan.failed, law.changed, certificate.issued, certificate.lapsed, certificate.revoked, notice.sent, notice.due, notice.overdue, consent.created, receipt.created, test_run.completed, test_run.failed, plan.updated, site.checks_passed, site.compliant (deprecated), task.verified. */
|
|
3969
4661
|
type: string;
|
|
3970
4662
|
/** API version used to render data.object. */
|
|
3971
4663
|
api_version: string;
|
|
@@ -4008,18 +4700,32 @@ export interface Feedback {
|
|
|
4008
4700
|
/** String representing the object's type. Always "feedback". */
|
|
4009
4701
|
object: "feedback";
|
|
4010
4702
|
/** Kind of feedback. */
|
|
4011
|
-
type: "bug" | "idea" | "question";
|
|
4703
|
+
type: "bug" | "idea" | "question" | "review";
|
|
4012
4704
|
/** open until Checkbox staff reply or close it. */
|
|
4013
4705
|
status: "open" | "replied" | "closed";
|
|
4706
|
+
/** true when text that looked like a secret, card number or email address was replaced with [redacted] before it was stored. */
|
|
4707
|
+
redacted: boolean;
|
|
4014
4708
|
/** When it was received. Unix timestamp in seconds. */
|
|
4015
4709
|
created: number;
|
|
4016
4710
|
}
|
|
4017
4711
|
export interface FeedbackParams {
|
|
4018
|
-
/** bug: something is broken; idea: a missing feature or improvement; question: something unclear. Default idea. */
|
|
4019
|
-
type?: "bug" | "idea" | "question";
|
|
4020
|
-
/** What you tried, what happened and what you expected (at most 5000 characters). */
|
|
4021
|
-
message
|
|
4022
|
-
/**
|
|
4712
|
+
/** bug: something is broken; idea: a missing feature or improvement; question: something unclear; review: a structured review of Checkbox the product (send only after the human said yes and saw the text; no site names, URLs, customer data, quotes of the site's pages or emails, or claims that the site broke a law). Default idea. */
|
|
4713
|
+
type?: "bug" | "idea" | "question" | "review";
|
|
4714
|
+
/** What you tried, what happened and what you expected (at most 5000 characters). Required except for type review. Secrets, card numbers and email addresses are replaced with [redacted]. */
|
|
4715
|
+
message?: string;
|
|
4716
|
+
/** type review (required): how likely the human is to recommend Checkbox, 0-10. */
|
|
4717
|
+
score?: number;
|
|
4718
|
+
/** type review: what worked, at most 5 short phrases. */
|
|
4719
|
+
liked?: Array<string>;
|
|
4720
|
+
/** type review: what did not work, at most 5 short phrases. */
|
|
4721
|
+
disliked?: Array<string>;
|
|
4722
|
+
/** type review: Checkbox verdicts the human believes were wrong, each "<check id>: <short reason about Checkbox's verdict>" (at most 5; the reason is kept to 200 characters). */
|
|
4723
|
+
wrong_verdicts?: Array<string>;
|
|
4724
|
+
/** type review: whether the human would keep using Checkbox. */
|
|
4725
|
+
would_keep_using?: boolean;
|
|
4726
|
+
/** type review: framework and billing, short. */
|
|
4727
|
+
stack?: string;
|
|
4728
|
+
/** Optional context that helps us reproduce it. For type review only agent and tool are kept (reviews never carry the site or request id). */
|
|
4023
4729
|
context?: {
|
|
4024
4730
|
/** Site id the feedback is about. */
|
|
4025
4731
|
site?: string;
|
|
@@ -4031,6 +4737,25 @@ export interface FeedbackParams {
|
|
|
4031
4737
|
agent?: string;
|
|
4032
4738
|
};
|
|
4033
4739
|
}
|
|
4740
|
+
/** The one-time prompt to ask the human for a review of the session. */
|
|
4741
|
+
export interface ReviewPrompt {
|
|
4742
|
+
/** String representing the object's type. Always "review_prompt". */
|
|
4743
|
+
object: "review_prompt";
|
|
4744
|
+
/** The site. */
|
|
4745
|
+
site: string;
|
|
4746
|
+
/** true exactly once per site, while its plan status is compliant (checks pass): ask the human once whether they want to send a review. false afterwards. */
|
|
4747
|
+
show: boolean;
|
|
4748
|
+
/** Why show is true or false. */
|
|
4749
|
+
reason: "first_time" | "already_shown" | "not_compliant";
|
|
4750
|
+
/** The instruction for the agent when show is true; null otherwise. */
|
|
4751
|
+
message: string | null;
|
|
4752
|
+
/** When the prompt was first shown for this site (null before). Unix timestamp in seconds. */
|
|
4753
|
+
shown_at: number | null;
|
|
4754
|
+
}
|
|
4755
|
+
export interface ReviewPromptParams {
|
|
4756
|
+
/** What reached "Checks pass": the plan (retrieveCompliancePlan) or the verification of the last required task (verifyTask). Default plan_compliant. */
|
|
4757
|
+
trigger?: "plan_compliant" | "last_task_verified";
|
|
4758
|
+
}
|
|
4034
4759
|
/** A compliance plan without task content (webhook payload). */
|
|
4035
4760
|
export interface CompliancePlanSummary {
|
|
4036
4761
|
/** Unique identifier of the compliance plan (plan_…). */
|
|
@@ -4043,8 +4768,8 @@ export interface CompliancePlanSummary {
|
|
|
4043
4768
|
site: string;
|
|
4044
4769
|
/** action_required (an agent can apply open tasks now), verifying (changes applied; waiting for confirming observations), compliant (every required check passes or only waits for a live check — an automated assessment, not a legal determination; see compliance.pending_live_checks and coverage), blocked (only human answers ("Your call") or declined critical tasks remain). */
|
|
4045
4770
|
status: "action_required" | "verifying" | "compliant" | "blocked";
|
|
4046
|
-
/**
|
|
4047
|
-
|
|
4771
|
+
/** The plan status in words to show a person: action_required "Fixes needed", verifying "Checking your changes", compliant "Checks pass", blocked "Your call"; while an agent works the site and everything left waits for a deploy or the owner (next_action done_for_now): "Waiting on deploy and you" or "Waiting on deploy". Show this, never the machine value (`compliant` is a status name, not a legal conclusion). */
|
|
4772
|
+
status_label?: string;
|
|
4048
4773
|
/** Two or three sentences for an LLM: where the site stands and what comes next. */
|
|
4049
4774
|
summary: string;
|
|
4050
4775
|
/** Tasks per status. */
|
|
@@ -4057,7 +4782,7 @@ export interface CompliancePlanSummary {
|
|
|
4057
4782
|
verifying: number;
|
|
4058
4783
|
/** Tasks waiting for a human answer. */
|
|
4059
4784
|
manual: number;
|
|
4060
|
-
/** Tasks that only wait for a live observation (count as
|
|
4785
|
+
/** Tasks that only wait for a live observation (count as passing the checks). */
|
|
4061
4786
|
pending_live_check?: number;
|
|
4062
4787
|
/** Done tasks. */
|
|
4063
4788
|
done: number;
|
|
@@ -4065,7 +4790,7 @@ export interface CompliancePlanSummary {
|
|
|
4065
4790
|
wont_fix: number;
|
|
4066
4791
|
};
|
|
4067
4792
|
next_action: PlanNextAction;
|
|
4068
|
-
/** What the assessment rests on. Tell the human about not_observed and attested items; never
|
|
4793
|
+
/** What the assessment rests on. Tell the human about not_observed and attested items; never tell them the site "is compliant". */
|
|
4069
4794
|
coverage: {
|
|
4070
4795
|
/** Lifecycle stages Checkbox observed (signup, acknowledgment_email, reminders, cancellation, policies, billing_settings). */
|
|
4071
4796
|
observed: Array<string>;
|
|
@@ -4139,6 +4864,8 @@ export interface ListSetupSessionsParams {
|
|
|
4139
4864
|
export interface UpdateAccountParams {
|
|
4140
4865
|
/** API version to pin. */
|
|
4141
4866
|
api_version?: string;
|
|
4867
|
+
retention?: RetentionParams;
|
|
4868
|
+
legal_hold?: LegalHoldParams;
|
|
4142
4869
|
}
|
|
4143
4870
|
/** Parameters of `sites.list()` (listSites). */
|
|
4144
4871
|
export interface ListSitesParams {
|
|
@@ -4289,6 +5016,17 @@ export interface RevokeCertificateParams {
|
|
|
4289
5016
|
/** Private reason. */
|
|
4290
5017
|
reason: string;
|
|
4291
5018
|
}
|
|
5019
|
+
/** Parameters of `noticeSends.list()` (listNoticeSends). */
|
|
5020
|
+
export interface ListNoticeSendsParams {
|
|
5021
|
+
/** At most this many rows (default 50). */
|
|
5022
|
+
limit?: number;
|
|
5023
|
+
/** Only this kind. */
|
|
5024
|
+
kind?: "acknowledgment" | "trial_ending" | "renewal_reminder" | "annual_terms" | "price_change" | "cancellation_confirmation" | "charge_notice";
|
|
5025
|
+
/** Only sends for this billing-platform subscription id. */
|
|
5026
|
+
subscription?: string;
|
|
5027
|
+
/** Include "Send a test" samples. */
|
|
5028
|
+
include_samples?: "true" | "false";
|
|
5029
|
+
}
|
|
4292
5030
|
/** Parameters of `notices.listDue()` (listDueNotices). */
|
|
4293
5031
|
export interface ListDueNoticesParams {
|
|
4294
5032
|
/** Number of objects to return, 1-100 (default 10). */
|
|
@@ -4373,10 +5111,12 @@ export interface ListReceiptsParams {
|
|
|
4373
5111
|
}
|
|
4374
5112
|
/** Parameters of `testCredentials.create()` (createTestCredential). */
|
|
4375
5113
|
export interface CreateTestCredentialParams {
|
|
4376
|
-
/** Kind of key
|
|
4377
|
-
type: "stripe_test";
|
|
4378
|
-
/** The Stripe test-mode restricted (rk_test_…)
|
|
5114
|
+
/** Kind of key: "stripe_test" ("stripe" is accepted as the same). Always stored as a Stripe TEST-mode key. */
|
|
5115
|
+
type: "stripe_test" | "stripe";
|
|
5116
|
+
/** The Stripe test-mode restricted key (rk_test_…). Secret keys (sk_…) and live keys are refused. Stored encrypted; never returned. */
|
|
4379
5117
|
secret_key: string;
|
|
5118
|
+
/** Set true only after the human confirmed it: store the key even though its Stripe account looks like another site’s (billing_account_mismatch). Default false. */
|
|
5119
|
+
confirm_account_mismatch?: boolean;
|
|
4380
5120
|
}
|
|
4381
5121
|
/** Parameters of `stripeCheckoutConfigs.create()` (createStripeCheckoutConfig). */
|
|
4382
5122
|
export interface CreateStripeCheckoutConfigParams {
|
|
@@ -4410,6 +5150,8 @@ export interface CreateTestRunParams {
|
|
|
4410
5150
|
cancel?: boolean;
|
|
4411
5151
|
/** State the synthetic shopper visits from (default: the site's first scan region). */
|
|
4412
5152
|
region?: "US-FED" | "US-AL" | "US-AK" | "US-AZ" | "US-AR" | "US-CA" | "US-CO" | "US-CT" | "US-DE" | "US-DC" | "US-FL" | "US-GA" | "US-HI" | "US-ID" | "US-IL" | "US-IN" | "US-IA" | "US-KS" | "US-KY" | "US-LA" | "US-ME" | "US-MD" | "US-MA" | "US-MI" | "US-MN" | "US-MS" | "US-MO" | "US-MT" | "US-NE" | "US-NV" | "US-NH" | "US-NJ" | "US-NM" | "US-NY" | "US-NC" | "US-ND" | "US-OH" | "US-OK" | "US-OR" | "US-PA" | "US-RI" | "US-SC" | "US-SD" | "US-TN" | "US-TX" | "US-UT" | "US-VT" | "US-VA" | "US-WA" | "US-WV" | "US-WI" | "US-WY";
|
|
5153
|
+
/** Round 23: which plan to run, by the name of a registered checkout config or a Price id (price_…) its line_items use: the run mirrors that config (same as stripe.checkout_config). An unknown plan is refused with the list of registered configs. */
|
|
5154
|
+
plan?: string;
|
|
4413
5155
|
/** Stripe options. */
|
|
4414
5156
|
stripe?: {
|
|
4415
5157
|
/** Registered checkout config (scc_…) to mirror; default: the newest one, else your latest live Checkout Session. "none" skips the registered configs (mirror your live checkout, stripe.price or stripe.payment_link instead). */
|
|
@@ -4426,7 +5168,7 @@ export interface CreateTestRunParams {
|
|
|
4426
5168
|
cancel_url?: string;
|
|
4427
5169
|
/** Clicks that cancel in your flow (after login / cancel_url), e.g. [{ "action": "click", "text": "Cancel subscription" }, { "action": "click", "text": "Confirm" }]. */
|
|
4428
5170
|
cancel_steps?: Array<ScanStep>;
|
|
4429
|
-
/** How your customers cancel. Default: your flow when test_account / cancel_url / cancel_steps describe it
|
|
5171
|
+
/** How your customers cancel. Default: your flow when test_account / cancel_url / cancel_steps describe it; else the Stripe portal, taken as declared when Stripe has portal cancellation on and your site links to the portal, or when the account or cancellation page you registered redirects or links to the portal; otherwise reported as a warning (cancel_flow_not_configured: the cancel worked, but how your customers cancel was not given). */
|
|
4430
5172
|
cancel_via?: "merchant_flow" | "stripe_portal";
|
|
4431
5173
|
/** A test account the shopper logs into: to buy as a logged-in user (real_checkout) and to cancel through your in-app flow. Mail to its address counts when you BCC the site's Checkbox address. */
|
|
4432
5174
|
test_account?: {
|
|
@@ -4443,9 +5185,9 @@ export interface CreateTestRunParams {
|
|
|
4443
5185
|
payment_link?: string;
|
|
4444
5186
|
/** real_checkout: the page of your TEST deployment that leads to your Stripe test-mode checkout (a pricing page, or a route that creates the Checkout Session and redirects). */
|
|
4445
5187
|
checkout_url?: string;
|
|
4446
|
-
/** real_checkout: clicks from checkout_url to the payment page, e.g. [{ "action": "click", "text": "Start free trial" }]. */
|
|
5188
|
+
/** real_checkout: clicks from checkout_url to the payment page, e.g. [{ "action": "click", "text": "Start free trial" }]. In fill values, {{email}} is the run inbox and {{password}} is stripe.test_account.password when a test account is given, so an account created here can log in for the cancellation. */
|
|
4447
5189
|
pre_checkout_steps?: Array<ScanStep>;
|
|
4448
|
-
/** A page of your test deployment Checkbox opens before the checkout (after logging in) that CLEANS UP the test account (ends its subscription), so every run starts without one. Mirror mode opens it before cancelling the test account's subscription.
|
|
5190
|
+
/** A page of your test deployment Checkbox opens before the checkout (after logging in) that CLEANS UP the test account (ends its subscription), so every run starts without one. Mirror mode opens it before cancelling the test account's subscription. */
|
|
4449
5191
|
cleanup_url?: string;
|
|
4450
5192
|
/** Deprecated alias of cleanup_url. */
|
|
4451
5193
|
reset_url?: string;
|
|
@@ -4487,11 +5229,16 @@ export interface ListTestRunsParams {
|
|
|
4487
5229
|
/** Cursor: an object id; returns the objects before it (newer). */
|
|
4488
5230
|
ending_before?: string;
|
|
4489
5231
|
}
|
|
5232
|
+
/** Parameters of `testRuns.retrieve()` (retrieveTestRun). */
|
|
5233
|
+
export interface RetrieveTestRunParams {
|
|
5234
|
+
/** Long-poll: wait up to this many seconds (0-30) for a meaningful change before answering: the run finishes, its status changes or a step starts or ends (not every internal phase change while the test clock moves). */
|
|
5235
|
+
wait?: number | null;
|
|
5236
|
+
}
|
|
4490
5237
|
/** Parameters of `webhookEndpoints.create()` (createWebhookEndpoint). */
|
|
4491
5238
|
export interface CreateWebhookEndpointParams {
|
|
4492
5239
|
/** HTTPS URL. */
|
|
4493
5240
|
url: string;
|
|
4494
|
-
/** Event types to send, or ["*"] for all: site.
|
|
5241
|
+
/** Event types to send, or ["*"] for all: site.compliance_changed, finding.created, finding.resolved, scan.completed, scan.failed, law.changed, certificate.issued, certificate.lapsed, certificate.revoked, notice.sent, notice.due, notice.overdue, consent.created, receipt.created, test_run.completed, test_run.failed, plan.updated, site.checks_passed, site.compliant (deprecated), task.verified. */
|
|
4495
5242
|
enabled_events: Array<string>;
|
|
4496
5243
|
/** Description. */
|
|
4497
5244
|
description?: string;
|
|
@@ -4511,7 +5258,7 @@ export interface ListWebhookEndpointsParams {
|
|
|
4511
5258
|
export interface UpdateWebhookEndpointParams {
|
|
4512
5259
|
/** HTTPS URL. */
|
|
4513
5260
|
url?: string;
|
|
4514
|
-
/** Event types to send, or ["*"] for all: site.
|
|
5261
|
+
/** Event types to send, or ["*"] for all: site.compliance_changed, finding.created, finding.resolved, scan.completed, scan.failed, law.changed, certificate.issued, certificate.lapsed, certificate.revoked, notice.sent, notice.due, notice.overdue, consent.created, receipt.created, test_run.completed, test_run.failed, plan.updated, site.checks_passed, site.compliant (deprecated), task.verified. */
|
|
4515
5262
|
enabled_events?: Array<string>;
|
|
4516
5263
|
/** Description (null clears it). */
|
|
4517
5264
|
description?: string | null;
|
|
@@ -4543,7 +5290,7 @@ export type PlanUpdatedEvent = Event & {
|
|
|
4543
5290
|
type?: "plan.updated";
|
|
4544
5291
|
data?: {
|
|
4545
5292
|
object: CompliancePlanSummary;
|
|
4546
|
-
/** plan.updated: the previous status
|
|
5293
|
+
/** plan.updated: the previous status. */
|
|
4547
5294
|
previous_attributes?: Record<string, unknown>;
|
|
4548
5295
|
};
|
|
4549
5296
|
};
|
|
@@ -4553,7 +5300,7 @@ export type TaskVerifiedEvent = Event & {
|
|
|
4553
5300
|
type?: "task.verified";
|
|
4554
5301
|
data?: {
|
|
4555
5302
|
object: Verification;
|
|
4556
|
-
/** plan.updated: the previous status
|
|
5303
|
+
/** plan.updated: the previous status. */
|
|
4557
5304
|
previous_attributes?: Record<string, unknown>;
|
|
4558
5305
|
};
|
|
4559
5306
|
};
|
|
@@ -4607,10 +5354,10 @@ export type TestRunFailedEvent = Event & {
|
|
|
4607
5354
|
previous_attributes?: Record<string, unknown>;
|
|
4608
5355
|
};
|
|
4609
5356
|
};
|
|
4610
|
-
/** `site.
|
|
4611
|
-
export type
|
|
5357
|
+
/** `site.compliance_changed`: A re-evaluation changed the site's check results; data.object is the site, with its current compliance status and label in data.object.compliance. */
|
|
5358
|
+
export type SiteComplianceChangedEvent = Event & {
|
|
4612
5359
|
/** Event type. */
|
|
4613
|
-
type?: "site.
|
|
5360
|
+
type?: "site.compliance_changed";
|
|
4614
5361
|
data?: {
|
|
4615
5362
|
object: Site;
|
|
4616
5363
|
/** Previous values of changed fields. */
|
|
@@ -4637,7 +5384,7 @@ export type FindingResolvedEvent = Event & {
|
|
|
4637
5384
|
previous_attributes?: Record<string, unknown>;
|
|
4638
5385
|
};
|
|
4639
5386
|
};
|
|
4640
|
-
/** `scan.completed`: A scan finished (the evaluation may follow in a separate site.
|
|
5387
|
+
/** `scan.completed`: A scan finished (the evaluation may follow in a separate site.compliance_changed event). */
|
|
4641
5388
|
export type ScanCompletedEvent = Event & {
|
|
4642
5389
|
/** Event type. */
|
|
4643
5390
|
type?: "scan.completed";
|
|
@@ -4717,7 +5464,17 @@ export type ConsentCreatedEvent = Event & {
|
|
|
4717
5464
|
previous_attributes?: Record<string, unknown>;
|
|
4718
5465
|
};
|
|
4719
5466
|
};
|
|
4720
|
-
/** `site.
|
|
5467
|
+
/** `site.checks_passed`: A site's compliance plan reached the status where its checks pass (plan status value `compliant`): nothing is left to apply, verify or answer; data.object is the site. Passing the checks is not a certification of legal compliance. */
|
|
5468
|
+
export type SiteChecksPassedEvent = Event & {
|
|
5469
|
+
/** Event type. */
|
|
5470
|
+
type?: "site.checks_passed";
|
|
5471
|
+
data?: {
|
|
5472
|
+
object: Site;
|
|
5473
|
+
/** Previous values of changed fields. */
|
|
5474
|
+
previous_attributes?: Record<string, unknown>;
|
|
5475
|
+
};
|
|
5476
|
+
};
|
|
5477
|
+
/** `site.compliant`: Deprecated alias of site.checks_passed, kept so existing endpoints keep working: sent at the same moment with the same data.object. Subscribe to site.checks_passed instead (an endpoint on "*" receives both). */
|
|
4721
5478
|
export type SiteCompliantEvent = Event & {
|
|
4722
5479
|
/** Event type. */
|
|
4723
5480
|
type?: "site.compliant";
|
|
@@ -4728,9 +5485,9 @@ export type SiteCompliantEvent = Event & {
|
|
|
4728
5485
|
};
|
|
4729
5486
|
};
|
|
4730
5487
|
/** Every event Checkbox delivers to webhook endpoints, discriminated by `type`. */
|
|
4731
|
-
export type WebhookEvent = PlanUpdatedEvent | TaskVerifiedEvent | NoticeDueEvent | NoticeOverdueEvent | ReceiptCreatedEvent | TestRunCompletedEvent | TestRunFailedEvent |
|
|
5488
|
+
export type WebhookEvent = PlanUpdatedEvent | TaskVerifiedEvent | NoticeDueEvent | NoticeOverdueEvent | ReceiptCreatedEvent | TestRunCompletedEvent | TestRunFailedEvent | SiteComplianceChangedEvent | FindingCreatedEvent | FindingResolvedEvent | ScanCompletedEvent | ScanFailedEvent | LawChangedEvent | CertificateIssuedEvent | CertificateLapsedEvent | CertificateRevokedEvent | NoticeSentEvent | ConsentCreatedEvent | SiteChecksPassedEvent | SiteCompliantEvent;
|
|
4732
5489
|
/** Every webhook event type. */
|
|
4733
|
-
export declare const WEBHOOK_EVENT_TYPES: readonly ["plan.updated", "task.verified", "notice.due", "notice.overdue", "receipt.created", "test_run.completed", "test_run.failed", "site.
|
|
5490
|
+
export declare const WEBHOOK_EVENT_TYPES: readonly ["plan.updated", "task.verified", "notice.due", "notice.overdue", "receipt.created", "test_run.completed", "test_run.failed", "site.compliance_changed", "finding.created", "finding.resolved", "scan.completed", "scan.failed", "law.changed", "certificate.issued", "certificate.lapsed", "certificate.revoked", "notice.sent", "consent.created", "site.checks_passed", "site.compliant"];
|
|
4734
5491
|
export type WebhookEventType = (typeof WEBHOOK_EVENT_TYPES)[number];
|
|
4735
5492
|
/** Stable error codes (`error.code`), with HTTP status, type and meaning. Codes are never renamed. */
|
|
4736
5493
|
export declare const ERROR_CODES: {
|
|
@@ -4777,12 +5534,22 @@ export declare const ERROR_CODES: {
|
|
|
4777
5534
|
readonly test_key_missing: {
|
|
4778
5535
|
readonly status: 400;
|
|
4779
5536
|
readonly type: "invalid_request_error";
|
|
4780
|
-
readonly description: "A Stripe test run needs a Stripe TEST-mode key stored for the site (createTestCredential
|
|
5537
|
+
readonly description: "A Stripe test run needs a Stripe TEST-mode key stored for the site: the agent stores the restricted test key (rk_test_…) with createTestCredential, or a person adds it in the dashboard.";
|
|
4781
5538
|
};
|
|
4782
5539
|
readonly test_key_not_test_mode: {
|
|
4783
5540
|
readonly status: 400;
|
|
4784
5541
|
readonly type: "invalid_request_error";
|
|
4785
|
-
readonly description: "The billing key is a live-mode (or malformed) key
|
|
5542
|
+
readonly description: "The billing key is a live-mode (or malformed) key. Agents only store TEST-mode restricted keys (rk_test_…); a human adds live keys in the Checkbox dashboard.";
|
|
5543
|
+
};
|
|
5544
|
+
readonly test_key_not_restricted: {
|
|
5545
|
+
readonly status: 400;
|
|
5546
|
+
readonly type: "invalid_request_error";
|
|
5547
|
+
readonly description: "The key is a full Stripe secret key (sk_test_… or sk_live_…), which is refused on every connect path (createTestCredential, connectBillingPlatform, the dashboard). Use a restricted key (rk_test_…) with the permissions on Checkbox's key checklist instead; `message` lists them.";
|
|
5548
|
+
};
|
|
5549
|
+
readonly test_key_declined: {
|
|
5550
|
+
readonly status: 403;
|
|
5551
|
+
readonly type: "permission_error";
|
|
5552
|
+
readonly description: "The owner did not allow the agent to use the project's Stripe TEST key when approving the setup; only a person can add it, in the dashboard.";
|
|
4786
5553
|
};
|
|
4787
5554
|
readonly test_key_rejected: {
|
|
4788
5555
|
readonly status: 400;
|
|
@@ -4857,13 +5624,18 @@ export declare const ERROR_CODES: {
|
|
|
4857
5624
|
readonly test_mode_scan_budget_exhausted: {
|
|
4858
5625
|
readonly status: 429;
|
|
4859
5626
|
readonly type: "rate_limit_error";
|
|
4860
|
-
readonly description: "No longer returned
|
|
5627
|
+
readonly description: "No longer returned: test mode has no scan budget for unverified domains any more, they are refused with test_mode_domain_unverified. Kept so older clients still recognise the code.";
|
|
4861
5628
|
};
|
|
4862
5629
|
readonly domain_not_verified: {
|
|
4863
5630
|
readonly status: 403;
|
|
4864
5631
|
readonly type: "permission_error";
|
|
4865
5632
|
readonly description: "Checkbox only scans, monitors, fetches and test-runs websites the account has verified (DNS TXT record or /.well-known file): every target host (site, checkout, account and policy URLs) must be on a verified domain. `next_action` says which domain to verify.";
|
|
4866
5633
|
};
|
|
5634
|
+
readonly live_key_requires_dashboard: {
|
|
5635
|
+
readonly status: 403;
|
|
5636
|
+
readonly type: "permission_error";
|
|
5637
|
+
readonly description: "A live-mode Stripe key (rk_live_ / sk_live_) cannot be connected through the API or by an AI agent: only a person signed in to the Checkbox dashboard can connect one (and never on a test-mode site). Agents store restricted TEST keys (rk_test_…).";
|
|
5638
|
+
};
|
|
4867
5639
|
readonly account_suspended: {
|
|
4868
5640
|
readonly status: 403;
|
|
4869
5641
|
readonly type: "permission_error";
|
|
@@ -4894,21 +5666,46 @@ export declare const ERROR_CODES: {
|
|
|
4894
5666
|
readonly type: "invalid_request_error";
|
|
4895
5667
|
readonly description: "The consent already carries a different customer_reference; references are set once and never changed.";
|
|
4896
5668
|
};
|
|
5669
|
+
readonly billing_account_mismatch: {
|
|
5670
|
+
readonly status: 409;
|
|
5671
|
+
readonly type: "invalid_request_error";
|
|
5672
|
+
readonly description: "The key's Stripe account looks like another site's (the site's prices or Payment Links are not in it, or it is already connected in another workspace), so nothing was stored or evaluated. Ask the human the question in `message`; retry with confirm_account_mismatch: true only if they say yes, else use this site's own key. `problems` lists what did not match.";
|
|
5673
|
+
};
|
|
4897
5674
|
readonly test_run_in_progress: {
|
|
4898
5675
|
readonly status: 409;
|
|
4899
5676
|
readonly type: "invalid_request_error";
|
|
4900
5677
|
readonly description: "The site already has a queued or running test run; wait for it (retrieveTestRun) or cancel it (cancelTestRun).";
|
|
4901
5678
|
};
|
|
5679
|
+
readonly legal_hold_active: {
|
|
5680
|
+
readonly status: 409;
|
|
5681
|
+
readonly type: "invalid_request_error";
|
|
5682
|
+
readonly description: "A legal hold is on for the account or the site: deleting data and shortening retention are refused until it is turned off (updateAccount / updateSite legal_hold).";
|
|
5683
|
+
};
|
|
4902
5684
|
readonly idempotency_key_in_use: {
|
|
4903
5685
|
readonly status: 409;
|
|
4904
5686
|
readonly type: "idempotency_error";
|
|
4905
5687
|
readonly description: "A request with this Idempotency-Key is still being processed; retry shortly.";
|
|
4906
5688
|
};
|
|
5689
|
+
readonly shopify_not_connected: {
|
|
5690
|
+
readonly status: 409;
|
|
5691
|
+
readonly type: "invalid_request_error";
|
|
5692
|
+
readonly description: "The site's Shopify store is not connected through the Checkbox Shopify app, so Checkbox cannot publish to the app block. Only the merchant can connect it: install the Checkbox app from the Shopify admin and click \"Connect to Checkbox\" (`next_action` has the exact step).";
|
|
5693
|
+
};
|
|
4907
5694
|
readonly resource_archived: {
|
|
4908
5695
|
readonly status: 410;
|
|
4909
5696
|
readonly type: "invalid_request_error";
|
|
4910
5697
|
readonly description: "The object is archived; restore it before changing it.";
|
|
4911
5698
|
};
|
|
5699
|
+
readonly terms_incomplete: {
|
|
5700
|
+
readonly status: 422;
|
|
5701
|
+
readonly type: "invalid_request_error";
|
|
5702
|
+
readonly description: "Checkbox cannot write the exact, verified renewal terms yet: plan facts are missing (price, interval, trial, cancellation URL or merchant name). `problems` lists them; `next_action` names the call that sets them.";
|
|
5703
|
+
};
|
|
5704
|
+
readonly fix_verification_failed: {
|
|
5705
|
+
readonly status: 422;
|
|
5706
|
+
readonly type: "invalid_request_error";
|
|
5707
|
+
readonly description: "The generated disclosure did not pass every sign-up check of the rules engine, so nothing was published. The message names the failing checks.";
|
|
5708
|
+
};
|
|
4912
5709
|
readonly body_too_large: {
|
|
4913
5710
|
readonly status: 413;
|
|
4914
5711
|
readonly type: "invalid_request_error";
|
|
@@ -4944,6 +5741,11 @@ export declare const ERROR_CODES: {
|
|
|
4944
5741
|
readonly type: "permission_error";
|
|
4945
5742
|
readonly description: "Consent receipts are turned off for this account (updateReceiptSettings enabled=true turns them on).";
|
|
4946
5743
|
};
|
|
5744
|
+
readonly platform_error: {
|
|
5745
|
+
readonly status: 502;
|
|
5746
|
+
readonly type: "api_error";
|
|
5747
|
+
readonly description: "The merchant's platform (e.g. Shopify) refused or failed the change; nothing was recorded as applied. Retry later; `message` has the platform's answer.";
|
|
5748
|
+
};
|
|
4947
5749
|
readonly feature_unavailable: {
|
|
4948
5750
|
readonly status: 503;
|
|
4949
5751
|
readonly type: "api_error";
|