@checkbox-site/node 0.2.1 → 0.2.2

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/dist/client.d.ts CHANGED
@@ -45,7 +45,7 @@ export interface Checkbox extends ResourceInstances {
45
45
  */
46
46
  export declare class Checkbox implements RequestSender {
47
47
  #private;
48
- static readonly VERSION = "0.2.1";
48
+ static readonly VERSION = "0.2.2";
49
49
  static readonly API_VERSION = "2026-10-30";
50
50
  static readonly errors: typeof errors;
51
51
  static readonly webhooks: Webhooks;
@@ -2630,7 +2630,7 @@ export declare class SitesResource extends Resource {
2630
2630
  /**
2631
2631
  * Connect a billing platform.
2632
2632
  *
2633
- * 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.
2633
+ * 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 key is then held until a person confirms the account in the dashboard (an agent cannot confirm it). The account owner is emailed about every key connected.
2634
2634
  *
2635
2635
  * @param site Unique identifier of the site (site_…).
2636
2636
  * @see POST /v1/sites/{site}/integrations (operation `connectBillingPlatform`, scope `sites:write`)
@@ -3000,7 +3000,7 @@ export declare class NoticesResource extends Resource {
3000
3000
  /**
3001
3001
  * List due notices.
3002
3002
  *
3003
- * The legally required emails you owe subscribers (sites in "You send" mode, the default): kind, the subscriber (billing-platform ids), the legal window for the subscriber's state, the recommended send date, the copy-ready email and the BCC address. Default: everything not yet sent (upcoming, due, overdue), soonest first. Live keys list live subscribers' notices, test keys test-mode ones. Send each one on its send_date (inside its window), then call markNoticeSent (or BCC the notice's bcc address). Subscribe to the notice.due webhook to get each one on its send date.
3003
+ * The legally required emails you owe subscribers (sites in "You send" mode, the default): kind, the subscriber (billing-platform ids), the legal window for the subscriber's state, the recommended send date, the email (ready to send once email.missing_fields is empty) and the BCC address. Default: everything not yet sent (upcoming, due, overdue), soonest first. Live keys list live subscribers' notices, test keys test-mode ones. Send each one on its send_date (inside its window), then call markNoticeSent (or BCC the notice's bcc address). Subscribe to the notice.due webhook to get each one on its send date.
3004
3004
  *
3005
3005
  * @see GET /v1/notices/due (operation `listDueNotices`, scope `notices:read`)
3006
3006
  */
@@ -3024,7 +3024,7 @@ export declare class NoticesResource extends Resource {
3024
3024
  /**
3025
3025
  * Retrieve a due notice.
3026
3026
  *
3027
- * One notice you owe a subscriber, with its window, recommended send date, copy-ready email, BCC address and send status.
3027
+ * One notice you owe a subscriber, with its window, recommended send date, email (ready to send once email.missing_fields is empty), BCC address and send status.
3028
3028
  *
3029
3029
  * @param notice Unique identifier of the due notice (ntd_…).
3030
3030
  * @see GET /v1/notices/{notice} (operation `retrieveDueNotice`, scope `notices:read`)
@@ -3323,7 +3323,7 @@ export declare class TestCredentialsResource extends Resource {
3323
3323
  /**
3324
3324
  * Store a billing test-mode key.
3325
3325
  *
3326
- * 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.
3326
+ * 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); the owner must have ticked "Let your agent store a Stripe test-mode key" on the approval page of the agent's sign-in or connection (else test_key_declined); a key whose Stripe account looks like another site's is refused with billing_account_mismatch (with confirm_account_mismatch: true the key is connected on hold until a person confirms the account in the dashboard; only a person can confirm it); 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.
3327
3327
  *
3328
3328
  * @param site Unique identifier of the site (site_…).
3329
3329
  * @see POST /v1/sites/{site}/test_credentials (operation `createTestCredential`, scope `test_runs:write`)
@@ -2058,7 +2058,7 @@ export class SitesResource extends Resource {
2058
2058
  /**
2059
2059
  * Connect a billing platform.
2060
2060
  *
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.
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 key is then held until a person confirms the account in the dashboard (an agent cannot confirm it). The account owner is emailed about every key connected.
2062
2062
  *
2063
2063
  * @param site Unique identifier of the site (site_…).
2064
2064
  * @see POST /v1/sites/{site}/integrations (operation `connectBillingPlatform`, scope `sites:write`)
@@ -2502,7 +2502,7 @@ export class NoticesResource extends Resource {
2502
2502
  /**
2503
2503
  * List due notices.
2504
2504
  *
2505
- * The legally required emails you owe subscribers (sites in "You send" mode, the default): kind, the subscriber (billing-platform ids), the legal window for the subscriber's state, the recommended send date, the copy-ready email and the BCC address. Default: everything not yet sent (upcoming, due, overdue), soonest first. Live keys list live subscribers' notices, test keys test-mode ones. Send each one on its send_date (inside its window), then call markNoticeSent (or BCC the notice's bcc address). Subscribe to the notice.due webhook to get each one on its send date.
2505
+ * The legally required emails you owe subscribers (sites in "You send" mode, the default): kind, the subscriber (billing-platform ids), the legal window for the subscriber's state, the recommended send date, the email (ready to send once email.missing_fields is empty) and the BCC address. Default: everything not yet sent (upcoming, due, overdue), soonest first. Live keys list live subscribers' notices, test keys test-mode ones. Send each one on its send_date (inside its window), then call markNoticeSent (or BCC the notice's bcc address). Subscribe to the notice.due webhook to get each one on its send date.
2506
2506
  *
2507
2507
  * @see GET /v1/notices/due (operation `listDueNotices`, scope `notices:read`)
2508
2508
  */
@@ -2532,7 +2532,7 @@ export class NoticesResource extends Resource {
2532
2532
  /**
2533
2533
  * Retrieve a due notice.
2534
2534
  *
2535
- * One notice you owe a subscriber, with its window, recommended send date, copy-ready email, BCC address and send status.
2535
+ * One notice you owe a subscriber, with its window, recommended send date, email (ready to send once email.missing_fields is empty), BCC address and send status.
2536
2536
  *
2537
2537
  * @param notice Unique identifier of the due notice (ntd_…).
2538
2538
  * @see GET /v1/notices/{notice} (operation `retrieveDueNotice`, scope `notices:read`)
@@ -2895,7 +2895,7 @@ export class TestCredentialsResource extends Resource {
2895
2895
  /**
2896
2896
  * Store a billing test-mode key.
2897
2897
  *
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.
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); the owner must have ticked "Let your agent store a Stripe test-mode key" on the approval page of the agent's sign-in or connection (else test_key_declined); a key whose Stripe account looks like another site's is refused with billing_account_mismatch (with confirm_account_mismatch: true the key is connected on hold until a person confirms the account in the dashboard; only a person can confirm it); 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.
2899
2899
  *
2900
2900
  * @param site Unique identifier of the site (site_…).
2901
2901
  * @see POST /v1/sites/{site}/test_credentials (operation `createTestCredential`, scope `test_runs:write`)
@@ -336,7 +336,7 @@ export interface SetupSession {
336
336
  discovered: Record<string, string>;
337
337
  /** Install details. */
338
338
  install: {
339
- /** The exact tag to put in <head> on every page. */
339
+ /** The exact tag to put in <head> of the homepage, pricing, checkout / sign-up and account pages (not needed on every page). */
340
340
  script_tag: string | null;
341
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. */
342
342
  snippet_key: string | null;
@@ -388,7 +388,7 @@ export interface SetupSession {
388
388
  }>;
389
389
  /** Stripe test mode for lifecycle test runs. */
390
390
  stripe: {
391
- /** Whether the human allowed Checkbox to use the project's Stripe TEST key for synthetic subscriptions. */
391
+ /** Whether the human ticked “Let your agent store a Stripe test-mode key” on the approval page (device login or OAuth connection). False: the agent may not store one (createTestCredential answers test_key_declined); the human adds it in the dashboard. Sessions started with a key the human made in the dashboard: true. */
392
392
  test_key_consent: boolean;
393
393
  /** Hint of the key the CLI found (never the key). */
394
394
  test_key_hint: string | null;
@@ -904,7 +904,7 @@ export type SiteCompliance = {
904
904
  } | null;
905
905
  /** What to install on the merchant site. */
906
906
  export interface SiteInstall {
907
- /** Paste into the <head> of every page (or let `checkbox init` do it). */
907
+ /** Paste into the <head> of the homepage, pricing, checkout / sign-up and account pages (or let `checkbox init` do it). It sends only the renewal-relevant blocks of a page. */
908
908
  script_tag: string;
909
909
  /** Public key of the snippet (also the inbound email local part). */
910
910
  snippet_key: string;
@@ -1297,7 +1297,7 @@ export interface ConnectBillingPlatformParams {
1297
1297
  platform: "stripe" | "recharge" | "shopify" | "chargebee" | "recurly" | "paddle";
1298
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. */
1299
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. */
1300
+ /** Set true only after the human said yes to the billing_account_mismatch question ("This looks like <other site>’s Stripe account. Use it anyway?"). It only proposes the account: the key is connected on hold (nothing from it is used, no test runs) until a person confirms it in the Checkbox dashboard (site Overview: “It is this site’s account: use it”). Default false: such a key is not connected and nothing is evaluated. */
1301
1301
  confirm_account_mismatch?: boolean;
1302
1302
  }
1303
1303
  /** A queued re-read of the site's billing-platform settings, followed by a re-evaluation. */
@@ -1691,8 +1691,8 @@ export interface Task {
1691
1691
  };
1692
1692
  /** What Checkbox needs before it can give the exact change (observation: it has not seen the page / email yet; facts: plan, price, cancel URL or merchant name). The title stays the same either way. */
1693
1693
  blocked_on: string | null;
1694
- /** Done / declined tasks: verified (its checks pass), no_longer_applicable (its checks no longer apply, e.g. the data source changed), superseded, declined. */
1695
- closed_reason: "verified" | "no_longer_applicable" | "superseded" | "declined" | null;
1694
+ /** Done / declined tasks: verified (its checks pass), no_longer_applicable (its checks no longer apply, e.g. the data source changed), superseded, declined, decided (the owner confirmed a decision, e.g. New York notices by email only: closed, but its checks are not verified). */
1695
+ closed_reason: "verified" | "no_longer_applicable" | "superseded" | "declined" | "decided" | null;
1696
1696
  /** Tasks to finish first (their result changes this task's content). */
1697
1697
  depends_on: Array<string>;
1698
1698
  /** Unfinished tasks among depends_on. */
@@ -1825,7 +1825,7 @@ export interface CompliancePlan {
1825
1825
  description: string;
1826
1826
  /** Every choice only the owner makes, together. */
1827
1827
  questions: Array<{
1828
- /** "email_sender" (who sends the required emails), or the id of the task whose question it is. */
1828
+ /** "email_sender" (who sends the required emails), "notices_support_email" / "notices_cancel_timing" (what Checkbox Notices needs before it sends), or the id of the task whose question it is. */
1829
1829
  id: string;
1830
1830
  /** The question, in plain words for the owner. */
1831
1831
  text: string;
@@ -2286,9 +2286,9 @@ export interface NoticeSettings {
2286
2286
  logo_url: string | null;
2287
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). */
2288
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. */
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 (Emails › 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
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. */
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 (Emails tab, after a preview); an API key or agent cannot confirm it. confirmed: they are emailed. off: Checkbox sends nothing. */
2292
2292
  real_sends: "test_mode" | "confirmed" | "needs_confirmation" | "off";
2293
2293
  /** Where subscribers cancel online (site domain, hosted cancellation page or billing portal). */
2294
2294
  cancel_url: string | null;
@@ -2358,7 +2358,7 @@ export interface UpdateNoticeSettingsParams {
2358
2358
  product_name?: string | null;
2359
2359
  /** Logo URL (https). */
2360
2360
  logo_url?: string | null;
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). */
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 (Emails › Branding). */
2362
2362
  support_email?: string | null;
2363
2363
  /** Online cancellation URL. */
2364
2364
  cancel_url?: string | null;
@@ -2374,7 +2374,7 @@ export interface UpdateNoticeSettingsParams {
2374
2374
  confirm: true;
2375
2375
  } | null;
2376
2376
  }
2377
- /** Copy-ready email for this subscriber. It passes the preflight email check for its kind when every field is filled. */
2377
+ /** The email for this subscriber, rendered from Checkbox's template. Ready to send only when missing_fields is empty; it then passes the preflight email check for its kind. */
2378
2378
  export interface RenderedNoticeEmail {
2379
2379
  /** Checkbox template the email was rendered from (GET /v1/notices/templates). */
2380
2380
  template_id: string;
@@ -2384,10 +2384,10 @@ export interface RenderedNoticeEmail {
2384
2384
  text: string;
2385
2385
  /** HTML body, merge fields filled (values HTML-escaped). */
2386
2386
  html: string;
2387
- /** Merge fields Checkbox could not fill (e.g. cancel_url until you set it); fill them before sending. */
2387
+ /** Merge fields Checkbox could not fill (support_contact until a support email is confirmed, cancel_url when neither the notice settings nor the site name an account page). While this is not empty the email is NOT ready to send: fill each {{field}} first, or a check of the sent copy reopens its task naming the unfilled field. */
2388
2388
  missing_fields: Array<string>;
2389
2389
  }
2390
- /** An email the merchant owes a subscriber, legally required (required: true) or recommended ("You send" mode): what, when, the copy-ready email and how to confirm it was sent. */
2390
+ /** An email the merchant owes a subscriber, legally required (required: true) or recommended ("You send" mode): what, when, the email to send (ready once email.missing_fields is empty) and how to confirm it was sent. */
2391
2391
  export interface DueNotice {
2392
2392
  /** Unique identifier of the due notice (ntd_…). */
2393
2393
  id: string;
@@ -5115,7 +5115,7 @@ export interface CreateTestCredentialParams {
5115
5115
  type: "stripe_test" | "stripe";
5116
5116
  /** The Stripe test-mode restricted key (rk_test_…). Secret keys (sk_…) and live keys are refused. Stored encrypted; never returned. */
5117
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. */
5118
+ /** Set true only after the human said yes: proposes the key even though its Stripe account looks like another site’s (billing_account_mismatch). It is connected on hold, and nothing from it is used, until a person confirms the account in the Checkbox dashboard (site Overview); next to a person’s Stripe connection it is refused. Default false. */
5119
5119
  confirm_account_mismatch?: boolean;
5120
5120
  }
5121
5121
  /** Parameters of `stripeCheckoutConfigs.create()` (createStripeCheckoutConfig). */
@@ -5160,6 +5160,10 @@ export interface CreateTestRunParams {
5160
5160
  price?: string;
5161
5161
  /** Trial for `price` (registered configs carry their own). */
5162
5162
  trial_period_days?: number;
5163
+ /** Mirror mode: a TEST-mode coupon id applied to the test subscription, so it has the same discount as your real subscribers (an intro price, for example). Its emails are then judged against that discount. Not with promotion_code. */
5164
+ coupon?: string;
5165
+ /** Mirror mode: a TEST-mode promotion code (promo_… id, or the code customers type) applied to the test subscription. Not with coupon. */
5166
+ promotion_code?: string;
5163
5167
  /** Live price id -> test-mode price id, when they differ. */
5164
5168
  price_map?: Record<string, string>;
5165
5169
  /** Steps that complete your hosted checkout with card 4242 4242 4242 4242 when it differs from Stripe's default page. */
@@ -5304,7 +5308,7 @@ export type TaskVerifiedEvent = Event & {
5304
5308
  previous_attributes?: Record<string, unknown>;
5305
5309
  };
5306
5310
  };
5307
- /** `notice.due`: An email the merchant sends itself ("You send" mode) reached its recommended send date: data.object is the due_notice with the window, send_at, the copy-ready email and its BCC address. Send it now (inside the window), then call markNoticeSent (or BCC the copy). required tells a legally required email from a recommended one. */
5311
+ /** `notice.due`: An email the merchant sends itself ("You send" mode) reached its recommended send date: data.object is the due_notice with the window, send_at, the email (ready to send once email.missing_fields is empty) and its BCC address. Send it now (inside the window), then call markNoticeSent (or BCC the copy). required tells a legally required email from a recommended one. */
5308
5312
  export type NoticeDueEvent = Event & {
5309
5313
  /** Event type. */
5310
5314
  type?: "notice.due";
@@ -5549,7 +5553,7 @@ export declare const ERROR_CODES: {
5549
5553
  readonly test_key_declined: {
5550
5554
  readonly status: 403;
5551
5555
  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.";
5556
+ readonly description: "The owner did not tick “Let your agent store a Stripe test-mode key” on the approval page of this agent's sign-in (device login) or connection (OAuth). Nothing was stored. Ask them to allow it on the approval page (sign in again) or to add the key themselves in the dashboard.";
5553
5557
  };
5554
5558
  readonly test_key_rejected: {
5555
5559
  readonly status: 400;
@@ -5669,7 +5673,7 @@ export declare const ERROR_CODES: {
5669
5673
  readonly billing_account_mismatch: {
5670
5674
  readonly status: 409;
5671
5675
  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.";
5676
+ 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 (that only proposes it: the key is held until a person confirms the account in the dashboard), else use this site's own key. `problems` lists what did not match.";
5673
5677
  };
5674
5678
  readonly test_run_in_progress: {
5675
5679
  readonly status: 409;
@@ -21,7 +21,7 @@ export const ERROR_CODES = {
21
21
  test_key_missing: { status: 400, type: "invalid_request_error", 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." },
22
22
  test_key_not_test_mode: { status: 400, type: "invalid_request_error", 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." },
23
23
  test_key_not_restricted: { status: 400, type: "invalid_request_error", 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." },
24
- test_key_declined: { status: 403, type: "permission_error", 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." },
24
+ test_key_declined: { status: 403, type: "permission_error", description: "The owner did not tick “Let your agent store a Stripe test-mode key” on the approval page of this agent's sign-in (device login) or connection (OAuth). Nothing was stored. Ask them to allow it on the approval page (sign in again) or to add the key themselves in the dashboard." },
25
25
  test_key_rejected: { status: 400, type: "invalid_request_error", description: "Stripe rejected the test-mode key or it lacks a permission test runs need; `message` names it." },
26
26
  authorization_pending: { status: 400, type: "invalid_request_error", description: "Device login: the human has not approved yet. Keep polling createDeviceToken every `interval` seconds." },
27
27
  slow_down: { status: 400, type: "rate_limit_error", description: "Device login: polling too fast. Add 5 seconds to the interval and keep polling." },
@@ -45,7 +45,7 @@ export const ERROR_CODES = {
45
45
  resource_conflict: { status: 409, type: "invalid_request_error", description: "The object is in a state that does not allow this action." },
46
46
  scan_already_queued: { status: 409, type: "invalid_request_error", description: "A scan of this site is already queued or running." },
47
47
  consent_reference_locked: { status: 409, type: "invalid_request_error", description: "The consent already carries a different customer_reference; references are set once and never changed." },
48
- billing_account_mismatch: { status: 409, type: "invalid_request_error", 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." },
48
+ billing_account_mismatch: { status: 409, type: "invalid_request_error", 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 (that only proposes it: the key is held until a person confirms the account in the dashboard), else use this site's own key. `problems` lists what did not match." },
49
49
  test_run_in_progress: { status: 409, type: "invalid_request_error", description: "The site already has a queued or running test run; wait for it (retrieveTestRun) or cancel it (cancelTestRun)." },
50
50
  legal_hold_active: { status: 409, type: "invalid_request_error", 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)." },
51
51
  idempotency_key_in_use: { status: 409, type: "idempotency_error", description: "A request with this Idempotency-Key is still being processed; retry shortly." },
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  /** Version of this SDK (kept equal to packages/sdk-node/package.json "version"; a test checks it). */
2
- export declare const SDK_VERSION = "0.2.1";
2
+ export declare const SDK_VERSION = "0.2.2";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /** Version of this SDK (kept equal to packages/sdk-node/package.json "version"; a test checks it). */
2
- export const SDK_VERSION = '0.2.1';
2
+ export const SDK_VERSION = '0.2.2';
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@checkbox-site/node",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Checkbox Node.js SDK: automatic-renewal-law compliance (ROSCA, California ARL, New York and other state laws) for subscription businesses. Zero dependencies. Published to npm as @checkbox-site/node.",
5
5
  "keywords": [
6
6
  "subscription",
7
7
  "subscription-compliance",
8
8
  "auto-renewal",
9
+ "autorenewal",
9
10
  "automatic-renewal",
10
11
  "compliance",
11
12
  "rosca",