@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.
@@ -341,6 +341,23 @@ export const OPERATIONS = {
341
341
  paginated: false,
342
342
  summary: "Check domain verification now",
343
343
  },
344
+ resyncBilling: {
345
+ operationId: "resyncBilling",
346
+ namespace: "billings",
347
+ method: "resync",
348
+ httpMethod: "POST",
349
+ path: "/v1/sites/{site}/billing/resync",
350
+ pathParams: ["site"],
351
+ queryParams: [],
352
+ body: false,
353
+ idempotent: true,
354
+ auth: true,
355
+ scope: "sites:write",
356
+ response: "json",
357
+ list: false,
358
+ paginated: false,
359
+ summary: "Re-sync Stripe settings",
360
+ },
344
361
  createScan: {
345
362
  operationId: "createScan",
346
363
  namespace: "scans",
@@ -681,6 +698,23 @@ export const OPERATIONS = {
681
698
  paginated: false,
682
699
  summary: "List fix plans for a site",
683
700
  },
701
+ publishShopifyTerms: {
702
+ operationId: "publishShopifyTerms",
703
+ namespace: "fixes",
704
+ method: "publishShopifyTerms",
705
+ httpMethod: "POST",
706
+ path: "/v1/sites/{site}/fixes/shopify/publish",
707
+ pathParams: ["site"],
708
+ queryParams: [],
709
+ body: true,
710
+ idempotent: true,
711
+ auth: true,
712
+ scope: "fixes:write",
713
+ response: "json",
714
+ list: false,
715
+ paginated: false,
716
+ summary: "Publish the renewal terms to the Shopify app block",
717
+ },
684
718
  listEvidence: {
685
719
  operationId: "listEvidence",
686
720
  namespace: "evidence",
@@ -817,6 +851,23 @@ export const OPERATIONS = {
817
851
  paginated: false,
818
852
  summary: "Revoke a certificate",
819
853
  },
854
+ listNoticeSends: {
855
+ operationId: "listNoticeSends",
856
+ namespace: "noticeSends",
857
+ method: "list",
858
+ httpMethod: "GET",
859
+ path: "/v1/sites/{site}/notice_sends",
860
+ pathParams: ["site"],
861
+ queryParams: ["limit", "kind", "subscription", "include_samples"],
862
+ body: false,
863
+ idempotent: false,
864
+ auth: true,
865
+ scope: "notices:read",
866
+ response: "json",
867
+ list: true,
868
+ paginated: false,
869
+ summary: "List Checkbox Notices sends",
870
+ },
820
871
  retrieveNoticeSettings: {
821
872
  operationId: "retrieveNoticeSettings",
822
873
  namespace: "noticeSettings",
@@ -1565,6 +1616,23 @@ export const OPERATIONS = {
1565
1616
  paginated: false,
1566
1617
  summary: "Delete a registered checkout config",
1567
1618
  },
1619
+ deleteSiteStripeCheckoutConfig: {
1620
+ operationId: "deleteSiteStripeCheckoutConfig",
1621
+ namespace: "siteStripeCheckoutConfigs",
1622
+ method: "del",
1623
+ httpMethod: "DELETE",
1624
+ path: "/v1/sites/{site}/stripe_checkout_configs/{stripe_checkout_config}",
1625
+ pathParams: ["site", "stripe_checkout_config"],
1626
+ queryParams: [],
1627
+ body: false,
1628
+ idempotent: false,
1629
+ auth: true,
1630
+ scope: "test_runs:write",
1631
+ response: "json",
1632
+ list: false,
1633
+ paginated: false,
1634
+ summary: "Delete a registered checkout config (site path)",
1635
+ },
1568
1636
  createTestRun: {
1569
1637
  operationId: "createTestRun",
1570
1638
  namespace: "testRuns",
@@ -1606,7 +1674,7 @@ export const OPERATIONS = {
1606
1674
  httpMethod: "GET",
1607
1675
  path: "/v1/test_runs/{test_run}",
1608
1676
  pathParams: ["test_run"],
1609
- queryParams: [],
1677
+ queryParams: ["wait"],
1610
1678
  body: false,
1611
1679
  idempotent: false,
1612
1680
  auth: true,
@@ -1786,6 +1854,23 @@ export const OPERATIONS = {
1786
1854
  paginated: false,
1787
1855
  summary: "Send feedback",
1788
1856
  },
1857
+ claimReviewPrompt: {
1858
+ operationId: "claimReviewPrompt",
1859
+ namespace: "reviewPrompts",
1860
+ method: "claim",
1861
+ httpMethod: "POST",
1862
+ path: "/v1/sites/{site}/review_prompt",
1863
+ pathParams: ["site"],
1864
+ queryParams: [],
1865
+ body: true,
1866
+ idempotent: false,
1867
+ auth: true,
1868
+ scope: "compliance_plans:read",
1869
+ response: "json",
1870
+ list: false,
1871
+ paginated: false,
1872
+ summary: "Claim the one-time review prompt for a site",
1873
+ },
1789
1874
  };
1790
1875
  /** `checkbox.device` */
1791
1876
  export class DeviceResource extends Resource {
@@ -1857,7 +1942,7 @@ export class SetupSessionsResource extends Resource {
1857
1942
  /**
1858
1943
  * Re-check the site now.
1859
1944
  *
1860
- * Loads the site (is the snippet live? which policy links does it have?), re-fetches the Terms and policies, re-evaluates compliance and queues the first synthetic-shopper scan. Call it after every change the agent made (and after deploying). Returns what was seen plus the updated session.
1945
+ * Loads the site (is the snippet live? which policy links does it have?), re-fetches the Terms and policies, re-evaluates compliance and queues the first synthetic-shopper scan. While the domain is not verified: a live snippet (or the checkbox-verify meta tag) on the homepage verifies it now; otherwise a read-only scan of the site's own public pages is queued (unverified: no checkout is submitted). Call it after every change the agent made (and after deploying). Returns what was seen plus the updated session.
1861
1946
  *
1862
1947
  * @param setupSession Unique identifier of the setup session (setup_…).
1863
1948
  * @see POST /v1/setup_sessions/{setup_session}/verify (operation `verifySetupSession`, scope `setup_sessions:write`)
@@ -1892,7 +1977,7 @@ export class AccountResource extends Resource {
1892
1977
  /**
1893
1978
  * Update the account.
1894
1979
  *
1895
- * Pins the account to an API version (requests without a Checkbox-Version header use it). Known versions: 2026-10-30.
1980
+ * Pins the account to an API version (requests without a Checkbox-Version header use it; known versions: 2026-10-30), sets the default retention, and turns the account-wide legal hold on or off. Retention and legal hold apply to the key's mode (test mode has its own).
1896
1981
  *
1897
1982
  * @see POST /v1/account (operation `updateAccount`, scope `account:write`)
1898
1983
  */
@@ -1925,7 +2010,7 @@ export class SitesResource extends Resource {
1925
2010
  /**
1926
2011
  * Retrieve a site.
1927
2012
  *
1928
- * Returns a site with its latest compliance verdict (score, status) and install details.
2013
+ * Returns a site with its latest compliance status (label and counts) and install details.
1929
2014
  *
1930
2015
  * @param site Unique identifier of the site (site_…).
1931
2016
  * @see GET /v1/sites/{site} (operation `retrieveSite`, scope `sites:read`)
@@ -1973,7 +2058,7 @@ export class SitesResource extends Resource {
1973
2058
  /**
1974
2059
  * Connect a billing platform.
1975
2060
  *
1976
- * Connects the site's billing platform with read-only credentials (a Stripe restricted key, a Recharge token or a Shopify Admin API token), so Checkbox reads the customer-portal and reminder settings. Works for test-mode sites too (use an rk_test_ key). The credentials are validated by reading the settings once and stored encrypted.
2061
+ * Connects the site's billing platform with the one restricted key (a Stripe restricted key, a Recharge token, a Shopify Admin API token, a Chargebee read-only API key, a Recurly private API key or a Paddle API key with read permissions), so Checkbox reads the customer-portal and reminder settings. Stripe: 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) (checklist: https://checkbox.site/docs/guides/stripe-key). A full secret key (sk_test_ / sk_live_) is refused on every path with test_key_not_restricted: use a restricted key. API keys and AI agents may connect TEST-mode keys (rk_test_…) only; a live key (rk_live_ / sk_live_) is refused with live_key_requires_dashboard, because only a person signed in to the Checkbox dashboard can connect one. The credentials are validated by reading the settings once and stored encrypted. When 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), nothing is connected and the error billing_account_mismatch asks the human to confirm; retry with confirm_account_mismatch: true only after they said yes. The account owner is emailed about every key connected.
1977
2062
  *
1978
2063
  * @param site Unique identifier of the site (site_…).
1979
2064
  * @see POST /v1/sites/{site}/integrations (operation `connectBillingPlatform`, scope `sites:write`)
@@ -2020,7 +2105,7 @@ export class DomainVerificationsResource extends Resource {
2020
2105
  /**
2021
2106
  * Check domain verification now.
2022
2107
  *
2023
- * Looks for the DNS TXT record and the /.well-known file now. On success in live mode, the account is activated and held monitoring starts.
2108
+ * Looks for the DNS TXT record, the /.well-known file, and the site's Checkbox snippet or the checkbox-verify meta tag on https://<domain>/ now. On success in live mode, the account is activated and held monitoring starts.
2024
2109
  *
2025
2110
  * @param site Unique identifier of the site (site_…).
2026
2111
  * @see POST /v1/sites/{site}/domain_verification/check (operation `checkDomainVerification`, scope `sites:write`)
@@ -2029,6 +2114,20 @@ export class DomainVerificationsResource extends Resource {
2029
2114
  return this._request(OPERATIONS.checkDomainVerification, [site], undefined, options);
2030
2115
  }
2031
2116
  }
2117
+ /** `checkbox.billings` */
2118
+ export class BillingsResource extends Resource {
2119
+ /**
2120
+ * Re-sync Stripe settings.
2121
+ *
2122
+ * Re-reads the site's billing-platform settings now (Stripe customer-portal cancellation, trial-ending emails, plans) and re-evaluates the site, so a setting you just changed in Stripe shows up without waiting for the next scan. Every scan also re-reads them. Then poll retrieveLatestEvaluation (or listFindings) after about a minute.
2123
+ *
2124
+ * @param site Unique identifier of the site (site_…).
2125
+ * @see POST /v1/sites/{site}/billing/resync (operation `resyncBilling`, scope `sites:write`)
2126
+ */
2127
+ resync(site, options) {
2128
+ return this._request(OPERATIONS.resyncBilling, [site], undefined, options);
2129
+ }
2130
+ }
2032
2131
  /** `checkbox.scans` */
2033
2132
  export class ScansResource extends Resource {
2034
2133
  /**
@@ -2080,7 +2179,7 @@ export class EvaluationsResource extends Resource {
2080
2179
  /**
2081
2180
  * List evaluations.
2082
2181
  *
2083
- * Verdicts newest first (score history), optionally for one site.
2182
+ * Verdicts newest first (status history), optionally for one site.
2084
2183
  *
2085
2184
  * @see GET /v1/evaluations (operation `listEvaluations`, scope `evaluations:read`)
2086
2185
  */
@@ -2101,7 +2200,7 @@ export class EvaluationsResource extends Resource {
2101
2200
  /**
2102
2201
  * Get the current verdict of a site.
2103
2202
  *
2104
- * The latest evaluation of the site: is it compliant (score and status), and what blocks it. 404 resource_missing with next_action createScan when the site was never evaluated.
2203
+ * The latest evaluation of the site: its compliance status and what blocks it. 404 resource_missing with next_action createScan when the site was never evaluated.
2105
2204
  *
2106
2205
  * @param site Unique identifier of the site (site_…).
2107
2206
  * @see GET /v1/sites/{site}/evaluation (operation `retrieveLatestEvaluation`, scope `evaluations:read`)
@@ -2115,7 +2214,7 @@ export class FindingsResource extends Resource {
2115
2214
  /**
2116
2215
  * List findings.
2117
2216
  *
2118
- * Findings ordered by urgency (failing first, then by severity). Filter by site, status (fail, needs_review, pass, not_applicable) and state (open, acknowledged, resolved, accepted_risk). Fix the open `fail` findings to become compliant.
2217
+ * Findings ordered by urgency (failing first, then by severity). Filter by site, status (fail, needs_review, pass, not_applicable) and state (open, acknowledged, resolved, accepted_risk). Fix the open `fail` findings so the checks pass.
2119
2218
  *
2120
2219
  * @see GET /v1/findings (operation `listFindings`, scope `findings:read`)
2121
2220
  */
@@ -2150,7 +2249,7 @@ export class PlansResource extends Resource {
2150
2249
  /**
2151
2250
  * Get the compliance plan for a site.
2152
2251
  *
2153
- * Ordered tasks that make the site compliant, recomputed from its latest evaluation: each with the requirement and citation, where to change (file / URL / selector / Stripe object), the exact change (unified-diff template with machine-applicable edits, copy, or Stripe params) and how to verify it. Do plan.next_action: apply the first open task, call verifyTask, repeat until status is compliant. Tasks with status manual hold a question for the human (answerTask); they never block the others.
2252
+ * Ordered tasks that make the site's checks pass, recomputed from its latest evaluation: each with the requirement and citation, where to change (file / URL / selector / Stripe object), the exact change (unified-diff template with machine-applicable edits, copy, or Stripe params) and how to verify it. Do plan.next_action: apply the first open task, call verifyTask, and repeat until the checks pass (status value compliant; status_label "Checks pass"). Tasks with status manual hold a question for the human (answerTask); they never block the others.
2154
2253
  *
2155
2254
  * @param site Unique identifier of the site (site_…).
2156
2255
  * @see GET /v1/sites/{site}/plan (operation `retrieveCompliancePlan`, scope `compliance_plans:read`)
@@ -2211,7 +2310,7 @@ export class VerificationsResource extends Resource {
2211
2310
  /**
2212
2311
  * Get a verification (long-poll with ?wait=30).
2213
2312
  *
2214
- * The verification's status (pending, passed, failed), expected vs observed per check, the diff and next_action. ?wait=N (≤ 30) holds the request until it resolves or N seconds pass.
2313
+ * The verification's status (pending, passed, failed), expected vs observed per check, the diff and next_action. Also takes a task id (task_…): the newest verification of that task. ?wait=N (≤ 30) holds the request until it resolves or N seconds pass.
2215
2314
  *
2216
2315
  * @param verification Unique identifier of the verification (ver_…).
2217
2316
  * @see GET /v1/verifications/{verification} (operation `retrieveVerification`, scope `compliance_plans:read`)
@@ -2255,6 +2354,17 @@ export class FixesResource extends Resource {
2255
2354
  list(site, params, options) {
2256
2355
  return this._request(OPERATIONS.listSiteFixes, [site], params, options);
2257
2356
  }
2357
+ /**
2358
+ * Publish the renewal terms to the Shopify app block.
2359
+ *
2360
+ * For a Shopify store connected through the Checkbox Shopify app (site.shopify.connection = app): generates the renewal disclosure and consent label from the site's real plan, verifies them against the rules engine, and publishes them to the app-owned metafield the Checkbox "Renewal terms + consent" theme block reads. Nothing else in the store changes (no theme, product or checkout edits). The merchant places the block once in the theme editor (theme_editor_url); after that, publishing again updates the text the block shows. Then verify the sign-up task (verifyTask) or the site (verifySite). Errors: shopify_not_connected (only the merchant can install and connect the app; next_action has the step), terms_incomplete (problems lists the missing plan facts; next_action names the call that sets them), fix_verification_failed, platform_error (Shopify refused the write). In test mode it acts on test-mode sites, whose connected store is written the same way.
2361
+ *
2362
+ * @param site Unique identifier of the site (site_…).
2363
+ * @see POST /v1/sites/{site}/fixes/shopify/publish (operation `publishShopifyTerms`, scope `fixes:write`, live mode needs an activated account)
2364
+ */
2365
+ publishShopifyTerms(site, params, options) {
2366
+ return this._request(OPERATIONS.publishShopifyTerms, [site], params, options);
2367
+ }
2258
2368
  }
2259
2369
  /** `checkbox.evidence` */
2260
2370
  export class EvidenceResource extends Resource {
@@ -2348,6 +2458,20 @@ export class CertificatesResource extends Resource {
2348
2458
  return this._request(OPERATIONS.revokeCertificate, [certificate], params, options);
2349
2459
  }
2350
2460
  }
2461
+ /** `checkbox.noticeSends` */
2462
+ export class NoticeSendsResource extends Resource {
2463
+ /**
2464
+ * List Checkbox Notices sends.
2465
+ *
2466
+ * Read-only: the emails Checkbox Notices sent, or tried to send, for this site (newest first), with status and, for a failed or skipped send, why. A test run's email steps name these rows (notices_send_log). Samples ("Send a test") are left out unless include_samples=true.
2467
+ *
2468
+ * @param site Unique identifier of the site (site_…).
2469
+ * @see GET /v1/sites/{site}/notice_sends (operation `listNoticeSends`, scope `notices:read`)
2470
+ */
2471
+ list(site, params, options) {
2472
+ return this._request(OPERATIONS.listNoticeSends, [site], params, options);
2473
+ }
2474
+ }
2351
2475
  /** `checkbox.noticeSettings` */
2352
2476
  export class NoticeSettingsResource extends Resource {
2353
2477
  /**
@@ -2364,7 +2488,7 @@ export class NoticeSettingsResource extends Resource {
2364
2488
  /**
2365
2489
  * Update notice settings.
2366
2490
  *
2367
- * Chooses who sends the required emails (mode: merchant = you send them and Checkbox tracks them, the default; checkbox = Checkbox sends them), and sets branding, cancel_url and the confirmed cancellation policy. In checkbox mode, turning a notice on (enabled_kinds) requires cancel_url, a confirmed policy, a connected Stripe or Recharge account and a sending address; otherwise resource_conflict explains what is missing.
2491
+ * Chooses who sends the required emails (mode: merchant = you send them and Checkbox tracks them, the default; checkbox = Checkbox sends them), and sets branding, cancel_url and the confirmed cancellation policy. add_kinds / remove_kinds turn single notices on or off and leave the others as they are; enabled_kinds replaces the whole list. In checkbox mode, turning a notice on requires cancel_url, a confirmed policy, a support email, a connected Stripe, Recharge, Chargebee, Recurly or Paddle account and a sending address; otherwise resource_conflict explains what is missing. The support email may be the Stripe account's public one (used automatically); the account owner's login address only after the human confirms it in the dashboard (support_email_to_confirm; an agent cannot confirm it). Turning notices on through the API never emails a real subscriber: on a test-mode site only test-run inboxes (and marked test copies to the owner) are emailed, and on a live site real subscribers are emailed only after a person confirms it once in the dashboard, after a preview (real_sends). The account owner is emailed when an agent turns notices on.
2368
2492
  *
2369
2493
  * @param site Unique identifier of the site (site_…).
2370
2494
  * @see POST /v1/sites/{site}/notice_settings (operation `updateNoticeSettings`, scope `notices:write`, live mode needs an activated account)
@@ -2468,7 +2592,7 @@ export class ChecksResource extends Resource {
2468
2592
  /**
2469
2593
  * Check checkout disclosure text.
2470
2594
  *
2471
- * Checks the automatic-renewal disclosure you are about to show next to a subscribe button: what it says (renewal until canceled, price, frequency, trial, term, how to cancel), where it sits (above the button, same page) and how it looks (size, contrast, set off), and the consent checkbox (present, not pre-checked). Returns the verdict per check and per legal requirement, plus `replacement`: compliant text and drop-in HTML generated from your price/interval/trial/cancel_url and verified by the engine. Call it whenever you write or change checkout copy. Stateless and deterministic: nothing is stored, the same input on the same as_of date gives the same verdicts. Every verdict comes from the Checkbox rules engine over the legal catalog (federal ROSCA / EFTA plus the state automatic-renewal laws); the response carries rules_version, catalog_version and a disclaimer (not legal advice). Read `verdict`, then `next_action`: it tells you exactly what to change and to call the check again until verdict is pass.
2595
+ * Checks the automatic-renewal disclosure you are about to show next to a subscribe button: what it says (renewal until canceled, price, frequency, trial, term, how to cancel), where it sits (above the button, same page) and how it looks (size, contrast, set off), and the consent checkbox (present, not pre-checked). Returns the verdict per check and per legal requirement, plus `replacement`: suggested text that passes the checks and drop-in HTML (and the same markup as JSX for React) generated from your price/interval/trial/cancel_url and verified by the engine. Call it whenever you write or change checkout copy. Stateless and deterministic: nothing is stored, the same input on the same as_of date gives the same verdicts. Every verdict comes from the Checkbox rules engine over the legal catalog (federal ROSCA / EFTA plus the state automatic-renewal laws); the response carries rules_version, catalog_version and a disclaimer (not legal advice). Read `verdict`, then `next_action`: it tells you exactly what to change and to call the check again until verdict is pass.
2472
2596
  *
2473
2597
  * @see POST /v1/checks/disclosure (operation `checkDisclosure`, scope `checks:read`)
2474
2598
  */
@@ -2498,7 +2622,7 @@ export class ChecksResource extends Resource {
2498
2622
  /**
2499
2623
  * Check a subscription lifecycle email.
2500
2624
  *
2501
- * Checks the content of an acknowledgment (welcome) email, trial-ending reminder, renewal reminder, price-change notice, yearly terms reminder or cancellation confirmation against the requirements for that notice (renewal terms, amount, frequency, how to cancel, trial cancellation). The email is modelled as sent on time, so the verdict is about content; get send dates from checkNoticeSchedule. Returns `required_by` (requirements that make the email mandatory for this plan) and a compliant `template` with {{merge_tags}}, verified by the engine. Stateless and deterministic: nothing is stored, the same input on the same as_of date gives the same verdicts. Every verdict comes from the Checkbox rules engine over the legal catalog (federal ROSCA / EFTA plus the state automatic-renewal laws); the response carries rules_version, catalog_version and a disclaimer (not legal advice). Read `verdict`, then `next_action`: it tells you exactly what to change and to call the check again until verdict is pass.
2625
+ * Checks the content of an acknowledgment (welcome) email, trial-ending reminder, renewal reminder, price-change notice, yearly terms reminder or cancellation confirmation against the requirements for that notice (renewal terms, amount, frequency, how to cancel, trial cancellation). The email is modelled as sent on time, so the verdict is about content; get send dates from checkNoticeSchedule. Prices are judged against what Stripe charges: with `site` (or, without it and without a price in terms, the account's one site with Stripe connected) the plan fields come from the site's plans and the email is matched to the plan it names ("Annual") first; a price that contradicts it fails, and `warnings` say which site and plan were used. Without `site`, a price you send in terms is judged as sent; when it differs from every plan of that site, the result is at most needs_review and Next is update_setup (update the site's plans first). Returns `required_by` (requirements that make the email mandatory for this plan) and a `template` that passes the checks, with {{merge_tags}}, verified by the engine. Stateless and deterministic: nothing is stored, the same input on the same as_of date gives the same verdicts. Every verdict comes from the Checkbox rules engine over the legal catalog (federal ROSCA / EFTA plus the state automatic-renewal laws); the response carries rules_version, catalog_version and a disclaimer (not legal advice). Read `verdict`, then `next_action`: it tells you exactly what to change and to call the check again until verdict is pass.
2502
2626
  *
2503
2627
  * @see POST /v1/checks/email (operation `checkEmail`, scope `checks:read`)
2504
2628
  */
@@ -2518,7 +2642,7 @@ export class ChecksResource extends Resource {
2518
2642
  /**
2519
2643
  * Get the dates each required notice must be sent.
2520
2644
  *
2521
- * For a subscription plan (price, interval, trial) and where you sell, returns every legally required notice — acknowledgment, trial-ending reminder, renewal reminders, yearly terms reminder, price-change notice — with the recommended send time and the compliant window (opens / closes), the jurisdictions each send satisfies and the citations. Uses the same timing as Checkbox Notices: per-state windows intersected, or the fewest sends that cover conflicting windows. Stateless. Check each email's content with checkEmail, or let Checkbox Notices send them.
2645
+ * For a subscription plan (price, interval, trial) and where you sell, returns every legally required notice — acknowledgment, trial-ending reminder, renewal reminders, yearly terms reminder, price-change notice — with the recommended send time and the allowed send window (opens / closes), the jurisdictions each send satisfies and the citations. Uses the same timing as Checkbox Notices: per-state windows intersected, or the fewest sends that cover conflicting windows. Stateless. Check each email's content with checkEmail, or let Checkbox Notices send them.
2522
2646
  *
2523
2647
  * @see POST /v1/checks/notice_schedule (operation `checkNoticeSchedule`, scope `checks:read`)
2524
2648
  */
@@ -2691,7 +2815,7 @@ export class ReceiptsResource extends Resource {
2691
2815
  /**
2692
2816
  * Erase a subscriber's receipts.
2693
2817
  *
2694
- * For a subscriber's deletion request: deletes every receipt that matches customer_reference, email (hashed before the lookup) or checkout_session (optionally only for one site). The signed copy in the write-once evidence vault is kept but holds only a salted commitment to the subscriber's identifiers; erasing destroys the salt, so it can no longer be tied to the person. Pending attorney review.
2818
+ * For a subscriber's deletion request: deletes every receipt that matches customer_reference, email (hashed before the lookup) or checkout_session (optionally only for one site). The signed copy in the write-once evidence vault is kept but holds only a salted commitment to the subscriber's identifiers; erasing destroys the salt, so it can no longer be tied to the person. Ask your counsel whether this meets a deletion request in your jurisdiction.
2695
2819
  *
2696
2820
  * @see POST /v1/receipts/erase (operation `eraseReceipts`, scope `receipts:write`)
2697
2821
  */
@@ -2758,7 +2882,7 @@ export class ReceiptSettingsResource extends Resource {
2758
2882
  /**
2759
2883
  * Update receipt settings.
2760
2884
  *
2761
- * Turn receipts on or off and set the retention in days (default 1461 = 4 years, the California UCL limitation period; pending attorney review). A new retention applies to receipts recorded afterwards.
2885
+ * Turn receipts on or off and set the retention in days (default 1461 = 4 years: the California Unfair Competition Law limitation period; adjust to your counsel's advice). A new retention applies to receipts recorded afterwards.
2762
2886
  *
2763
2887
  * @see POST /v1/receipt_settings (operation `updateReceiptSettings`, scope `receipts:write`)
2764
2888
  */
@@ -2771,7 +2895,7 @@ export class TestCredentialsResource extends Resource {
2771
2895
  /**
2772
2896
  * Store a billing test-mode key.
2773
2897
  *
2774
- * Stores the site's Stripe TEST-mode key (rk_test_… preferred) used by test runs, after checking it with Stripe. Live keys are refused (test_key_not_test_mode). Least privilege: Write on Customers, Checkout Sessions, Subscriptions, Test clocks and Customer portal; Read on Prices, Products and Billing portal configuration. Replaces an existing key. Next: createTestRun.
2898
+ * Stores the site's Stripe TEST-mode restricted key (rk_test_…), after checking it with Stripe the way the dashboard's Connect Stripe does. An agent may call this itself once the owner approved the setup; every store is logged on the site's setup timeline and Billing connection line, and the human can revoke it in one click. Live keys are refused (test_key_not_test_mode: a human adds live keys in the dashboard); a key whose Stripe account looks like another site's is refused with billing_account_mismatch until the human confirms (confirm_account_mismatch: true); secret keys (sk_test_…) are refused (test_key_not_restricted). On a test-mode site without a Stripe connection the key also becomes the site's Stripe connection: one key for checks, fixes (only after the human approves each) and test runs. The key's 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. Replaces an existing key. Next: createTestRun.
2775
2899
  *
2776
2900
  * @param site Unique identifier of the site (site_…).
2777
2901
  * @see POST /v1/sites/{site}/test_credentials (operation `createTestCredential`, scope `test_runs:write`)
@@ -2812,7 +2936,7 @@ export class StripeCheckoutConfigsResource extends Resource {
2812
2936
  /**
2813
2937
  * Register the Checkout Session params your code uses.
2814
2938
  *
2815
- * Registers exactly the object your code passes to stripe.checkout.sessions.create (customer, URLs and secrets are not needed and are ignored). Test runs mirror it into Stripe test mode; when it matches your latest live checkout, the scanned test page counts as an observation of your live checkout. Re-register after changing your checkout code, then call createTestRun.
2939
+ * Registers exactly the object your code passes to stripe.checkout.sessions.create (customer, URLs and secrets are not needed and are ignored; `warnings` says what was not stored). It is judged exactly like checkStripeCheckoutSession, discounts included. A config with the same name, or for the same Price ids, replaces the older one (`replaced`). Test runs mirror it into Stripe test mode; when it matches your latest live checkout, the scanned test page counts as an observation of your live checkout. Re-register after changing your checkout code, then call createTestRun.
2816
2940
  *
2817
2941
  * @param site Unique identifier of the site (site_…).
2818
2942
  * @see POST /v1/sites/{site}/stripe_checkout_configs (operation `createStripeCheckoutConfig`, scope `test_runs:write`)
@@ -2858,12 +2982,31 @@ export class StripeCheckoutConfigsResource extends Resource {
2858
2982
  return this.del(stripeCheckoutConfig, options);
2859
2983
  }
2860
2984
  }
2985
+ /** `checkbox.siteStripeCheckoutConfigs` */
2986
+ export class SiteStripeCheckoutConfigsResource extends Resource {
2987
+ /**
2988
+ * Delete a registered checkout config (site path).
2989
+ *
2990
+ * The same as deleteStripeCheckoutConfig, under the site path where configs are created and listed.
2991
+ *
2992
+ * @param site Unique identifier of the site (site_…).
2993
+ * @param stripeCheckoutConfig Unique identifier of the stripe checkout config (scc_…).
2994
+ * @see DELETE /v1/sites/{site}/stripe_checkout_configs/{stripe_checkout_config} (operation `deleteSiteStripeCheckoutConfig`, scope `test_runs:write`)
2995
+ */
2996
+ del(site, stripeCheckoutConfig, options) {
2997
+ return this._request(OPERATIONS.deleteSiteStripeCheckoutConfig, [site, stripeCheckoutConfig], undefined, options);
2998
+ }
2999
+ /** Alias of `del()`. */
3000
+ delete(site, stripeCheckoutConfig, options) {
3001
+ return this.del(site, stripeCheckoutConfig, options);
3002
+ }
3003
+ }
2861
3004
  /** `checkbox.testRuns` */
2862
3005
  export class TestRunsResource extends Resource {
2863
3006
  /**
2864
3007
  * Start a lifecycle test run.
2865
3008
  *
2866
- * Starts a synthetic test subscription in TEST mode and returns it queued. Stripe runs mirror your checkout into a test-mode Checkout Session, subscribe a test customer (card 4242) whose email is a Checkbox inbox, wait for your acknowledgment, advance a test clock through every legal notice window before trial end and renewal, cancel online in the customer portal and wait for the confirmation; then delete the test clock. Takes about 5-20 minutes: poll retrieveTestRun (next_action says when) or listen for test_run.completed. Each step reports observations, check results and agent-readable fixes; apply them and run again to verify.
3009
+ * Starts a synthetic test subscription in TEST mode and returns it queued. Stripe runs mirror your checkout into a test-mode Checkout Session, subscribe a test customer (card 4242) whose email is a Checkbox inbox, wait for your acknowledgment, advance a test clock through every legal notice window before trial end and renewal, cancel online in the customer portal and wait for the confirmation; then delete the test clock. Usually takes 2-4 minutes (longer when your own emails are slow to arrive): poll retrieveTestRun (next_action says when) or listen for test_run.completed. Each step reports observations, check results and agent-readable fixes; apply them and run again to verify.
2867
3010
  *
2868
3011
  * @param site Unique identifier of the site (site_…).
2869
3012
  * @see POST /v1/sites/{site}/test_runs (operation `createTestRun`, scope `test_runs:write`, live mode needs an activated account)
@@ -2885,13 +3028,13 @@ export class TestRunsResource extends Resource {
2885
3028
  /**
2886
3029
  * Retrieve a test run.
2887
3030
  *
2888
- * The run with every step's status, observations, check results and fixes. While it runs, next_action.type is "wait"; when it finished, next_action says what to fix (apply_fixes / review_warnings) or "none".
3031
+ * The run with every step's status, observations, check results and fixes. While it runs, next_action.type is "wait" and waiting_for says what it waits for; ?wait=30 answers as soon as the run moves on (or after 30 seconds). When it finished, next_action says what to fix (apply_fixes / review_warnings), retrieve_plan when the only warnings have nothing to change, or "none".
2889
3032
  *
2890
3033
  * @param testRun Unique identifier of the test run (run_…).
2891
3034
  * @see GET /v1/test_runs/{test_run} (operation `retrieveTestRun`, scope `test_runs:read`)
2892
3035
  */
2893
- retrieve(testRun, options) {
2894
- return this._request(OPERATIONS.retrieveTestRun, [testRun], undefined, options);
3036
+ retrieve(testRun, params, options) {
3037
+ return this._request(OPERATIONS.retrieveTestRun, [testRun], params, options);
2895
3038
  }
2896
3039
  /**
2897
3040
  * Cancel a test run.
@@ -3005,7 +3148,7 @@ export class FeedbacksResource extends Resource {
3005
3148
  /**
3006
3149
  * Send feedback.
3007
3150
  *
3008
- * Report a problem or a missing feature in Checkbox. Include what you tried, what happened and what you expected, and the site / request id when there is one. The Checkbox team reads every message. Rate limited to 20 per key per hour.
3151
+ * Report a problem or a missing feature in Checkbox. Include what you tried, what happened and what you expected, and the site / request id when there is one. With type review, send a structured review of Checkbox the product (score 0-10, liked, disliked, wrong_verdicts, would_keep_using, stack) — only after the human said yes and saw the text. A review describes what worked or did not in Checkbox: it never states that the site broke a law or had unfixed problems, and carries no site names, URLs, customer data or quotes of the site's pages or emails (URLs are removed and no site is attached). Never include secrets or customer data: anything that looks like a secret, card number or email address is replaced with [redacted]. The Checkbox team reads every message. Rate limited to 20 per key per hour.
3009
3152
  *
3010
3153
  * @see POST /v1/feedback (operation `createFeedback`, scope `account:read`)
3011
3154
  */
@@ -3013,6 +3156,20 @@ export class FeedbacksResource extends Resource {
3013
3156
  return this._request(OPERATIONS.createFeedback, [], params, options);
3014
3157
  }
3015
3158
  }
3159
+ /** `checkbox.reviewPrompts` */
3160
+ export class ReviewPromptsResource extends Resource {
3161
+ /**
3162
+ * Claim the one-time review prompt for a site.
3163
+ *
3164
+ * The MCP tools call this when a site's compliance plan reaches status compliant, i.e. checks pass (including "Checks pass · N live checks pending"). show is true exactly once per site: the agent then asks the human once whether they want to send a quick review of Checkbox (createFeedback with type review), and sends it only on a yes, after showing the text. Never send a review without the human's yes.
3165
+ *
3166
+ * @param site Unique identifier of the site (site_…).
3167
+ * @see POST /v1/sites/{site}/review_prompt (operation `claimReviewPrompt`, scope `compliance_plans:read`)
3168
+ */
3169
+ claim(site, params, options) {
3170
+ return this._request(OPERATIONS.claimReviewPrompt, [site], params, options);
3171
+ }
3172
+ }
3016
3173
  /** Resource namespaces of the client. */
3017
3174
  export const RESOURCES = {
3018
3175
  device: DeviceResource,
@@ -3020,6 +3177,7 @@ export const RESOURCES = {
3020
3177
  account: AccountResource,
3021
3178
  sites: SitesResource,
3022
3179
  domainVerifications: DomainVerificationsResource,
3180
+ billings: BillingsResource,
3023
3181
  scans: ScansResource,
3024
3182
  evaluations: EvaluationsResource,
3025
3183
  findings: FindingsResource,
@@ -3029,6 +3187,7 @@ export const RESOURCES = {
3029
3187
  fixes: FixesResource,
3030
3188
  evidence: EvidenceResource,
3031
3189
  certificates: CertificatesResource,
3190
+ noticeSends: NoticeSendsResource,
3032
3191
  noticeSettings: NoticeSettingsResource,
3033
3192
  notices: NoticesResource,
3034
3193
  lawUpdates: LawUpdatesResource,
@@ -3042,8 +3201,10 @@ export const RESOURCES = {
3042
3201
  receiptSettings: ReceiptSettingsResource,
3043
3202
  testCredentials: TestCredentialsResource,
3044
3203
  stripeCheckoutConfigs: StripeCheckoutConfigsResource,
3204
+ siteStripeCheckoutConfigs: SiteStripeCheckoutConfigsResource,
3045
3205
  testRuns: TestRunsResource,
3046
3206
  webhookEndpoints: WebhookEndpointsResource,
3047
3207
  events: EventsResource,
3048
3208
  feedbacks: FeedbacksResource,
3209
+ reviewPrompts: ReviewPromptsResource,
3049
3210
  };