@usethrottle/cart 3.6.0 → 3.8.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/README.md CHANGED
@@ -96,7 +96,7 @@ const { checkoutUrl } = await cart.checkout({
96
96
  ```
97
97
 
98
98
  The opaque `cart_…` session id is scoped to exactly one cart. See the
99
- [cart sessions guide](https://docs.usethrottle.dev/developers/cart-sessions).
99
+ [cart sessions guide](https://usethrottle.dev/docs/developers/cart-sessions).
100
100
 
101
101
  ## Net-N invoice terms
102
102
 
package/dist/index.d.cts CHANGED
@@ -11,6 +11,8 @@ export { ThrottleError, isThrottleError } from '@usethrottle/errors';
11
11
  interface CartAddress {
12
12
  firstName?: string;
13
13
  lastName?: string;
14
+ /** Business name. Optional — B2B addresses use it, B2C addresses omit it. */
15
+ company?: string;
14
16
  addressLine1: string;
15
17
  addressLine2?: string;
16
18
  city: string;
@@ -26,6 +28,8 @@ interface Cart {
26
28
  workspaceId: string;
27
29
  applicationId: string;
28
30
  customerId: string | null;
31
+ /** Lightweight captured email (no full customer record), or null. */
32
+ customerEmail: string | null;
29
33
  status: 'open' | 'checkout' | 'converted' | 'abandoned';
30
34
  currency: string;
31
35
  subtotal: number;
@@ -113,12 +117,16 @@ interface CartEvent {
113
117
  interface CreateCartInput {
114
118
  applicationId: string;
115
119
  customerId?: string;
120
+ /** Optional lightweight email capture (no full customer record required). */
121
+ customerEmail?: string;
116
122
  currency?: string;
117
123
  netN?: number | null;
118
124
  metadata?: Record<string, unknown>;
119
125
  }
120
126
  interface UpdateCartInput {
121
127
  customerId?: string;
128
+ /** Lightweight email capture; `null` clears a previously-set value. */
129
+ customerEmail?: string | null;
122
130
  billingAddress?: CartAddress;
123
131
  shippingAddress?: CartAddress;
124
132
  notes?: string;
package/dist/index.d.ts CHANGED
@@ -11,6 +11,8 @@ export { ThrottleError, isThrottleError } from '@usethrottle/errors';
11
11
  interface CartAddress {
12
12
  firstName?: string;
13
13
  lastName?: string;
14
+ /** Business name. Optional — B2B addresses use it, B2C addresses omit it. */
15
+ company?: string;
14
16
  addressLine1: string;
15
17
  addressLine2?: string;
16
18
  city: string;
@@ -26,6 +28,8 @@ interface Cart {
26
28
  workspaceId: string;
27
29
  applicationId: string;
28
30
  customerId: string | null;
31
+ /** Lightweight captured email (no full customer record), or null. */
32
+ customerEmail: string | null;
29
33
  status: 'open' | 'checkout' | 'converted' | 'abandoned';
30
34
  currency: string;
31
35
  subtotal: number;
@@ -113,12 +117,16 @@ interface CartEvent {
113
117
  interface CreateCartInput {
114
118
  applicationId: string;
115
119
  customerId?: string;
120
+ /** Optional lightweight email capture (no full customer record required). */
121
+ customerEmail?: string;
116
122
  currency?: string;
117
123
  netN?: number | null;
118
124
  metadata?: Record<string, unknown>;
119
125
  }
120
126
  interface UpdateCartInput {
121
127
  customerId?: string;
128
+ /** Lightweight email capture; `null` clears a previously-set value. */
129
+ customerEmail?: string | null;
122
130
  billingAddress?: CartAddress;
123
131
  shippingAddress?: CartAddress;
124
132
  notes?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usethrottle/cart",
3
- "version": "3.6.0",
3
+ "version": "3.8.0",
4
4
  "description": "Typed REST client for the Throttle Cart API.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",