brainerce 2.3.0 → 2.4.0

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.mts CHANGED
@@ -3401,8 +3401,20 @@ interface TaxBreakdownItem {
3401
3401
  * ```
3402
3402
  */
3403
3403
  interface TaxBreakdown {
3404
- /** Subtotal before tax */
3404
+ /**
3405
+ * Subtotal before tax — and it INCLUDES the shipping net.
3406
+ *
3407
+ * Rendering `subtotal + shipping + tax` therefore counts shipping twice. Use
3408
+ * `subtotal - shippingNet` for a goods-only row beside a separate shipping
3409
+ * line, or the three rows will not add up to the total you are charging.
3410
+ */
3405
3411
  subtotal: number;
3412
+ /**
3413
+ * The shipping net already counted inside `subtotal`. Zero when there is no
3414
+ * shipping. Subtract this rather than the gross `shippingAmount`: they differ
3415
+ * whenever shipping is taxed.
3416
+ */
3417
+ shippingNet?: number;
3406
3418
  /** Total tax amount */
3407
3419
  totalTax: number;
3408
3420
  /** Total including tax */
@@ -13522,7 +13534,7 @@ declare class BrainerceError extends Error {
13522
13534
  constructor(message: string, statusCode: number, details?: unknown);
13523
13535
  }
13524
13536
 
13525
- declare const SDK_VERSION = "2.3.0";
13537
+ declare const SDK_VERSION = "2.4.0";
13526
13538
 
13527
13539
  /**
13528
13540
  * Verify a webhook signature from Brainerce
package/dist/index.d.ts CHANGED
@@ -3401,8 +3401,20 @@ interface TaxBreakdownItem {
3401
3401
  * ```
3402
3402
  */
3403
3403
  interface TaxBreakdown {
3404
- /** Subtotal before tax */
3404
+ /**
3405
+ * Subtotal before tax — and it INCLUDES the shipping net.
3406
+ *
3407
+ * Rendering `subtotal + shipping + tax` therefore counts shipping twice. Use
3408
+ * `subtotal - shippingNet` for a goods-only row beside a separate shipping
3409
+ * line, or the three rows will not add up to the total you are charging.
3410
+ */
3405
3411
  subtotal: number;
3412
+ /**
3413
+ * The shipping net already counted inside `subtotal`. Zero when there is no
3414
+ * shipping. Subtract this rather than the gross `shippingAmount`: they differ
3415
+ * whenever shipping is taxed.
3416
+ */
3417
+ shippingNet?: number;
3406
3418
  /** Total tax amount */
3407
3419
  totalTax: number;
3408
3420
  /** Total including tax */
@@ -13522,7 +13534,7 @@ declare class BrainerceError extends Error {
13522
13534
  constructor(message: string, statusCode: number, details?: unknown);
13523
13535
  }
13524
13536
 
13525
- declare const SDK_VERSION = "2.3.0";
13537
+ declare const SDK_VERSION = "2.4.0";
13526
13538
 
13527
13539
  /**
13528
13540
  * Verify a webhook signature from Brainerce
package/dist/index.js CHANGED
@@ -204,7 +204,7 @@ function isDevGuardsEnabled() {
204
204
  }
205
205
 
206
206
  // src/version.ts
207
- var SDK_VERSION = "2.3.0";
207
+ var SDK_VERSION = "2.4.0";
208
208
 
209
209
  // src/client.ts
210
210
  var DEFAULT_BASE_URL = "https://api.brainerce.com";
package/dist/index.mjs CHANGED
@@ -115,7 +115,7 @@ function isDevGuardsEnabled() {
115
115
  }
116
116
 
117
117
  // src/version.ts
118
- var SDK_VERSION = "2.3.0";
118
+ var SDK_VERSION = "2.4.0";
119
119
 
120
120
  // src/client.ts
121
121
  var DEFAULT_BASE_URL = "https://api.brainerce.com";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brainerce",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
4
4
  "description": "Official SDK for building e-commerce storefronts with Brainerce Platform. Perfect for vibe-coded sites, AI-built stores (Cursor, Lovable, v0), and custom storefronts.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",