commerceforai 0.1.0 → 0.1.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/dist/index.d.ts CHANGED
@@ -200,6 +200,29 @@ declare class Discounts extends Resource {
200
200
  }>>;
201
201
  }
202
202
  declare class Reports extends Resource {
203
+ /** Sales and tax by state over the last `days` (default 365). `watch` flags US states near common registration thresholds. */
204
+ tax(params?: {
205
+ days?: number;
206
+ }): Promise<Result<{
207
+ object: "tax_report";
208
+ days: number;
209
+ currency: string;
210
+ note: string;
211
+ totals: {
212
+ sales: number;
213
+ tax_collected: number;
214
+ orders: number;
215
+ };
216
+ data: {
217
+ country: string;
218
+ state: string | null;
219
+ orders: number;
220
+ sales: number;
221
+ tax_collected: number;
222
+ registered: boolean;
223
+ watch: boolean;
224
+ }[];
225
+ }>>;
203
226
  /** Sales over the last `days` (default 30, max 366): totals vs the previous period, a time series and top products. */
204
227
  sales(params?: {
205
228
  days?: number;
@@ -547,6 +570,32 @@ declare class StoreResource extends Resource {
547
570
  * Note on `tax_enabled`: Stripe only collects tax in jurisdictions where you have an active
548
571
  * tax registration in Stripe Tax. Turning this on without registrations collects $0 tax.
549
572
  */
573
+ /** Sales tax readiness: Stripe Tax status, registrations, what to do next, and the tax categories to choose from. */
574
+ tax(): Promise<Result<{
575
+ object: "tax_overview";
576
+ enabled: boolean;
577
+ default_tax_code: string | null;
578
+ collecting: boolean;
579
+ next_step: string | null;
580
+ fix_url: string | null;
581
+ note: string;
582
+ stripe: {
583
+ status: string;
584
+ missing_fields: string[];
585
+ registrations: {
586
+ country: string;
587
+ state: string | null;
588
+ }[];
589
+ };
590
+ last_error: {
591
+ message: string;
592
+ at: string;
593
+ } | null;
594
+ categories: {
595
+ code: string;
596
+ name: string;
597
+ }[];
598
+ }>>;
550
599
  /**
551
600
  * Preview a sync from this store's other version (test or live) into this store. Nothing changes.
552
601
  * Syncs cover products, prices, images, collections, discounts and shipping/email settings; never orders, keys, Stripe, site URLs or stock counts.
@@ -569,7 +618,8 @@ declare class StoreResource extends Resource {
569
618
  }>>;
570
619
  update(params: {
571
620
  name?: string;
572
- tax_enabled?: boolean;
621
+ tax_enabled?: boolean; /** Stripe tax code for products without their own, e.g. "txcd_30011000" (clothing). */
622
+ default_tax_code?: string | null;
573
623
  default_success_url?: string | null;
574
624
  default_cancel_url?: string | null;
575
625
  builtin_emails?: boolean;
package/dist/index.js CHANGED
@@ -240,6 +240,10 @@ class Discounts extends Resource {
240
240
  delete(idOrCode) { return this.client.request("DELETE", `/v1/discounts/${encodeURIComponent(idOrCode)}`); }
241
241
  }
242
242
  class Reports extends Resource {
243
+ /** Sales and tax by state over the last `days` (default 365). `watch` flags US states near common registration thresholds. */
244
+ tax(params = {}) {
245
+ return this.client.request("GET", "/v1/reports/tax", { query: params });
246
+ }
243
247
  /** Sales over the last `days` (default 30, max 366): totals vs the previous period, a time series and top products. */
244
248
  sales(params = {}) { return this.client.request("GET", "/v1/reports/sales", { query: params }); }
245
249
  }
@@ -362,6 +366,10 @@ class StoreResource extends Resource {
362
366
  * Note on `tax_enabled`: Stripe only collects tax in jurisdictions where you have an active
363
367
  * tax registration in Stripe Tax. Turning this on without registrations collects $0 tax.
364
368
  */
369
+ /** Sales tax readiness: Stripe Tax status, registrations, what to do next, and the tax categories to choose from. */
370
+ tax() {
371
+ return this.client.request("GET", "/v1/store/tax");
372
+ }
365
373
  /**
366
374
  * Preview a sync from this store's other version (test or live) into this store. Nothing changes.
367
375
  * Syncs cover products, prices, images, collections, discounts and shipping/email settings; never orders, keys, Stripe, site URLs or stock counts.
package/dist/types.d.ts CHANGED
@@ -89,6 +89,8 @@ export interface VariantFulfillment {
89
89
  }
90
90
  export type ProductCreateParams = {
91
91
  name: string;
92
+ /** Stripe Tax category, e.g. "txcd_30011000" (clothing). Defaults to the store's default_tax_code. */
93
+ tax_code?: string | null;
92
94
  /** Default artwork for every variant — artwork is usually per design, not per size. */
93
95
  print_files?: PrintFile[];
94
96
  description?: string;
@@ -107,6 +109,8 @@ export type ProductCreateParams = {
107
109
  variants?: never;
108
110
  });
109
111
  export interface ProductUpdateParams {
112
+ /** Stripe Tax category; null falls back to the store's default_tax_code. */
113
+ tax_code?: string | null;
110
114
  name?: string;
111
115
  print_files?: PrintFile[] | null;
112
116
  description?: string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "commerceforai",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Commerce for apps built by AI. Products, inventory, checkout and orders on top of your Stripe account.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",