@rechargeapps/storefront-client 1.7.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/api/cdn.js +13 -8
- package/dist/cjs/api/cdn.js.map +1 -1
- package/dist/cjs/api/customer.js +25 -0
- package/dist/cjs/api/customer.js.map +1 -1
- package/dist/cjs/api/product.js +25 -0
- package/dist/cjs/api/product.js.map +1 -0
- package/dist/cjs/index.js +3 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/cdn.js +13 -8
- package/dist/esm/api/cdn.js.map +1 -1
- package/dist/esm/api/customer.js +25 -1
- package/dist/esm/api/customer.js.map +1 -1
- package/dist/esm/api/product.js +21 -0
- package/dist/esm/api/product.js.map +1 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +499 -222
- package/dist/umd/recharge-client.min.js +8 -8
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,80 @@
|
|
|
1
|
+
interface ChannelSettings {
|
|
2
|
+
api: {
|
|
3
|
+
display: boolean;
|
|
4
|
+
};
|
|
5
|
+
checkout_page: {
|
|
6
|
+
display: boolean;
|
|
7
|
+
};
|
|
8
|
+
customer_portal: {
|
|
9
|
+
display: boolean;
|
|
10
|
+
};
|
|
11
|
+
merchant_portal: {
|
|
12
|
+
display: boolean;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
interface SubscriptionPreferences {
|
|
16
|
+
charge_interval_frequency: number;
|
|
17
|
+
cutoff_day_of_month: null | number;
|
|
18
|
+
cutoff_day_of_week: null | number;
|
|
19
|
+
expire_after_specific_number_of_charges: null | number;
|
|
20
|
+
interval_unit: 'day' | 'week' | 'month';
|
|
21
|
+
order_day_of_month: number;
|
|
22
|
+
order_day_of_week: null | number;
|
|
23
|
+
order_interval_frequency: number;
|
|
24
|
+
}
|
|
25
|
+
type PlanType = 'prepaid' | 'subscription' | 'onetime' | 'membership_subscription';
|
|
26
|
+
interface Plan {
|
|
27
|
+
/** Unique numeric identifier for the Plan. */
|
|
28
|
+
id: number;
|
|
29
|
+
/** An object containing the availability of the plan through various supported channels. */
|
|
30
|
+
channel_settings: ChannelSettings;
|
|
31
|
+
/** The time the plan was created. */
|
|
32
|
+
created_at: IsoDateString;
|
|
33
|
+
/** If deleted, the time the plan was deleted. */
|
|
34
|
+
deleted_at?: IsoDateString;
|
|
35
|
+
/** The discount amount applied to the product price when purchased through this Plan. All Plans for a product must have the same discount amount. */
|
|
36
|
+
discount_amount: string;
|
|
37
|
+
/** Used in combination with discount amount to determine the discount applied on a product price when purchased through this Plan. */
|
|
38
|
+
discount_type: DiscountType;
|
|
39
|
+
/** External plan group id */
|
|
40
|
+
external_plan_group_id: number | null;
|
|
41
|
+
/** External plan id */
|
|
42
|
+
external_plan_id: number | null;
|
|
43
|
+
/** External plan name */
|
|
44
|
+
external_plan_name: string | null;
|
|
45
|
+
/** An object containing the product id as it appears in external platforms. */
|
|
46
|
+
external_product_id: ExternalId;
|
|
47
|
+
/** External variant ids related to this plan */
|
|
48
|
+
external_variant_ids: number[] | null;
|
|
49
|
+
has_variant_restrictions: boolean;
|
|
50
|
+
/** The number indicating the order which the plan will be in a list of related plans. */
|
|
51
|
+
sort_order: number;
|
|
52
|
+
/** An object containing the various subscription preferences associated with this plan. */
|
|
53
|
+
subscription_preferences: SubscriptionPreferences;
|
|
54
|
+
/** The title of the plan. All Plans for a product must have the same title. */
|
|
55
|
+
title: string;
|
|
56
|
+
/** The type of the plan. Products with a prepaid plan cannot have plans of other types. */
|
|
57
|
+
type: PlanType;
|
|
58
|
+
/** The time the plan was last updated. */
|
|
59
|
+
updated_at: IsoDateString;
|
|
60
|
+
}
|
|
61
|
+
interface PlansResponse {
|
|
62
|
+
next_cursor: null | string;
|
|
63
|
+
previous_cursor: null | string;
|
|
64
|
+
plans: Plan[];
|
|
65
|
+
}
|
|
66
|
+
type PlanSortBy = 'id-asc' | 'id-desc' | 'updated_at-asc' | 'updated_at-desc';
|
|
67
|
+
interface PlanListParams extends ListParams<PlanSortBy> {
|
|
68
|
+
/** Return the Plans linked to the Product record in Recharge with the indicated external_product_id */
|
|
69
|
+
external_product_id?: string | number;
|
|
70
|
+
/** Return the plans updated before the given date. */
|
|
71
|
+
updated_at_max?: IsoDateString;
|
|
72
|
+
/** Return the plans updated after the given date. */
|
|
73
|
+
updated_at_min?: IsoDateString;
|
|
74
|
+
/** Return the plans that are of a specific type. */
|
|
75
|
+
type?: PlanType;
|
|
76
|
+
}
|
|
77
|
+
|
|
1
78
|
/** HEXA, RGBA, HSLA */
|
|
2
79
|
type ColorString = string;
|
|
3
80
|
/** HTML String */
|
|
@@ -65,7 +142,7 @@ interface LineItem {
|
|
|
65
142
|
/** An array of name value pairs of additional line_item attributes. */
|
|
66
143
|
properties: Property[];
|
|
67
144
|
/** An indicator of the type of the purchase item. */
|
|
68
|
-
purchase_item_type:
|
|
145
|
+
purchase_item_type: PlanType;
|
|
69
146
|
/** The quantity of the line_item. */
|
|
70
147
|
quantity: number;
|
|
71
148
|
/** The SKU (stock keeping unit) of the Product associated with the line_item. */
|
|
@@ -97,6 +174,7 @@ interface TaxLine {
|
|
|
97
174
|
/** The title/name of the taxing jurisdiction. */
|
|
98
175
|
title: string;
|
|
99
176
|
}
|
|
177
|
+
type DiscountType = 'percentage' | 'fixed_amount' | 'shipping';
|
|
100
178
|
interface Discount {
|
|
101
179
|
/** The ID of the Discount. */
|
|
102
180
|
id: number;
|
|
@@ -105,7 +183,7 @@ interface Discount {
|
|
|
105
183
|
/** The value of the Discount. */
|
|
106
184
|
value?: number;
|
|
107
185
|
/** The type of the value of the Discount. */
|
|
108
|
-
value_type?:
|
|
186
|
+
value_type?: DiscountType;
|
|
109
187
|
}
|
|
110
188
|
interface AnalyticsData {
|
|
111
189
|
utm_params: {
|
|
@@ -344,8 +422,8 @@ interface BundlePurchaseItemParams {
|
|
|
344
422
|
}
|
|
345
423
|
|
|
346
424
|
interface AddonSettings {
|
|
347
|
-
collectionId: string;
|
|
348
425
|
collectionHandle: string;
|
|
426
|
+
collectionId: string;
|
|
349
427
|
enabled: boolean;
|
|
350
428
|
}
|
|
351
429
|
interface AddToCartCallbackSettings {
|
|
@@ -458,6 +536,7 @@ interface BundleVariant {
|
|
|
458
536
|
created_at: IsoDateString;
|
|
459
537
|
}
|
|
460
538
|
interface BundleProduct {
|
|
539
|
+
created_at: IsoDateString;
|
|
461
540
|
custom_prices: boolean;
|
|
462
541
|
customization_window_disabled_message: string | null;
|
|
463
542
|
customization_window: number | null;
|
|
@@ -466,15 +545,14 @@ interface BundleProduct {
|
|
|
466
545
|
external_product_id: string;
|
|
467
546
|
id: number;
|
|
468
547
|
is_customizable: boolean;
|
|
548
|
+
layout_settings: BundleProductLayoutSettings;
|
|
469
549
|
layout_settings_version: '2021-11';
|
|
470
550
|
max_quantity_per_variant: number | null;
|
|
551
|
+
price_rule: BundlePriceRule | null;
|
|
471
552
|
reset_box_contents: boolean;
|
|
472
553
|
title: string;
|
|
473
554
|
updated_at: IsoDateString;
|
|
474
|
-
created_at: IsoDateString;
|
|
475
|
-
layout_settings: BundleProductLayoutSettings;
|
|
476
555
|
variants: BundleVariant[];
|
|
477
|
-
price_rule: BundlePriceRule | null;
|
|
478
556
|
}
|
|
479
557
|
|
|
480
558
|
type SubscriptionStatus = 'active' | 'cancelled' | 'expired';
|
|
@@ -670,6 +748,9 @@ interface Subscription_2021_01 {
|
|
|
670
748
|
status: 'ACTIVE' | 'CANCELLED' | 'EXPIRED';
|
|
671
749
|
}
|
|
672
750
|
|
|
751
|
+
type CustomerNotification = 'SHOPIFY_UPDATE_PAYMENT_INFO';
|
|
752
|
+
type CustomerNotificationType = 'email' | 'sms';
|
|
753
|
+
type CustomerNotificationTemplate = 'shopify_update_payment_information';
|
|
673
754
|
type CustomerIncludes = 'addresses' | 'metafields' | 'payment_methods' | 'subscriptions';
|
|
674
755
|
interface GetCustomerOptions {
|
|
675
756
|
include?: CustomerIncludes[];
|
|
@@ -724,7 +805,7 @@ interface DeliveryLineItem extends Omit<LineItem, 'external_inventory_policy' |
|
|
|
724
805
|
/** Value is set to true if the order is skipped. */
|
|
725
806
|
is_skipped: boolean;
|
|
726
807
|
/** The type of the plan. May return null value in certain cases. */
|
|
727
|
-
plan_type:
|
|
808
|
+
plan_type: PlanType;
|
|
728
809
|
/** Value is set to true if it is a prepaid item */
|
|
729
810
|
is_prepaid: boolean;
|
|
730
811
|
/** The name of the product in a store’s catalog. */
|
|
@@ -1313,9 +1394,379 @@ interface RequestOptions extends GetRequestOptions, CRUDRequestOptions {
|
|
|
1313
1394
|
headers?: RequestHeaders;
|
|
1314
1395
|
}
|
|
1315
1396
|
|
|
1316
|
-
type
|
|
1317
|
-
type
|
|
1397
|
+
type ProductInclude = 'collections';
|
|
1398
|
+
type ProductSource = 'all' | 'in_recharge' | 'not_in_recharge';
|
|
1399
|
+
type PublishStatus = 'published' | 'unpublished' | 'any';
|
|
1318
1400
|
type StorefrontPurchaseOption = 'subscription_and_onetime' | 'subscription_only' | 'onetime_only' | 'inactive';
|
|
1401
|
+
interface ProductValueOption {
|
|
1402
|
+
id?: number | null;
|
|
1403
|
+
label: string;
|
|
1404
|
+
position?: number;
|
|
1405
|
+
}
|
|
1406
|
+
interface ProductOption {
|
|
1407
|
+
id: number;
|
|
1408
|
+
name: string;
|
|
1409
|
+
position: number;
|
|
1410
|
+
values: ProductValueOption[];
|
|
1411
|
+
}
|
|
1412
|
+
interface Modifier {
|
|
1413
|
+
id: number;
|
|
1414
|
+
type: 'dropdown' | 'multiple_choice' | 'radio_buttons' | 'rectangles' | 'checkbox' | 'text' | 'multi_line_text';
|
|
1415
|
+
name: 'Subscribe' | string;
|
|
1416
|
+
required: boolean;
|
|
1417
|
+
option_values: {
|
|
1418
|
+
id: number;
|
|
1419
|
+
label: string;
|
|
1420
|
+
}[];
|
|
1421
|
+
}
|
|
1422
|
+
interface SellingPlan {
|
|
1423
|
+
created_at?: IsoDateString;
|
|
1424
|
+
id: number;
|
|
1425
|
+
order_interval_frequency: number;
|
|
1426
|
+
order_interval_unit_type: IntervalUnit;
|
|
1427
|
+
price_adjustments_value: number;
|
|
1428
|
+
price_adjustments_value_type: 'percentage';
|
|
1429
|
+
selling_plan_id: number;
|
|
1430
|
+
selling_plan_name: string;
|
|
1431
|
+
updated_at?: IsoDateString;
|
|
1432
|
+
}
|
|
1433
|
+
interface SellingPlanGroup {
|
|
1434
|
+
selling_plan_group_id: string | number;
|
|
1435
|
+
selling_plans: SellingPlan[];
|
|
1436
|
+
subscription_product_id: number;
|
|
1437
|
+
}
|
|
1438
|
+
interface SubscriptionOption {
|
|
1439
|
+
charge_interval_frequency: number | null;
|
|
1440
|
+
cutoff_day_of_month: number | null;
|
|
1441
|
+
cutoff_day_of_week: number | null;
|
|
1442
|
+
expire_after_specific_number_of_charges: number | null;
|
|
1443
|
+
is_prepaid: boolean;
|
|
1444
|
+
modifiable_properties: string[];
|
|
1445
|
+
number_charges_until_expiration: number | null;
|
|
1446
|
+
order_day_of_month: number | null;
|
|
1447
|
+
order_day_of_week: number | null;
|
|
1448
|
+
order_interval_frequency_options: string[];
|
|
1449
|
+
order_interval_unit: 'day' | 'week' | 'month';
|
|
1450
|
+
storefront_purchase_options: StorefrontPurchaseOption;
|
|
1451
|
+
updated_at: IsoDateString;
|
|
1452
|
+
}
|
|
1453
|
+
interface ProductVariant_2020_12 {
|
|
1454
|
+
external_metafields: Record<string, unknown>;
|
|
1455
|
+
external_product_id: number;
|
|
1456
|
+
fulfillment_service: 'manual';
|
|
1457
|
+
id: number;
|
|
1458
|
+
image?: ProductImage;
|
|
1459
|
+
inventory: {
|
|
1460
|
+
inventory_level: number;
|
|
1461
|
+
inventory_policy: 'deny' | string;
|
|
1462
|
+
inventory_tracking: 'shopify' | string;
|
|
1463
|
+
};
|
|
1464
|
+
is_deleted: boolean;
|
|
1465
|
+
is_published: boolean;
|
|
1466
|
+
option_values: ProductValueOption[];
|
|
1467
|
+
price_includes_tax: boolean;
|
|
1468
|
+
prices: {
|
|
1469
|
+
compare_at_price: string | null;
|
|
1470
|
+
discounted_price: string;
|
|
1471
|
+
unit_price: string;
|
|
1472
|
+
zero_decimal_currency: boolean;
|
|
1473
|
+
prices?: [
|
|
1474
|
+
{
|
|
1475
|
+
presentment_prices: {
|
|
1476
|
+
currency: string;
|
|
1477
|
+
discounted_price: string;
|
|
1478
|
+
unit_price: string;
|
|
1479
|
+
}[];
|
|
1480
|
+
}
|
|
1481
|
+
];
|
|
1482
|
+
};
|
|
1483
|
+
product_id: number;
|
|
1484
|
+
requires_shipping: boolean;
|
|
1485
|
+
selling_plan_allocations: {
|
|
1486
|
+
selling_plan_group_id: string | number;
|
|
1487
|
+
selling_plan_id: number;
|
|
1488
|
+
discounted_price: string;
|
|
1489
|
+
}[];
|
|
1490
|
+
shipping_dimensions: {
|
|
1491
|
+
depth: string;
|
|
1492
|
+
height: string;
|
|
1493
|
+
weight: number;
|
|
1494
|
+
weight_unit: string;
|
|
1495
|
+
width: string;
|
|
1496
|
+
};
|
|
1497
|
+
sku: string;
|
|
1498
|
+
tax_code: string;
|
|
1499
|
+
taxable: boolean;
|
|
1500
|
+
title: string;
|
|
1501
|
+
}
|
|
1502
|
+
interface Product_2020_12 {
|
|
1503
|
+
brand: string;
|
|
1504
|
+
bundle_product: BundleProduct | null;
|
|
1505
|
+
collection_ids: number[];
|
|
1506
|
+
description: string;
|
|
1507
|
+
discount_amount: number;
|
|
1508
|
+
discount_type: DiscountType;
|
|
1509
|
+
external_created_at: IsoDateString;
|
|
1510
|
+
external_metafields: Record<string, unknown>;
|
|
1511
|
+
external_product_id: number;
|
|
1512
|
+
external_updated_at: IsoDateString;
|
|
1513
|
+
handle: string | null;
|
|
1514
|
+
id: number;
|
|
1515
|
+
images: ProductImage[];
|
|
1516
|
+
in_recharge: boolean;
|
|
1517
|
+
is_deleted: boolean;
|
|
1518
|
+
is_published: boolean;
|
|
1519
|
+
minimum_variant_price: string;
|
|
1520
|
+
modifiers: Modifier[];
|
|
1521
|
+
more_than_one_price: boolean;
|
|
1522
|
+
options: ProductOption[];
|
|
1523
|
+
published_at: IsoDateString;
|
|
1524
|
+
requires_shipping: boolean;
|
|
1525
|
+
selling_plan_groups: SellingPlanGroup[];
|
|
1526
|
+
subscription_options: SubscriptionOption;
|
|
1527
|
+
tags: string[];
|
|
1528
|
+
title: string;
|
|
1529
|
+
type: string;
|
|
1530
|
+
variants: ProductVariant_2020_12[];
|
|
1531
|
+
vendor: string;
|
|
1532
|
+
}
|
|
1533
|
+
interface ProductVariant_2022_06 {
|
|
1534
|
+
external_metafields: Record<string, unknown>;
|
|
1535
|
+
external_product_id: string;
|
|
1536
|
+
external_variant_id: string;
|
|
1537
|
+
fulfillment_service: 'manual';
|
|
1538
|
+
image?: ProductImage;
|
|
1539
|
+
inventory: {
|
|
1540
|
+
level: number;
|
|
1541
|
+
policy: 'deny' | string;
|
|
1542
|
+
tracking: 'shopify' | string;
|
|
1543
|
+
};
|
|
1544
|
+
is_deleted: boolean;
|
|
1545
|
+
is_published: boolean;
|
|
1546
|
+
option_values: string[];
|
|
1547
|
+
price_includes_tax: boolean;
|
|
1548
|
+
prices: {
|
|
1549
|
+
compare_at_price: null | unknown;
|
|
1550
|
+
currency: string;
|
|
1551
|
+
plans: {
|
|
1552
|
+
discount_value: string;
|
|
1553
|
+
discounted_price: string;
|
|
1554
|
+
id: number;
|
|
1555
|
+
}[];
|
|
1556
|
+
unit_price: string;
|
|
1557
|
+
};
|
|
1558
|
+
requires_shipping: boolean;
|
|
1559
|
+
shipping_dimensions: {
|
|
1560
|
+
depth: string | null;
|
|
1561
|
+
height: string | null;
|
|
1562
|
+
weight: number;
|
|
1563
|
+
weight_unit: string;
|
|
1564
|
+
width: string | null;
|
|
1565
|
+
};
|
|
1566
|
+
sku: string | null;
|
|
1567
|
+
tax_code: string | null;
|
|
1568
|
+
taxable: boolean;
|
|
1569
|
+
title: string;
|
|
1570
|
+
}
|
|
1571
|
+
interface Product_2022_06 {
|
|
1572
|
+
brand: string | null;
|
|
1573
|
+
bundle_product_id: number | null;
|
|
1574
|
+
collections: {
|
|
1575
|
+
id: number;
|
|
1576
|
+
position: unknown | null;
|
|
1577
|
+
}[];
|
|
1578
|
+
description: string | null;
|
|
1579
|
+
external_created_at: IsoDateString;
|
|
1580
|
+
external_metafields: Record<string, unknown>;
|
|
1581
|
+
external_plan_group_id: number | null;
|
|
1582
|
+
external_product_id: string;
|
|
1583
|
+
external_updated_at: IsoDateString;
|
|
1584
|
+
handle: string;
|
|
1585
|
+
has_plans: boolean;
|
|
1586
|
+
images: ProductImage[];
|
|
1587
|
+
is_deleted: boolean;
|
|
1588
|
+
is_published: boolean;
|
|
1589
|
+
minimum_variant_prices: {
|
|
1590
|
+
currency: string;
|
|
1591
|
+
price: string;
|
|
1592
|
+
}[];
|
|
1593
|
+
modifiers: Modifier[];
|
|
1594
|
+
more_than_one_price: boolean;
|
|
1595
|
+
options: ProductOption[];
|
|
1596
|
+
plans: Plan[];
|
|
1597
|
+
published_at: IsoDateString;
|
|
1598
|
+
requires_shipping: boolean;
|
|
1599
|
+
store_id: number;
|
|
1600
|
+
tags: string[];
|
|
1601
|
+
title: string;
|
|
1602
|
+
type: string | null;
|
|
1603
|
+
variants: ProductVariant_2022_06[];
|
|
1604
|
+
vendor: string;
|
|
1605
|
+
}
|
|
1606
|
+
interface ProductSearchResponse_2020_12 {
|
|
1607
|
+
products: Product_2020_12[];
|
|
1608
|
+
has_more: boolean;
|
|
1609
|
+
total: number;
|
|
1610
|
+
}
|
|
1611
|
+
interface ProductSearchResponse_2022_06 {
|
|
1612
|
+
products: Product_2022_06[];
|
|
1613
|
+
total: number;
|
|
1614
|
+
next_cursor: null | string;
|
|
1615
|
+
previous_cursor: null | string;
|
|
1616
|
+
}
|
|
1617
|
+
interface ProductSearchParams_2020_12 {
|
|
1618
|
+
/** Query by collection id, these are ReCharge collection_id’s. */
|
|
1619
|
+
collection_ids?: (string | number)[];
|
|
1620
|
+
/** If true, do NOT include products where subscription_options.is_prepaid is false. If true, ignore the value in subscription_options.is_prepaid. */
|
|
1621
|
+
exclude_prepaids?: boolean;
|
|
1622
|
+
/** Query by product id, these are external product id’s. */
|
|
1623
|
+
external_product_ids?: (string | number)[];
|
|
1624
|
+
/** Specifies the product format of the response. */
|
|
1625
|
+
format_type?: 'vendor' | 'recharge';
|
|
1626
|
+
/** Required. Product search version. */
|
|
1627
|
+
format_version: '2020-12';
|
|
1628
|
+
/** Whether to include deleted results, default false */
|
|
1629
|
+
include_deleted?: boolean;
|
|
1630
|
+
/** default is 50, max is 250 */
|
|
1631
|
+
limit?: number;
|
|
1632
|
+
/** Ignore given collection ids */
|
|
1633
|
+
not_collection_ids?: (string | number)[];
|
|
1634
|
+
/** Ignore given product ids */
|
|
1635
|
+
not_product_ids?: (string | number)[];
|
|
1636
|
+
/** Specifies the page of results to return for a query. Defaults to 1. */
|
|
1637
|
+
page?: number;
|
|
1638
|
+
/** Query by product id, these are ReCharge product_id’s. */
|
|
1639
|
+
product_ids?: (string | number)[];
|
|
1640
|
+
/** Return all products that have a matching type */
|
|
1641
|
+
product_types?: PlanType[];
|
|
1642
|
+
/** External platform published status. */
|
|
1643
|
+
published_status?: PublishStatus;
|
|
1644
|
+
/** Determines the sort order. Default is elasticsearch’s score. If sort_by = title, results will be sorted by the product title in ascending order. */
|
|
1645
|
+
sort_by?: 'score' | 'title';
|
|
1646
|
+
/** Query by source */
|
|
1647
|
+
source?: ProductSource;
|
|
1648
|
+
/** string representing at least 3 characters of the product title being queried. Should perform a like search ('%{querytext}%') */
|
|
1649
|
+
title?: string;
|
|
1650
|
+
/** Query by variant id, these are external variant ids */
|
|
1651
|
+
variant_ids?: (string | number)[];
|
|
1652
|
+
/**
|
|
1653
|
+
* External platform published status for the variant. This really only comes into play with BigCommerce because in BC you can set purchaseability at the variant-level.
|
|
1654
|
+
* If variant_published_status=published, the product-proxy's response only includes variants where variants[].is_published=true.
|
|
1655
|
+
* If variant_published_status=unpublished, the product-proxy's response only includes variants where variants[].is_published=false.
|
|
1656
|
+
* If variant_published_status=any, the product-proxy's response includes all variants irrespective of the value for variants[].is_published.
|
|
1657
|
+
*/
|
|
1658
|
+
variant_published_status?: PublishStatus;
|
|
1659
|
+
}
|
|
1660
|
+
type SortField = 'external_product_id' | 'collection_position' | 'relevance' | 'product_title' | 'unit_price' | 'discounted_price' | 'minimum_variant_price' | 'inventory_level' | 'created_at' | 'updated_at';
|
|
1661
|
+
type SortKeys = 'asc' | 'desc';
|
|
1662
|
+
type SortBy = `${SortField}-${SortKeys}`;
|
|
1663
|
+
interface ProductSearchParams_2022_06 extends ListParams<SortBy> {
|
|
1664
|
+
/** Return all products that have at least one non-deleted plan with a matching channel_setting{}.display set to true. */
|
|
1665
|
+
channel_settings_display?: (keyof ChannelSettings)[];
|
|
1666
|
+
/** Return products that are present in any of the passed in collection IDs. */
|
|
1667
|
+
collection_ids?: (string | number)[];
|
|
1668
|
+
/** Ignore given collection ids */
|
|
1669
|
+
collection_ids_not?: (string | number)[];
|
|
1670
|
+
/** Query on created_at. '<' */
|
|
1671
|
+
created_at_lt?: IsoDateString;
|
|
1672
|
+
/** Query on created_at. '<=' */
|
|
1673
|
+
created_at_lte?: IsoDateString;
|
|
1674
|
+
/** Query on created_at. '>' */
|
|
1675
|
+
created_at_gt?: IsoDateString;
|
|
1676
|
+
/** Query on created_at. '>=' */
|
|
1677
|
+
created_at_gte?: IsoDateString;
|
|
1678
|
+
/** Query on created_at. */
|
|
1679
|
+
created_at?: IsoDateString;
|
|
1680
|
+
/** Perform substring match on the product description. */
|
|
1681
|
+
description?: string;
|
|
1682
|
+
/** Filter on the variants[].prices.plans[].discounted_price. '<' */
|
|
1683
|
+
discounted_price_lt?: number;
|
|
1684
|
+
/** Filter on the variants[].prices.plans[].discounted_price. '<=' */
|
|
1685
|
+
discounted_price_lte?: number;
|
|
1686
|
+
/** Filter on the variants[].prices.plans[].discounted_price. '>' */
|
|
1687
|
+
discounted_price_gt?: number;
|
|
1688
|
+
/** Filter on the variants[].prices.plans[].discounted_price. '>=' */
|
|
1689
|
+
discounted_price_gte?: number;
|
|
1690
|
+
/** Filter on the variants[].prices.plans[].discounted_price. */
|
|
1691
|
+
discounted_price?: number;
|
|
1692
|
+
/** Exclude hidden results */
|
|
1693
|
+
exclude_hidden?: boolean;
|
|
1694
|
+
/** List of external_product_ids. */
|
|
1695
|
+
external_product_ids?: (string | number)[];
|
|
1696
|
+
/** List of external_variant_ids. */
|
|
1697
|
+
external_variant_ids?: (string | number)[];
|
|
1698
|
+
/** Required. Product search version. */
|
|
1699
|
+
format_version: '2022-06';
|
|
1700
|
+
/** If true, return only products that have at least one non-deleted plan in Recharge */
|
|
1701
|
+
has_plans?: boolean;
|
|
1702
|
+
/** Accepts either an external_product_id or an external_variant_id. Must perform exact match. */
|
|
1703
|
+
id?: string | number;
|
|
1704
|
+
/** If true, return products where at least one variant’s inventory.level > 0 OR inventory.policy=continue. */
|
|
1705
|
+
in_stock?: boolean;
|
|
1706
|
+
/** Whether to include deleted results, default false */
|
|
1707
|
+
include_deleted?: boolean;
|
|
1708
|
+
/** Query on the variants[].inventory.level. '<' */
|
|
1709
|
+
inventory_level_lt?: number;
|
|
1710
|
+
/** Query on the variants[].inventory.level. '<=' */
|
|
1711
|
+
inventory_level_lte?: number;
|
|
1712
|
+
/** Query on the variants[].inventory.level. '>' */
|
|
1713
|
+
inventory_level_gt?: number;
|
|
1714
|
+
/** Query on the variants[].inventory.level. '>=' */
|
|
1715
|
+
inventory_level_gte?: number;
|
|
1716
|
+
/** Query on the variants[].inventory.level. */
|
|
1717
|
+
inventory_level?: number;
|
|
1718
|
+
/** Filter on the minimum_variant_price. '<' */
|
|
1719
|
+
minimum_variant_price_lt?: number;
|
|
1720
|
+
/** Filter on the minimum_variant_price. '<=' */
|
|
1721
|
+
minimum_variant_price_lte?: number;
|
|
1722
|
+
/** Filter on the minimum_variant_price. '>' */
|
|
1723
|
+
minimum_variant_price_gt?: number;
|
|
1724
|
+
/** Filter on the minimum_variant_price. '>=' */
|
|
1725
|
+
minimum_variant_price_gte?: number;
|
|
1726
|
+
/** Filter on the minimum_variant_price. */
|
|
1727
|
+
minimum_variant_price?: number;
|
|
1728
|
+
/** Return all products that have a matching plan.type */
|
|
1729
|
+
plan_types?: PlanType[];
|
|
1730
|
+
/** Exclude given plan types */
|
|
1731
|
+
plan_types_exclusive?: PlanType[];
|
|
1732
|
+
/** Perform search on published status */
|
|
1733
|
+
product_published_status?: PublishStatus;
|
|
1734
|
+
/** Perform substring match on the product title */
|
|
1735
|
+
product_title?: string;
|
|
1736
|
+
/** Accept up to 256 characters. Should search on the following fields: title, description, tags, variants[].sku, variants[].title. */
|
|
1737
|
+
search_term?: string;
|
|
1738
|
+
/** Perform substring match on variants[].sku */
|
|
1739
|
+
sku?: string;
|
|
1740
|
+
/** Perform substring match on tags */
|
|
1741
|
+
tags?: string[];
|
|
1742
|
+
/** Filter on the variants[].prices.unit_price. '<' */
|
|
1743
|
+
unit_price_lt?: number;
|
|
1744
|
+
/** Filter on the variants[].prices.unit_price. '<=' */
|
|
1745
|
+
unit_price_lte?: number;
|
|
1746
|
+
/** Filter on the variants[].prices.unit_price. '>' */
|
|
1747
|
+
unit_price_gt?: number;
|
|
1748
|
+
/** Filter on the variants[].prices.unit_price. '>=' */
|
|
1749
|
+
unit_price_gte?: number;
|
|
1750
|
+
/** Filter on the variants[].prices.unit_price. */
|
|
1751
|
+
unit_price?: number;
|
|
1752
|
+
/** Query on updated_at. '<' */
|
|
1753
|
+
updated_at_lt?: IsoDateString;
|
|
1754
|
+
/** Query on updated_at. '<=' */
|
|
1755
|
+
updated_at_lte?: IsoDateString;
|
|
1756
|
+
/** Query on updated_at. '>' */
|
|
1757
|
+
updated_at_gt?: IsoDateString;
|
|
1758
|
+
/** Query on updated_at. '>=' */
|
|
1759
|
+
updated_at_gte?: IsoDateString;
|
|
1760
|
+
/** Query on updated_at. */
|
|
1761
|
+
updated_at?: IsoDateString;
|
|
1762
|
+
/** Return products where at least one variant’s is_published value matches the value passed in to this query param. */
|
|
1763
|
+
variant_published_status?: Exclude<PublishStatus, 'any'>;
|
|
1764
|
+
/** Perform substring match on the variants[].title */
|
|
1765
|
+
variant_title?: string;
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1768
|
+
type CDNVersion = '2020-12' | '2022-06';
|
|
1769
|
+
type FirstOption = 'onetime' | 'autodeliver';
|
|
1319
1770
|
interface BundleTranslations {
|
|
1320
1771
|
cpb_add: string;
|
|
1321
1772
|
cpb_add_items_to_continue: string;
|
|
@@ -1401,11 +1852,18 @@ interface Translations {
|
|
|
1401
1852
|
}
|
|
1402
1853
|
type WidgetTemplateType = 'radio' | 'checkbox' | 'button_group' | 'radio_group';
|
|
1403
1854
|
type WidgetIconColor = '#191D48' | 'white' | 'black' | '#ffffff';
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1855
|
+
type CDNProductType<T extends CDNProductQuery_2020_12 | CDNProductQuery_2022_06> = T extends CDNProductQuery_2020_12 ? CDNProduct : CDNProduct_2022_06;
|
|
1856
|
+
type CDNProductResponseType<T extends CDNProductQuery_2020_12 | CDNProductQuery_2022_06> = CDNProductResource<T>;
|
|
1857
|
+
interface CDNProductQuery_2020_12 {
|
|
1858
|
+
version: '2020-12';
|
|
1859
|
+
}
|
|
1860
|
+
interface CDNProductQuery_2022_06 {
|
|
1861
|
+
version: '2022-06';
|
|
1862
|
+
}
|
|
1863
|
+
interface CDNProductResource<T extends CDNProductQuery_2020_12 | CDNProductQuery_2022_06> {
|
|
1864
|
+
product: T extends CDNProductQuery_2020_12 ? CDNProductRaw : CDNProduct_2022_06;
|
|
1407
1865
|
meta: {
|
|
1408
|
-
version: '
|
|
1866
|
+
version: T extends CDNProductQuery_2020_12 ? CDNProductQuery_2020_12['version'] : CDNProductQuery_2022_06['version'];
|
|
1409
1867
|
};
|
|
1410
1868
|
}
|
|
1411
1869
|
interface CDNProductKeyObject {
|
|
@@ -1422,68 +1880,14 @@ interface CDNProductsAndSettingsResource {
|
|
|
1422
1880
|
message: string;
|
|
1423
1881
|
};
|
|
1424
1882
|
}
|
|
1425
|
-
interface
|
|
1426
|
-
order_interval_frequency: string | number;
|
|
1427
|
-
created_at?: IsoDateString;
|
|
1428
|
-
order_interval_unit_type: IntervalUnit;
|
|
1429
|
-
updated_at?: IsoDateString;
|
|
1430
|
-
id: number;
|
|
1431
|
-
selling_plan_id: number;
|
|
1432
|
-
selling_plan_name: string;
|
|
1433
|
-
price_adjustments_value_type: PriceAdjustmentsType;
|
|
1434
|
-
price_adjustments_value: number;
|
|
1435
|
-
}
|
|
1436
|
-
interface CDNSellingPlanGroup {
|
|
1437
|
-
selling_plan_group_id: string | number;
|
|
1438
|
-
selling_plans: CDNSellingPlan[];
|
|
1439
|
-
subscription_product_id: number;
|
|
1440
|
-
}
|
|
1441
|
-
interface CDNSubscriptionOption {
|
|
1442
|
-
storefront_purchase_options: StorefrontPurchaseOption;
|
|
1443
|
-
updated_at: IsoDateString;
|
|
1444
|
-
is_prepaid?: boolean;
|
|
1445
|
-
}
|
|
1446
|
-
interface CDNSellingPlanAllocations {
|
|
1447
|
-
selling_plan_group_id: string | number;
|
|
1448
|
-
selling_plan_id: number;
|
|
1449
|
-
discounted_price: string;
|
|
1883
|
+
interface CDNSubscriptionOption extends Omit<SubscriptionOption, 'charge_interval_frequency' | 'cutoff_day_of_month' | 'cutoff_day_of_week' | 'expire_after_specific_number_of_charges' | 'modifiable_properties' | 'number_charges_until_expiration' | 'order_day_of_month' | 'order_day_of_week' | 'order_interval_frequency_options' | 'order_interval_unit'> {
|
|
1450
1884
|
}
|
|
1451
|
-
interface
|
|
1452
|
-
compare_at_price: string | null;
|
|
1453
|
-
unit_price: string;
|
|
1454
|
-
discounted_price: string;
|
|
1455
|
-
zero_decimal_currency: boolean;
|
|
1885
|
+
interface CDNVariant extends Omit<ProductVariant_2020_12, 'external_metafields' | 'external_product_id' | 'fulfillment_service' | 'image' | 'inventory' | 'is_deleted' | 'is_published' | 'price_includes_tax' | 'product_id' | 'requires_shipping' | 'shipping_dimensions' | 'sku' | 'tax_code' | 'taxable' | 'title'> {
|
|
1456
1886
|
}
|
|
1457
|
-
interface
|
|
1458
|
-
id: number;
|
|
1459
|
-
label: string;
|
|
1460
|
-
}
|
|
1461
|
-
interface CDNVariant {
|
|
1462
|
-
id: number;
|
|
1463
|
-
option_values: CDNVariantOptionValue[];
|
|
1464
|
-
prices: CDNPrices;
|
|
1465
|
-
selling_plan_allocations: CDNSellingPlanAllocations[];
|
|
1466
|
-
}
|
|
1467
|
-
interface CDNProductOptionValue {
|
|
1468
|
-
id?: number | null;
|
|
1469
|
-
label: string;
|
|
1470
|
-
position: number;
|
|
1471
|
-
}
|
|
1472
|
-
interface CDNProductOption {
|
|
1473
|
-
id: number;
|
|
1474
|
-
name: string;
|
|
1475
|
-
position: number;
|
|
1476
|
-
values: CDNProductOptionValue[];
|
|
1477
|
-
}
|
|
1478
|
-
interface CDNProductRaw {
|
|
1479
|
-
id: number | null;
|
|
1887
|
+
interface CDNProductRaw extends Omit<Product_2020_12, 'brand' | 'bundle_product' | 'collection_ids' | 'description' | 'discount_amount' | 'discount_type' | 'external_created_at' | 'external_metafields' | 'external_updated_at' | 'handle' | 'images' | 'is_deleted' | 'is_published' | 'minimum_variant_price' | 'modifiers' | 'more_than_one_price' | 'published_at' | 'requires_shipping' | 'subscription_options' | 'tags' | 'title' | 'type' | 'variants' | 'vendor'> {
|
|
1480
1888
|
bundle_product?: CDNBundleSettings | null;
|
|
1481
|
-
external_product_id: number;
|
|
1482
|
-
in_recharge: boolean;
|
|
1483
|
-
options: CDNProductOption[];
|
|
1484
|
-
variants: CDNVariant[];
|
|
1485
1889
|
subscription_options: CDNSubscriptionOption;
|
|
1486
|
-
|
|
1890
|
+
variants: CDNVariant[];
|
|
1487
1891
|
}
|
|
1488
1892
|
interface CDNProduct extends CDNProductRaw {
|
|
1489
1893
|
/** @deprecated */
|
|
@@ -1571,94 +1975,31 @@ interface CDNStoreSettings {
|
|
|
1571
1975
|
zero_decimal_currency?: boolean;
|
|
1572
1976
|
};
|
|
1573
1977
|
}
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1978
|
+
interface CDNPlan extends Omit<Plan, 'channel_settings' | 'created_at' | 'deleted_at' | 'external_product_id' | 'subscription_preferences' | 'updated_at'> {
|
|
1979
|
+
apply_custom_date_to_checkout: boolean;
|
|
1980
|
+
charge_interval_frequency: number | null;
|
|
1981
|
+
interval_unit: IntervalUnit | null;
|
|
1982
|
+
order_interval_frequency: number | null;
|
|
1983
|
+
pricing_progression: {
|
|
1984
|
+
recurring_discount_type: DiscountType | null;
|
|
1985
|
+
recurring_discount_amount: number | null;
|
|
1986
|
+
recurring_discount_after_cycle: number | null;
|
|
1987
|
+
}[];
|
|
1579
1988
|
}
|
|
1580
|
-
interface
|
|
1581
|
-
data?: {
|
|
1582
|
-
optionsMeta: {
|
|
1583
|
-
[key: string]: CDNBundleStepOption;
|
|
1584
|
-
};
|
|
1585
|
-
};
|
|
1586
|
-
disable: boolean;
|
|
1587
|
-
index: string;
|
|
1588
|
-
name: string;
|
|
1589
|
-
title: string;
|
|
1590
|
-
type: 'variantSelector' | 'all-collections' | 'addons' | 'summary' | 'cross-sells';
|
|
1989
|
+
interface CDNProductVariant_2022_06 extends Omit<ProductVariant_2022_06, 'external_metafields' | 'external_product_id' | 'fulfillment_service' | 'image' | 'inventory' | 'is_deleted' | 'is_published' | 'price_includes_tax' | 'requires_shipping' | 'shipping_dimensions' | 'sku' | 'tax_code' | 'taxable' | 'title'> {
|
|
1591
1990
|
}
|
|
1592
|
-
interface
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
};
|
|
1597
|
-
addons: {
|
|
1598
|
-
collectionHandle: string;
|
|
1599
|
-
collectionId: string;
|
|
1600
|
-
enabled: boolean;
|
|
1601
|
-
};
|
|
1602
|
-
collapsibleSections: boolean;
|
|
1603
|
-
crossSells: {
|
|
1604
|
-
collectionId: string;
|
|
1605
|
-
enabled: boolean;
|
|
1606
|
-
collectionHandle: string;
|
|
1607
|
-
};
|
|
1608
|
-
defaultFrequency: string;
|
|
1609
|
-
defaultVariantId: string;
|
|
1610
|
-
description: string;
|
|
1611
|
-
filters: any[];
|
|
1612
|
-
learnMoreModal: boolean;
|
|
1613
|
-
published: boolean;
|
|
1614
|
-
showVariants: boolean;
|
|
1615
|
-
template: 'one-page' | 'multi-step';
|
|
1616
|
-
templateSettings: {
|
|
1617
|
-
onePage: {
|
|
1618
|
-
frequencySelector: 'dropdown';
|
|
1619
|
-
};
|
|
1620
|
-
multiStep?: {
|
|
1621
|
-
steps: CDNBundleStep[];
|
|
1622
|
-
optionImages: string;
|
|
1623
|
-
};
|
|
1624
|
-
};
|
|
1625
|
-
title: string;
|
|
1626
|
-
visibility: {
|
|
1627
|
-
portal: boolean;
|
|
1628
|
-
signup: boolean;
|
|
1629
|
-
};
|
|
1991
|
+
interface CDNProduct_2022_06 extends Omit<Product_2022_06, 'brand' | 'bundle_product' | 'collections' | 'description' | 'external_created_at' | 'external_metafields' | 'external_updated_at' | 'handle' | 'images' | 'is_deleted' | 'is_published' | 'minimum_variant_prices' | 'modifiers' | 'more_than_one_price' | 'plans' | 'published_at' | 'requires_shipping' | 'store_id' | 'tags' | 'title' | 'type' | 'variants' | 'vendor'> {
|
|
1992
|
+
bundle_product: CDNBundleSettings | null;
|
|
1993
|
+
plans: CDNPlan[];
|
|
1994
|
+
variants: CDNProductVariant_2022_06[];
|
|
1630
1995
|
}
|
|
1631
|
-
interface CDNBundleVariantOptionSource {
|
|
1632
|
-
id: number;
|
|
1996
|
+
interface CDNBundleVariantOptionSource extends Omit<BundleVariantOptionSource, 'created_at' | 'option_source_id' | 'position' | 'source_platform' | 'updated_at'> {
|
|
1633
1997
|
collection_id: string;
|
|
1634
|
-
quantity_max: number | null;
|
|
1635
|
-
quantity_min: number | null;
|
|
1636
1998
|
}
|
|
1637
|
-
interface
|
|
1638
|
-
id: number;
|
|
1639
|
-
quantity: number;
|
|
1640
|
-
external_variant_id: string;
|
|
1641
|
-
}
|
|
1642
|
-
interface CDNBundleVariant {
|
|
1643
|
-
enabled: boolean;
|
|
1644
|
-
external_variant_id: string;
|
|
1645
|
-
id: number;
|
|
1646
|
-
items_count: number;
|
|
1999
|
+
interface CDNBundleVariant extends Omit<BundleVariant, 'created_at' | 'option_sources' | 'position' | 'ranges' | 'selection_defaults' | 'title' | 'updated_at'> {
|
|
1647
2000
|
option_sources: CDNBundleVariantOptionSource[];
|
|
1648
|
-
selection_defaults?: CDNBundleVariantSelectionDefault[];
|
|
1649
2001
|
}
|
|
1650
|
-
interface CDNBundleSettings {
|
|
1651
|
-
customization_window_disabled_message: string | null;
|
|
1652
|
-
customization_window?: number;
|
|
1653
|
-
default_bundle_variant_id?: number;
|
|
1654
|
-
description: string | null;
|
|
1655
|
-
external_product_id: string;
|
|
1656
|
-
id: number;
|
|
1657
|
-
is_customizable?: boolean;
|
|
1658
|
-
layout_settings: CDNBundleLayoutSettings;
|
|
1659
|
-
layout_settings_version: '2021-11';
|
|
1660
|
-
max_quantity_per_variant: number | null;
|
|
1661
|
-
reset_box_contents?: boolean;
|
|
2002
|
+
interface CDNBundleSettings extends Omit<BundleProduct, 'created_at' | 'custom_prices' | 'price_rule' | 'title' | 'updated_at' | 'variants'> {
|
|
1662
2003
|
variants: CDNBundleVariant[];
|
|
1663
2004
|
}
|
|
1664
2005
|
|
|
@@ -1937,74 +2278,6 @@ interface InitOptions {
|
|
|
1937
2278
|
loginRetryFn?: () => Promise<Session | undefined>;
|
|
1938
2279
|
}
|
|
1939
2280
|
|
|
1940
|
-
interface ChannelSettings {
|
|
1941
|
-
api: {
|
|
1942
|
-
display: boolean;
|
|
1943
|
-
};
|
|
1944
|
-
checkout_page: {
|
|
1945
|
-
display: boolean;
|
|
1946
|
-
};
|
|
1947
|
-
customer_portal: {
|
|
1948
|
-
display: boolean;
|
|
1949
|
-
};
|
|
1950
|
-
merchant_portal: {
|
|
1951
|
-
display: boolean;
|
|
1952
|
-
};
|
|
1953
|
-
}
|
|
1954
|
-
interface SubscriptionPreferences {
|
|
1955
|
-
charge_interval_frequency: number;
|
|
1956
|
-
cutoff_day_of_month: null | number;
|
|
1957
|
-
cutoff_day_of_week: null | number;
|
|
1958
|
-
expire_after_specific_number_of_charges: null | number;
|
|
1959
|
-
interval_unit: 'day' | 'week' | 'month';
|
|
1960
|
-
order_day_of_month: number;
|
|
1961
|
-
order_day_of_week: null | number;
|
|
1962
|
-
order_interval_frequency: number;
|
|
1963
|
-
}
|
|
1964
|
-
type PlanType = 'subscription' | 'prepaid' | 'onetime';
|
|
1965
|
-
interface Plan {
|
|
1966
|
-
/** Unique numeric identifier for the Plan. */
|
|
1967
|
-
id: number;
|
|
1968
|
-
/** An object containing the availability of the plan through various supported channels. */
|
|
1969
|
-
channel_settings: ChannelSettings;
|
|
1970
|
-
/** The time the plan was created. */
|
|
1971
|
-
created_at: IsoDateString;
|
|
1972
|
-
/** If deleted, the time the plan was deleted. */
|
|
1973
|
-
deleted_at: IsoDateString;
|
|
1974
|
-
/** The discount amount applied to the product price when purchased through this Plan. All Plans for a product must have the same discount amount. */
|
|
1975
|
-
discount_amount: string;
|
|
1976
|
-
/** Used in combination with discount amount to determine the discount applied on a product price when purchased through this Plan. */
|
|
1977
|
-
discount_type: 'percentage';
|
|
1978
|
-
/** An object containing the product id as it appears in external platforms. */
|
|
1979
|
-
external_product_id: ExternalId;
|
|
1980
|
-
/** The number indicating the order which the plan will be in a list of related plans. */
|
|
1981
|
-
sort_order: number;
|
|
1982
|
-
/** An object containing the various subscription preferences associated with this plan. */
|
|
1983
|
-
subscription_preferences: SubscriptionPreferences;
|
|
1984
|
-
/** The title of the plan. All Plans for a product must have the same title. */
|
|
1985
|
-
title: string;
|
|
1986
|
-
/** The type of the plan. Products with a prepaid plan cannot have plans of other types. */
|
|
1987
|
-
type: PlanType;
|
|
1988
|
-
/** The time the plan was last updated. */
|
|
1989
|
-
updated_at: IsoDateString;
|
|
1990
|
-
}
|
|
1991
|
-
interface PlansResponse {
|
|
1992
|
-
next_cursor: null | string;
|
|
1993
|
-
previous_cursor: null | string;
|
|
1994
|
-
plans: Plan[];
|
|
1995
|
-
}
|
|
1996
|
-
type PlanSortBy = 'id-asc' | 'id-desc' | 'updated_at-asc' | 'updated_at-desc';
|
|
1997
|
-
interface PlanListParams extends ListParams<PlanSortBy> {
|
|
1998
|
-
/** Return the Plans linked to the Product record in Recharge with the indicated external_product_id */
|
|
1999
|
-
external_product_id?: string | number;
|
|
2000
|
-
/** Return the plans updated before the given date. */
|
|
2001
|
-
updated_at_max?: IsoDateString;
|
|
2002
|
-
/** Return the plans updated after the given date. */
|
|
2003
|
-
updated_at_min?: IsoDateString;
|
|
2004
|
-
/** Return the plans that are of a specific type. */
|
|
2005
|
-
type?: PlanType;
|
|
2006
|
-
}
|
|
2007
|
-
|
|
2008
2281
|
declare function getCharge(session: Session, id: number | string, options?: GetChargeOptions): Promise<Charge>;
|
|
2009
2282
|
/** Lists charges */
|
|
2010
2283
|
declare function listCharges(session: Session, query?: ChargeListParams): Promise<ChargeListResponse>;
|
|
@@ -2025,7 +2298,7 @@ declare function skipCharge(session: Session, id: number | string, purchaseItemI
|
|
|
2025
2298
|
declare function unskipCharge(session: Session, id: number | string, purchaseItemIds: (string | number)[]): Promise<Charge>;
|
|
2026
2299
|
declare function processCharge(session: Session, id: number | string): Promise<Charge>;
|
|
2027
2300
|
|
|
2028
|
-
declare function getCDNProduct(externalProductId: string | number): Promise<
|
|
2301
|
+
declare function getCDNProduct<T extends CDNProductQuery_2020_12 | CDNProductQuery_2022_06 = CDNProductQuery_2020_12>(externalProductId: string | number, query?: T): Promise<CDNProductType<T>>;
|
|
2029
2302
|
declare function getCDNStoreSettings(): Promise<CDNStoreSettings>;
|
|
2030
2303
|
declare function getCDNWidgetSettings(): Promise<CDNWidgetSettings>;
|
|
2031
2304
|
declare function getCDNProductsAndSettings(): Promise<CDNProductsAndSettings>;
|
|
@@ -2092,6 +2365,9 @@ declare function listPaymentMethods(session: Session, query?: PaymentMethodListP
|
|
|
2092
2365
|
declare function getPlan(session: Session, id: string | number): Promise<Plan>;
|
|
2093
2366
|
declare function listPlans(session: Session, query?: PlanListParams): Promise<PlansResponse>;
|
|
2094
2367
|
|
|
2368
|
+
type ProductSearchType<T extends ProductSearchParams_2020_12 | ProductSearchParams_2022_06> = T extends ProductSearchParams_2020_12 ? ProductSearchResponse_2020_12 : ProductSearchResponse_2022_06;
|
|
2369
|
+
declare function productSearch<T extends ProductSearchParams_2020_12 | ProductSearchParams_2022_06>(session: Session, query: T): Promise<ProductSearchType<T>>;
|
|
2370
|
+
|
|
2095
2371
|
declare function getSubscription(session: Session, id: string | number, options?: GetSubscriptionOptions): Promise<Subscription>;
|
|
2096
2372
|
declare function listSubscriptions(session: Session, query?: SubscriptionListParams): Promise<SubscriptionsResponse>;
|
|
2097
2373
|
/**
|
|
@@ -2149,6 +2425,7 @@ declare function getCustomer(session: Session, options?: GetCustomerOptions): Pr
|
|
|
2149
2425
|
declare function updateCustomer(session: Session, updateRequest: UpdateCustomerRequest): Promise<Customer>;
|
|
2150
2426
|
declare function getDeliverySchedule(session: Session, query?: CustomerDeliveryScheduleParams): Promise<Delivery[]>;
|
|
2151
2427
|
declare function getCustomerPortalAccess(session: Session): Promise<CustomerPortalAccessResponse>;
|
|
2428
|
+
declare function sendCustomerNotification(session: Session, notification: CustomerNotification): Promise<void>;
|
|
2152
2429
|
|
|
2153
2430
|
declare const api: {
|
|
2154
2431
|
get<T>(url: string, requestOptions?: GetRequestOptions): Promise<T>;
|
|
@@ -2158,4 +2435,4 @@ declare const api: {
|
|
|
2158
2435
|
};
|
|
2159
2436
|
declare function initRecharge(opt?: InitOptions): void;
|
|
2160
2437
|
|
|
2161
|
-
export { ActivateMembershipRequest, Address, AddressIncludes, AddressListParams, AddressListResponse, AddressResponse, AddressSortBy, AnalyticsData, AssociatedAddress, BasicSubscriptionParams, BooleanLike, BooleanNumbers, BooleanString, BooleanStringNumbers, BundleAppProxy, BundleProduct, BundlePurchaseItem, BundlePurchaseItemParams, BundleSelection, BundleSelectionAppProxy, BundleSelectionItem, BundleSelectionItemRequiredCreateProps, BundleSelectionListParams, BundleSelectionsResponse, BundleSelectionsSortBy, BundleTranslations,
|
|
2438
|
+
export { ActivateMembershipRequest, Address, AddressIncludes, AddressListParams, AddressListResponse, AddressResponse, AddressSortBy, AnalyticsData, AssociatedAddress, BasicSubscriptionParams, BooleanLike, BooleanNumbers, BooleanString, BooleanStringNumbers, BundleAppProxy, BundleProduct, BundlePurchaseItem, BundlePurchaseItemParams, BundleSelection, BundleSelectionAppProxy, BundleSelectionItem, BundleSelectionItemRequiredCreateProps, BundleSelectionListParams, BundleSelectionsResponse, BundleSelectionsSortBy, BundleTranslations, BundleVariant, BundleVariantOptionSource, CDNBaseWidgetSettings, CDNBundleSettings, CDNBundleVariant, CDNBundleVariantOptionSource, CDNPlan, CDNProduct, CDNProductAndSettings, CDNProductKeyObject, CDNProductQuery_2020_12, CDNProductQuery_2022_06, CDNProductRaw, CDNProductResource, CDNProductResponseType, CDNProductType, CDNProductVariant_2022_06, CDNProduct_2022_06, CDNProductsAndSettings, CDNProductsAndSettingsResource, CDNStoreSettings, CDNSubscriptionOption, CDNVariant, CDNVersion, CDNWidgetSettings, CDNWidgetSettingsRaw, CDNWidgetSettingsResource, CRUDRequestOptions, CancelMembershipRequest, CancelSubscriptionRequest, ChangeMembershipRequest, ChannelSettings, Charge, ChargeIncludes, ChargeListParams, ChargeListResponse, ChargeResponse, ChargeSortBy, ChargeStatus, ColorString, CreateAddressRequest, CreateBundleSelectionRequest, CreateMetafieldRequest, CreateOnetimeRequest, CreateRecipientAddress, CreateSubscriptionRequest, Customer, CustomerDeliveryScheduleParams, CustomerDeliveryScheduleResponse, CustomerIncludes, CustomerNotification, CustomerNotificationTemplate, CustomerNotificationType, CustomerPortalAccessResponse, Delivery, DeliveryLineItem, DeliveryOrder, DeliveryPaymentMethod, Discount, DiscountType, DynamicBundleItemAppProxy, DynamicBundlePropertiesAppProxy, ExternalAttributeSchema, ExternalId, ExternalTransactionId, FirstOption, GetAddressOptions, GetChargeOptions, GetCustomerOptions, GetMembershipProgramOptions, GetPaymentMethodOptions, GetRequestOptions, GetSubscriptionOptions, HTMLString, InitOptions, IntervalUnit, IsoDateString, LineItem, ListParams, LoginResponse, Membership, MembershipBenefit, MembershipIncludes, MembershipListParams, MembershipListResponse, MembershipProgram, MembershipProgramIncludes, MembershipProgramListParams, MembershipProgramListResponse, MembershipProgramResponse, MembershipProgramSortBy, MembershipProgramStatus, MembershipResponse, MembershipStatus, MembershipsSortBy, MergeAddressesRequest, Metafield, MetafieldOptionalCreateProps, MetafieldOwnerResource, MetafieldRequiredCreateProps, Method, Modifier, Onetime, OnetimeListParams, OnetimeOptionalCreateProps, OnetimeRequiredCreateProps, OnetimesResponse, OnetimesSortBy, Order, OrderIncludes, OrderListParams, OrderSortBy, OrderStatus, OrderType, OrdersResponse, PasswordlessCodeResponse, PasswordlessOptions, PasswordlessValidateResponse, PaymentDetails, PaymentMethod, PaymentMethodIncludes, PaymentMethodListParams, PaymentMethodSortBy, PaymentMethodStatus, PaymentMethodsResponse, PaymentType, Plan, PlanListParams, PlanSortBy, PlanType, PlansResponse, ProcessorName, ProductImage, ProductInclude, ProductOption, ProductSearchParams_2020_12, ProductSearchParams_2022_06, ProductSearchResponse_2020_12, ProductSearchResponse_2022_06, ProductSearchType, ProductSource, ProductValueOption, ProductVariant_2020_12, ProductVariant_2022_06, Product_2020_12, Product_2022_06, Property, PublishStatus, Request, RequestHeaders, RequestOptions, SellingPlan, SellingPlanGroup, Session, ShippingLine, SkipFutureChargeAddressRequest, SkipFutureChargeAddressResponse, SortBy, SortField, SortKeys, StorefrontEnvironment, StorefrontOptions, StorefrontPurchaseOption, SubType, Subscription, SubscriptionIncludes, SubscriptionListParams, SubscriptionOption, SubscriptionOptionalCreateProps, SubscriptionPreferences, SubscriptionRequiredCreateProps, SubscriptionSortBy, SubscriptionStatus, Subscription_2021_01, SubscriptionsResponse, TaxLine, Translations, UpdateAddressRequest, UpdateBundlePurchaseItem, UpdateBundleSelectionRequest, UpdateCustomerRequest, UpdateMetafieldRequest, UpdateOnetimeRequest, UpdatePaymentMethodRequest, UpdateSubscriptionParams, UpdateSubscriptionRequest, UpdateSubscriptionsParams, UpdateSubscriptionsRequest, WidgetIconColor, WidgetTemplateType, activateMembership, activateSubscription, api, applyDiscountToAddress, applyDiscountToCharge, cancelMembership, cancelSubscription, changeMembership, createAddress, createBundleSelection, createMetafield, createOnetime, createSubscription, createSubscriptions, deleteAddress, deleteBundleSelection, deleteMetafield, deleteOnetime, getAddress, getBundleId, getBundleSelection, getCDNBundleSettings, getCDNProduct, getCDNProductAndSettings, getCDNProducts, getCDNProductsAndSettings, getCDNStoreSettings, getCDNWidgetSettings, getCharge, getCustomer, getCustomerPortalAccess, getDeliverySchedule, getDynamicBundleItems, getMembership, getMembershipProgram, getOnetime, getOrder, getPaymentMethod, getPlan, getSubscription, initRecharge, intervalUnit, listAddresses, listBundleSelections, listCharges, listMembershipPrograms, listMemberships, listOnetimes, listOrders, listPaymentMethods, listPlans, listSubscriptions, loginCustomerPortal, loginShopifyApi, loginShopifyAppProxy, membershipIncludes, mergeAddresses, processCharge, productSearch, removeDiscountsFromAddress, removeDiscountsFromCharge, resetCDNCache, sendCustomerNotification, sendPasswordlessCode, sendPasswordlessCodeAppProxy, skipCharge, skipFutureCharge, skipGiftSubscriptionCharge, skipSubscriptionCharge, unskipCharge, updateAddress, updateBundle, updateBundleSelection, updateCustomer, updateMetafield, updateOnetime, updatePaymentMethod, updateSubscription, updateSubscriptionAddress, updateSubscriptionChargeDate, updateSubscriptions, validateBundle, validateDynamicBundle, validatePasswordlessCode, validatePasswordlessCodeAppProxy };
|