@basedone/core 0.2.5 → 0.2.7

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.
@@ -1241,18 +1241,30 @@ interface ShippingRate extends BaseEntity {
1241
1241
  }
1242
1242
  /**
1243
1243
  * Shipping option (calculated for checkout)
1244
+ *
1245
+ * Use `rateId` when creating orders - the server will validate and calculate cost.
1244
1246
  */
1245
1247
  interface ShippingOption {
1246
- /** Rate ID */
1247
- id: string;
1248
- /** Rate name */
1249
- name: string;
1250
- /** Calculated cost in USDC */
1251
- cost: number;
1252
- /** Estimated delivery string */
1253
- estimatedDelivery: string;
1248
+ /** Rate ID - use this when creating orders */
1249
+ rateId: string;
1254
1250
  /** Zone name */
1255
1251
  zoneName: string;
1252
+ /** Rate name (e.g., "Standard", "Express") */
1253
+ rateName: string;
1254
+ /** Base rate in USDC */
1255
+ baseRate: number;
1256
+ /** Per-kg rate in USDC */
1257
+ perKgRate: number;
1258
+ /** Calculated total cost in USDC (for display only - server recalculates) */
1259
+ calculatedCost: number;
1260
+ /** Whether free shipping applies */
1261
+ isFree: boolean;
1262
+ /** Estimated delivery string (e.g., "5-7 business days") */
1263
+ estimatedDelivery: string | null;
1264
+ /** Minimum delivery days */
1265
+ minDeliveryDays: number | null;
1266
+ /** Maximum delivery days */
1267
+ maxDeliveryDays: number | null;
1256
1268
  }
1257
1269
 
1258
1270
  /**
@@ -1386,13 +1398,24 @@ interface CreateOrderRequest {
1386
1398
  couponCode?: string;
1387
1399
  /** Idempotency key */
1388
1400
  idempotencyKey?: string;
1389
- /** Selected shipping method name (e.g., "Standard", "Express") */
1401
+ /**
1402
+ * Selected shipping rate ID (from shipping calculator)
1403
+ * The server will validate this rate and calculate the cost server-side.
1404
+ * SECURITY: The cost is never trusted from the frontend.
1405
+ */
1406
+ shippingRateId?: string;
1407
+ /**
1408
+ * Shipping method name (e.g., "On-site Collection")
1409
+ * Sent as fallback when validation is disabled, so the method name can still be stored.
1410
+ */
1411
+ shippingMethodName?: string;
1412
+ /** @deprecated Use shippingRateId instead. This value is ignored by the server. */
1390
1413
  shippingMethod?: string;
1391
- /** Calculated shipping cost in USDC */
1414
+ /** @deprecated Use shippingRateId instead. This value is ignored by the server. */
1392
1415
  shippingCost?: number;
1393
- /** Shipping zone name for reference */
1416
+ /** @deprecated Use shippingRateId instead. This value is ignored by the server. */
1394
1417
  shippingZone?: string;
1395
- /** Estimated delivery time (e.g., "5-7 business days") */
1418
+ /** @deprecated Use shippingRateId instead. This value is ignored by the server. */
1396
1419
  estimatedDelivery?: string;
1397
1420
  }
1398
1421
  /**
@@ -3102,6 +3125,27 @@ interface DeleteBrowsingLocationResponse {
3102
3125
  /** Success message */
3103
3126
  message: string;
3104
3127
  }
3128
+ /**
3129
+ * Cash account balance response
3130
+ */
3131
+ interface CashAccountBalanceResponse {
3132
+ /** Balance amount */
3133
+ balance: string;
3134
+ /** Currency code (e.g., "USD") */
3135
+ currency: string;
3136
+ }
3137
+ interface DeliveryAddressResponse {
3138
+ name: string;
3139
+ phoneNumber: string;
3140
+ deliveryAddress: {
3141
+ addressLine1: string;
3142
+ addressLine2?: string | null;
3143
+ postalCode: string;
3144
+ city: string | null;
3145
+ region: string | null;
3146
+ country: string;
3147
+ };
3148
+ }
3105
3149
 
3106
3150
  /**
3107
3151
  * Customer/End-User Ecommerce API Client
@@ -3198,11 +3242,28 @@ declare class CustomerEcommerceClient extends BaseEcommerceClient {
3198
3242
  *
3199
3243
  * Supports multi-merchant checkout - automatically splits orders by merchant.
3200
3244
  *
3245
+ * **IMPORTANT: Shipping Cost Security**
3246
+ * - Use `shippingRateId` to specify the selected shipping rate
3247
+ * - The server calculates shipping cost from the rate ID (never trust frontend costs)
3248
+ * - Get available rates from `calculateShippingOptions()` first
3249
+ *
3201
3250
  * @param request - Order creation request
3202
3251
  * @returns Created order(s) with payment instructions
3203
3252
  *
3204
3253
  * @example
3205
3254
  * ```typescript
3255
+ * // Step 1: Calculate available shipping options
3256
+ * const shippingOptions = await client.calculateShippingOptions({
3257
+ * merchantId: "merchant_123",
3258
+ * destinationCountry: "US",
3259
+ * cartItems: [{ productId: "prod_123", quantity: 2, priceUSDC: 29.99 }],
3260
+ * orderSubtotal: 59.98
3261
+ * });
3262
+ *
3263
+ * // Step 2: Let user select a shipping option, get the rateId
3264
+ * const selectedRateId = shippingOptions.shippingOptions[0].rateId;
3265
+ *
3266
+ * // Step 3: Create order with shippingRateId (server validates and calculates cost)
3206
3267
  * const result = await client.createOrder({
3207
3268
  * items: [
3208
3269
  * { productId: "prod_123", quantity: 2 },
@@ -3218,6 +3279,7 @@ declare class CustomerEcommerceClient extends BaseEcommerceClient {
3218
3279
  * postalCode: "10001",
3219
3280
  * country: "US"
3220
3281
  * },
3282
+ * shippingRateId: selectedRateId, // Server validates and calculates cost
3221
3283
  * couponCode: "SAVE10"
3222
3284
  * });
3223
3285
  *
@@ -3850,6 +3912,34 @@ declare class CustomerEcommerceClient extends BaseEcommerceClient {
3850
3912
  * ```
3851
3913
  */
3852
3914
  clearBrowsingLocation(): Promise<DeleteBrowsingLocationResponse>;
3915
+ /**
3916
+ * Get user's cash account balance for BASEDPAY
3917
+ *
3918
+ * Returns the current balance in the user's BasedPay cash account.
3919
+ *
3920
+ * @returns Cash account balance with currency
3921
+ *
3922
+ * @example
3923
+ * ```typescript
3924
+ * const balance = await client.getCashAccountBalance();
3925
+ * console.log(`Balance: ${balance.balance} ${balance.currency}`);
3926
+ * ```
3927
+ */
3928
+ getCashAccountBalance(): Promise<CashAccountBalanceResponse>;
3929
+ /**
3930
+ * Get user's delivery address for BASEDPAY
3931
+ *
3932
+ * Returns the user's delivery address for BASEDPAY.
3933
+ *
3934
+ * @returns Delivery address
3935
+ *
3936
+ * @example
3937
+ * ```typescript
3938
+ * const address = await client.getDeliveryAddress();
3939
+ * console.log(`Address: ${address.address}`);
3940
+ * ```
3941
+ */
3942
+ getDeliveryAddress(): Promise<DeliveryAddressResponse>;
3853
3943
  }
3854
3944
 
3855
3945
  /**
@@ -5564,4 +5654,4 @@ declare function calculateDiscountAmount(price: number, discountType: "PERCENTAG
5564
5654
  */
5565
5655
  declare function calculateFinalPrice(price: number, discountType: "PERCENTAGE" | "FIXED_AMOUNT", discountValue: number): number;
5566
5656
 
5567
- export { type ActiveFlashSalesResponse, type AnalyticsOverview, type ApiResponse, type AppliedDiscount, type Banner, type BannerResponse, BannerType, BaseEcommerceClient, type BaseEntity, type BrowsingLocation, type CalculateCartDiscountsRequest, type CalculateCartDiscountsResponse, type CalculateShippingRequest, type CalculateShippingResponse, type CalculateTaxRequest, type CalculateTaxResponse, type CartItem, type ConfirmEscrowDepositResponse, type Coupon, type CouponResponse, type CouponUsage, type CreateBannerRequest, type CreateCouponRequest, type CreateFlashSaleRequest, type CreateOrderEventRequest, type CreateOrderEventResponse, type CreateOrderRequest, type CreateOrderResponse, type CreateProductRequest, type CreateProductVariantRequest, type CreateReviewRequest, type CreateShippingMethodRequest, type CreateShippingRateRequest, type CreateShippingZoneRequest, type CreateTaxNexusRequest, type CreateTaxRuleRequest, CustomerEcommerceClient, type CustomerMessagesResponse, type CustomerSummary, type DeleteBrowsingLocationResponse, DiscountMethod, DiscountScope, DiscountType, EcommerceApiError, type EcommerceClientConfig, type ExpiringGemBatch, type FlashSale, type FlashSaleAllowanceInfo, type FlashSaleItem, type FlashSaleItemInput, type FollowActionResponse, type FollowStatusResponse, type FollowedMerchantSummary, type GemHistoryItem, type GemHistoryType, type GemHistoryTypeFilter, type GemSource, type GenerateTaxReportRequest, type GetAnalyticsParams, type GetAnalyticsResponse, type GetBrowsingLocationResponse, type GetCouponResponse, type GetExpiringGemsParams, type GetExpiringGemsResponse, type GetFlashSaleAllowanceParams, type GetFlashSaleAllowanceResponse, type GetGemBalanceResponse, type GetGemHistoryParams, type GetGemHistoryResponse, type GetOrderResponse, type GetPaymentMethodsResponse, type GetProductMetricsResponse, type GetProductResponse, type GetTaxReportResponse, InventoryAuditAction, type InventoryAuditEntry, type ListActiveBannersParams, type ListActiveFlashSalesParams, type ListBannersResponse, type ListCouponsResponse, type ListCustomersParams, type ListCustomersResponse, type ListFollowingParams, type ListFollowingResponse, type ListInventoryAuditResponse, type ListMediaAssetsResponse, type ListMerchantProductsParams, type ListMessagesResponse, type ListOrdersParams, type ListOrdersResponse, type ListProductVariantsResponse, type ListProductsParams, type ListProductsResponse, type ListReturnsResponse, type ListReviewsParams, type ListReviewsResponse, type ListShipmentsResponse, type ListShippingAddressesResponse, type ListShippingMethodsResponse, type ListShippingRatesResponse, type ListShippingZonesResponse, type ListTaxNexusResponse, type ListTaxReportsParams, type ListTaxReportsResponse, type ListTaxRulesResponse, type MediaAsset, type MediaAssetResponse, type Merchant, MerchantEcommerceClient, type MerchantProductsResponse, type MerchantProfileRequest, type MerchantProfileResponse, type MerchantShippingSettings, MerchantStatus, type Message, type MessageResponse, type MessageStatsResponse, type Order, type OrderEvent, type OrderItem, type OrderReceiptResponse, OrderStatus, type OrdersByStatus, type PaginatedResponse, type PaginationParams, type Payment, PaymentMethod, type PaymentMethodInfo, PaymentStatus, type ProcessPaymentRequest, type ProcessPaymentResponse, type Product, type ProductDimensions, type ProductDiscountsResponse, type ProductMetrics, type ProductResponse, type ProductReview, ProductSortBy, type ProductVariant, type ProductVariantResponse, type PublicMerchantProfile, type PublicMerchantProfileResponse, type RecentOrderSummary, type RespondToReviewRequest, type Return, type ReturnItem, type ReturnResponse, ReturnStatus, type RevenueByDay, type ReviewResponse, ReviewSortBy, ReviewStatus, type SaveBrowsingLocationRequest, type SaveBrowsingLocationResponse, type SendMessageRequest, type Settlement, type Shipment, type ShipmentResponse, ShipmentStatus, type ShippingAddress$1 as ShippingAddress, type ShippingAddressRequest, type ShippingAddressResponse, type ShippingMethod, type ShippingMethodResponse, type ShippingOption, type ShippingRate, type ShippingRateResponse, type ShippingSettingsResponse, type ShippingZone, type ShippingZoneResponse, SortOrder, type SuccessResponse, TaxBehavior, type TaxBreakdownItem, type TaxNexus, type TaxNexusResponse, type TaxReport, type TaxReportDetails, TaxReportPeriodType, type TaxReportResponse, TaxReportStatus, type TaxRule, type TaxRuleResponse, type TaxSettings, type TaxSettingsResponse, TaxType, type TopProduct, type TrackBannerRequest, type UpdateBannerRequest, type UpdateCouponRequest, type UpdateFlashSaleRequest, type UpdateOrderResponse, type UpdateOrderStatusRequest, type UpdateProductRequest, type UpdateProductVariantRequest, type UpdateShipmentRequest, type UpdateShippingMethodRequest, type UpdateShippingRateRequest, type UpdateShippingSettingsRequest, type UpdateShippingZoneRequest, type UpdateTaxNexusRequest, type UpdateTaxReportStatusRequest, type UpdateTaxRuleRequest, type UpdateTaxSettingsRequest, type UserShippingAddress, type ValidateDiscountRequest, type ValidateDiscountResponse, buildQueryString, calculateDiscountAmount, calculateFinalPrice, formatPrice, getBackoffDelay, isRetryableError, isValidAddress, isValidEmail, parseError, retryWithBackoff, sleep, truncateAddress };
5657
+ export { type ActiveFlashSalesResponse, type AnalyticsOverview, type ApiResponse, type AppliedDiscount, type Banner, type BannerResponse, BannerType, BaseEcommerceClient, type BaseEntity, type BrowsingLocation, type CalculateCartDiscountsRequest, type CalculateCartDiscountsResponse, type CalculateShippingRequest, type CalculateShippingResponse, type CalculateTaxRequest, type CalculateTaxResponse, type CartItem, type CashAccountBalanceResponse, type ConfirmEscrowDepositResponse, type Coupon, type CouponResponse, type CouponUsage, type CreateBannerRequest, type CreateCouponRequest, type CreateFlashSaleRequest, type CreateOrderEventRequest, type CreateOrderEventResponse, type CreateOrderRequest, type CreateOrderResponse, type CreateProductRequest, type CreateProductVariantRequest, type CreateReviewRequest, type CreateShippingMethodRequest, type CreateShippingRateRequest, type CreateShippingZoneRequest, type CreateTaxNexusRequest, type CreateTaxRuleRequest, CustomerEcommerceClient, type CustomerMessagesResponse, type CustomerSummary, type DeleteBrowsingLocationResponse, type DeliveryAddressResponse, DiscountMethod, DiscountScope, DiscountType, EcommerceApiError, type EcommerceClientConfig, type ExpiringGemBatch, type FlashSale, type FlashSaleAllowanceInfo, type FlashSaleItem, type FlashSaleItemInput, type FollowActionResponse, type FollowStatusResponse, type FollowedMerchantSummary, type GemHistoryItem, type GemHistoryType, type GemHistoryTypeFilter, type GemSource, type GenerateTaxReportRequest, type GetAnalyticsParams, type GetAnalyticsResponse, type GetBrowsingLocationResponse, type GetCouponResponse, type GetExpiringGemsParams, type GetExpiringGemsResponse, type GetFlashSaleAllowanceParams, type GetFlashSaleAllowanceResponse, type GetGemBalanceResponse, type GetGemHistoryParams, type GetGemHistoryResponse, type GetOrderResponse, type GetPaymentMethodsResponse, type GetProductMetricsResponse, type GetProductResponse, type GetTaxReportResponse, InventoryAuditAction, type InventoryAuditEntry, type ListActiveBannersParams, type ListActiveFlashSalesParams, type ListBannersResponse, type ListCouponsResponse, type ListCustomersParams, type ListCustomersResponse, type ListFollowingParams, type ListFollowingResponse, type ListInventoryAuditResponse, type ListMediaAssetsResponse, type ListMerchantProductsParams, type ListMessagesResponse, type ListOrdersParams, type ListOrdersResponse, type ListProductVariantsResponse, type ListProductsParams, type ListProductsResponse, type ListReturnsResponse, type ListReviewsParams, type ListReviewsResponse, type ListShipmentsResponse, type ListShippingAddressesResponse, type ListShippingMethodsResponse, type ListShippingRatesResponse, type ListShippingZonesResponse, type ListTaxNexusResponse, type ListTaxReportsParams, type ListTaxReportsResponse, type ListTaxRulesResponse, type MediaAsset, type MediaAssetResponse, type Merchant, MerchantEcommerceClient, type MerchantProductsResponse, type MerchantProfileRequest, type MerchantProfileResponse, type MerchantShippingSettings, MerchantStatus, type Message, type MessageResponse, type MessageStatsResponse, type Order, type OrderEvent, type OrderItem, type OrderReceiptResponse, OrderStatus, type OrdersByStatus, type PaginatedResponse, type PaginationParams, type Payment, PaymentMethod, type PaymentMethodInfo, PaymentStatus, type ProcessPaymentRequest, type ProcessPaymentResponse, type Product, type ProductDimensions, type ProductDiscountsResponse, type ProductMetrics, type ProductResponse, type ProductReview, ProductSortBy, type ProductVariant, type ProductVariantResponse, type PublicMerchantProfile, type PublicMerchantProfileResponse, type RecentOrderSummary, type RespondToReviewRequest, type Return, type ReturnItem, type ReturnResponse, ReturnStatus, type RevenueByDay, type ReviewResponse, ReviewSortBy, ReviewStatus, type SaveBrowsingLocationRequest, type SaveBrowsingLocationResponse, type SendMessageRequest, type Settlement, type Shipment, type ShipmentResponse, ShipmentStatus, type ShippingAddress$1 as ShippingAddress, type ShippingAddressRequest, type ShippingAddressResponse, type ShippingMethod, type ShippingMethodResponse, type ShippingOption, type ShippingRate, type ShippingRateResponse, type ShippingSettingsResponse, type ShippingZone, type ShippingZoneResponse, SortOrder, type SuccessResponse, TaxBehavior, type TaxBreakdownItem, type TaxNexus, type TaxNexusResponse, type TaxReport, type TaxReportDetails, TaxReportPeriodType, type TaxReportResponse, TaxReportStatus, type TaxRule, type TaxRuleResponse, type TaxSettings, type TaxSettingsResponse, TaxType, type TopProduct, type TrackBannerRequest, type UpdateBannerRequest, type UpdateCouponRequest, type UpdateFlashSaleRequest, type UpdateOrderResponse, type UpdateOrderStatusRequest, type UpdateProductRequest, type UpdateProductVariantRequest, type UpdateShipmentRequest, type UpdateShippingMethodRequest, type UpdateShippingRateRequest, type UpdateShippingSettingsRequest, type UpdateShippingZoneRequest, type UpdateTaxNexusRequest, type UpdateTaxReportStatusRequest, type UpdateTaxRuleRequest, type UpdateTaxSettingsRequest, type UserShippingAddress, type ValidateDiscountRequest, type ValidateDiscountResponse, buildQueryString, calculateDiscountAmount, calculateFinalPrice, formatPrice, getBackoffDelay, isRetryableError, isValidAddress, isValidEmail, parseError, retryWithBackoff, sleep, truncateAddress };
@@ -1241,18 +1241,30 @@ interface ShippingRate extends BaseEntity {
1241
1241
  }
1242
1242
  /**
1243
1243
  * Shipping option (calculated for checkout)
1244
+ *
1245
+ * Use `rateId` when creating orders - the server will validate and calculate cost.
1244
1246
  */
1245
1247
  interface ShippingOption {
1246
- /** Rate ID */
1247
- id: string;
1248
- /** Rate name */
1249
- name: string;
1250
- /** Calculated cost in USDC */
1251
- cost: number;
1252
- /** Estimated delivery string */
1253
- estimatedDelivery: string;
1248
+ /** Rate ID - use this when creating orders */
1249
+ rateId: string;
1254
1250
  /** Zone name */
1255
1251
  zoneName: string;
1252
+ /** Rate name (e.g., "Standard", "Express") */
1253
+ rateName: string;
1254
+ /** Base rate in USDC */
1255
+ baseRate: number;
1256
+ /** Per-kg rate in USDC */
1257
+ perKgRate: number;
1258
+ /** Calculated total cost in USDC (for display only - server recalculates) */
1259
+ calculatedCost: number;
1260
+ /** Whether free shipping applies */
1261
+ isFree: boolean;
1262
+ /** Estimated delivery string (e.g., "5-7 business days") */
1263
+ estimatedDelivery: string | null;
1264
+ /** Minimum delivery days */
1265
+ minDeliveryDays: number | null;
1266
+ /** Maximum delivery days */
1267
+ maxDeliveryDays: number | null;
1256
1268
  }
1257
1269
 
1258
1270
  /**
@@ -1386,13 +1398,24 @@ interface CreateOrderRequest {
1386
1398
  couponCode?: string;
1387
1399
  /** Idempotency key */
1388
1400
  idempotencyKey?: string;
1389
- /** Selected shipping method name (e.g., "Standard", "Express") */
1401
+ /**
1402
+ * Selected shipping rate ID (from shipping calculator)
1403
+ * The server will validate this rate and calculate the cost server-side.
1404
+ * SECURITY: The cost is never trusted from the frontend.
1405
+ */
1406
+ shippingRateId?: string;
1407
+ /**
1408
+ * Shipping method name (e.g., "On-site Collection")
1409
+ * Sent as fallback when validation is disabled, so the method name can still be stored.
1410
+ */
1411
+ shippingMethodName?: string;
1412
+ /** @deprecated Use shippingRateId instead. This value is ignored by the server. */
1390
1413
  shippingMethod?: string;
1391
- /** Calculated shipping cost in USDC */
1414
+ /** @deprecated Use shippingRateId instead. This value is ignored by the server. */
1392
1415
  shippingCost?: number;
1393
- /** Shipping zone name for reference */
1416
+ /** @deprecated Use shippingRateId instead. This value is ignored by the server. */
1394
1417
  shippingZone?: string;
1395
- /** Estimated delivery time (e.g., "5-7 business days") */
1418
+ /** @deprecated Use shippingRateId instead. This value is ignored by the server. */
1396
1419
  estimatedDelivery?: string;
1397
1420
  }
1398
1421
  /**
@@ -3102,6 +3125,27 @@ interface DeleteBrowsingLocationResponse {
3102
3125
  /** Success message */
3103
3126
  message: string;
3104
3127
  }
3128
+ /**
3129
+ * Cash account balance response
3130
+ */
3131
+ interface CashAccountBalanceResponse {
3132
+ /** Balance amount */
3133
+ balance: string;
3134
+ /** Currency code (e.g., "USD") */
3135
+ currency: string;
3136
+ }
3137
+ interface DeliveryAddressResponse {
3138
+ name: string;
3139
+ phoneNumber: string;
3140
+ deliveryAddress: {
3141
+ addressLine1: string;
3142
+ addressLine2?: string | null;
3143
+ postalCode: string;
3144
+ city: string | null;
3145
+ region: string | null;
3146
+ country: string;
3147
+ };
3148
+ }
3105
3149
 
3106
3150
  /**
3107
3151
  * Customer/End-User Ecommerce API Client
@@ -3198,11 +3242,28 @@ declare class CustomerEcommerceClient extends BaseEcommerceClient {
3198
3242
  *
3199
3243
  * Supports multi-merchant checkout - automatically splits orders by merchant.
3200
3244
  *
3245
+ * **IMPORTANT: Shipping Cost Security**
3246
+ * - Use `shippingRateId` to specify the selected shipping rate
3247
+ * - The server calculates shipping cost from the rate ID (never trust frontend costs)
3248
+ * - Get available rates from `calculateShippingOptions()` first
3249
+ *
3201
3250
  * @param request - Order creation request
3202
3251
  * @returns Created order(s) with payment instructions
3203
3252
  *
3204
3253
  * @example
3205
3254
  * ```typescript
3255
+ * // Step 1: Calculate available shipping options
3256
+ * const shippingOptions = await client.calculateShippingOptions({
3257
+ * merchantId: "merchant_123",
3258
+ * destinationCountry: "US",
3259
+ * cartItems: [{ productId: "prod_123", quantity: 2, priceUSDC: 29.99 }],
3260
+ * orderSubtotal: 59.98
3261
+ * });
3262
+ *
3263
+ * // Step 2: Let user select a shipping option, get the rateId
3264
+ * const selectedRateId = shippingOptions.shippingOptions[0].rateId;
3265
+ *
3266
+ * // Step 3: Create order with shippingRateId (server validates and calculates cost)
3206
3267
  * const result = await client.createOrder({
3207
3268
  * items: [
3208
3269
  * { productId: "prod_123", quantity: 2 },
@@ -3218,6 +3279,7 @@ declare class CustomerEcommerceClient extends BaseEcommerceClient {
3218
3279
  * postalCode: "10001",
3219
3280
  * country: "US"
3220
3281
  * },
3282
+ * shippingRateId: selectedRateId, // Server validates and calculates cost
3221
3283
  * couponCode: "SAVE10"
3222
3284
  * });
3223
3285
  *
@@ -3850,6 +3912,34 @@ declare class CustomerEcommerceClient extends BaseEcommerceClient {
3850
3912
  * ```
3851
3913
  */
3852
3914
  clearBrowsingLocation(): Promise<DeleteBrowsingLocationResponse>;
3915
+ /**
3916
+ * Get user's cash account balance for BASEDPAY
3917
+ *
3918
+ * Returns the current balance in the user's BasedPay cash account.
3919
+ *
3920
+ * @returns Cash account balance with currency
3921
+ *
3922
+ * @example
3923
+ * ```typescript
3924
+ * const balance = await client.getCashAccountBalance();
3925
+ * console.log(`Balance: ${balance.balance} ${balance.currency}`);
3926
+ * ```
3927
+ */
3928
+ getCashAccountBalance(): Promise<CashAccountBalanceResponse>;
3929
+ /**
3930
+ * Get user's delivery address for BASEDPAY
3931
+ *
3932
+ * Returns the user's delivery address for BASEDPAY.
3933
+ *
3934
+ * @returns Delivery address
3935
+ *
3936
+ * @example
3937
+ * ```typescript
3938
+ * const address = await client.getDeliveryAddress();
3939
+ * console.log(`Address: ${address.address}`);
3940
+ * ```
3941
+ */
3942
+ getDeliveryAddress(): Promise<DeliveryAddressResponse>;
3853
3943
  }
3854
3944
 
3855
3945
  /**
@@ -5564,4 +5654,4 @@ declare function calculateDiscountAmount(price: number, discountType: "PERCENTAG
5564
5654
  */
5565
5655
  declare function calculateFinalPrice(price: number, discountType: "PERCENTAGE" | "FIXED_AMOUNT", discountValue: number): number;
5566
5656
 
5567
- export { type ActiveFlashSalesResponse, type AnalyticsOverview, type ApiResponse, type AppliedDiscount, type Banner, type BannerResponse, BannerType, BaseEcommerceClient, type BaseEntity, type BrowsingLocation, type CalculateCartDiscountsRequest, type CalculateCartDiscountsResponse, type CalculateShippingRequest, type CalculateShippingResponse, type CalculateTaxRequest, type CalculateTaxResponse, type CartItem, type ConfirmEscrowDepositResponse, type Coupon, type CouponResponse, type CouponUsage, type CreateBannerRequest, type CreateCouponRequest, type CreateFlashSaleRequest, type CreateOrderEventRequest, type CreateOrderEventResponse, type CreateOrderRequest, type CreateOrderResponse, type CreateProductRequest, type CreateProductVariantRequest, type CreateReviewRequest, type CreateShippingMethodRequest, type CreateShippingRateRequest, type CreateShippingZoneRequest, type CreateTaxNexusRequest, type CreateTaxRuleRequest, CustomerEcommerceClient, type CustomerMessagesResponse, type CustomerSummary, type DeleteBrowsingLocationResponse, DiscountMethod, DiscountScope, DiscountType, EcommerceApiError, type EcommerceClientConfig, type ExpiringGemBatch, type FlashSale, type FlashSaleAllowanceInfo, type FlashSaleItem, type FlashSaleItemInput, type FollowActionResponse, type FollowStatusResponse, type FollowedMerchantSummary, type GemHistoryItem, type GemHistoryType, type GemHistoryTypeFilter, type GemSource, type GenerateTaxReportRequest, type GetAnalyticsParams, type GetAnalyticsResponse, type GetBrowsingLocationResponse, type GetCouponResponse, type GetExpiringGemsParams, type GetExpiringGemsResponse, type GetFlashSaleAllowanceParams, type GetFlashSaleAllowanceResponse, type GetGemBalanceResponse, type GetGemHistoryParams, type GetGemHistoryResponse, type GetOrderResponse, type GetPaymentMethodsResponse, type GetProductMetricsResponse, type GetProductResponse, type GetTaxReportResponse, InventoryAuditAction, type InventoryAuditEntry, type ListActiveBannersParams, type ListActiveFlashSalesParams, type ListBannersResponse, type ListCouponsResponse, type ListCustomersParams, type ListCustomersResponse, type ListFollowingParams, type ListFollowingResponse, type ListInventoryAuditResponse, type ListMediaAssetsResponse, type ListMerchantProductsParams, type ListMessagesResponse, type ListOrdersParams, type ListOrdersResponse, type ListProductVariantsResponse, type ListProductsParams, type ListProductsResponse, type ListReturnsResponse, type ListReviewsParams, type ListReviewsResponse, type ListShipmentsResponse, type ListShippingAddressesResponse, type ListShippingMethodsResponse, type ListShippingRatesResponse, type ListShippingZonesResponse, type ListTaxNexusResponse, type ListTaxReportsParams, type ListTaxReportsResponse, type ListTaxRulesResponse, type MediaAsset, type MediaAssetResponse, type Merchant, MerchantEcommerceClient, type MerchantProductsResponse, type MerchantProfileRequest, type MerchantProfileResponse, type MerchantShippingSettings, MerchantStatus, type Message, type MessageResponse, type MessageStatsResponse, type Order, type OrderEvent, type OrderItem, type OrderReceiptResponse, OrderStatus, type OrdersByStatus, type PaginatedResponse, type PaginationParams, type Payment, PaymentMethod, type PaymentMethodInfo, PaymentStatus, type ProcessPaymentRequest, type ProcessPaymentResponse, type Product, type ProductDimensions, type ProductDiscountsResponse, type ProductMetrics, type ProductResponse, type ProductReview, ProductSortBy, type ProductVariant, type ProductVariantResponse, type PublicMerchantProfile, type PublicMerchantProfileResponse, type RecentOrderSummary, type RespondToReviewRequest, type Return, type ReturnItem, type ReturnResponse, ReturnStatus, type RevenueByDay, type ReviewResponse, ReviewSortBy, ReviewStatus, type SaveBrowsingLocationRequest, type SaveBrowsingLocationResponse, type SendMessageRequest, type Settlement, type Shipment, type ShipmentResponse, ShipmentStatus, type ShippingAddress$1 as ShippingAddress, type ShippingAddressRequest, type ShippingAddressResponse, type ShippingMethod, type ShippingMethodResponse, type ShippingOption, type ShippingRate, type ShippingRateResponse, type ShippingSettingsResponse, type ShippingZone, type ShippingZoneResponse, SortOrder, type SuccessResponse, TaxBehavior, type TaxBreakdownItem, type TaxNexus, type TaxNexusResponse, type TaxReport, type TaxReportDetails, TaxReportPeriodType, type TaxReportResponse, TaxReportStatus, type TaxRule, type TaxRuleResponse, type TaxSettings, type TaxSettingsResponse, TaxType, type TopProduct, type TrackBannerRequest, type UpdateBannerRequest, type UpdateCouponRequest, type UpdateFlashSaleRequest, type UpdateOrderResponse, type UpdateOrderStatusRequest, type UpdateProductRequest, type UpdateProductVariantRequest, type UpdateShipmentRequest, type UpdateShippingMethodRequest, type UpdateShippingRateRequest, type UpdateShippingSettingsRequest, type UpdateShippingZoneRequest, type UpdateTaxNexusRequest, type UpdateTaxReportStatusRequest, type UpdateTaxRuleRequest, type UpdateTaxSettingsRequest, type UserShippingAddress, type ValidateDiscountRequest, type ValidateDiscountResponse, buildQueryString, calculateDiscountAmount, calculateFinalPrice, formatPrice, getBackoffDelay, isRetryableError, isValidAddress, isValidEmail, parseError, retryWithBackoff, sleep, truncateAddress };
5657
+ export { type ActiveFlashSalesResponse, type AnalyticsOverview, type ApiResponse, type AppliedDiscount, type Banner, type BannerResponse, BannerType, BaseEcommerceClient, type BaseEntity, type BrowsingLocation, type CalculateCartDiscountsRequest, type CalculateCartDiscountsResponse, type CalculateShippingRequest, type CalculateShippingResponse, type CalculateTaxRequest, type CalculateTaxResponse, type CartItem, type CashAccountBalanceResponse, type ConfirmEscrowDepositResponse, type Coupon, type CouponResponse, type CouponUsage, type CreateBannerRequest, type CreateCouponRequest, type CreateFlashSaleRequest, type CreateOrderEventRequest, type CreateOrderEventResponse, type CreateOrderRequest, type CreateOrderResponse, type CreateProductRequest, type CreateProductVariantRequest, type CreateReviewRequest, type CreateShippingMethodRequest, type CreateShippingRateRequest, type CreateShippingZoneRequest, type CreateTaxNexusRequest, type CreateTaxRuleRequest, CustomerEcommerceClient, type CustomerMessagesResponse, type CustomerSummary, type DeleteBrowsingLocationResponse, type DeliveryAddressResponse, DiscountMethod, DiscountScope, DiscountType, EcommerceApiError, type EcommerceClientConfig, type ExpiringGemBatch, type FlashSale, type FlashSaleAllowanceInfo, type FlashSaleItem, type FlashSaleItemInput, type FollowActionResponse, type FollowStatusResponse, type FollowedMerchantSummary, type GemHistoryItem, type GemHistoryType, type GemHistoryTypeFilter, type GemSource, type GenerateTaxReportRequest, type GetAnalyticsParams, type GetAnalyticsResponse, type GetBrowsingLocationResponse, type GetCouponResponse, type GetExpiringGemsParams, type GetExpiringGemsResponse, type GetFlashSaleAllowanceParams, type GetFlashSaleAllowanceResponse, type GetGemBalanceResponse, type GetGemHistoryParams, type GetGemHistoryResponse, type GetOrderResponse, type GetPaymentMethodsResponse, type GetProductMetricsResponse, type GetProductResponse, type GetTaxReportResponse, InventoryAuditAction, type InventoryAuditEntry, type ListActiveBannersParams, type ListActiveFlashSalesParams, type ListBannersResponse, type ListCouponsResponse, type ListCustomersParams, type ListCustomersResponse, type ListFollowingParams, type ListFollowingResponse, type ListInventoryAuditResponse, type ListMediaAssetsResponse, type ListMerchantProductsParams, type ListMessagesResponse, type ListOrdersParams, type ListOrdersResponse, type ListProductVariantsResponse, type ListProductsParams, type ListProductsResponse, type ListReturnsResponse, type ListReviewsParams, type ListReviewsResponse, type ListShipmentsResponse, type ListShippingAddressesResponse, type ListShippingMethodsResponse, type ListShippingRatesResponse, type ListShippingZonesResponse, type ListTaxNexusResponse, type ListTaxReportsParams, type ListTaxReportsResponse, type ListTaxRulesResponse, type MediaAsset, type MediaAssetResponse, type Merchant, MerchantEcommerceClient, type MerchantProductsResponse, type MerchantProfileRequest, type MerchantProfileResponse, type MerchantShippingSettings, MerchantStatus, type Message, type MessageResponse, type MessageStatsResponse, type Order, type OrderEvent, type OrderItem, type OrderReceiptResponse, OrderStatus, type OrdersByStatus, type PaginatedResponse, type PaginationParams, type Payment, PaymentMethod, type PaymentMethodInfo, PaymentStatus, type ProcessPaymentRequest, type ProcessPaymentResponse, type Product, type ProductDimensions, type ProductDiscountsResponse, type ProductMetrics, type ProductResponse, type ProductReview, ProductSortBy, type ProductVariant, type ProductVariantResponse, type PublicMerchantProfile, type PublicMerchantProfileResponse, type RecentOrderSummary, type RespondToReviewRequest, type Return, type ReturnItem, type ReturnResponse, ReturnStatus, type RevenueByDay, type ReviewResponse, ReviewSortBy, ReviewStatus, type SaveBrowsingLocationRequest, type SaveBrowsingLocationResponse, type SendMessageRequest, type Settlement, type Shipment, type ShipmentResponse, ShipmentStatus, type ShippingAddress$1 as ShippingAddress, type ShippingAddressRequest, type ShippingAddressResponse, type ShippingMethod, type ShippingMethodResponse, type ShippingOption, type ShippingRate, type ShippingRateResponse, type ShippingSettingsResponse, type ShippingZone, type ShippingZoneResponse, SortOrder, type SuccessResponse, TaxBehavior, type TaxBreakdownItem, type TaxNexus, type TaxNexusResponse, type TaxReport, type TaxReportDetails, TaxReportPeriodType, type TaxReportResponse, TaxReportStatus, type TaxRule, type TaxRuleResponse, type TaxSettings, type TaxSettingsResponse, TaxType, type TopProduct, type TrackBannerRequest, type UpdateBannerRequest, type UpdateCouponRequest, type UpdateFlashSaleRequest, type UpdateOrderResponse, type UpdateOrderStatusRequest, type UpdateProductRequest, type UpdateProductVariantRequest, type UpdateShipmentRequest, type UpdateShippingMethodRequest, type UpdateShippingRateRequest, type UpdateShippingSettingsRequest, type UpdateShippingZoneRequest, type UpdateTaxNexusRequest, type UpdateTaxReportStatusRequest, type UpdateTaxRuleRequest, type UpdateTaxSettingsRequest, type UserShippingAddress, type ValidateDiscountRequest, type ValidateDiscountResponse, buildQueryString, calculateDiscountAmount, calculateFinalPrice, formatPrice, getBackoffDelay, isRetryableError, isValidAddress, isValidEmail, parseError, retryWithBackoff, sleep, truncateAddress };