@basedone/core 0.2.2 → 0.2.4

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.
@@ -25,6 +25,8 @@ interface EcommerceClientConfig {
25
25
  headers?: Record<string, string>;
26
26
  /** Enable automatic retry on retryable errors */
27
27
  enableRetry?: boolean;
28
+ /** Whether to send cookies with requests */
29
+ withCredentials?: boolean;
28
30
  }
29
31
  /**
30
32
  * Base ecommerce API client class
@@ -199,8 +201,12 @@ declare enum OrderStatus {
199
201
  * Payment method enum
200
202
  */
201
203
  declare enum PaymentMethod {
202
- /** USDC payment via Hyperliquid escrow */
204
+ /** USDC payment via Hyperliquid SpotTransfer */
203
205
  USDC_ESCROW = "USDC_ESCROW",
206
+ /** BasedPay external ledger payment */
207
+ BASEDPAY = "BASEDPAY",
208
+ /** Stripe card payment */
209
+ STRIPE = "STRIPE",
204
210
  /** Points-based payment */
205
211
  POINTS = "POINTS"
206
212
  }
@@ -404,7 +410,9 @@ declare enum ProductSortBy {
404
410
  /** Sort by popularity */
405
411
  POPULAR = "popular",
406
412
  /** Sort by featured status */
407
- FEATURED = "featured"
413
+ FEATURED = "featured",
414
+ /** Sort by proximity to user location (requires lat/lng) */
415
+ NEARBY = "nearby"
408
416
  }
409
417
  /**
410
418
  * Review sort by enum
@@ -542,7 +550,7 @@ interface Merchant extends BaseEntity {
542
550
  /**
543
551
  * Shipping address
544
552
  */
545
- interface ShippingAddress {
553
+ interface ShippingAddress$1 {
546
554
  /** Full name */
547
555
  fullName: string;
548
556
  /** Phone number */
@@ -567,7 +575,7 @@ interface ShippingAddress {
567
575
  /**
568
576
  * User shipping address entity (saved addresses)
569
577
  */
570
- interface UserShippingAddress extends BaseEntity, ShippingAddress {
578
+ interface UserShippingAddress extends BaseEntity, ShippingAddress$1 {
571
579
  /** User ID */
572
580
  userId: string;
573
581
  /** Is default address */
@@ -670,7 +678,7 @@ interface Order extends BaseEntity {
670
678
  /** Payment method */
671
679
  paymentMethod: PaymentMethod;
672
680
  /** Shipping address */
673
- shippingAddress: ShippingAddress;
681
+ shippingAddress: ShippingAddress$1;
674
682
  /** Customer notes */
675
683
  customerNotes?: string | null;
676
684
  /** Order items */
@@ -1160,6 +1168,92 @@ interface FlashSale {
1160
1168
  /** Flash sale items */
1161
1169
  items: FlashSaleItem[];
1162
1170
  }
1171
+ /**
1172
+ * Merchant shipping settings entity
1173
+ */
1174
+ interface MerchantShippingSettings extends BaseEntity {
1175
+ /** Merchant ID */
1176
+ merchantId: string;
1177
+ /** Default handling fee in USDC */
1178
+ defaultHandlingFee: number;
1179
+ /** Default processing time in days */
1180
+ defaultProcessingDays: number;
1181
+ /** Default product weight in kg */
1182
+ defaultWeightKg: number;
1183
+ /** Free shipping enabled globally */
1184
+ freeShippingEnabled: boolean;
1185
+ /** Free shipping threshold in USDC */
1186
+ freeShippingThreshold: number | null;
1187
+ /** Show estimated delivery to customers */
1188
+ showEstimatedDelivery: boolean;
1189
+ }
1190
+ /**
1191
+ * Shipping zone entity
1192
+ */
1193
+ interface ShippingZone extends BaseEntity {
1194
+ /** Merchant ID */
1195
+ merchantId: string;
1196
+ /** Zone name */
1197
+ name: string;
1198
+ /** Country codes (ISO 2-letter codes) */
1199
+ countries: string[];
1200
+ /** Is default zone for unlisted countries */
1201
+ isDefault: boolean;
1202
+ /** Is zone active */
1203
+ isActive: boolean;
1204
+ /** Priority (higher = checked first) */
1205
+ priority: number;
1206
+ /** Number of rates in this zone */
1207
+ rateCount?: number;
1208
+ /** Associated shipping rates */
1209
+ rates?: ShippingRate[];
1210
+ }
1211
+ /**
1212
+ * Shipping rate entity
1213
+ */
1214
+ interface ShippingRate extends BaseEntity {
1215
+ /** Zone ID */
1216
+ zoneId: string;
1217
+ /** Zone name (for display) */
1218
+ zoneName?: string;
1219
+ /** Merchant ID */
1220
+ merchantId: string;
1221
+ /** Rate name (e.g., "Standard", "Express") */
1222
+ name: string;
1223
+ /** Base shipping rate in USDC */
1224
+ baseRate: number;
1225
+ /** Per kg rate in USDC */
1226
+ perKgRate: number;
1227
+ /** Minimum weight in kg */
1228
+ minWeightKg: number | null;
1229
+ /** Maximum weight in kg */
1230
+ maxWeightKg: number | null;
1231
+ /** Minimum delivery days */
1232
+ minDeliveryDays: number | null;
1233
+ /** Maximum delivery days */
1234
+ maxDeliveryDays: number | null;
1235
+ /** Free shipping above this amount */
1236
+ freeAboveAmount: number | null;
1237
+ /** Is rate active */
1238
+ isActive: boolean;
1239
+ /** Sort order */
1240
+ sortOrder: number;
1241
+ }
1242
+ /**
1243
+ * Shipping option (calculated for checkout)
1244
+ */
1245
+ 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;
1254
+ /** Zone name */
1255
+ zoneName: string;
1256
+ }
1163
1257
 
1164
1258
  /**
1165
1259
  * Ecommerce API Request Types
@@ -1200,6 +1294,12 @@ interface ListProductsParams extends PaginationParams {
1200
1294
  sortBy?: ProductSortBy;
1201
1295
  /** Filter by active status */
1202
1296
  isActive?: boolean;
1297
+ /** Filter by destination country (ISO 2-letter code) - only show products from merchants that ship here */
1298
+ country?: string;
1299
+ /** User latitude for proximity sorting (used with sortBy=nearby) */
1300
+ lat?: number;
1301
+ /** User longitude for proximity sorting (used with sortBy=nearby) */
1302
+ lng?: number;
1203
1303
  }
1204
1304
  /**
1205
1305
  * Create product request
@@ -1279,13 +1379,21 @@ interface CreateOrderRequest {
1279
1379
  /** Payment method */
1280
1380
  paymentMethod: PaymentMethod;
1281
1381
  /** Shipping address */
1282
- shippingAddress: ShippingAddress;
1382
+ shippingAddress: ShippingAddress$1;
1283
1383
  /** Customer notes */
1284
1384
  customerNotes?: string;
1285
1385
  /** Coupon code */
1286
1386
  couponCode?: string;
1287
1387
  /** Idempotency key */
1288
1388
  idempotencyKey?: string;
1389
+ /** Selected shipping method name (e.g., "Standard", "Express") */
1390
+ shippingMethod?: string;
1391
+ /** Calculated shipping cost in USDC */
1392
+ shippingCost?: number;
1393
+ /** Shipping zone name for reference */
1394
+ shippingZone?: string;
1395
+ /** Estimated delivery time (e.g., "5-7 business days") */
1396
+ estimatedDelivery?: string;
1289
1397
  }
1290
1398
  /**
1291
1399
  * List orders request parameters
@@ -1347,7 +1455,7 @@ interface RespondToReviewRequest {
1347
1455
  /**
1348
1456
  * Create/update shipping address request
1349
1457
  */
1350
- interface ShippingAddressRequest extends ShippingAddress {
1458
+ interface ShippingAddressRequest extends ShippingAddress$1 {
1351
1459
  /** Is default address */
1352
1460
  isDefault?: boolean;
1353
1461
  /** Address label */
@@ -1711,6 +1819,123 @@ interface ListFollowingParams extends PaginationParams {
1711
1819
  /** Sort by: recent (default) or name */
1712
1820
  sortBy?: "recent" | "name";
1713
1821
  }
1822
+ /**
1823
+ * Update shipping settings request
1824
+ */
1825
+ interface UpdateShippingSettingsRequest {
1826
+ /** Default handling fee in USDC */
1827
+ defaultHandlingFee?: number;
1828
+ /** Default processing time in days */
1829
+ defaultProcessingDays?: number;
1830
+ /** Default product weight in kg */
1831
+ defaultWeightKg?: number;
1832
+ /** Free shipping enabled globally */
1833
+ freeShippingEnabled?: boolean;
1834
+ /** Free shipping threshold in USDC */
1835
+ freeShippingThreshold?: number | null;
1836
+ /** Show estimated delivery to customers */
1837
+ showEstimatedDelivery?: boolean;
1838
+ }
1839
+ /**
1840
+ * Create shipping zone request
1841
+ */
1842
+ interface CreateShippingZoneRequest {
1843
+ /** Zone name */
1844
+ name: string;
1845
+ /** Country codes (ISO 2-letter codes) */
1846
+ countries: string[];
1847
+ /** Is default zone for unlisted countries */
1848
+ isDefault?: boolean;
1849
+ /** Is zone active */
1850
+ isActive?: boolean;
1851
+ /** Priority (higher = checked first) */
1852
+ priority?: number;
1853
+ }
1854
+ /**
1855
+ * Update shipping zone request
1856
+ */
1857
+ interface UpdateShippingZoneRequest extends Partial<CreateShippingZoneRequest> {
1858
+ }
1859
+ /**
1860
+ * Create shipping rate request
1861
+ */
1862
+ interface CreateShippingRateRequest {
1863
+ /** Zone ID */
1864
+ zoneId: string;
1865
+ /** Rate name (e.g., "Standard", "Express") */
1866
+ name: string;
1867
+ /** Base shipping rate in USDC */
1868
+ baseRate: number;
1869
+ /** Per kg rate in USDC */
1870
+ perKgRate?: number;
1871
+ /** Minimum weight in kg */
1872
+ minWeightKg?: number | null;
1873
+ /** Maximum weight in kg */
1874
+ maxWeightKg?: number | null;
1875
+ /** Minimum delivery days */
1876
+ minDeliveryDays?: number | null;
1877
+ /** Maximum delivery days */
1878
+ maxDeliveryDays?: number | null;
1879
+ /** Free shipping above this amount */
1880
+ freeAboveAmount?: number | null;
1881
+ /** Is rate active */
1882
+ isActive?: boolean;
1883
+ /** Sort order */
1884
+ sortOrder?: number;
1885
+ }
1886
+ /**
1887
+ * Update shipping rate request
1888
+ */
1889
+ interface UpdateShippingRateRequest extends Partial<Omit<CreateShippingRateRequest, "zoneId">> {
1890
+ }
1891
+ /**
1892
+ * Calculate shipping options request
1893
+ */
1894
+ interface CalculateShippingRequest {
1895
+ /** Merchant ID */
1896
+ merchantId: string;
1897
+ /** Cart items */
1898
+ cartItems: CartItem[];
1899
+ /** Destination country code (ISO 2-letter) */
1900
+ destinationCountry: string;
1901
+ /** Order subtotal in USDC */
1902
+ orderSubtotal: number;
1903
+ }
1904
+ /**
1905
+ * Gem history type filter
1906
+ */
1907
+ type GemHistoryTypeFilter = "earn" | "spend" | "all";
1908
+ /**
1909
+ * Get gem history parameters
1910
+ */
1911
+ interface GetGemHistoryParams extends PaginationParams {
1912
+ /** Filter by transaction type */
1913
+ type?: GemHistoryTypeFilter;
1914
+ }
1915
+ /**
1916
+ * Get expiring gems parameters
1917
+ */
1918
+ interface GetExpiringGemsParams {
1919
+ /** Number of days ahead to check (default: 30, max: 180) */
1920
+ days?: number;
1921
+ }
1922
+ /**
1923
+ * Save browsing location request
1924
+ */
1925
+ interface SaveBrowsingLocationRequest {
1926
+ /** Full display address from Google Places */
1927
+ formattedAddress: string;
1928
+ /** City name */
1929
+ city: string;
1930
+ /** State/Province (optional) */
1931
+ stateProvince?: string;
1932
+ /** ISO 2-letter country code (e.g., "SG", "US") */
1933
+ country: string;
1934
+ /** Latitude coordinate */
1935
+ latitude: number;
1936
+ /** Longitude coordinate */
1937
+ longitude: number;
1938
+ }
1714
1939
 
1715
1940
  /**
1716
1941
  * Ecommerce API Response Types
@@ -2577,6 +2802,271 @@ interface ActiveFlashSalesResponse {
2577
2802
  serverTime: string;
2578
2803
  }
2579
2804
 
2805
+ /**
2806
+ * Get shipping settings response
2807
+ */
2808
+ interface ShippingSettingsResponse {
2809
+ /** Shipping settings */
2810
+ settings: MerchantShippingSettings | {
2811
+ defaultHandlingFee: number;
2812
+ defaultProcessingDays: number;
2813
+ freeShippingEnabled: boolean;
2814
+ freeShippingThreshold: number | null;
2815
+ defaultWeightKg: number;
2816
+ showEstimatedDelivery: boolean;
2817
+ };
2818
+ }
2819
+ /**
2820
+ * List shipping zones response
2821
+ */
2822
+ interface ListShippingZonesResponse {
2823
+ /** Shipping zones */
2824
+ zones: ShippingZone[];
2825
+ }
2826
+ /**
2827
+ * Shipping zone response
2828
+ */
2829
+ interface ShippingZoneResponse {
2830
+ /** Shipping zone */
2831
+ zone: ShippingZone;
2832
+ }
2833
+ /**
2834
+ * List shipping rates response
2835
+ */
2836
+ interface ListShippingRatesResponse {
2837
+ /** Shipping rates */
2838
+ rates: ShippingRate[];
2839
+ }
2840
+ /**
2841
+ * Shipping rate response
2842
+ */
2843
+ interface ShippingRateResponse {
2844
+ /** Shipping rate */
2845
+ rate: ShippingRate;
2846
+ }
2847
+ /**
2848
+ * Calculate shipping options response
2849
+ */
2850
+ interface CalculateShippingResponse {
2851
+ /** Available shipping options */
2852
+ shippingOptions: ShippingOption[];
2853
+ }
2854
+ /**
2855
+ * Payment method info for display
2856
+ */
2857
+ interface PaymentMethodInfo {
2858
+ /** Payment method ID (e.g., "USDC_ESCROW") */
2859
+ id: string;
2860
+ /** Display name (e.g., "USDC (Hyperliquid)") */
2861
+ name: string;
2862
+ /** Description of the payment method */
2863
+ description: string;
2864
+ /** Icon identifier */
2865
+ icon?: string;
2866
+ /** Whether the payment requires user signature (e.g., blockchain) */
2867
+ requiresSignature?: boolean;
2868
+ /** Whether refunds are supported */
2869
+ supportsRefund?: boolean;
2870
+ }
2871
+ /**
2872
+ * Get payment methods response
2873
+ */
2874
+ interface GetPaymentMethodsResponse {
2875
+ /** Whether the request was successful */
2876
+ success: boolean;
2877
+ /** Whether payments are globally enabled */
2878
+ paymentsEnabled: boolean;
2879
+ /** List of enabled payment methods */
2880
+ methods: PaymentMethodInfo[];
2881
+ /** Optional message (e.g., when payments are disabled) */
2882
+ message?: string;
2883
+ }
2884
+ /**
2885
+ * Process payment request
2886
+ */
2887
+ interface ProcessPaymentRequest {
2888
+ /** Order ID to pay for */
2889
+ orderId: string;
2890
+ /** Payment method to use */
2891
+ paymentMethod: string;
2892
+ /** Amount in USDC */
2893
+ amount: number;
2894
+ /** Pre-signed action for USDC_ESCROW */
2895
+ signedAction?: {
2896
+ action: unknown;
2897
+ nonce: number;
2898
+ signature: unknown;
2899
+ };
2900
+ /** Stripe payment method ID */
2901
+ stripePaymentMethodId?: string;
2902
+ /** BasedPay account ID */
2903
+ basedPayAccountId?: string;
2904
+ /** Points to spend */
2905
+ pointsAmount?: number;
2906
+ }
2907
+ /**
2908
+ * Process payment response
2909
+ */
2910
+ interface ProcessPaymentResponse {
2911
+ /** Whether the payment was successful */
2912
+ success: boolean;
2913
+ /** Payment transaction ID */
2914
+ transactionId?: string;
2915
+ /** Blockchain transaction hash (for crypto payments) */
2916
+ transactionHash?: string;
2917
+ /** Payment status */
2918
+ status: "PENDING" | "PROCESSING" | "COMPLETED" | "FAILED" | "CANCELLED" | "REFUNDED";
2919
+ /** Amount charged */
2920
+ amount: number;
2921
+ /** Currency */
2922
+ currency: string;
2923
+ /** Error message if failed */
2924
+ error?: string;
2925
+ /** Error code */
2926
+ errorCode?: string;
2927
+ }
2928
+ /**
2929
+ * Gem source type - how gems were earned
2930
+ */
2931
+ type GemSource = "BUILDER_CODE" | "PREDICTION" | "CARD_SPEND" | "MALL_SPEND" | "ADMIN" | "REFUND";
2932
+ /**
2933
+ * Get gem balance response
2934
+ */
2935
+ interface GetGemBalanceResponse {
2936
+ /** User ID */
2937
+ userId: string;
2938
+ /** Total gems owned */
2939
+ totalGems: number;
2940
+ /** Available gems (not reserved) */
2941
+ availableGems: number;
2942
+ /** Gems expiring within 30 days */
2943
+ expiringSoon: number;
2944
+ /** Last balance update timestamp */
2945
+ lastUpdated: string;
2946
+ /** USD equivalent (totalGems / 100) */
2947
+ usdEquivalent: number;
2948
+ /** Conversion rate (gems per $1) */
2949
+ conversionRate: number;
2950
+ }
2951
+ /**
2952
+ * Gem history item type
2953
+ */
2954
+ type GemHistoryType = "earn" | "spend" | "expire";
2955
+ /**
2956
+ * Gem history item
2957
+ */
2958
+ interface GemHistoryItem {
2959
+ /** Transaction ID */
2960
+ id: string;
2961
+ /** Type of transaction */
2962
+ type: GemHistoryType;
2963
+ /** Amount of gems (positive for earn, negative for spend) */
2964
+ amount: number;
2965
+ /** Source type (for earn transactions) */
2966
+ source?: GemSource;
2967
+ /** Reason description (for spend transactions) */
2968
+ reason?: string;
2969
+ /** When the transaction occurred */
2970
+ createdAt: string;
2971
+ /** When the gems expire (for earn transactions) */
2972
+ expiresAt?: string;
2973
+ }
2974
+ /**
2975
+ * Get gem history response
2976
+ */
2977
+ interface GetGemHistoryResponse {
2978
+ /** History items */
2979
+ items: GemHistoryItem[];
2980
+ /** Total count of items */
2981
+ total: number;
2982
+ /** Pagination info */
2983
+ pagination: {
2984
+ /** Items per page */
2985
+ limit: number;
2986
+ /** Current offset */
2987
+ offset: number;
2988
+ /** Whether more items exist */
2989
+ hasMore: boolean;
2990
+ };
2991
+ }
2992
+ /**
2993
+ * Expiring gem batch
2994
+ */
2995
+ interface ExpiringGemBatch {
2996
+ /** Batch ID */
2997
+ id: string;
2998
+ /** Remaining gems in batch */
2999
+ amount: number;
3000
+ /** How the gems were earned */
3001
+ source: GemSource;
3002
+ /** When the batch expires */
3003
+ expiresAt: string;
3004
+ /** When the batch was created */
3005
+ createdAt: string;
3006
+ /** Days until expiry */
3007
+ daysUntilExpiry: number;
3008
+ }
3009
+ /**
3010
+ * Get expiring gems response
3011
+ */
3012
+ interface GetExpiringGemsResponse {
3013
+ /** Total gems expiring within the query period */
3014
+ totalExpiring: number;
3015
+ /** Expiring batches */
3016
+ batches: ExpiringGemBatch[];
3017
+ /** Query parameters used */
3018
+ queryParams: {
3019
+ /** Days ahead that were queried */
3020
+ days: number;
3021
+ };
3022
+ }
3023
+ /**
3024
+ * User's browsing location for geo-based product filtering
3025
+ */
3026
+ interface BrowsingLocation {
3027
+ /** Location ID */
3028
+ id: string;
3029
+ /** Full display address */
3030
+ formattedAddress: string;
3031
+ /** City name */
3032
+ city: string;
3033
+ /** State/Province (if applicable) */
3034
+ stateProvince?: string | null;
3035
+ /** ISO 2-letter country code */
3036
+ country: string;
3037
+ /** Latitude coordinate */
3038
+ latitude: number;
3039
+ /** Longitude coordinate */
3040
+ longitude: number;
3041
+ /** Last updated timestamp */
3042
+ updatedAt: string;
3043
+ }
3044
+ /**
3045
+ * Get browsing location response
3046
+ */
3047
+ interface GetBrowsingLocationResponse {
3048
+ /** User's saved browsing location (null if not set) */
3049
+ location: BrowsingLocation | null;
3050
+ }
3051
+ /**
3052
+ * Save browsing location response
3053
+ */
3054
+ interface SaveBrowsingLocationResponse {
3055
+ /** Whether the operation was successful */
3056
+ success: boolean;
3057
+ /** The saved location */
3058
+ location: BrowsingLocation;
3059
+ }
3060
+ /**
3061
+ * Delete browsing location response
3062
+ */
3063
+ interface DeleteBrowsingLocationResponse {
3064
+ /** Whether the operation was successful */
3065
+ success: boolean;
3066
+ /** Success message */
3067
+ message: string;
3068
+ }
3069
+
2580
3070
  /**
2581
3071
  * Customer/End-User Ecommerce API Client
2582
3072
  *
@@ -2922,6 +3412,29 @@ declare class CustomerEcommerceClient extends BaseEcommerceClient {
2922
3412
  * ```
2923
3413
  */
2924
3414
  calculateTax(request: CalculateTaxRequest): Promise<CalculateTaxResponse>;
3415
+ /**
3416
+ * Calculate shipping options for cart items
3417
+ *
3418
+ * @param request - Cart items, merchant, and destination
3419
+ * @returns Available shipping options with costs
3420
+ *
3421
+ * @example
3422
+ * ```typescript
3423
+ * const result = await client.calculateShippingOptions({
3424
+ * merchantId: "merchant_123",
3425
+ * cartItems: [
3426
+ * { productId: "prod_123", quantity: 2 }
3427
+ * ],
3428
+ * destinationCountry: "US",
3429
+ * orderSubtotal: 99.99
3430
+ * });
3431
+ *
3432
+ * result.shippingOptions.forEach(opt => {
3433
+ * console.log(opt.name, opt.cost, opt.estimatedDelivery);
3434
+ * });
3435
+ * ```
3436
+ */
3437
+ calculateShippingOptions(request: CalculateShippingRequest): Promise<CalculateShippingResponse>;
2925
3438
  /**
2926
3439
  * Get active promotional banners
2927
3440
  *
@@ -3135,6 +3648,146 @@ declare class CustomerEcommerceClient extends BaseEcommerceClient {
3135
3648
  * ```
3136
3649
  */
3137
3650
  getFollowedMerchants(params?: ListFollowingParams): Promise<ListFollowingResponse>;
3651
+ /**
3652
+ * Get available payment methods
3653
+ *
3654
+ * Returns the list of enabled payment methods that can be used during checkout.
3655
+ *
3656
+ * @returns List of available payment methods with display info
3657
+ *
3658
+ * @example
3659
+ * ```typescript
3660
+ * const result = await client.getPaymentMethods();
3661
+ * if (result.paymentsEnabled) {
3662
+ * result.methods.forEach(method => {
3663
+ * console.log(`${method.name}: ${method.description}`);
3664
+ * });
3665
+ * }
3666
+ * ```
3667
+ */
3668
+ getPaymentMethods(): Promise<GetPaymentMethodsResponse>;
3669
+ /**
3670
+ * Get user's gem balance
3671
+ *
3672
+ * Returns the current gem balance including total gems, available gems,
3673
+ * and gems expiring soon. Gems are earned at 100 per $1 of revenue.
3674
+ *
3675
+ * @returns Current gem balance with USD equivalent
3676
+ *
3677
+ * @example
3678
+ * ```typescript
3679
+ * const balance = await client.getGemBalance();
3680
+ * console.log(`You have ${balance.totalGems} gems (${balance.usdEquivalent} USD)`);
3681
+ * console.log(`${balance.expiringSoon} gems expiring soon`);
3682
+ * ```
3683
+ */
3684
+ getGemBalance(): Promise<GetGemBalanceResponse>;
3685
+ /**
3686
+ * Get gem transaction history
3687
+ *
3688
+ * Returns paginated history of gem transactions including earning,
3689
+ * spending, and expiration events.
3690
+ *
3691
+ * @param params - Query parameters for filtering and pagination
3692
+ * @returns Paginated gem history
3693
+ *
3694
+ * @example
3695
+ * ```typescript
3696
+ * // Get all history
3697
+ * const history = await client.getGemHistory({ limit: 20, offset: 0 });
3698
+ *
3699
+ * // Get only earned gems
3700
+ * const earned = await client.getGemHistory({ type: "earn", limit: 10 });
3701
+ *
3702
+ * // Get only spent gems
3703
+ * const spent = await client.getGemHistory({ type: "spend", limit: 10 });
3704
+ *
3705
+ * history.items.forEach(item => {
3706
+ * console.log(`${item.type}: ${item.amount} gems - ${item.createdAt}`);
3707
+ * });
3708
+ * ```
3709
+ */
3710
+ getGemHistory(params?: GetGemHistoryParams): Promise<GetGemHistoryResponse>;
3711
+ /**
3712
+ * Get gems that are expiring soon
3713
+ *
3714
+ * Returns gem batches that will expire within the specified number of days.
3715
+ * Useful for prompting users to spend gems before they expire.
3716
+ *
3717
+ * @param params - Query parameters (days: default 30, max 180)
3718
+ * @returns Expiring gem batches with countdown info
3719
+ *
3720
+ * @example
3721
+ * ```typescript
3722
+ * // Get gems expiring in next 30 days (default)
3723
+ * const expiring = await client.getExpiringGems();
3724
+ *
3725
+ * // Get gems expiring in next 7 days
3726
+ * const urgent = await client.getExpiringGems({ days: 7 });
3727
+ *
3728
+ * if (expiring.totalExpiring > 0) {
3729
+ * console.log(`${expiring.totalExpiring} gems expiring soon!`);
3730
+ * expiring.batches.forEach(batch => {
3731
+ * console.log(`${batch.amount} gems expire in ${batch.daysUntilExpiry} days`);
3732
+ * });
3733
+ * }
3734
+ * ```
3735
+ */
3736
+ getExpiringGems(params?: GetExpiringGemsParams): Promise<GetExpiringGemsResponse>;
3737
+ /**
3738
+ * Get user's browsing location
3739
+ *
3740
+ * Returns the user's saved delivery location for geo-based product filtering.
3741
+ * This location is used to show products from merchants that ship to the area.
3742
+ *
3743
+ * @returns Current browsing location or null if not set
3744
+ *
3745
+ * @example
3746
+ * ```typescript
3747
+ * const result = await client.getBrowsingLocation();
3748
+ * if (result.location) {
3749
+ * console.log(`Delivery to: ${result.location.city}, ${result.location.country}`);
3750
+ * }
3751
+ * ```
3752
+ */
3753
+ getBrowsingLocation(): Promise<GetBrowsingLocationResponse>;
3754
+ /**
3755
+ * Save user's browsing location
3756
+ *
3757
+ * Sets the user's delivery location for geo-based product filtering.
3758
+ * Products will be filtered to show only items from merchants that ship to this location.
3759
+ *
3760
+ * @param request - Location data from Google Places or manual input
3761
+ * @returns The saved location
3762
+ *
3763
+ * @example
3764
+ * ```typescript
3765
+ * const result = await client.saveBrowsingLocation({
3766
+ * formattedAddress: "Singapore, Singapore",
3767
+ * city: "Singapore",
3768
+ * country: "SG",
3769
+ * latitude: 1.3521,
3770
+ * longitude: 103.8198
3771
+ * });
3772
+ * console.log(`Location saved: ${result.location.formattedAddress}`);
3773
+ * ```
3774
+ */
3775
+ saveBrowsingLocation(request: SaveBrowsingLocationRequest): Promise<SaveBrowsingLocationResponse>;
3776
+ /**
3777
+ * Clear user's browsing location
3778
+ *
3779
+ * Removes the user's saved delivery location. Products will no longer
3780
+ * be filtered by shipping destination.
3781
+ *
3782
+ * @returns Success response
3783
+ *
3784
+ * @example
3785
+ * ```typescript
3786
+ * await client.clearBrowsingLocation();
3787
+ * console.log("Location cleared - showing all products");
3788
+ * ```
3789
+ */
3790
+ clearBrowsingLocation(): Promise<DeleteBrowsingLocationResponse>;
3138
3791
  }
3139
3792
 
3140
3793
  /**
@@ -3616,6 +4269,166 @@ declare class MerchantEcommerceClient extends BaseEcommerceClient {
3616
4269
  * ```
3617
4270
  */
3618
4271
  updateShipment(shipmentId: string, request: UpdateShipmentRequest): Promise<ShipmentResponse>;
4272
+ /**
4273
+ * Get merchant shipping settings
4274
+ *
4275
+ * @returns Shipping settings
4276
+ *
4277
+ * @example
4278
+ * ```typescript
4279
+ * const { settings } = await client.getShippingSettings();
4280
+ * console.log("Handling fee:", settings.defaultHandlingFee);
4281
+ * ```
4282
+ */
4283
+ getShippingSettings(): Promise<ShippingSettingsResponse>;
4284
+ /**
4285
+ * Update merchant shipping settings
4286
+ *
4287
+ * @param request - Settings to update
4288
+ * @returns Updated settings
4289
+ *
4290
+ * @example
4291
+ * ```typescript
4292
+ * await client.updateShippingSettings({
4293
+ * defaultHandlingFee: 2.50,
4294
+ * freeShippingEnabled: true,
4295
+ * freeShippingThreshold: 100
4296
+ * });
4297
+ * ```
4298
+ */
4299
+ updateShippingSettings(request: UpdateShippingSettingsRequest): Promise<ShippingSettingsResponse>;
4300
+ /**
4301
+ * List all shipping zones
4302
+ *
4303
+ * @returns List of shipping zones with rate counts
4304
+ *
4305
+ * @example
4306
+ * ```typescript
4307
+ * const { zones } = await client.listShippingZones();
4308
+ * zones.forEach(z => console.log(z.name, z.countries.length, "countries"));
4309
+ * ```
4310
+ */
4311
+ listShippingZones(): Promise<ListShippingZonesResponse>;
4312
+ /**
4313
+ * Get a shipping zone by ID
4314
+ *
4315
+ * @param zoneId - Zone ID
4316
+ * @returns Zone with rates
4317
+ *
4318
+ * @example
4319
+ * ```typescript
4320
+ * const { zone } = await client.getShippingZone("zone_123");
4321
+ * console.log(zone.name, zone.rates?.length, "rates");
4322
+ * ```
4323
+ */
4324
+ getShippingZone(zoneId: string): Promise<ShippingZoneResponse>;
4325
+ /**
4326
+ * Create a shipping zone
4327
+ *
4328
+ * @param request - Zone data
4329
+ * @returns Created zone
4330
+ *
4331
+ * @example
4332
+ * ```typescript
4333
+ * const { zone } = await client.createShippingZone({
4334
+ * name: "Southeast Asia",
4335
+ * countries: ["SG", "MY", "TH", "ID", "PH", "VN"],
4336
+ * isDefault: false,
4337
+ * priority: 10
4338
+ * });
4339
+ * ```
4340
+ */
4341
+ createShippingZone(request: CreateShippingZoneRequest): Promise<ShippingZoneResponse>;
4342
+ /**
4343
+ * Update a shipping zone
4344
+ *
4345
+ * @param zoneId - Zone ID
4346
+ * @param request - Updated zone data
4347
+ * @returns Updated zone
4348
+ *
4349
+ * @example
4350
+ * ```typescript
4351
+ * await client.updateShippingZone("zone_123", {
4352
+ * countries: ["SG", "MY", "TH", "ID", "PH", "VN", "BN"]
4353
+ * });
4354
+ * ```
4355
+ */
4356
+ updateShippingZone(zoneId: string, request: UpdateShippingZoneRequest): Promise<ShippingZoneResponse>;
4357
+ /**
4358
+ * Delete a shipping zone
4359
+ *
4360
+ * @param zoneId - Zone ID
4361
+ * @returns Success response
4362
+ *
4363
+ * @example
4364
+ * ```typescript
4365
+ * await client.deleteShippingZone("zone_123");
4366
+ * ```
4367
+ */
4368
+ deleteShippingZone(zoneId: string): Promise<SuccessResponse>;
4369
+ /**
4370
+ * List shipping rates
4371
+ *
4372
+ * @param zoneId - Optional zone ID to filter by
4373
+ * @returns List of shipping rates
4374
+ *
4375
+ * @example
4376
+ * ```typescript
4377
+ * // All rates
4378
+ * const { rates } = await client.listShippingRates();
4379
+ *
4380
+ * // Rates for a specific zone
4381
+ * const { rates: zoneRates } = await client.listShippingRates("zone_123");
4382
+ * ```
4383
+ */
4384
+ listShippingRates(zoneId?: string): Promise<ListShippingRatesResponse>;
4385
+ /**
4386
+ * Create a shipping rate
4387
+ *
4388
+ * @param request - Rate data
4389
+ * @returns Created rate
4390
+ *
4391
+ * @example
4392
+ * ```typescript
4393
+ * const { rate } = await client.createShippingRate({
4394
+ * zoneId: "zone_123",
4395
+ * name: "Standard Shipping",
4396
+ * baseRate: 5.00,
4397
+ * perKgRate: 1.50,
4398
+ * minDeliveryDays: 7,
4399
+ * maxDeliveryDays: 14
4400
+ * });
4401
+ * ```
4402
+ */
4403
+ createShippingRate(request: CreateShippingRateRequest): Promise<ShippingRateResponse>;
4404
+ /**
4405
+ * Update a shipping rate
4406
+ *
4407
+ * @param rateId - Rate ID
4408
+ * @param request - Updated rate data
4409
+ * @returns Updated rate
4410
+ *
4411
+ * @example
4412
+ * ```typescript
4413
+ * await client.updateShippingRate("rate_123", {
4414
+ * baseRate: 6.00,
4415
+ * freeAboveAmount: 75
4416
+ * });
4417
+ * ```
4418
+ */
4419
+ updateShippingRate(rateId: string, request: UpdateShippingRateRequest): Promise<ShippingRateResponse>;
4420
+ /**
4421
+ * Delete a shipping rate
4422
+ *
4423
+ * @param rateId - Rate ID
4424
+ * @returns Success response
4425
+ *
4426
+ * @example
4427
+ * ```typescript
4428
+ * await client.deleteShippingRate("rate_123");
4429
+ * ```
4430
+ */
4431
+ deleteShippingRate(rateId: string): Promise<SuccessResponse>;
3619
4432
  /**
3620
4433
  * List returns
3621
4434
  *
@@ -4111,6 +4924,506 @@ declare class MerchantEcommerceClient extends BaseEcommerceClient {
4111
4924
  * ```
4112
4925
  */
4113
4926
  exportTaxReport(reportId: string): Promise<string>;
4927
+ /**
4928
+ * List connected dropship suppliers
4929
+ *
4930
+ * @returns Connected and available suppliers
4931
+ *
4932
+ * @example
4933
+ * ```typescript
4934
+ * const { connected, available } = await client.listDropshipSuppliers();
4935
+ * ```
4936
+ */
4937
+ listDropshipSuppliers(): Promise<{
4938
+ connected: DropshipSupplier[];
4939
+ available: DropshipSupplierInfo[];
4940
+ }>;
4941
+ /**
4942
+ * Connect a new dropship supplier
4943
+ *
4944
+ * @param request - Supplier credentials
4945
+ * @returns Connected supplier
4946
+ *
4947
+ * @example
4948
+ * ```typescript
4949
+ * const supplier = await client.connectDropshipSupplier({
4950
+ * code: "CJ_DROPSHIPPING",
4951
+ * apiKey: "your-api-key"
4952
+ * });
4953
+ * ```
4954
+ */
4955
+ connectDropshipSupplier(request: ConnectDropshipSupplierRequest): Promise<{
4956
+ supplier: DropshipSupplier;
4957
+ message: string;
4958
+ }>;
4959
+ /**
4960
+ * Update dropship supplier settings
4961
+ *
4962
+ * @param supplierId - Supplier ID
4963
+ * @param request - Settings to update
4964
+ * @returns Updated supplier
4965
+ */
4966
+ updateDropshipSupplier(supplierId: string, request: UpdateDropshipSupplierRequest): Promise<{
4967
+ supplier: DropshipSupplier;
4968
+ }>;
4969
+ /**
4970
+ * Disconnect a dropship supplier
4971
+ *
4972
+ * @param supplierId - Supplier ID
4973
+ */
4974
+ disconnectDropshipSupplier(supplierId: string): Promise<SuccessResponse>;
4975
+ /**
4976
+ * Search products from connected suppliers
4977
+ *
4978
+ * @param request - Search parameters
4979
+ * @returns Search results with pagination
4980
+ *
4981
+ * @example
4982
+ * ```typescript
4983
+ * const results = await client.searchDropshipProducts({
4984
+ * supplierId: "supplier_123",
4985
+ * query: "wireless headphones",
4986
+ * limit: 20
4987
+ * });
4988
+ * ```
4989
+ */
4990
+ searchDropshipProducts(request: SearchDropshipProductsRequest): Promise<{
4991
+ products: SupplierProduct[];
4992
+ pagination: {
4993
+ total: number;
4994
+ page: number;
4995
+ limit: number;
4996
+ hasMore: boolean;
4997
+ };
4998
+ supplier?: string;
4999
+ }>;
5000
+ /**
5001
+ * Get dropship supplier categories
5002
+ *
5003
+ * @param supplierId - Supplier ID
5004
+ * @returns Category list
5005
+ */
5006
+ getDropshipCategories(supplierId: string): Promise<{
5007
+ categories: SupplierCategory[];
5008
+ }>;
5009
+ /**
5010
+ * Get detailed product info from supplier
5011
+ *
5012
+ * @param supplierId - Supplier ID
5013
+ * @param externalProductId - Supplier's product ID
5014
+ * @returns Product details with suggested pricing
5015
+ */
5016
+ getDropshipProductDetails(supplierId: string, externalProductId: string): Promise<{
5017
+ product: SupplierProduct;
5018
+ suggestedPrice: number;
5019
+ estimatedMargin: number;
5020
+ }>;
5021
+ /**
5022
+ * Import a product from supplier to your store
5023
+ *
5024
+ * @param request - Import parameters
5025
+ * @returns Created product IDs
5026
+ *
5027
+ * @example
5028
+ * ```typescript
5029
+ * const result = await client.importDropshipProduct({
5030
+ * supplierId: "supplier_123",
5031
+ * externalProductId: "ext_product_456",
5032
+ * priceUSDC: 29.99,
5033
+ * title: "Custom Title"
5034
+ * });
5035
+ * ```
5036
+ */
5037
+ importDropshipProduct(request: ImportDropshipProductRequest): Promise<{
5038
+ success: boolean;
5039
+ productId?: string;
5040
+ dropshipProductId?: string;
5041
+ error?: string;
5042
+ }>;
5043
+ /**
5044
+ * Bulk import products from supplier
5045
+ *
5046
+ * @param request - Bulk import parameters
5047
+ * @returns Import results
5048
+ */
5049
+ bulkImportDropshipProducts(request: BulkImportDropshipProductsRequest): Promise<{
5050
+ success: boolean;
5051
+ imported: number;
5052
+ failed: number;
5053
+ results: Array<{
5054
+ externalProductId: string;
5055
+ success: boolean;
5056
+ productId?: string;
5057
+ error?: string;
5058
+ }>;
5059
+ }>;
5060
+ /**
5061
+ * List imported dropship products
5062
+ *
5063
+ * @param params - Filter parameters
5064
+ * @returns Imported products list
5065
+ */
5066
+ listDropshipProducts(params?: {
5067
+ supplierId?: string;
5068
+ isActive?: boolean;
5069
+ limit?: number;
5070
+ offset?: number;
5071
+ }): Promise<{
5072
+ items: DropshipProduct[];
5073
+ pagination: {
5074
+ total: number;
5075
+ limit: number;
5076
+ offset: number;
5077
+ hasMore: boolean;
5078
+ };
5079
+ }>;
5080
+ /**
5081
+ * List dropship order links
5082
+ *
5083
+ * @param params - Filter parameters
5084
+ * @returns Order links with status summary
5085
+ */
5086
+ listDropshipOrders(params?: {
5087
+ status?: string | string[];
5088
+ limit?: number;
5089
+ offset?: number;
5090
+ }): Promise<{
5091
+ items: DropshipOrderLink[];
5092
+ pagination: {
5093
+ total: number;
5094
+ limit: number;
5095
+ offset: number;
5096
+ hasMore: boolean;
5097
+ };
5098
+ summary: {
5099
+ pending: number;
5100
+ forwarded: number;
5101
+ processing: number;
5102
+ shipped: number;
5103
+ delivered: number;
5104
+ failed: number;
5105
+ };
5106
+ }>;
5107
+ /**
5108
+ * Forward orders to supplier
5109
+ *
5110
+ * @param orderItemIds - Order item IDs to forward
5111
+ * @returns Forward results
5112
+ */
5113
+ forwardDropshipOrders(orderItemIds: string[]): Promise<{
5114
+ success: boolean;
5115
+ forwarded: number;
5116
+ failed: number;
5117
+ results: Array<{
5118
+ orderItemId: string;
5119
+ success: boolean;
5120
+ externalOrderId?: string;
5121
+ error?: string;
5122
+ }>;
5123
+ }>;
5124
+ /**
5125
+ * Sync tracking for all pending dropship orders
5126
+ *
5127
+ * @returns Sync results
5128
+ */
5129
+ syncDropshipTracking(): Promise<{
5130
+ success: boolean;
5131
+ total: number;
5132
+ synced: number;
5133
+ updated: number;
5134
+ failed: number;
5135
+ }>;
5136
+ /**
5137
+ * Get order forwarding details for manual forwarding
5138
+ *
5139
+ * @param orderItemId - Order item ID
5140
+ * @returns Forwarding details
5141
+ */
5142
+ getDropshipOrderDetails(orderItemId: string): Promise<{
5143
+ details: {
5144
+ orderId: string;
5145
+ orderItemId: string;
5146
+ productTitle: string;
5147
+ quantity: number;
5148
+ supplierName: string;
5149
+ supplierProductId: string;
5150
+ supplierPrice: number;
5151
+ shippingAddress: ShippingAddress;
5152
+ estimatedCost: number;
5153
+ status: string;
5154
+ };
5155
+ }>;
5156
+ /**
5157
+ * Forward a single order item to supplier
5158
+ *
5159
+ * @param orderItemId - Order item ID
5160
+ * @returns Forward result
5161
+ */
5162
+ forwardDropshipOrder(orderItemId: string): Promise<{
5163
+ success: boolean;
5164
+ dropshipOrderLinkId?: string;
5165
+ externalOrderId?: string;
5166
+ error?: string;
5167
+ }>;
5168
+ /**
5169
+ * Get dropship settings
5170
+ *
5171
+ * @returns Merchant dropship settings
5172
+ */
5173
+ getDropshipSettings(): Promise<{
5174
+ settings: DropshipMerchantSettings;
5175
+ }>;
5176
+ /**
5177
+ * Update dropship settings
5178
+ *
5179
+ * @param request - Settings to update
5180
+ * @returns Updated settings
5181
+ */
5182
+ updateDropshipSettings(request: UpdateDropshipSettingsRequest): Promise<{
5183
+ settings: DropshipMerchantSettings;
5184
+ }>;
5185
+ /**
5186
+ * Sync dropship products and/or orders
5187
+ *
5188
+ * @param type - Sync type (products, orders, all, single)
5189
+ * @param dropshipProductId - For single product sync
5190
+ * @returns Sync results
5191
+ */
5192
+ syncDropship(type: "products" | "orders" | "all" | "single", dropshipProductId?: string): Promise<{
5193
+ success: boolean;
5194
+ type: string;
5195
+ results: {
5196
+ products?: {
5197
+ total: number;
5198
+ synced: number;
5199
+ failed: number;
5200
+ };
5201
+ orders?: {
5202
+ total: number;
5203
+ synced: number;
5204
+ updated: number;
5205
+ failed: number;
5206
+ };
5207
+ product?: {
5208
+ success: boolean;
5209
+ updated: boolean;
5210
+ error?: string;
5211
+ };
5212
+ };
5213
+ }>;
5214
+ }
5215
+ interface DropshipSupplier {
5216
+ id: string;
5217
+ code: string;
5218
+ name: string;
5219
+ isActive: boolean;
5220
+ autoForward: boolean;
5221
+ settings?: Record<string, any>;
5222
+ createdAt: string;
5223
+ }
5224
+ interface DropshipSupplierInfo {
5225
+ code: string;
5226
+ name: string;
5227
+ description: string;
5228
+ features: string[];
5229
+ isConnected: boolean;
5230
+ }
5231
+ interface ConnectDropshipSupplierRequest {
5232
+ code: string;
5233
+ apiKey?: string;
5234
+ apiSecret?: string;
5235
+ accessToken?: string;
5236
+ }
5237
+ interface UpdateDropshipSupplierRequest {
5238
+ autoForward?: boolean;
5239
+ settings?: Record<string, any>;
5240
+ apiKey?: string;
5241
+ apiSecret?: string;
5242
+ accessToken?: string;
5243
+ }
5244
+ interface SearchDropshipProductsRequest {
5245
+ supplierId?: string;
5246
+ supplierCode?: string;
5247
+ query?: string;
5248
+ category?: string;
5249
+ minPrice?: number;
5250
+ maxPrice?: number;
5251
+ page?: number;
5252
+ limit?: number;
5253
+ sortBy?: "price_asc" | "price_desc" | "rating" | "orders" | "newest";
5254
+ }
5255
+ interface SupplierProduct {
5256
+ externalProductId: string;
5257
+ externalUrl?: string;
5258
+ externalSku?: string;
5259
+ title: string;
5260
+ description: string;
5261
+ images: string[];
5262
+ price: number;
5263
+ currency: string;
5264
+ shippingCost?: number;
5265
+ processingDays?: number;
5266
+ shippingDays?: number;
5267
+ warehouseLocation?: string;
5268
+ category?: string;
5269
+ variants?: SupplierProductVariant[];
5270
+ rating?: number;
5271
+ reviewCount?: number;
5272
+ minOrderQuantity?: number;
5273
+ inventory?: number;
5274
+ }
5275
+ interface SupplierProductVariant {
5276
+ externalVariantId: string;
5277
+ name: string;
5278
+ sku?: string;
5279
+ price: number;
5280
+ inventory?: number;
5281
+ attributes: Record<string, string>;
5282
+ image?: string;
5283
+ }
5284
+ interface SupplierCategory {
5285
+ id: string;
5286
+ name: string;
5287
+ parentId?: string;
5288
+ children?: SupplierCategory[];
5289
+ }
5290
+ interface ImportDropshipProductRequest {
5291
+ supplierId: string;
5292
+ externalProductId: string;
5293
+ priceUSDC: number;
5294
+ compareAtPrice?: number;
5295
+ title?: string;
5296
+ richDescription?: string;
5297
+ category?: string;
5298
+ categoryId?: string;
5299
+ tags?: string[];
5300
+ isActive?: boolean;
5301
+ }
5302
+ interface BulkImportDropshipProductsRequest {
5303
+ supplierId: string;
5304
+ products: Array<{
5305
+ externalProductId: string;
5306
+ priceUSDC: number;
5307
+ compareAtPrice?: number;
5308
+ title?: string;
5309
+ category?: string;
5310
+ categoryId?: string;
5311
+ }>;
5312
+ }
5313
+ interface DropshipProduct {
5314
+ id: string;
5315
+ supplierId: string;
5316
+ externalProductId: string;
5317
+ externalUrl?: string;
5318
+ supplierPrice: string;
5319
+ supplierCurrency: string;
5320
+ shippingCost?: string;
5321
+ processingDays?: number;
5322
+ shippingDays?: number;
5323
+ warehouseLocation?: string;
5324
+ productSnapshot: any;
5325
+ lastSyncedAt?: string;
5326
+ syncError?: string;
5327
+ localProductId?: string;
5328
+ localProduct?: {
5329
+ id: string;
5330
+ title: string;
5331
+ priceUSDC: string;
5332
+ images: string[];
5333
+ isActive: boolean;
5334
+ inventory?: number;
5335
+ soldCount: number;
5336
+ };
5337
+ supplier?: {
5338
+ id: string;
5339
+ name: string;
5340
+ code: string;
5341
+ };
5342
+ isActive: boolean;
5343
+ createdAt: string;
5344
+ }
5345
+ interface DropshipOrderLink {
5346
+ id: string;
5347
+ orderId: string;
5348
+ orderItemId: string;
5349
+ supplierId: string;
5350
+ dropshipProductId?: string;
5351
+ externalOrderId?: string;
5352
+ externalStatus?: string;
5353
+ status: string;
5354
+ forwardedAt?: string;
5355
+ processedAt?: string;
5356
+ shippedAt?: string;
5357
+ deliveredAt?: string;
5358
+ trackingNumber?: string;
5359
+ trackingUrl?: string;
5360
+ carrier?: string;
5361
+ supplierCost?: string;
5362
+ shippingCost?: string;
5363
+ lastError?: string;
5364
+ order?: {
5365
+ id: string;
5366
+ status: string;
5367
+ totalUSDC: string;
5368
+ shippingAddress: any;
5369
+ createdAt: string;
5370
+ };
5371
+ orderItem?: {
5372
+ id: string;
5373
+ titleSnapshot: string;
5374
+ quantity: number;
5375
+ unitPriceUSDC: string;
5376
+ };
5377
+ supplier?: {
5378
+ id: string;
5379
+ name: string;
5380
+ code: string;
5381
+ };
5382
+ createdAt: string;
5383
+ }
5384
+ interface DropshipMerchantSettings {
5385
+ merchantId: string;
5386
+ defaultMarkupType: string;
5387
+ defaultMarkupValue: string;
5388
+ roundPriceTo?: string;
5389
+ autoForwardOrders: boolean;
5390
+ autoSyncTracking: boolean;
5391
+ syncIntervalMinutes: number;
5392
+ autoSyncInventory: boolean;
5393
+ lowStockThreshold: number;
5394
+ outOfStockBehavior: string;
5395
+ defaultShippingMethod?: string;
5396
+ freeShippingThreshold?: string;
5397
+ notifyOnNewOrder: boolean;
5398
+ notifyOnLowStock: boolean;
5399
+ notifyOnShipment: boolean;
5400
+ }
5401
+ interface UpdateDropshipSettingsRequest {
5402
+ defaultMarkupType?: string;
5403
+ defaultMarkupValue?: number;
5404
+ roundPriceTo?: number | null;
5405
+ autoForwardOrders?: boolean;
5406
+ autoSyncTracking?: boolean;
5407
+ syncIntervalMinutes?: number;
5408
+ autoSyncInventory?: boolean;
5409
+ lowStockThreshold?: number;
5410
+ outOfStockBehavior?: string;
5411
+ defaultShippingMethod?: string | null;
5412
+ freeShippingThreshold?: number | null;
5413
+ notifyOnNewOrder?: boolean;
5414
+ notifyOnLowStock?: boolean;
5415
+ notifyOnShipment?: boolean;
5416
+ }
5417
+ interface ShippingAddress {
5418
+ fullName: string;
5419
+ phone: string;
5420
+ email?: string;
5421
+ addressLine1: string;
5422
+ addressLine2?: string;
5423
+ city: string;
5424
+ state?: string;
5425
+ postalCode: string;
5426
+ country: string;
4114
5427
  }
4115
5428
 
4116
5429
  /**
@@ -4189,4 +5502,4 @@ declare function calculateDiscountAmount(price: number, discountType: "PERCENTAG
4189
5502
  */
4190
5503
  declare function calculateFinalPrice(price: number, discountType: "PERCENTAGE" | "FIXED_AMOUNT", discountValue: number): number;
4191
5504
 
4192
- export { type ActiveFlashSalesResponse, type AnalyticsOverview, type ApiResponse, type AppliedDiscount, type Banner, type BannerResponse, BannerType, BaseEcommerceClient, type BaseEntity, type CalculateCartDiscountsRequest, type CalculateCartDiscountsResponse, 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 CreateTaxNexusRequest, type CreateTaxRuleRequest, CustomerEcommerceClient, type CustomerMessagesResponse, type CustomerSummary, DiscountMethod, DiscountScope, DiscountType, EcommerceApiError, type EcommerceClientConfig, type FlashSale, type FlashSaleItem, type FlashSaleItemInput, type FollowActionResponse, type FollowStatusResponse, type FollowedMerchantSummary, type GenerateTaxReportRequest, type GetAnalyticsParams, type GetAnalyticsResponse, type GetCouponResponse, type GetOrderResponse, 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 ListTaxNexusResponse, type ListTaxReportsParams, type ListTaxReportsResponse, type ListTaxRulesResponse, type MediaAsset, type MediaAssetResponse, type Merchant, MerchantEcommerceClient, type MerchantProductsResponse, type MerchantProfileRequest, type MerchantProfileResponse, 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, PaymentStatus, 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 SendMessageRequest, type Settlement, type Shipment, type ShipmentResponse, ShipmentStatus, type ShippingAddress, type ShippingAddressRequest, type ShippingAddressResponse, type ShippingMethod, type ShippingMethodResponse, 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 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 };
5505
+ 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 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 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 };