brainerce 1.51.0 → 1.53.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.ts CHANGED
@@ -1522,6 +1522,30 @@ interface Order {
1522
1522
  shippedAt?: string | null;
1523
1523
  /** ISO-8601 timestamp when the order was delivered. */
1524
1524
  deliveredAt?: string | null;
1525
+ /**
1526
+ * The live carrier service the shopper chose and was charged for at
1527
+ * checkout. Admin reads only (`getOrder` / `getOrders`); the buyer-facing
1528
+ * order endpoints never return it.
1529
+ *
1530
+ * `null` when no live carrier rate was sold — flat-rate or zone shipping,
1531
+ * pickup, or an imported order. Use it to re-find the service the shopper
1532
+ * paid for in a fresh quote from {@link BrainerceClient.getOrderShippingRates}
1533
+ * before buying a label: match on `carrier` + `service`, case- and
1534
+ * whitespace-insensitively. The rate id itself is not carried, because it
1535
+ * names a shipment the carrier created at quote time and does not survive a
1536
+ * re-quote.
1537
+ */
1538
+ shippingSelection?: {
1539
+ /** Carrier code as the carrier reported it, e.g. `"USPS"`. */
1540
+ carrier: string | null;
1541
+ /** Service code as the carrier reported it, e.g. `"Priority"`. */
1542
+ service: string | null;
1543
+ /** The label the shopper actually saw, e.g. `"USPS Priority Mail"`. */
1544
+ methodName: string | null;
1545
+ /** Shipping charged at checkout, in the order's `currency`. `"0"` when a
1546
+ * free-shipping threshold zeroed it — the shopper still chose the service. */
1547
+ amount: string | null;
1548
+ } | null;
1525
1549
  /** Status timeline entries in chronological order. */
1526
1550
  statusHistory?: OrderStatusChange[] | null;
1527
1551
  }
@@ -2278,6 +2302,13 @@ interface Cart {
2278
2302
  currency: string;
2279
2303
  /** Optional notes on the cart */
2280
2304
  notes?: string | null;
2305
+ /**
2306
+ * GA4 gtag.js stitch ids, if the storefront forwarded them (via
2307
+ * `loadGoogleAnalytics()` or manually). Used server-side to join a
2308
+ * server-sent purchase conversion to this browser's GA4 session.
2309
+ */
2310
+ analyticsClientId?: string | null;
2311
+ analyticsSessionId?: string | null;
2281
2312
  /**
2282
2313
  * Cart subtotal as a string (e.g., "59.98").
2283
2314
  * Use parseFloat() for calculations.
@@ -2327,12 +2358,33 @@ interface Cart {
2327
2358
  */
2328
2359
  reservation?: ReservationInfo;
2329
2360
  }
2361
+ interface CreateCartOptions {
2362
+ /** Existing session token to re-attach to (rare — usually omit and let the server mint one). */
2363
+ sessionToken?: string;
2364
+ /** Customer id to associate the cart with (admin / server-to-server callers only). */
2365
+ customerId?: string;
2366
+ /**
2367
+ * GA4 gtag.js stitch ids. Auto-attached by the SDK when
2368
+ * `loadGoogleAnalytics()` has resolved them; pass explicitly to override.
2369
+ */
2370
+ analyticsClientId?: string;
2371
+ analyticsSessionId?: string;
2372
+ }
2330
2373
  interface AddToCartDto {
2331
2374
  productId: string;
2332
2375
  variantId?: string;
2333
2376
  quantity: number;
2334
2377
  notes?: string;
2335
2378
  metadata?: Record<string, unknown>;
2379
+ /**
2380
+ * GA4 gtag.js `client_id` (from `gtag('get', measurementId, 'client_id', cb)`).
2381
+ * Auto-attached by the SDK when `loadGoogleAnalytics()` has resolved one;
2382
+ * pass explicitly to override. Omit if unavailable — never send a
2383
+ * synthesized id.
2384
+ */
2385
+ analyticsClientId?: string;
2386
+ /** GA4 gtag.js `session_id`, forwarded alongside `analyticsClientId`. */
2387
+ analyticsSessionId?: string;
2336
2388
  /**
2337
2389
  * Modifier-group selections for restaurant / customizable products
2338
2390
  * (e.g., toppings, sauces, sides). The server validates against effective
@@ -2785,6 +2837,29 @@ interface ShippingRate {
2785
2837
  carrier?: string;
2786
2838
  /** Service level (e.g., "ground", "express") - only for carrier rates */
2787
2839
  service?: string;
2840
+ /**
2841
+ * Where this rate sits among the live carrier options.
2842
+ *
2843
+ * **Render this and `estimatedDays`, not `name`.** A shopper chooses between
2844
+ * how fast and how much; `name` carries the carrier's own service identifier
2845
+ * — `USPS ExpressMailInternational`, `USAExportPBA USAExportStandard` — which
2846
+ * tells them nothing. Label the tiers in your own words and locale:
2847
+ *
2848
+ * ```typescript
2849
+ * const label = {
2850
+ * cheapest: 'Standard delivery',
2851
+ * balanced: 'Express delivery',
2852
+ * fastest: 'Priority delivery',
2853
+ * }[rate.speedTier ?? 'cheapest'];
2854
+ * ```
2855
+ *
2856
+ * Derived per quote rather than mapped from service names, so a carrier you
2857
+ * have never heard of tiers correctly with no lookup table.
2858
+ *
2859
+ * Absent on manual zone rates — the merchant named those deliberately, and
2860
+ * you should show their name as written.
2861
+ */
2862
+ speedTier?: 'cheapest' | 'balanced' | 'fastest';
2788
2863
  }
2789
2864
  /**
2790
2865
  * Pickup location details for local pickup orders.
@@ -3054,6 +3129,12 @@ interface SetCheckoutCustomerDto {
3054
3129
  * Send an empty string to clear a previously-set note.
3055
3130
  */
3056
3131
  notes?: string;
3132
+ /**
3133
+ * GA4 gtag.js stitch ids. Auto-attached by the SDK when
3134
+ * `loadGoogleAnalytics()` has resolved them; pass explicitly to override.
3135
+ */
3136
+ analyticsClientId?: string;
3137
+ analyticsSessionId?: string;
3057
3138
  }
3058
3139
  /**
3059
3140
  * Shipping address with customer email (required for checkout).
@@ -3081,6 +3162,49 @@ interface SetShippingAddressDto {
3081
3162
  * the dashboard and included in the confirmation email. Max 2000 chars.
3082
3163
  */
3083
3164
  notes?: string;
3165
+ /**
3166
+ * GA4 gtag.js stitch ids. Auto-attached by the SDK when
3167
+ * `loadGoogleAnalytics()` has resolved them; pass explicitly to override.
3168
+ */
3169
+ analyticsClientId?: string;
3170
+ analyticsSessionId?: string;
3171
+ /**
3172
+ * The `placeId` of the autocomplete suggestion the shopper picked (from
3173
+ * `addressAutocomplete()`). Send it whenever the address came from the
3174
+ * autocomplete.
3175
+ *
3176
+ * The server re-resolves it to exact rooftop coordinates and matches
3177
+ * polygon ("draw on map") shipping zones against those. Without it, zone
3178
+ * matching falls back to geocoding the address lines, which is materially
3179
+ * less accurate — a same-named street in a neighbouring city can outrank
3180
+ * the right one, putting the shopper in the wrong zone or in none at all.
3181
+ * If your store uses polygon zones, passing this is the difference between
3182
+ * reliable and roughly-right delivery pricing.
3183
+ *
3184
+ * **Clear it if the shopper edits any address field after picking.** The
3185
+ * coordinates belong to the suggestion, not to whatever is in the inputs
3186
+ * now — a stale `placeId` would match zones against the address they
3187
+ * originally picked. Dropping it falls back to geocoding the edited text,
3188
+ * which is the correct behaviour once the two no longer agree.
3189
+ *
3190
+ * Note there is deliberately no `lat`/`lng` field: zone matching decides
3191
+ * which shipping rate is offered and charged, so the server resolves the
3192
+ * coordinates itself from this `placeId` and never accepts them from the
3193
+ * client. You can still spread `getAddressDetails().address` in here — the
3194
+ * SDK drops its `lat`/`lng`/`formattedAddress` before sending, because the
3195
+ * endpoint rejects any unknown property with a `400` that would otherwise
3196
+ * block checkout entirely.
3197
+ */
3198
+ placeId?: string;
3199
+ /**
3200
+ * The same `sessionToken` you passed to `addressAutocomplete()` for the
3201
+ * calls that produced `placeId`. Optional — the resolved place is cached
3202
+ * server-side for 24h by `placeId`, so the normal
3203
+ * autocomplete → `getAddressDetails()` → here flow hits that cache. Pass it
3204
+ * when you have it so a cache miss still bills within the original
3205
+ * autocomplete session instead of opening a new one.
3206
+ */
3207
+ placeSessionToken?: string;
3084
3208
  }
3085
3209
  /**
3086
3210
  * Billing address (email not required - already set in shipping address)
@@ -3168,11 +3292,44 @@ interface AddressDetailsResult {
3168
3292
  */
3169
3293
  region: string;
3170
3294
  postalCode: string;
3295
+ /**
3296
+ * ISO-3166-1 alpha-2, or **an empty string** — Google omits the country
3297
+ * outright for places whose sovereignty it declines to attribute, which in
3298
+ * practice includes ordinary residential addresses (verified live: Ramat
3299
+ * Shlomo, Giv'at Ze'ev, Modi'in Ilit, Ma'ale Adumim all come back with no
3300
+ * country). The API deliberately does not guess one.
3301
+ *
3302
+ * Treat it exactly like `region`: when it's empty, leave your country
3303
+ * field for the shopper to confirm rather than submitting a blank
3304
+ * `SetShippingAddressDto.country`. Everything else on the address
3305
+ * (`line1`, `city`, `lat`/`lng`, `formattedAddress`) is still valid and
3306
+ * should still be filled in.
3307
+ *
3308
+ * Note that `region` is necessarily empty too whenever this is — region
3309
+ * codes are resolved *within* a country, so with no country there is no
3310
+ * region list to match against. Prompt for both.
3311
+ */
3171
3312
  country: string;
3313
+ /**
3314
+ * Resolved coordinates, **for your own use only** — a map pin, a distance
3315
+ * readout. They are not part of any address payload: zone matching decides
3316
+ * which shipping rate is offered and charged, so the server re-resolves
3317
+ * them from `placeId` instead of trusting the client. Sending them is
3318
+ * harmless (the SDK strips `lat`/`lng`/`formattedAddress` from
3319
+ * `setShippingAddress()` / `setBillingAddress()` bodies), but pass
3320
+ * `placeId` — that is what actually reaches zone matching.
3321
+ */
3172
3322
  lat: number;
3173
3323
  lng: number;
3174
3324
  formattedAddress: string;
3175
3325
  };
3326
+ /**
3327
+ * Soft coverage hint, never a rejection. Note it can read `false` purely
3328
+ * because `country` came back empty and the store's zones are country-listed
3329
+ * — a polygon zone can still match this address, since the server matches it
3330
+ * against the coordinates it resolves from `placeId`. Show a "we'll confirm
3331
+ * by phone" banner; do not block the shopper.
3332
+ */
3176
3333
  inZone: boolean;
3177
3334
  }
3178
3335
  interface CompleteCheckoutResponse {
@@ -3335,9 +3492,29 @@ interface UpdateOrderShippingDto {
3335
3492
  phone?: string;
3336
3493
  }
3337
3494
  interface FulfillOrderDto {
3495
+ /** Carrier tracking number. Send an empty string to clear a wrong one. */
3338
3496
  trackingNumber?: string;
3497
+ /** Carrier name/code shown to the shopper (`ups`, `Israel Post`, …). */
3339
3498
  trackingCompany?: string;
3499
+ /**
3500
+ * Absolute `http(s)` link to the carrier's tracking page. The shipped email
3501
+ * only renders its "Track Your Order" button when this is present — a bare
3502
+ * tracking number gives the shopper nothing to click. Any other scheme is
3503
+ * rejected.
3504
+ */
3505
+ trackingUrl?: string;
3506
+ /**
3507
+ * Email the shopper. Defaults to `true` on a first fulfilment and to
3508
+ * `false` when correcting the tracking of an order that already shipped.
3509
+ */
3340
3510
  notifyCustomer?: boolean;
3511
+ /**
3512
+ * Ship an order whose payment was never confirmed — COD, bank transfer,
3513
+ * net terms, or an order created through the API. Without it those orders
3514
+ * are refused, and there is no other way to mark them paid. `CANCELLED`,
3515
+ * `REFUNDED` and voided orders are still refused regardless.
3516
+ */
3517
+ allowUnpaidFulfillment?: boolean;
3341
3518
  }
3342
3519
  interface CompleteDraftDto {
3343
3520
  paymentPending?: boolean;
@@ -6097,6 +6274,12 @@ interface BrainerceApiError {
6097
6274
  details?: unknown;
6098
6275
  }
6099
6276
 
6277
+ declare global {
6278
+ interface Window {
6279
+ dataLayer?: unknown[];
6280
+ gtag?: (...args: unknown[]) => void;
6281
+ }
6282
+ }
6100
6283
  /**
6101
6284
  * BCP-47 primary subtags whose script is written right-to-left. Inlined in the
6102
6285
  * SDK so storefronts don't take a runtime dependency on `@brainerce/types`.
@@ -6155,6 +6338,16 @@ declare class BrainerceClient {
6155
6338
  * so the recovered cart shows up with zero per-store code.
6156
6339
  */
6157
6340
  private _pendingRecoverCartId;
6341
+ private _ga4MeasurementId;
6342
+ private _ga4StitchPromise;
6343
+ /**
6344
+ * Fields present on `getAddressDetails().address` that the address endpoints
6345
+ * do NOT accept — stripped by `stripResolvedOnlyAddressFields()` so a
6346
+ * `{ ...address }` spread doesn't 400 the whole checkout.
6347
+ */
6348
+ private static readonly RESOLVED_ONLY_ADDRESS_FIELDS;
6349
+ /** One warning per client, not per keystroke-driven address submit. */
6350
+ private _warnedResolvedOnlyAddressFields;
6158
6351
  /** localStorage key for session cart reference (sessionToken + cartId) */
6159
6352
  private readonly SESSION_CART_KEY;
6160
6353
  /**
@@ -6228,10 +6421,19 @@ declare class BrainerceClient {
6228
6421
  * Set the customer authentication token (obtained from login/register).
6229
6422
  * Required for accessing customer-specific data in storefront mode.
6230
6423
  *
6424
+ * This is a plain setter — it authenticates subsequent requests and nothing
6425
+ * else. In particular it does NOT attach the shopper's existing guest cart to
6426
+ * their account. Pair every sign-in with {@link syncCartOnLogin}, or the cart
6427
+ * stays anonymous and every feature keyed on buyer identity degrades quietly:
6428
+ * "first order only" discounts keep applying to returning customers,
6429
+ * per-customer usage caps stop being enforced at cart time, and abandoned-cart
6430
+ * recovery can't identify who to email.
6431
+ *
6231
6432
  * @example
6232
6433
  * ```typescript
6233
6434
  * const auth = await client.loginCustomer('user@example.com', 'password');
6234
6435
  * client.setCustomerToken(auth.token);
6436
+ * await client.syncCartOnLogin(); // claim the guest cart for this account
6235
6437
  *
6236
6438
  * // Now can access customer data
6237
6439
  * const profile = await client.getMyProfile();
@@ -6325,6 +6527,76 @@ declare class BrainerceClient {
6325
6527
  * omits credentials (cookieless), and never throws.
6326
6528
  */
6327
6529
  private sendAnalyticsBeacon;
6530
+ /**
6531
+ * Load GA4's `gtag.js` and start resolving the `client_id`/`session_id`
6532
+ * "stitch" ids Google needs to join a later server-side purchase conversion
6533
+ * to this browser's GA4 session (without them, a server-sent purchase event
6534
+ * either gets rejected or creates a phantom user in GA4). Call this once,
6535
+ * as early as possible (app entry / root layout).
6536
+ *
6537
+ * `createCart()`, `addToCart()`, `setCheckoutCustomer()`, and
6538
+ * `setShippingAddress()` all auto-attach the resolved ids once available —
6539
+ * an explicit `analyticsClientId`/`analyticsSessionId` you pass to any of
6540
+ * those always wins over the auto-captured value. You only need to call
6541
+ * this once; every subsequent cart/checkout call benefits automatically.
6542
+ *
6543
+ * Ids are resolved via `gtag('get', measurementId, 'client_id' | 'session_id', cb)`
6544
+ * — Google's documented method — never by parsing the `_ga` cookie, which
6545
+ * is undocumented and breaks silently across cookie-format changes and
6546
+ * Consent Mode v2 states. If the shopper has denied analytics consent,
6547
+ * gtag reports no client_id and the ids are simply omitted — never
6548
+ * synthesized.
6549
+ *
6550
+ * No-op outside the browser (SSR-safe) and never throws — a blocked or
6551
+ * slow gtag just means server-side conversions won't stitch; it never
6552
+ * breaks the storefront or delays checkout by more than `options.timeoutMs`.
6553
+ *
6554
+ * @example
6555
+ * ```typescript
6556
+ * // Call once, e.g. in your root layout / app entry point
6557
+ * client.loadGoogleAnalytics('G-XXXXXXX');
6558
+ *
6559
+ * // Every cart/checkout call from here on auto-forwards the stitch ids —
6560
+ * // no other code changes needed.
6561
+ * const cart = await client.createCart();
6562
+ * await client.addToCart(cart.id, { productId: 'prod_abc', quantity: 1 });
6563
+ * ```
6564
+ */
6565
+ loadGoogleAnalytics(measurementId: string, options?: {
6566
+ timeoutMs?: number;
6567
+ }): void;
6568
+ /**
6569
+ * Resolve GA4's `client_id`/`session_id` via `gtag('get', ...)`, bounded by
6570
+ * `timeoutMs` so a slow/blocked gtag never hangs a cart/checkout call.
6571
+ * Resolves to `{}` (never rejects) on timeout, missing gtag, or denied
6572
+ * consent.
6573
+ */
6574
+ private resolveGa4StitchIds;
6575
+ /**
6576
+ * Merge the resolved GA4 stitch ids onto a request body — only for fields
6577
+ * the caller didn't already set explicitly (explicit values always win).
6578
+ * No-op (returns `dto` unchanged) if `loadGoogleAnalytics()` was never
6579
+ * called, or if it hasn't resolved any ids by the time this is awaited.
6580
+ */
6581
+ private withAnalyticsStitchIds;
6582
+ /**
6583
+ * Drop the fields `getAddressDetails()` returns that no address endpoint
6584
+ * accepts, so spreading its `address` straight into `setShippingAddress()`
6585
+ * / `setBillingAddress()` works instead of failing the whole request.
6586
+ *
6587
+ * The address endpoints validate against a strict allow-list: ONE unknown
6588
+ * property rejects the call with `400 "property lat should not exist"`, and
6589
+ * the shopper cannot check out at all. `lat`/`lng`/`formattedAddress` are
6590
+ * the only realistic way to hit that — they come out of this SDK's own
6591
+ * resolved-address shape, so this SDK cleans up after itself rather than
6592
+ * making every storefront remember to. Nothing else is stripped: a genuine
6593
+ * typo still reaches the server and still fails loudly.
6594
+ *
6595
+ * Coordinates are dropped rather than forwarded because zone matching picks
6596
+ * which shipping rate is offered and charged — the server resolves them
6597
+ * itself from `placeId`, and never takes them from the caller.
6598
+ */
6599
+ private stripResolvedOnlyAddressFields;
6328
6600
  /**
6329
6601
  * Get a list of products with pagination and filtering
6330
6602
  * Works in vibe-coded, storefront (public), and admin mode
@@ -6768,13 +7040,23 @@ declare class BrainerceClient {
6768
7040
  updateOrderShipping(orderId: string, data: UpdateOrderShippingDto): Promise<Order>;
6769
7041
  /**
6770
7042
  * Create a shipping label for an order via the installed App Store shipping app.
6771
- * Pass the rate ID returned from checkout rate shopping. Billing goes directly
6772
- * to the merchant's carrier account Brainerce is not a billing intermediary.
7043
+ * Pass the rate ID returned from rate shopping treat it as opaque and never
7044
+ * parse it. Billing goes directly to the merchant's carrier account; Brainerce
7045
+ * is not a billing intermediary.
7046
+ *
7047
+ * `labelFormat` defaults to `PDF`. Use `ZPL` or `EPL` for warehouse thermal
7048
+ * printers. If the carrier cannot produce the requested format it returns its
7049
+ * closest match rather than failing the purchase — check the response.
7050
+ *
7051
+ * Once the label exists, tracking updates arrive automatically: the carrier's
7052
+ * webhooks move the shipment through in-transit → delivered and complete the
7053
+ * order. No polling required.
6773
7054
  *
6774
7055
  * @example
6775
7056
  * ```typescript
6776
7057
  * const label = await client.createShippingLabel('order_abc', {
6777
7058
  * rateId: 'rate_8f123456789abcdef',
7059
+ * labelFormat: 'ZPL',
6778
7060
  * });
6779
7061
  * console.log('Label URL:', label.labelUrl);
6780
7062
  * console.log('Tracking:', label.trackingNumber);
@@ -6783,12 +7065,83 @@ declare class BrainerceClient {
6783
7065
  createShippingLabel(orderId: string, data: {
6784
7066
  rateId: string;
6785
7067
  parcel?: Record<string, string>;
7068
+ labelFormat?: 'PDF' | 'PNG' | 'ZPL' | 'EPL';
7069
+ /**
7070
+ * Cross-border only. The declaration itself is built from the order's
7071
+ * line items; this just says what the parcel is. Ignored domestically.
7072
+ */
7073
+ customsContentsType?: 'merchandise' | 'gift' | 'documents' | 'sample' | 'return';
6786
7074
  }): Promise<{
6787
7075
  shipmentId: string;
6788
7076
  labelUrl: string;
6789
7077
  trackingNumber: string;
6790
7078
  carrier: string;
7079
+ labelFormat?: string;
6791
7080
  }>;
7081
+ /**
7082
+ * Live carrier rates for an order, from the merchant's installed shipping app.
7083
+ *
7084
+ * Call this immediately before {@link createShippingLabel} and pass the chosen
7085
+ * `id` straight through — the id is opaque and must not be parsed. It is also
7086
+ * short-lived: this call is what creates the shipment at the carrier, so a
7087
+ * rate from an old call may no longer be purchasable.
7088
+ *
7089
+ * Returns `[]` when the store has no shipping app installed, or when the
7090
+ * order has no usable shipping address.
7091
+ *
7092
+ * @example
7093
+ * ```typescript
7094
+ * const rates = await client.getOrderShippingRates('order_abc');
7095
+ * const cheapest = rates[0];
7096
+ * const label = await client.createShippingLabel('order_abc', { rateId: cheapest.id });
7097
+ * ```
7098
+ */
7099
+ getOrderShippingRates(orderId: string): Promise<Array<{
7100
+ id: string;
7101
+ name: string;
7102
+ description: string | null;
7103
+ price: string;
7104
+ currency: string;
7105
+ estimatedDays: number | null;
7106
+ carrier: string | null;
7107
+ service: string | null;
7108
+ }>>;
7109
+ /**
7110
+ * Shipments recorded for an order, each with its tracking history.
7111
+ *
7112
+ * History arrives on its own: the carrier's webhooks flow through the
7113
+ * installed shipping app and append events as the parcel moves. Poll this for
7114
+ * display if you need it; do not poll expecting to *drive* anything.
7115
+ */
7116
+ getOrderShipments(orderId: string): Promise<Array<{
7117
+ id: string;
7118
+ carrier: string;
7119
+ service: string | null;
7120
+ status: string;
7121
+ trackingNumber: string | null;
7122
+ trackingUrl: string | null;
7123
+ labelUrl: string | null;
7124
+ labelFormat: string | null;
7125
+ estimatedDeliveryDate: string | null;
7126
+ actualDeliveryDate: string | null;
7127
+ /** What the carrier charged the merchant, in `rateCurrency`. */
7128
+ rate: string | null;
7129
+ rateCurrency: string;
7130
+ createdAt: string;
7131
+ /** Newest first, capped at the 200 most recent. */
7132
+ events: Array<{
7133
+ status: string;
7134
+ statusDetail: string | null;
7135
+ message: string;
7136
+ location: {
7137
+ city?: string;
7138
+ state?: string;
7139
+ country?: string;
7140
+ zip?: string;
7141
+ } | null;
7142
+ occurredAt: string;
7143
+ }>;
7144
+ }>>;
6792
7145
  /**
6793
7146
  * Cancel an order
6794
7147
  * Works for Shopify and WooCommerce orders that haven't been fulfilled
@@ -6801,16 +7154,31 @@ declare class BrainerceClient {
6801
7154
  */
6802
7155
  cancelOrder(orderId: string): Promise<Order>;
6803
7156
  /**
6804
- * Fulfill an order (mark as shipped)
6805
- * Works for Shopify and WooCommerce orders
7157
+ * Fulfill an order (mark as shipped), or correct the tracking of an order
7158
+ * that has already shipped.
7159
+ *
7160
+ * Pass `trackingUrl` alongside the number — the shipped email only renders
7161
+ * its "Track Your Order" button when a URL is present.
7162
+ *
7163
+ * Calling this again on an order that is already `SHIPPED`/`FULFILLED` with
7164
+ * tracking fields edits only those fields: the status does not move, the
7165
+ * ship date is not rewritten, and no fulfilment event fires. That is the way
7166
+ * to fix a mistyped tracking number.
6806
7167
  *
6807
7168
  * @example
6808
7169
  * ```typescript
6809
- * const order = await client.fulfillOrder('order_123', {
7170
+ * // First fulfilment emails the shopper by default.
7171
+ * await client.fulfillOrder('order_123', {
6810
7172
  * trackingNumber: '1Z999AA10123456784',
6811
7173
  * trackingCompany: 'UPS',
7174
+ * trackingUrl: 'https://www.ups.com/track?tracknum=1Z999AA10123456784',
6812
7175
  * notifyCustomer: true,
6813
7176
  * });
7177
+ *
7178
+ * // Correction — silent unless you opt back in.
7179
+ * await client.fulfillOrder('order_123', {
7180
+ * trackingNumber: '1Z999AA10123456785',
7181
+ * });
6814
7182
  * ```
6815
7183
  */
6816
7184
  fulfillOrder(orderId: string, data?: FulfillOrderDto): Promise<Order>;
@@ -7314,11 +7682,25 @@ declare class BrainerceClient {
7314
7682
  *
7315
7683
  * @param provider - OAuth provider ('GOOGLE', 'FACEBOOK', 'GITHUB')
7316
7684
  * @param options - Optional configuration
7317
- * @param options.redirectUrl - Full absolute URL to redirect to after OAuth completes (must include origin)
7318
- *
7319
- * @example
7320
- * ```typescript
7321
- * // Get authorization URL (redirectUrl MUST be absolute with origin)
7685
+ * @param options.redirectUrl - Where to send the browser once OAuth finishes
7686
+ * on success *and* on failure. Validated server-side against the sales
7687
+ * channel's trusted origins, so what is accepted depends on the mode:
7688
+ * - vibe-coded (`salesChannelId: 'vc_*'`): an absolute URL on the channel's
7689
+ * registered `domain` or one of its `allowedOrigins`; in TEST mode, any
7690
+ * `localhost`/`127.0.0.1` port. A relative path (`/auth/callback`) also
7691
+ * works — it is resolved against the channel's `domain` on the way back,
7692
+ * so the channel must have one registered.
7693
+ * - storefront (`storeId`): **social login cannot round-trip in this mode.**
7694
+ * No channel is bound to the request, so an absolute URL has no
7695
+ * trusted-origin list to match (400 at this call) and a relative path has
7696
+ * no origin to resolve against on the way back. Use a `salesChannelId`
7697
+ * connection for OAuth.
7698
+ * Anything invalid fails fast here, before the shopper ever reaches the
7699
+ * provider.
7700
+ *
7701
+ * @example
7702
+ * ```typescript
7703
+ * // Vibe-coded mode — absolute URL on the registered storefront domain
7322
7704
  * const { authorizationUrl } = await client.getOAuthAuthorizeUrl('GOOGLE', {
7323
7705
  * redirectUrl: window.location.origin + '/auth/callback'
7324
7706
  * });
@@ -7333,9 +7715,25 @@ declare class BrainerceClient {
7333
7715
  * if (params.get('oauth_success') === 'true' && params.get('auth_code')) {
7334
7716
  * const result = await client.exchangeOAuthCode(params.get('auth_code')!);
7335
7717
  * client.setCustomerToken(result.token);
7718
+ * // REQUIRED: setCustomerToken only stores the JWT — it does NOT attach the
7719
+ * // guest cart to the account. Without this call the cart stays anonymous,
7720
+ * // and anything keyed on the buyer's identity misbehaves: "first order
7721
+ * // only" discounts re-apply to returning customers, per-customer usage
7722
+ * // caps go unenforced, and abandoned-cart recovery can't reach them.
7723
+ * await client.syncCartOnLogin();
7336
7724
  * // result.customer, result.isNewCustomer, result.redirectUrl, ...
7337
7725
  * } else if (params.get('oauth_error')) {
7338
- * // Show error
7726
+ * // Failures land on this same page, on `redirectUrl` — never on the API
7727
+ * // host. `oauth_error` is a stable snake_case code (see OAuthErrorCode);
7728
+ * // `error_description` is English developer detail, not shopper copy.
7729
+ * const code = params.get('oauth_error') as OAuthErrorCode;
7730
+ * showMessage(
7731
+ * code === 'link_blocked_unverified_password_account'
7732
+ * ? t('auth.verifyEmailFirst') // send them to email verification
7733
+ * : code === 'state_expired'
7734
+ * ? t('auth.sessionExpiredRetry')
7735
+ * : t('auth.signInFailed')
7736
+ * );
7339
7737
  * }
7340
7738
  * ```
7341
7739
  */
@@ -7357,6 +7755,11 @@ declare class BrainerceClient {
7357
7755
  *
7358
7756
  * @param authCode - The single-use code from the `?auth_code=` URL param.
7359
7757
  *
7758
+ * Always follow a successful exchange with `syncCartOnLogin()`. Storing the
7759
+ * token does not claim the guest cart, and an unclaimed cart has no buyer
7760
+ * identity — which silently breaks first-order discounts, per-customer usage
7761
+ * caps, and abandoned-cart recovery for everyone who signs in with OAuth.
7762
+ *
7360
7763
  * @example
7361
7764
  * ```typescript
7362
7765
  * const params = new URLSearchParams(window.location.search);
@@ -7365,6 +7768,7 @@ declare class BrainerceClient {
7365
7768
  * const { token, customer, isNewCustomer, redirectUrl } =
7366
7769
  * await client.exchangeOAuthCode(code);
7367
7770
  * client.setCustomerToken(token);
7771
+ * await client.syncCartOnLogin(); // attach the guest cart to the account
7368
7772
  * }
7369
7773
  * ```
7370
7774
  */
@@ -7741,6 +8145,9 @@ declare class BrainerceClient {
7741
8145
  * Create a new cart for a guest user
7742
8146
  * Returns a cart with a sessionToken that identifies this cart
7743
8147
  *
8148
+ * If `loadGoogleAnalytics()` was called and has resolved a GA4 client/session
8149
+ * id, it's auto-attached unless `options` already specifies one.
8150
+ *
7744
8151
  * @example
7745
8152
  * ```typescript
7746
8153
  * const cart = await client.createCart();
@@ -7748,7 +8155,7 @@ declare class BrainerceClient {
7748
8155
  * // Store sessionToken in localStorage or cookie
7749
8156
  * ```
7750
8157
  */
7751
- createCart(): Promise<Cart>;
8158
+ createCart(options?: CreateCartOptions): Promise<Cart>;
7752
8159
  /**
7753
8160
  * Get a cart by session token (for guest users)
7754
8161
  *
@@ -8511,6 +8918,17 @@ declare class BrainerceClient {
8511
8918
  * should include an optional "Order notes" textarea by default and send its
8512
8919
  * value here (or via `setCheckoutCustomer`). The note lands on the order.
8513
8920
  *
8921
+ * **Pass `placeId` whenever the address came from `addressAutocomplete()`.**
8922
+ * The server re-resolves it to exact coordinates and matches polygon
8923
+ * ("draw on map") shipping zones against those instead of re-geocoding the
8924
+ * address text — which is materially less accurate and can place the
8925
+ * shopper in a neighbouring city's zone, or in none at all.
8926
+ *
8927
+ * Spreading `getAddressDetails().address` in here is safe: its `lat`, `lng`
8928
+ * and `formattedAddress` are dropped before the request goes out (the
8929
+ * endpoint rejects unknown properties outright, and coordinates are never
8930
+ * taken from the client — the server resolves them from `placeId`).
8931
+ *
8514
8932
  * @example
8515
8933
  * ```typescript
8516
8934
  * const { checkout, rates } = await client.setShippingAddress('checkout_123', {
@@ -8523,6 +8941,8 @@ declare class BrainerceClient {
8523
8941
  * postalCode: '10001',
8524
8942
  * country: 'US',
8525
8943
  * notes: 'Please leave the package at the door', // optional order notes
8944
+ * placeId: suggestion.placeId, // from addressAutocomplete()
8945
+ * placeSessionToken: sessionToken, // the same token used for it
8526
8946
  * });
8527
8947
  * console.log('Available rates:', rates);
8528
8948
  * ```
@@ -10706,7 +11126,7 @@ declare class BrainerceError extends Error {
10706
11126
  constructor(message: string, statusCode: number, details?: unknown);
10707
11127
  }
10708
11128
 
10709
- declare const SDK_VERSION = "1.51.0";
11129
+ declare const SDK_VERSION = "1.53.0";
10710
11130
 
10711
11131
  /**
10712
11132
  * Verify a webhook signature from Brainerce
@@ -10869,6 +11289,53 @@ interface StoreLocalParts {
10869
11289
  * Falls back to UTC parts on an invalid IANA timezone string — never throws.
10870
11290
  */
10871
11291
  declare function resolveStoreLocalParts(instant: Date, timezone: string): StoreLocalParts;
11292
+ interface ParsedDateFieldValue {
11293
+ /**
11294
+ * The absolute instant the value denotes. For a DATE field this is UTC
11295
+ * midnight of the authored day, matching what `isDateValueAllowed`'s DATE
11296
+ * branch expects.
11297
+ */
11298
+ instant: Date;
11299
+ /**
11300
+ * The canonical form to persist: `"YYYY-MM-DD"` for DATE, an ISO-8601 UTC
11301
+ * instant (`"…Z"`) for DATETIME. Storing this instead of the caller's raw
11302
+ * string is what keeps a column from accumulating `"2026-08-06"`,
11303
+ * `"2026-07-16 10:00"` and `"2026-08-13T13:00-14:00"` side by side.
11304
+ */
11305
+ normalized: string;
11306
+ }
11307
+ /**
11308
+ * Discriminated by a STRING, not a boolean: `apps/backend` compiles with
11309
+ * `strictNullChecks: false`, where TypeScript refuses to narrow a union on a
11310
+ * `true`/`false` literal discriminant, so `if (!result.ok)` would leave every
11311
+ * backend call site unable to reach `.reason`. Do not "simplify" this back to
11312
+ * `ok: boolean`.
11313
+ */
11314
+ type DateFieldParseResult = {
11315
+ status: 'valid';
11316
+ value: ParsedDateFieldValue;
11317
+ } | {
11318
+ status: 'invalid';
11319
+ reason: string;
11320
+ };
11321
+ /**
11322
+ * Strict parse of a customer- or admin-submitted DATE/DATETIME field value.
11323
+ *
11324
+ * Replaces a bare `new Date(raw)`, which is far too permissive for a value that
11325
+ * gets persisted: it accepts implementation-defined shapes, silently reads a
11326
+ * trailing `-14:00` slot label as a UTC offset, and resolves an offsetless
11327
+ * datetime in the *server's* timezone rather than the store's.
11328
+ *
11329
+ * Accepted:
11330
+ * - DATE: `YYYY-MM-DD` only. A time-of-day would be meaningless and, worse,
11331
+ * could shift the authored calendar day, so a datetime is truncated to its
11332
+ * literal date part rather than round-tripped through a timezone.
11333
+ * - DATETIME: `YYYY-MM-DDTHH:mm[:ss[.sss]]` with an optional `Z` or
11334
+ * `±HH:mm` offset (a space may replace the `T`). **Without an offset the
11335
+ * value is resolved in the store's timezone**, the only frame a store-scoped
11336
+ * field has. A date with no time at all means midnight, store-local.
11337
+ */
11338
+ declare function parseDateFieldValue(raw: unknown, fieldType: 'DATE' | 'DATETIME', timezone: string): DateFieldParseResult;
10872
11339
  /** Day-level gate: minDate/maxDate/blockedWeekdays/blockedDates only (no time-of-day). */
10873
11340
  declare function isCalendarDateAllowed(dateYYYYMMDD: string, config: DateAvailabilityConstraints | null | undefined): boolean;
10874
11341
  /**
@@ -10888,6 +11355,19 @@ declare function isCalendarDateAllowed(dateYYYYMMDD: string, config: DateAvailab
10888
11355
  * ```
10889
11356
  */
10890
11357
  declare function computeAvailableSlots(config: DateAvailabilityConstraints | null | undefined, dateYYYYMMDD: string): string[];
11358
+ /**
11359
+ * The open/close windows that apply on one calendar date — `[]` when the date
11360
+ * is blocked outright or the weekday has no window (which, per
11361
+ * `BusinessHoursWindow`'s contract, means closed all day).
11362
+ *
11363
+ * Exists because `computeAvailableSlots` returns `[]` in two very different
11364
+ * situations: "nothing is bookable that day" and "this field isn't slot-based
11365
+ * at all" (`slotDurationMinutes` unset). A storefront rendering a picker needs
11366
+ * to tell those apart — non-empty here with empty slots means "bound a free
11367
+ * time input by these windows", which is exactly what `isDateValueAllowed`
11368
+ * enforces on the way back in.
11369
+ */
11370
+ declare function getBusinessHoursForDate(config: DateAvailabilityConstraints | null | undefined, dateYYYYMMDD: string): BusinessHoursWindow[];
10891
11371
  /**
10892
11372
  * Full value validation for a candidate date/datetime a shopper is about to
10893
11373
  * submit — use this to disable a "Continue" button client-side before the
@@ -11044,4 +11524,4 @@ interface CategorySitemapOptions {
11044
11524
  */
11045
11525
  declare function getCategorySitemapEntries(client: BrainerceClient, opts: CategorySitemapOptions): Promise<SitemapEntry[]>;
11046
11526
 
11047
- export { type AddToCartDto, type AddressDetailsResult, type AddressSuggestion, type AnnouncementContent, type AnnouncementSeverity, type AppliedDiscount, type ApplyCouponDto, type AttachModifierGroupInput, type Attribute, type AttributeOption, type AttributeSource, type BlogSitemapOptions, type BrainerceApiError, BrainerceClient, type BrainerceClientOptions, BrainerceError, type Brand, type BulkInventoryResponse, type BulkSaveVariantsDto, type BulkSaveVariantsResponse, type BulkVariantInput, type BusinessHoursWindow, type Cart, type CartAppliedDiscount, type CartBundleOffer, type CartBundlesResponse, type CartIncludeOption, type CartIncludeOptions, type CartItem, type CartItemModifierLine, type CartNudge, type CartRecommendationsResponse, type CartStatus, type CartUpgradeSuggestion, type CartUpgradesResponse, type CartWithIncludes, type Category, type CategoryDetail, type CategoryNode, type CategorySitemapOptions, type CategorySuggestion, type Checkout, type CheckoutAddress, type CheckoutBumpsResponse, type CheckoutCustomFieldDefinition, type CheckoutFieldPricing, type CheckoutFieldVisibility, type CheckoutLineItem, type CheckoutPrefillData, type CheckoutStatus, type CompleteCheckoutResponse, type CompleteDraftDto, type ConfigureOAuthProviderDto as ConfigureOAuthProviderInput, type ConflictStatus, type ConnectorPlatform, type ContactFormFieldType, type ContactFormFieldValidation, type ContactFormPublic, type ContactFormPublicField, type ContactFormSummary, type Content, type ContentDataMap, type ContentStatus, type ContentSummary, type ContentType, type Coupon, type CouponCreateResponse, type CouponQueryParams, type CouponStatus, type CouponType, type CouponValidationWarning, type CreateAddressDto, type CreateAttributeDto as CreateAttributeInput, type CreateAttributeOptionDto as CreateAttributeOptionInput, type CreateBrandDto as CreateBrandInput, type CreateCategoryDto as CreateCategoryInput, type CreateCheckoutDto, type CreateContentInput, type CreateCouponDto, type CreateCustomApiDto, type CreateCustomerDto, type CreateEmailTemplateDto as CreateEmailTemplateInput, type CreateGuestOrderDto, type CreateInquiryInput, type CreateInquiryResponse, type CreateMetafieldDefinitionDto as CreateMetafieldDefinitionInput, type CreateModifierGroupInput, type CreateModifierInput, type CreateOrderDto, type CreateProductDto, type CreateRefundDto, type CreateShippingRateDto as CreateShippingRateInput, type CreateShippingZoneDto as CreateShippingZoneInput, type CreateTagDto as CreateTagInput, type CreateTaxRateDto as CreateTaxRateInput, type CreateVariantDto, type CustomApiAuthType, type CustomApiConnectionStatus, type CustomApiCredentials, type CustomApiIntegration, type CustomApiSyncConfig, type CustomApiSyncDirection, type CustomApiTestResult, type Customer, type CustomerAddress, type CustomerAuthResponse, type CustomerOAuthProvider, type CustomerProfile, type CustomerQueryParams, type DateAvailabilityConstraints, type DeleteProductResponse, type DiscountBanner, type DiscountRuleType, type DownloadFile, type DraftLineItem, type EditInventoryDto, type EmailDomain, type EmailEventSettings, type EmailEventType, type EmailSettings, type EmailTemplate, type EmailTemplatePreview, type EmailTemplatesResponse, type EmailVerificationResponse, type ExtendReservationResponse, type FaqContent, type FaqItem, type FooterColumn, type FooterContent, type FooterLink, type FooterSocialLink, type FormatPriceOptions, type FormatProductPriceOptions, type FreeAllocationPolicy, type FulfillOrderDto, type GuestCheckoutStartResponse, type GuestOrderResponse, type HeaderContent, type HeaderCta, type HeaderLogo, type HeaderNavItem, type InsufficientStockError, type InventoryInfo, type InventoryReservationStrategy, type InventorySyncStatus, type InventoryTrackingMode, type InvitationStatus, type InviteMemberDto as InviteMemberInput, type InviteStoreMemberDto as InviteStoreMemberInput, type JsonLdOptions, type ListModifierGroupsParams, type LocalCart, type LocalCartItem, type LockedVariant, type LoyaltyNextTierSummary, type LoyaltyReward, type LoyaltyStatus, type LoyaltyTierSummary, type MergeCartsDto, type MetafieldConflict, type MetafieldConflictResolution, type MetafieldDefinition, type MetafieldFilter, type MetafieldFilterValue, type MetafieldFiltersResponse, type MetafieldType, type Modifier, type ModifierGroup, type ModifierSelection, type ModifierSelectionType, type ModifierValidationCode, type ModifierValidationError, type MyProductReview, type OAuthAuthorizeResponse, type OAuthCallbackResponse, type OAuthConnection, type OAuthConnectionsResponse, type OAuthProviderConfig, type OAuthProviderType, type OAuthProvidersResponse, type Order, type OrderAddress, type OrderBump, type OrderCustomer, type OrderDownloadLink, type OrderItem, type OrderQueryParams, type OrderStatus, type OrderStatusChange, type PageContent, type PageSeo, type PaginatedResponse, type PaymentClientSdk, type PaymentConfig, type PaymentIntent, type PaymentProvider, type PaymentProviderConfig, type PaymentProvidersConfig, type PaymentStatus, type PaymentUrlOptions, type PickupLocation, type PlatformCouponCapabilities, type PlatformMetafieldMetadata, type PreviewEmailTemplateDto as PreviewEmailTemplateInput, type Product, type ProductAttributeInput, type ProductAvailability, type ProductCustomizationField, type ProductDiscount, type ProductDiscountBadge, type ProductImage, type ProductMetafield, type ProductMetafieldValue, type ProductModifierGroupAttachment, type ProductQueryParams, type ProductRecommendation, type ProductRecommendationsResponse, type ProductRelationType, type ProductReview, type ProductReviewAdmin, type ProductSuggestion, type ProductVariant, type PublicMetafieldDefinition, type PublishProductResponse, RTL_LOCALES, type RecommendationVariant, type ReconcileInventoryResponse, type RedeemRewardResult, type ReferralInfo, type Refund, type RefundLineItem, type RefundLineItemResponse, type RefundType, type RegisterCustomerDto, type ReservationInfo, type ResolveMetafieldConflictDto as ResolveMetafieldConflictInput, type ResolveSyncConflictDto as ResolveSyncConflictInput, type RichTextContent, SDK_VERSION, type SearchSuggestions, type SelectPickupLocationDto, type SelectShippingMethodDto, type SendInvoiceDto, type SessionCartRef, type SetBillingAddressDto, type SetCheckoutCustomFieldsDto, type SetCheckoutCustomerDto, type SetDefinitionProductsDto as SetDefinitionProductsInput, type SetMetafieldPlatformsDto as SetMetafieldPlatformsInput, type SetShippingAddressDto, type SetShippingAddressResponse, type ShippingDestinations, type ShippingLine, type ShippingRate, type ShippingRateConfig, type ShippingRateType, type ShippingSummaryEntry, type ShippingZone, type ShippingZoneQueryParams, type SitemapEntry, type StockAvailabilityRequest, type StockAvailabilityResponse, type StockAvailabilityResult, type StoreInfo, type StoreInvitation, type StoreInvitationDetails, type StoreMember, type StorePermission, type StoreRole, type StoreTeamResponse, type SubmitProductReviewInput, type SupportedLocaleObject, type SyncConflict, type SyncConflictResolution, type SyncJob, type Tag, type TaxBreakdown, type TaxBreakdownItem, type TaxRate, type TaxonomyQueryParams, type TeamInvitation, type TeamInvitationsResponse, type TeamMember, type TeamMembersResponse, type TeamRole, type UpdateAddressDto, type UpdateAttachmentInput, type UpdateAttributeDto as UpdateAttributeInput, type UpdateAttributeOptionDto as UpdateAttributeOptionInput, type UpdateBrandDto as UpdateBrandInput, type UpdateCartItemDto, type UpdateCategoryDto as UpdateCategoryInput, type UpdateContentInput, type UpdateCouponDto, type UpdateCustomApiDto, type UpdateCustomerDto, type UpdateDraftDto, type UpdateEmailSettingsDto as UpdateEmailSettingsInput, type UpdateEmailTemplateDto as UpdateEmailTemplateInput, type UpdateInventoryDto, type UpdateMemberRoleDto as UpdateMemberRoleInput, type UpdateMetafieldDefinitionDto as UpdateMetafieldDefinitionInput, type UpdateModifierGroupInput, type UpdateModifierInput, type UpdateOAuthProviderDto as UpdateOAuthProviderInput, type UpdateOrderDto, type UpdateOrderShippingDto, type UpdateProductDto, type UpdateShippingRateDto as UpdateShippingRateInput, type UpdateShippingZoneDto as UpdateShippingZoneInput, type UpdateStoreMemberDto as UpdateStoreMemberInput, type UpdateTagDto as UpdateTagInput, type UpdateTaxRateDto as UpdateTaxRateInput, type UpdateVariantDto, type UpdateVariantInventoryDto, type UpsertProductMetafieldDto as UpsertProductMetafieldInput, type UserStore, type UserStorePermissions, type VariantInventoryResponse, type VariantPlatformOverlay, type VariantStatus, type WaitForOrderOptions, type WaitForOrderResult, type WebhookEvent, type WebhookEventType, type WriteProductReviewInput, buildArticleJsonLd, buildBreadcrumbJsonLd, buildCollectionPageJsonLd, buildOrganizationJsonLd, buildProductJsonLd, buildWebsiteJsonLd, computeAvailableSlots, createWebhookHandler, deriveSeoDescription, enableDevGuards, formatMoney, formatPrice, formatProductPrice, formatVariantPrice, getBlogSitemapEntries, getCartItemImage, getCartItemName, getCartTotals, getCategorySitemapEntries, getDescriptionContent, getDirectionForLocale, formatPrice as getPriceDisplay, getProductCustomizationFields, getProductMetafield, getProductMetafieldValue, getProductMetafieldsByType, getProductPrice, getProductPriceInfo, getProductSwatches, getStockStatus, getVariantOptions, getVariantPrice, isAllowedPaymentUrl, isCalendarDateAllowed, isCouponApplicableToProduct, isDateValueAllowed, isHtmlDescription, isWebhookEventType, jsonLdScriptProps, parseWebhookEvent, resolveStoreLocalParts, safePaymentRedirect, stripHtml, validateDateAvailabilityConfig, verifyWebhook };
11527
+ export { type AddToCartDto, type AddressDetailsResult, type AddressSuggestion, type AnnouncementContent, type AnnouncementSeverity, type AppliedDiscount, type ApplyCouponDto, type AttachModifierGroupInput, type Attribute, type AttributeOption, type AttributeSource, type BlogSitemapOptions, type BrainerceApiError, BrainerceClient, type BrainerceClientOptions, BrainerceError, type Brand, type BulkInventoryResponse, type BulkSaveVariantsDto, type BulkSaveVariantsResponse, type BulkVariantInput, type BusinessHoursWindow, type Cart, type CartAppliedDiscount, type CartBundleOffer, type CartBundlesResponse, type CartIncludeOption, type CartIncludeOptions, type CartItem, type CartItemModifierLine, type CartNudge, type CartRecommendationsResponse, type CartStatus, type CartUpgradeSuggestion, type CartUpgradesResponse, type CartWithIncludes, type Category, type CategoryDetail, type CategoryNode, type CategorySitemapOptions, type CategorySuggestion, type Checkout, type CheckoutAddress, type CheckoutBumpsResponse, type CheckoutCustomFieldDefinition, type CheckoutFieldPricing, type CheckoutFieldVisibility, type CheckoutLineItem, type CheckoutPrefillData, type CheckoutStatus, type CompleteCheckoutResponse, type CompleteDraftDto, type ConfigureOAuthProviderDto as ConfigureOAuthProviderInput, type ConflictStatus, type ConnectorPlatform, type ContactFormFieldType, type ContactFormFieldValidation, type ContactFormPublic, type ContactFormPublicField, type ContactFormSummary, type Content, type ContentDataMap, type ContentStatus, type ContentSummary, type ContentType, type Coupon, type CouponCreateResponse, type CouponQueryParams, type CouponStatus, type CouponType, type CouponValidationWarning, type CreateAddressDto, type CreateAttributeDto as CreateAttributeInput, type CreateAttributeOptionDto as CreateAttributeOptionInput, type CreateBrandDto as CreateBrandInput, type CreateCategoryDto as CreateCategoryInput, type CreateCheckoutDto, type CreateContentInput, type CreateCouponDto, type CreateCustomApiDto, type CreateCustomerDto, type CreateEmailTemplateDto as CreateEmailTemplateInput, type CreateGuestOrderDto, type CreateInquiryInput, type CreateInquiryResponse, type CreateMetafieldDefinitionDto as CreateMetafieldDefinitionInput, type CreateModifierGroupInput, type CreateModifierInput, type CreateOrderDto, type CreateProductDto, type CreateRefundDto, type CreateShippingRateDto as CreateShippingRateInput, type CreateShippingZoneDto as CreateShippingZoneInput, type CreateTagDto as CreateTagInput, type CreateTaxRateDto as CreateTaxRateInput, type CreateVariantDto, type CustomApiAuthType, type CustomApiConnectionStatus, type CustomApiCredentials, type CustomApiIntegration, type CustomApiSyncConfig, type CustomApiSyncDirection, type CustomApiTestResult, type Customer, type CustomerAddress, type CustomerAuthResponse, type CustomerOAuthProvider, type CustomerProfile, type CustomerQueryParams, type DateAvailabilityConstraints, type DateFieldParseResult, type DeleteProductResponse, type DiscountBanner, type DiscountRuleType, type DownloadFile, type DraftLineItem, type EditInventoryDto, type EmailDomain, type EmailEventSettings, type EmailEventType, type EmailSettings, type EmailTemplate, type EmailTemplatePreview, type EmailTemplatesResponse, type EmailVerificationResponse, type ExtendReservationResponse, type FaqContent, type FaqItem, type FooterColumn, type FooterContent, type FooterLink, type FooterSocialLink, type FormatPriceOptions, type FormatProductPriceOptions, type FreeAllocationPolicy, type FulfillOrderDto, type GuestCheckoutStartResponse, type GuestOrderResponse, type HeaderContent, type HeaderCta, type HeaderLogo, type HeaderNavItem, type InsufficientStockError, type InventoryInfo, type InventoryReservationStrategy, type InventorySyncStatus, type InventoryTrackingMode, type InvitationStatus, type InviteMemberDto as InviteMemberInput, type InviteStoreMemberDto as InviteStoreMemberInput, type JsonLdOptions, type ListModifierGroupsParams, type LocalCart, type LocalCartItem, type LockedVariant, type LoyaltyNextTierSummary, type LoyaltyReward, type LoyaltyStatus, type LoyaltyTierSummary, type MergeCartsDto, type MetafieldConflict, type MetafieldConflictResolution, type MetafieldDefinition, type MetafieldFilter, type MetafieldFilterValue, type MetafieldFiltersResponse, type MetafieldType, type Modifier, type ModifierGroup, type ModifierSelection, type ModifierSelectionType, type ModifierValidationCode, type ModifierValidationError, type MyProductReview, type OAuthAuthorizeResponse, type OAuthCallbackResponse, type OAuthConnection, type OAuthConnectionsResponse, type OAuthProviderConfig, type OAuthProviderType, type OAuthProvidersResponse, type Order, type OrderAddress, type OrderBump, type OrderCustomer, type OrderDownloadLink, type OrderItem, type OrderQueryParams, type OrderStatus, type OrderStatusChange, type PageContent, type PageSeo, type PaginatedResponse, type ParsedDateFieldValue, type PaymentClientSdk, type PaymentConfig, type PaymentIntent, type PaymentProvider, type PaymentProviderConfig, type PaymentProvidersConfig, type PaymentStatus, type PaymentUrlOptions, type PickupLocation, type PlatformCouponCapabilities, type PlatformMetafieldMetadata, type PreviewEmailTemplateDto as PreviewEmailTemplateInput, type Product, type ProductAttributeInput, type ProductAvailability, type ProductCustomizationField, type ProductDiscount, type ProductDiscountBadge, type ProductImage, type ProductMetafield, type ProductMetafieldValue, type ProductModifierGroupAttachment, type ProductQueryParams, type ProductRecommendation, type ProductRecommendationsResponse, type ProductRelationType, type ProductReview, type ProductReviewAdmin, type ProductSuggestion, type ProductVariant, type PublicMetafieldDefinition, type PublishProductResponse, RTL_LOCALES, type RecommendationVariant, type ReconcileInventoryResponse, type RedeemRewardResult, type ReferralInfo, type Refund, type RefundLineItem, type RefundLineItemResponse, type RefundType, type RegisterCustomerDto, type ReservationInfo, type ResolveMetafieldConflictDto as ResolveMetafieldConflictInput, type ResolveSyncConflictDto as ResolveSyncConflictInput, type RichTextContent, SDK_VERSION, type SearchSuggestions, type SelectPickupLocationDto, type SelectShippingMethodDto, type SendInvoiceDto, type SessionCartRef, type SetBillingAddressDto, type SetCheckoutCustomFieldsDto, type SetCheckoutCustomerDto, type SetDefinitionProductsDto as SetDefinitionProductsInput, type SetMetafieldPlatformsDto as SetMetafieldPlatformsInput, type SetShippingAddressDto, type SetShippingAddressResponse, type ShippingDestinations, type ShippingLine, type ShippingRate, type ShippingRateConfig, type ShippingRateType, type ShippingSummaryEntry, type ShippingZone, type ShippingZoneQueryParams, type SitemapEntry, type StockAvailabilityRequest, type StockAvailabilityResponse, type StockAvailabilityResult, type StoreInfo, type StoreInvitation, type StoreInvitationDetails, type StoreMember, type StorePermission, type StoreRole, type StoreTeamResponse, type SubmitProductReviewInput, type SupportedLocaleObject, type SyncConflict, type SyncConflictResolution, type SyncJob, type Tag, type TaxBreakdown, type TaxBreakdownItem, type TaxRate, type TaxonomyQueryParams, type TeamInvitation, type TeamInvitationsResponse, type TeamMember, type TeamMembersResponse, type TeamRole, type UpdateAddressDto, type UpdateAttachmentInput, type UpdateAttributeDto as UpdateAttributeInput, type UpdateAttributeOptionDto as UpdateAttributeOptionInput, type UpdateBrandDto as UpdateBrandInput, type UpdateCartItemDto, type UpdateCategoryDto as UpdateCategoryInput, type UpdateContentInput, type UpdateCouponDto, type UpdateCustomApiDto, type UpdateCustomerDto, type UpdateDraftDto, type UpdateEmailSettingsDto as UpdateEmailSettingsInput, type UpdateEmailTemplateDto as UpdateEmailTemplateInput, type UpdateInventoryDto, type UpdateMemberRoleDto as UpdateMemberRoleInput, type UpdateMetafieldDefinitionDto as UpdateMetafieldDefinitionInput, type UpdateModifierGroupInput, type UpdateModifierInput, type UpdateOAuthProviderDto as UpdateOAuthProviderInput, type UpdateOrderDto, type UpdateOrderShippingDto, type UpdateProductDto, type UpdateShippingRateDto as UpdateShippingRateInput, type UpdateShippingZoneDto as UpdateShippingZoneInput, type UpdateStoreMemberDto as UpdateStoreMemberInput, type UpdateTagDto as UpdateTagInput, type UpdateTaxRateDto as UpdateTaxRateInput, type UpdateVariantDto, type UpdateVariantInventoryDto, type UpsertProductMetafieldDto as UpsertProductMetafieldInput, type UserStore, type UserStorePermissions, type VariantInventoryResponse, type VariantPlatformOverlay, type VariantStatus, type WaitForOrderOptions, type WaitForOrderResult, type WebhookEvent, type WebhookEventType, type WriteProductReviewInput, buildArticleJsonLd, buildBreadcrumbJsonLd, buildCollectionPageJsonLd, buildOrganizationJsonLd, buildProductJsonLd, buildWebsiteJsonLd, computeAvailableSlots, createWebhookHandler, deriveSeoDescription, enableDevGuards, formatMoney, formatPrice, formatProductPrice, formatVariantPrice, getBlogSitemapEntries, getBusinessHoursForDate, getCartItemImage, getCartItemName, getCartTotals, getCategorySitemapEntries, getDescriptionContent, getDirectionForLocale, formatPrice as getPriceDisplay, getProductCustomizationFields, getProductMetafield, getProductMetafieldValue, getProductMetafieldsByType, getProductPrice, getProductPriceInfo, getProductSwatches, getStockStatus, getVariantOptions, getVariantPrice, isAllowedPaymentUrl, isCalendarDateAllowed, isCouponApplicableToProduct, isDateValueAllowed, isHtmlDescription, isWebhookEventType, jsonLdScriptProps, parseDateFieldValue, parseWebhookEvent, resolveStoreLocalParts, safePaymentRedirect, stripHtml, validateDateAvailabilityConfig, verifyWebhook };