@rechargeapps/storefront-client 1.7.0 → 1.8.1
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 +506 -222
- package/dist/umd/recharge-client.min.js +8 -8
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,87 @@
|
|
|
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 PlanPricingProgression {
|
|
16
|
+
recurring_discount_after_cycle: string | null;
|
|
17
|
+
recurring_discount_amount: string | null;
|
|
18
|
+
recurring_discount_type: DiscountType | null;
|
|
19
|
+
}
|
|
20
|
+
interface SubscriptionPreferences {
|
|
21
|
+
apply_cutoff_date_to_checkout: boolean;
|
|
22
|
+
charge_interval_frequency: number | null;
|
|
23
|
+
cutoff_day_of_month: number | null;
|
|
24
|
+
cutoff_day_of_week: number | null;
|
|
25
|
+
expire_after_specific_number_of_charges: number | null;
|
|
26
|
+
interval_unit: 'day' | 'week' | 'month' | null;
|
|
27
|
+
order_day_of_month: number | null;
|
|
28
|
+
order_day_of_week: number | null;
|
|
29
|
+
order_interval_frequency: number | null;
|
|
30
|
+
pricing_progression: PlanPricingProgression[];
|
|
31
|
+
}
|
|
32
|
+
type PlanType = 'prepaid' | 'subscription' | 'onetime' | 'membership_subscription';
|
|
33
|
+
interface Plan {
|
|
34
|
+
/** Unique numeric identifier for the Plan. */
|
|
35
|
+
id: number;
|
|
36
|
+
/** An object containing the availability of the plan through various supported channels. */
|
|
37
|
+
channel_settings: ChannelSettings;
|
|
38
|
+
/** The time the plan was created. */
|
|
39
|
+
created_at: IsoDateString;
|
|
40
|
+
/** If deleted, the time the plan was deleted. */
|
|
41
|
+
deleted_at?: IsoDateString | null;
|
|
42
|
+
/** The discount amount applied to the product price when purchased through this Plan. All Plans for a product must have the same discount amount. */
|
|
43
|
+
discount_amount: string | null;
|
|
44
|
+
/** Used in combination with discount amount to determine the discount applied on a product price when purchased through this Plan. */
|
|
45
|
+
discount_type: DiscountType | null;
|
|
46
|
+
/** External plan group id */
|
|
47
|
+
external_plan_group_id: number | null;
|
|
48
|
+
/** External plan id */
|
|
49
|
+
external_plan_id: number | null;
|
|
50
|
+
/** External plan name */
|
|
51
|
+
external_plan_name: string | null;
|
|
52
|
+
/** An object containing the product id as it appears in external platforms. */
|
|
53
|
+
external_product_id: ExternalId;
|
|
54
|
+
/** External variant ids related to this plan */
|
|
55
|
+
external_variant_ids: string[] | null;
|
|
56
|
+
has_variant_restrictions: boolean;
|
|
57
|
+
/** The number indicating the order which the plan will be in a list of related plans. */
|
|
58
|
+
sort_order: number;
|
|
59
|
+
/** An object containing the various subscription preferences associated with this plan. */
|
|
60
|
+
subscription_preferences: SubscriptionPreferences;
|
|
61
|
+
/** The title of the plan. All Plans for a product must have the same title. */
|
|
62
|
+
title: string;
|
|
63
|
+
/** The type of the plan. Products with a prepaid plan cannot have plans of other types. */
|
|
64
|
+
type: PlanType;
|
|
65
|
+
/** The time the plan was last updated. */
|
|
66
|
+
updated_at: IsoDateString;
|
|
67
|
+
}
|
|
68
|
+
interface PlansResponse {
|
|
69
|
+
next_cursor: null | string;
|
|
70
|
+
previous_cursor: null | string;
|
|
71
|
+
plans: Plan[];
|
|
72
|
+
}
|
|
73
|
+
type PlanSortBy = 'id-asc' | 'id-desc' | 'updated_at-asc' | 'updated_at-desc';
|
|
74
|
+
interface PlanListParams extends ListParams<PlanSortBy> {
|
|
75
|
+
/** Return the Plans linked to the Product record in Recharge with the indicated external_product_id */
|
|
76
|
+
external_product_id?: string | number;
|
|
77
|
+
/** Return the plans updated before the given date. */
|
|
78
|
+
updated_at_max?: IsoDateString;
|
|
79
|
+
/** Return the plans updated after the given date. */
|
|
80
|
+
updated_at_min?: IsoDateString;
|
|
81
|
+
/** Return the plans that are of a specific type. */
|
|
82
|
+
type?: PlanType;
|
|
83
|
+
}
|
|
84
|
+
|
|
1
85
|
/** HEXA, RGBA, HSLA */
|
|
2
86
|
type ColorString = string;
|
|
3
87
|
/** HTML String */
|
|
@@ -65,7 +149,7 @@ interface LineItem {
|
|
|
65
149
|
/** An array of name value pairs of additional line_item attributes. */
|
|
66
150
|
properties: Property[];
|
|
67
151
|
/** An indicator of the type of the purchase item. */
|
|
68
|
-
purchase_item_type:
|
|
152
|
+
purchase_item_type: PlanType;
|
|
69
153
|
/** The quantity of the line_item. */
|
|
70
154
|
quantity: number;
|
|
71
155
|
/** The SKU (stock keeping unit) of the Product associated with the line_item. */
|
|
@@ -97,6 +181,7 @@ interface TaxLine {
|
|
|
97
181
|
/** The title/name of the taxing jurisdiction. */
|
|
98
182
|
title: string;
|
|
99
183
|
}
|
|
184
|
+
type DiscountType = 'percentage' | 'fixed_amount' | 'shipping';
|
|
100
185
|
interface Discount {
|
|
101
186
|
/** The ID of the Discount. */
|
|
102
187
|
id: number;
|
|
@@ -105,7 +190,7 @@ interface Discount {
|
|
|
105
190
|
/** The value of the Discount. */
|
|
106
191
|
value?: number;
|
|
107
192
|
/** The type of the value of the Discount. */
|
|
108
|
-
value_type?:
|
|
193
|
+
value_type?: DiscountType;
|
|
109
194
|
}
|
|
110
195
|
interface AnalyticsData {
|
|
111
196
|
utm_params: {
|
|
@@ -344,8 +429,8 @@ interface BundlePurchaseItemParams {
|
|
|
344
429
|
}
|
|
345
430
|
|
|
346
431
|
interface AddonSettings {
|
|
347
|
-
collectionId: string;
|
|
348
432
|
collectionHandle: string;
|
|
433
|
+
collectionId: string;
|
|
349
434
|
enabled: boolean;
|
|
350
435
|
}
|
|
351
436
|
interface AddToCartCallbackSettings {
|
|
@@ -458,6 +543,7 @@ interface BundleVariant {
|
|
|
458
543
|
created_at: IsoDateString;
|
|
459
544
|
}
|
|
460
545
|
interface BundleProduct {
|
|
546
|
+
created_at: IsoDateString;
|
|
461
547
|
custom_prices: boolean;
|
|
462
548
|
customization_window_disabled_message: string | null;
|
|
463
549
|
customization_window: number | null;
|
|
@@ -466,15 +552,14 @@ interface BundleProduct {
|
|
|
466
552
|
external_product_id: string;
|
|
467
553
|
id: number;
|
|
468
554
|
is_customizable: boolean;
|
|
555
|
+
layout_settings: BundleProductLayoutSettings;
|
|
469
556
|
layout_settings_version: '2021-11';
|
|
470
557
|
max_quantity_per_variant: number | null;
|
|
558
|
+
price_rule: BundlePriceRule | null;
|
|
471
559
|
reset_box_contents: boolean;
|
|
472
560
|
title: string;
|
|
473
561
|
updated_at: IsoDateString;
|
|
474
|
-
created_at: IsoDateString;
|
|
475
|
-
layout_settings: BundleProductLayoutSettings;
|
|
476
562
|
variants: BundleVariant[];
|
|
477
|
-
price_rule: BundlePriceRule | null;
|
|
478
563
|
}
|
|
479
564
|
|
|
480
565
|
type SubscriptionStatus = 'active' | 'cancelled' | 'expired';
|
|
@@ -670,6 +755,9 @@ interface Subscription_2021_01 {
|
|
|
670
755
|
status: 'ACTIVE' | 'CANCELLED' | 'EXPIRED';
|
|
671
756
|
}
|
|
672
757
|
|
|
758
|
+
type CustomerNotification = 'SHOPIFY_UPDATE_PAYMENT_INFO';
|
|
759
|
+
type CustomerNotificationType = 'email' | 'sms';
|
|
760
|
+
type CustomerNotificationTemplate = 'shopify_update_payment_information';
|
|
673
761
|
type CustomerIncludes = 'addresses' | 'metafields' | 'payment_methods' | 'subscriptions';
|
|
674
762
|
interface GetCustomerOptions {
|
|
675
763
|
include?: CustomerIncludes[];
|
|
@@ -724,7 +812,7 @@ interface DeliveryLineItem extends Omit<LineItem, 'external_inventory_policy' |
|
|
|
724
812
|
/** Value is set to true if the order is skipped. */
|
|
725
813
|
is_skipped: boolean;
|
|
726
814
|
/** The type of the plan. May return null value in certain cases. */
|
|
727
|
-
plan_type:
|
|
815
|
+
plan_type: PlanType;
|
|
728
816
|
/** Value is set to true if it is a prepaid item */
|
|
729
817
|
is_prepaid: boolean;
|
|
730
818
|
/** The name of the product in a store’s catalog. */
|
|
@@ -1313,9 +1401,379 @@ interface RequestOptions extends GetRequestOptions, CRUDRequestOptions {
|
|
|
1313
1401
|
headers?: RequestHeaders;
|
|
1314
1402
|
}
|
|
1315
1403
|
|
|
1316
|
-
type
|
|
1317
|
-
type
|
|
1404
|
+
type ProductInclude = 'collections';
|
|
1405
|
+
type ProductSource = 'all' | 'in_recharge' | 'not_in_recharge';
|
|
1406
|
+
type PublishStatus = 'published' | 'unpublished' | 'any';
|
|
1318
1407
|
type StorefrontPurchaseOption = 'subscription_and_onetime' | 'subscription_only' | 'onetime_only' | 'inactive';
|
|
1408
|
+
interface ProductValueOption {
|
|
1409
|
+
id?: number | null;
|
|
1410
|
+
label: string;
|
|
1411
|
+
position?: number;
|
|
1412
|
+
}
|
|
1413
|
+
interface ProductOption {
|
|
1414
|
+
id: number;
|
|
1415
|
+
name: string;
|
|
1416
|
+
position: number;
|
|
1417
|
+
values: ProductValueOption[];
|
|
1418
|
+
}
|
|
1419
|
+
interface Modifier {
|
|
1420
|
+
id: number;
|
|
1421
|
+
type: 'dropdown' | 'multiple_choice' | 'radio_buttons' | 'rectangles' | 'checkbox' | 'text' | 'multi_line_text';
|
|
1422
|
+
name: 'Subscribe' | string;
|
|
1423
|
+
required: boolean;
|
|
1424
|
+
option_values: {
|
|
1425
|
+
id: number;
|
|
1426
|
+
label: string;
|
|
1427
|
+
}[];
|
|
1428
|
+
}
|
|
1429
|
+
interface SellingPlan {
|
|
1430
|
+
created_at?: IsoDateString;
|
|
1431
|
+
id: number;
|
|
1432
|
+
order_interval_frequency: number;
|
|
1433
|
+
order_interval_unit_type: IntervalUnit;
|
|
1434
|
+
price_adjustments_value: number;
|
|
1435
|
+
price_adjustments_value_type: 'percentage';
|
|
1436
|
+
selling_plan_id: number;
|
|
1437
|
+
selling_plan_name: string;
|
|
1438
|
+
updated_at?: IsoDateString;
|
|
1439
|
+
}
|
|
1440
|
+
interface SellingPlanGroup {
|
|
1441
|
+
selling_plan_group_id: string | number;
|
|
1442
|
+
selling_plans: SellingPlan[];
|
|
1443
|
+
subscription_product_id: number;
|
|
1444
|
+
}
|
|
1445
|
+
interface SubscriptionOption {
|
|
1446
|
+
charge_interval_frequency: number | null;
|
|
1447
|
+
cutoff_day_of_month: number | null;
|
|
1448
|
+
cutoff_day_of_week: number | null;
|
|
1449
|
+
expire_after_specific_number_of_charges: number | null;
|
|
1450
|
+
is_prepaid: boolean;
|
|
1451
|
+
modifiable_properties: string[];
|
|
1452
|
+
number_charges_until_expiration: number | null;
|
|
1453
|
+
order_day_of_month: number | null;
|
|
1454
|
+
order_day_of_week: number | null;
|
|
1455
|
+
order_interval_frequency_options: string[];
|
|
1456
|
+
order_interval_unit: 'day' | 'week' | 'month';
|
|
1457
|
+
storefront_purchase_options: StorefrontPurchaseOption;
|
|
1458
|
+
updated_at: IsoDateString;
|
|
1459
|
+
}
|
|
1460
|
+
interface ProductVariant_2020_12 {
|
|
1461
|
+
external_metafields: Record<string, unknown>;
|
|
1462
|
+
external_product_id: number;
|
|
1463
|
+
fulfillment_service: 'manual';
|
|
1464
|
+
id: number;
|
|
1465
|
+
image?: ProductImage;
|
|
1466
|
+
inventory: {
|
|
1467
|
+
inventory_level: number;
|
|
1468
|
+
inventory_policy: 'deny' | string;
|
|
1469
|
+
inventory_tracking: 'shopify' | string;
|
|
1470
|
+
};
|
|
1471
|
+
is_deleted: boolean;
|
|
1472
|
+
is_published: boolean;
|
|
1473
|
+
option_values: ProductValueOption[];
|
|
1474
|
+
price_includes_tax: boolean;
|
|
1475
|
+
prices: {
|
|
1476
|
+
compare_at_price: string | null;
|
|
1477
|
+
discounted_price: string;
|
|
1478
|
+
unit_price: string;
|
|
1479
|
+
zero_decimal_currency: boolean;
|
|
1480
|
+
prices?: [
|
|
1481
|
+
{
|
|
1482
|
+
presentment_prices: {
|
|
1483
|
+
currency: string;
|
|
1484
|
+
discounted_price: string;
|
|
1485
|
+
unit_price: string;
|
|
1486
|
+
}[];
|
|
1487
|
+
}
|
|
1488
|
+
];
|
|
1489
|
+
};
|
|
1490
|
+
product_id: number;
|
|
1491
|
+
requires_shipping: boolean;
|
|
1492
|
+
selling_plan_allocations: {
|
|
1493
|
+
selling_plan_group_id: string | number;
|
|
1494
|
+
selling_plan_id: number;
|
|
1495
|
+
discounted_price: string;
|
|
1496
|
+
}[];
|
|
1497
|
+
shipping_dimensions: {
|
|
1498
|
+
depth: string;
|
|
1499
|
+
height: string;
|
|
1500
|
+
weight: number;
|
|
1501
|
+
weight_unit: string;
|
|
1502
|
+
width: string;
|
|
1503
|
+
};
|
|
1504
|
+
sku: string;
|
|
1505
|
+
tax_code: string;
|
|
1506
|
+
taxable: boolean;
|
|
1507
|
+
title: string;
|
|
1508
|
+
}
|
|
1509
|
+
interface Product_2020_12 {
|
|
1510
|
+
brand: string;
|
|
1511
|
+
bundle_product: BundleProduct | null;
|
|
1512
|
+
collection_ids: number[];
|
|
1513
|
+
description: string;
|
|
1514
|
+
discount_amount: number;
|
|
1515
|
+
discount_type: DiscountType;
|
|
1516
|
+
external_created_at: IsoDateString;
|
|
1517
|
+
external_metafields: Record<string, unknown>;
|
|
1518
|
+
external_product_id: number;
|
|
1519
|
+
external_updated_at: IsoDateString;
|
|
1520
|
+
handle: string | null;
|
|
1521
|
+
id: number;
|
|
1522
|
+
images: ProductImage[];
|
|
1523
|
+
in_recharge: boolean;
|
|
1524
|
+
is_deleted: boolean;
|
|
1525
|
+
is_published: boolean;
|
|
1526
|
+
minimum_variant_price: string;
|
|
1527
|
+
modifiers: Modifier[];
|
|
1528
|
+
more_than_one_price: boolean;
|
|
1529
|
+
options: ProductOption[];
|
|
1530
|
+
published_at: IsoDateString;
|
|
1531
|
+
requires_shipping: boolean;
|
|
1532
|
+
selling_plan_groups: SellingPlanGroup[];
|
|
1533
|
+
subscription_options: SubscriptionOption;
|
|
1534
|
+
tags: string[];
|
|
1535
|
+
title: string;
|
|
1536
|
+
type: string;
|
|
1537
|
+
variants: ProductVariant_2020_12[];
|
|
1538
|
+
vendor: string;
|
|
1539
|
+
}
|
|
1540
|
+
interface ProductVariant_2022_06 {
|
|
1541
|
+
external_metafields: Record<string, unknown>;
|
|
1542
|
+
external_product_id: string;
|
|
1543
|
+
external_variant_id: string;
|
|
1544
|
+
fulfillment_service: 'manual';
|
|
1545
|
+
image?: ProductImage | null;
|
|
1546
|
+
inventory: {
|
|
1547
|
+
level: number;
|
|
1548
|
+
policy: 'deny' | string;
|
|
1549
|
+
tracking: 'shopify' | string | null;
|
|
1550
|
+
};
|
|
1551
|
+
is_deleted: boolean;
|
|
1552
|
+
is_published: boolean;
|
|
1553
|
+
option_values: string[];
|
|
1554
|
+
price_includes_tax: boolean;
|
|
1555
|
+
prices: {
|
|
1556
|
+
compare_at_price: string | null;
|
|
1557
|
+
currency: string;
|
|
1558
|
+
plans: {
|
|
1559
|
+
discount_value: string;
|
|
1560
|
+
discounted_price: string;
|
|
1561
|
+
id: number;
|
|
1562
|
+
}[];
|
|
1563
|
+
unit_price: string;
|
|
1564
|
+
}[];
|
|
1565
|
+
requires_shipping: boolean;
|
|
1566
|
+
shipping_dimensions: {
|
|
1567
|
+
depth: string | null;
|
|
1568
|
+
height: string | null;
|
|
1569
|
+
weight: number;
|
|
1570
|
+
weight_unit: string;
|
|
1571
|
+
width: string | null;
|
|
1572
|
+
};
|
|
1573
|
+
sku: string | null;
|
|
1574
|
+
tax_code: string | null;
|
|
1575
|
+
taxable: boolean;
|
|
1576
|
+
title: string;
|
|
1577
|
+
}
|
|
1578
|
+
interface Product_2022_06 {
|
|
1579
|
+
brand: string | null;
|
|
1580
|
+
bundle_product: number | null;
|
|
1581
|
+
collections: {
|
|
1582
|
+
id: number;
|
|
1583
|
+
position: number | null;
|
|
1584
|
+
}[];
|
|
1585
|
+
description: string | null;
|
|
1586
|
+
external_created_at: IsoDateString;
|
|
1587
|
+
external_metafields: Record<string, unknown>;
|
|
1588
|
+
external_plan_group_id: number | null;
|
|
1589
|
+
external_product_id: string;
|
|
1590
|
+
external_updated_at: IsoDateString;
|
|
1591
|
+
handle: string;
|
|
1592
|
+
has_plans: boolean;
|
|
1593
|
+
images: ProductImage[];
|
|
1594
|
+
is_deleted: boolean;
|
|
1595
|
+
is_published: boolean;
|
|
1596
|
+
minimum_variant_prices: {
|
|
1597
|
+
currency: string;
|
|
1598
|
+
price: string;
|
|
1599
|
+
}[];
|
|
1600
|
+
modifiers: Modifier[];
|
|
1601
|
+
more_than_one_price: boolean;
|
|
1602
|
+
options: ProductOption[];
|
|
1603
|
+
plans: Plan[];
|
|
1604
|
+
published_at: IsoDateString;
|
|
1605
|
+
requires_shipping: boolean;
|
|
1606
|
+
store_id: number;
|
|
1607
|
+
tags: string[];
|
|
1608
|
+
title: string;
|
|
1609
|
+
type: string | null;
|
|
1610
|
+
variants: ProductVariant_2022_06[];
|
|
1611
|
+
vendor: string | null;
|
|
1612
|
+
}
|
|
1613
|
+
interface ProductSearchResponse_2020_12 {
|
|
1614
|
+
products: Product_2020_12[];
|
|
1615
|
+
has_more: boolean;
|
|
1616
|
+
total: number;
|
|
1617
|
+
}
|
|
1618
|
+
interface ProductSearchResponse_2022_06 {
|
|
1619
|
+
products: Product_2022_06[];
|
|
1620
|
+
total: number;
|
|
1621
|
+
next_cursor: null | string;
|
|
1622
|
+
previous_cursor: null | string;
|
|
1623
|
+
}
|
|
1624
|
+
interface ProductSearchParams_2020_12 {
|
|
1625
|
+
/** Query by collection id, these are ReCharge collection_id’s. */
|
|
1626
|
+
collection_ids?: (string | number)[];
|
|
1627
|
+
/** If true, do NOT include products where subscription_options.is_prepaid is false. If true, ignore the value in subscription_options.is_prepaid. */
|
|
1628
|
+
exclude_prepaids?: boolean;
|
|
1629
|
+
/** Query by product id, these are external product id’s. */
|
|
1630
|
+
external_product_ids?: (string | number)[];
|
|
1631
|
+
/** Specifies the product format of the response. */
|
|
1632
|
+
format_type?: 'vendor' | 'recharge';
|
|
1633
|
+
/** Required. Product search version. */
|
|
1634
|
+
format_version: '2020-12';
|
|
1635
|
+
/** Whether to include deleted results, default false */
|
|
1636
|
+
include_deleted?: boolean;
|
|
1637
|
+
/** default is 50, max is 250 */
|
|
1638
|
+
limit?: number;
|
|
1639
|
+
/** Ignore given collection ids */
|
|
1640
|
+
not_collection_ids?: (string | number)[];
|
|
1641
|
+
/** Ignore given product ids */
|
|
1642
|
+
not_product_ids?: (string | number)[];
|
|
1643
|
+
/** Specifies the page of results to return for a query. Defaults to 1. */
|
|
1644
|
+
page?: number;
|
|
1645
|
+
/** Query by product id, these are ReCharge product_id’s. */
|
|
1646
|
+
product_ids?: (string | number)[];
|
|
1647
|
+
/** Return all products that have a matching type */
|
|
1648
|
+
product_types?: PlanType[];
|
|
1649
|
+
/** External platform published status. */
|
|
1650
|
+
published_status?: PublishStatus;
|
|
1651
|
+
/** Determines the sort order. Default is elasticsearch’s score. If sort_by = title, results will be sorted by the product title in ascending order. */
|
|
1652
|
+
sort_by?: 'score' | 'title';
|
|
1653
|
+
/** Query by source */
|
|
1654
|
+
source?: ProductSource;
|
|
1655
|
+
/** string representing at least 3 characters of the product title being queried. Should perform a like search ('%{querytext}%') */
|
|
1656
|
+
title?: string;
|
|
1657
|
+
/** Query by variant id, these are external variant ids */
|
|
1658
|
+
variant_ids?: (string | number)[];
|
|
1659
|
+
/**
|
|
1660
|
+
* 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.
|
|
1661
|
+
* If variant_published_status=published, the product-proxy's response only includes variants where variants[].is_published=true.
|
|
1662
|
+
* If variant_published_status=unpublished, the product-proxy's response only includes variants where variants[].is_published=false.
|
|
1663
|
+
* If variant_published_status=any, the product-proxy's response includes all variants irrespective of the value for variants[].is_published.
|
|
1664
|
+
*/
|
|
1665
|
+
variant_published_status?: PublishStatus;
|
|
1666
|
+
}
|
|
1667
|
+
type SortField = 'external_product_id' | 'collection_position' | 'relevance' | 'product_title' | 'unit_price' | 'discounted_price' | 'minimum_variant_price' | 'inventory_level' | 'created_at' | 'updated_at';
|
|
1668
|
+
type SortKeys = 'asc' | 'desc';
|
|
1669
|
+
type SortBy = `${SortField}-${SortKeys}`;
|
|
1670
|
+
interface ProductSearchParams_2022_06 extends ListParams<SortBy> {
|
|
1671
|
+
/** Return all products that have at least one non-deleted plan with a matching channel_setting{}.display set to true. */
|
|
1672
|
+
channel_settings_display?: (keyof ChannelSettings)[];
|
|
1673
|
+
/** Return products that are present in any of the passed in collection IDs. */
|
|
1674
|
+
collection_ids?: (string | number)[];
|
|
1675
|
+
/** Ignore given collection ids */
|
|
1676
|
+
collection_ids_not?: (string | number)[];
|
|
1677
|
+
/** Query on created_at. '<' */
|
|
1678
|
+
created_at_lt?: IsoDateString;
|
|
1679
|
+
/** Query on created_at. '<=' */
|
|
1680
|
+
created_at_lte?: IsoDateString;
|
|
1681
|
+
/** Query on created_at. '>' */
|
|
1682
|
+
created_at_gt?: IsoDateString;
|
|
1683
|
+
/** Query on created_at. '>=' */
|
|
1684
|
+
created_at_gte?: IsoDateString;
|
|
1685
|
+
/** Query on created_at. */
|
|
1686
|
+
created_at?: IsoDateString;
|
|
1687
|
+
/** Perform substring match on the product description. */
|
|
1688
|
+
description?: string;
|
|
1689
|
+
/** Filter on the variants[].prices.plans[].discounted_price. '<' */
|
|
1690
|
+
discounted_price_lt?: number;
|
|
1691
|
+
/** Filter on the variants[].prices.plans[].discounted_price. '<=' */
|
|
1692
|
+
discounted_price_lte?: number;
|
|
1693
|
+
/** Filter on the variants[].prices.plans[].discounted_price. '>' */
|
|
1694
|
+
discounted_price_gt?: number;
|
|
1695
|
+
/** Filter on the variants[].prices.plans[].discounted_price. '>=' */
|
|
1696
|
+
discounted_price_gte?: number;
|
|
1697
|
+
/** Filter on the variants[].prices.plans[].discounted_price. */
|
|
1698
|
+
discounted_price?: number;
|
|
1699
|
+
/** Exclude hidden results */
|
|
1700
|
+
exclude_hidden?: boolean;
|
|
1701
|
+
/** List of external_product_ids. */
|
|
1702
|
+
external_product_ids?: (string | number)[];
|
|
1703
|
+
/** List of external_variant_ids. */
|
|
1704
|
+
external_variant_ids?: (string | number)[];
|
|
1705
|
+
/** Required. Product search version. */
|
|
1706
|
+
format_version: '2022-06';
|
|
1707
|
+
/** If true, return only products that have at least one non-deleted plan in Recharge */
|
|
1708
|
+
has_plans?: boolean;
|
|
1709
|
+
/** Accepts either an external_product_id or an external_variant_id. Must perform exact match. */
|
|
1710
|
+
id?: string | number;
|
|
1711
|
+
/** If true, return products where at least one variant’s inventory.level > 0 OR inventory.policy=continue. */
|
|
1712
|
+
in_stock?: boolean;
|
|
1713
|
+
/** Whether to include deleted results, default false */
|
|
1714
|
+
include_deleted?: boolean;
|
|
1715
|
+
/** Query on the variants[].inventory.level. '<' */
|
|
1716
|
+
inventory_level_lt?: number;
|
|
1717
|
+
/** Query on the variants[].inventory.level. '<=' */
|
|
1718
|
+
inventory_level_lte?: number;
|
|
1719
|
+
/** Query on the variants[].inventory.level. '>' */
|
|
1720
|
+
inventory_level_gt?: number;
|
|
1721
|
+
/** Query on the variants[].inventory.level. '>=' */
|
|
1722
|
+
inventory_level_gte?: number;
|
|
1723
|
+
/** Query on the variants[].inventory.level. */
|
|
1724
|
+
inventory_level?: number;
|
|
1725
|
+
/** Filter on the minimum_variant_price. '<' */
|
|
1726
|
+
minimum_variant_price_lt?: number;
|
|
1727
|
+
/** Filter on the minimum_variant_price. '<=' */
|
|
1728
|
+
minimum_variant_price_lte?: number;
|
|
1729
|
+
/** Filter on the minimum_variant_price. '>' */
|
|
1730
|
+
minimum_variant_price_gt?: number;
|
|
1731
|
+
/** Filter on the minimum_variant_price. '>=' */
|
|
1732
|
+
minimum_variant_price_gte?: number;
|
|
1733
|
+
/** Filter on the minimum_variant_price. */
|
|
1734
|
+
minimum_variant_price?: number;
|
|
1735
|
+
/** Return all products that have a matching plan.type */
|
|
1736
|
+
plan_types?: PlanType[];
|
|
1737
|
+
/** Exclude given plan types */
|
|
1738
|
+
plan_types_exclusive?: PlanType[];
|
|
1739
|
+
/** Perform search on published status */
|
|
1740
|
+
product_published_status?: PublishStatus;
|
|
1741
|
+
/** Perform substring match on the product title */
|
|
1742
|
+
product_title?: string;
|
|
1743
|
+
/** Accept up to 256 characters. Should search on the following fields: title, description, tags, variants[].sku, variants[].title. */
|
|
1744
|
+
search_term?: string;
|
|
1745
|
+
/** Perform substring match on variants[].sku */
|
|
1746
|
+
sku?: string;
|
|
1747
|
+
/** Perform substring match on tags */
|
|
1748
|
+
tags?: string[];
|
|
1749
|
+
/** Filter on the variants[].prices.unit_price. '<' */
|
|
1750
|
+
unit_price_lt?: number;
|
|
1751
|
+
/** Filter on the variants[].prices.unit_price. '<=' */
|
|
1752
|
+
unit_price_lte?: number;
|
|
1753
|
+
/** Filter on the variants[].prices.unit_price. '>' */
|
|
1754
|
+
unit_price_gt?: number;
|
|
1755
|
+
/** Filter on the variants[].prices.unit_price. '>=' */
|
|
1756
|
+
unit_price_gte?: number;
|
|
1757
|
+
/** Filter on the variants[].prices.unit_price. */
|
|
1758
|
+
unit_price?: number;
|
|
1759
|
+
/** Query on updated_at. '<' */
|
|
1760
|
+
updated_at_lt?: IsoDateString;
|
|
1761
|
+
/** Query on updated_at. '<=' */
|
|
1762
|
+
updated_at_lte?: IsoDateString;
|
|
1763
|
+
/** Query on updated_at. '>' */
|
|
1764
|
+
updated_at_gt?: IsoDateString;
|
|
1765
|
+
/** Query on updated_at. '>=' */
|
|
1766
|
+
updated_at_gte?: IsoDateString;
|
|
1767
|
+
/** Query on updated_at. */
|
|
1768
|
+
updated_at?: IsoDateString;
|
|
1769
|
+
/** Return products where at least one variant’s is_published value matches the value passed in to this query param. */
|
|
1770
|
+
variant_published_status?: Exclude<PublishStatus, 'any'>;
|
|
1771
|
+
/** Perform substring match on the variants[].title */
|
|
1772
|
+
variant_title?: string;
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
type CDNVersion = '2020-12' | '2022-06';
|
|
1776
|
+
type FirstOption = 'onetime' | 'autodeliver';
|
|
1319
1777
|
interface BundleTranslations {
|
|
1320
1778
|
cpb_add: string;
|
|
1321
1779
|
cpb_add_items_to_continue: string;
|
|
@@ -1401,11 +1859,18 @@ interface Translations {
|
|
|
1401
1859
|
}
|
|
1402
1860
|
type WidgetTemplateType = 'radio' | 'checkbox' | 'button_group' | 'radio_group';
|
|
1403
1861
|
type WidgetIconColor = '#191D48' | 'white' | 'black' | '#ffffff';
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1862
|
+
type CDNProductType<T extends CDNProductQuery_2020_12 | CDNProductQuery_2022_06> = T extends CDNProductQuery_2020_12 ? CDNProduct : CDNProduct_2022_06;
|
|
1863
|
+
type CDNProductResponseType<T extends CDNProductQuery_2020_12 | CDNProductQuery_2022_06> = CDNProductResource<T>;
|
|
1864
|
+
interface CDNProductQuery_2020_12 {
|
|
1865
|
+
version: '2020-12';
|
|
1866
|
+
}
|
|
1867
|
+
interface CDNProductQuery_2022_06 {
|
|
1868
|
+
version: '2022-06';
|
|
1869
|
+
}
|
|
1870
|
+
interface CDNProductResource<T extends CDNProductQuery_2020_12 | CDNProductQuery_2022_06> {
|
|
1871
|
+
product: T extends CDNProductQuery_2020_12 ? CDNProductRaw : CDNProduct_2022_06;
|
|
1407
1872
|
meta: {
|
|
1408
|
-
version: '
|
|
1873
|
+
version: T extends CDNProductQuery_2020_12 ? CDNProductQuery_2020_12['version'] : CDNProductQuery_2022_06['version'];
|
|
1409
1874
|
};
|
|
1410
1875
|
}
|
|
1411
1876
|
interface CDNProductKeyObject {
|
|
@@ -1422,68 +1887,14 @@ interface CDNProductsAndSettingsResource {
|
|
|
1422
1887
|
message: string;
|
|
1423
1888
|
};
|
|
1424
1889
|
}
|
|
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;
|
|
1450
|
-
}
|
|
1451
|
-
interface CDNPrices {
|
|
1452
|
-
compare_at_price: string | null;
|
|
1453
|
-
unit_price: string;
|
|
1454
|
-
discounted_price: string;
|
|
1455
|
-
zero_decimal_currency: boolean;
|
|
1456
|
-
}
|
|
1457
|
-
interface CDNVariantOptionValue {
|
|
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;
|
|
1890
|
+
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'> {
|
|
1471
1891
|
}
|
|
1472
|
-
interface
|
|
1473
|
-
id: number;
|
|
1474
|
-
name: string;
|
|
1475
|
-
position: number;
|
|
1476
|
-
values: CDNProductOptionValue[];
|
|
1892
|
+
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'> {
|
|
1477
1893
|
}
|
|
1478
|
-
interface CDNProductRaw {
|
|
1479
|
-
id: number | null;
|
|
1894
|
+
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
1895
|
bundle_product?: CDNBundleSettings | null;
|
|
1481
|
-
external_product_id: number;
|
|
1482
|
-
in_recharge: boolean;
|
|
1483
|
-
options: CDNProductOption[];
|
|
1484
|
-
variants: CDNVariant[];
|
|
1485
1896
|
subscription_options: CDNSubscriptionOption;
|
|
1486
|
-
|
|
1897
|
+
variants: CDNVariant[];
|
|
1487
1898
|
}
|
|
1488
1899
|
interface CDNProduct extends CDNProductRaw {
|
|
1489
1900
|
/** @deprecated */
|
|
@@ -1571,94 +1982,31 @@ interface CDNStoreSettings {
|
|
|
1571
1982
|
zero_decimal_currency?: boolean;
|
|
1572
1983
|
};
|
|
1573
1984
|
}
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1985
|
+
interface CDNPlan extends Omit<Plan, 'channel_settings' | 'created_at' | 'deleted_at' | 'external_product_id' | 'subscription_preferences' | 'updated_at'> {
|
|
1986
|
+
apply_custom_date_to_checkout: boolean;
|
|
1987
|
+
charge_interval_frequency: number | null;
|
|
1988
|
+
interval_unit: IntervalUnit | null;
|
|
1989
|
+
order_interval_frequency: number | null;
|
|
1990
|
+
pricing_progression: {
|
|
1991
|
+
recurring_discount_type: DiscountType | null;
|
|
1992
|
+
recurring_discount_amount: number | null;
|
|
1993
|
+
recurring_discount_after_cycle: number | null;
|
|
1994
|
+
}[];
|
|
1579
1995
|
}
|
|
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';
|
|
1996
|
+
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
1997
|
}
|
|
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
|
-
};
|
|
1998
|
+
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'> {
|
|
1999
|
+
bundle_product: CDNBundleSettings | null;
|
|
2000
|
+
plans: CDNPlan[];
|
|
2001
|
+
variants: CDNProductVariant_2022_06[];
|
|
1630
2002
|
}
|
|
1631
|
-
interface CDNBundleVariantOptionSource {
|
|
1632
|
-
id: number;
|
|
2003
|
+
interface CDNBundleVariantOptionSource extends Omit<BundleVariantOptionSource, 'created_at' | 'option_source_id' | 'position' | 'source_platform' | 'updated_at'> {
|
|
1633
2004
|
collection_id: string;
|
|
1634
|
-
quantity_max: number | null;
|
|
1635
|
-
quantity_min: number | null;
|
|
1636
2005
|
}
|
|
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;
|
|
2006
|
+
interface CDNBundleVariant extends Omit<BundleVariant, 'created_at' | 'option_sources' | 'position' | 'ranges' | 'selection_defaults' | 'title' | 'updated_at'> {
|
|
1647
2007
|
option_sources: CDNBundleVariantOptionSource[];
|
|
1648
|
-
selection_defaults?: CDNBundleVariantSelectionDefault[];
|
|
1649
2008
|
}
|
|
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;
|
|
2009
|
+
interface CDNBundleSettings extends Omit<BundleProduct, 'created_at' | 'custom_prices' | 'price_rule' | 'title' | 'updated_at' | 'variants'> {
|
|
1662
2010
|
variants: CDNBundleVariant[];
|
|
1663
2011
|
}
|
|
1664
2012
|
|
|
@@ -1937,74 +2285,6 @@ interface InitOptions {
|
|
|
1937
2285
|
loginRetryFn?: () => Promise<Session | undefined>;
|
|
1938
2286
|
}
|
|
1939
2287
|
|
|
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
2288
|
declare function getCharge(session: Session, id: number | string, options?: GetChargeOptions): Promise<Charge>;
|
|
2009
2289
|
/** Lists charges */
|
|
2010
2290
|
declare function listCharges(session: Session, query?: ChargeListParams): Promise<ChargeListResponse>;
|
|
@@ -2025,7 +2305,7 @@ declare function skipCharge(session: Session, id: number | string, purchaseItemI
|
|
|
2025
2305
|
declare function unskipCharge(session: Session, id: number | string, purchaseItemIds: (string | number)[]): Promise<Charge>;
|
|
2026
2306
|
declare function processCharge(session: Session, id: number | string): Promise<Charge>;
|
|
2027
2307
|
|
|
2028
|
-
declare function getCDNProduct(externalProductId: string | number): Promise<
|
|
2308
|
+
declare function getCDNProduct<T extends CDNProductQuery_2020_12 | CDNProductQuery_2022_06 = CDNProductQuery_2020_12>(externalProductId: string | number, query?: T): Promise<CDNProductType<T>>;
|
|
2029
2309
|
declare function getCDNStoreSettings(): Promise<CDNStoreSettings>;
|
|
2030
2310
|
declare function getCDNWidgetSettings(): Promise<CDNWidgetSettings>;
|
|
2031
2311
|
declare function getCDNProductsAndSettings(): Promise<CDNProductsAndSettings>;
|
|
@@ -2092,6 +2372,9 @@ declare function listPaymentMethods(session: Session, query?: PaymentMethodListP
|
|
|
2092
2372
|
declare function getPlan(session: Session, id: string | number): Promise<Plan>;
|
|
2093
2373
|
declare function listPlans(session: Session, query?: PlanListParams): Promise<PlansResponse>;
|
|
2094
2374
|
|
|
2375
|
+
type ProductSearchType<T extends ProductSearchParams_2020_12 | ProductSearchParams_2022_06> = T extends ProductSearchParams_2020_12 ? ProductSearchResponse_2020_12 : ProductSearchResponse_2022_06;
|
|
2376
|
+
declare function productSearch<T extends ProductSearchParams_2020_12 | ProductSearchParams_2022_06>(session: Session, query: T): Promise<ProductSearchType<T>>;
|
|
2377
|
+
|
|
2095
2378
|
declare function getSubscription(session: Session, id: string | number, options?: GetSubscriptionOptions): Promise<Subscription>;
|
|
2096
2379
|
declare function listSubscriptions(session: Session, query?: SubscriptionListParams): Promise<SubscriptionsResponse>;
|
|
2097
2380
|
/**
|
|
@@ -2149,6 +2432,7 @@ declare function getCustomer(session: Session, options?: GetCustomerOptions): Pr
|
|
|
2149
2432
|
declare function updateCustomer(session: Session, updateRequest: UpdateCustomerRequest): Promise<Customer>;
|
|
2150
2433
|
declare function getDeliverySchedule(session: Session, query?: CustomerDeliveryScheduleParams): Promise<Delivery[]>;
|
|
2151
2434
|
declare function getCustomerPortalAccess(session: Session): Promise<CustomerPortalAccessResponse>;
|
|
2435
|
+
declare function sendCustomerNotification(session: Session, notification: CustomerNotification): Promise<void>;
|
|
2152
2436
|
|
|
2153
2437
|
declare const api: {
|
|
2154
2438
|
get<T>(url: string, requestOptions?: GetRequestOptions): Promise<T>;
|
|
@@ -2158,4 +2442,4 @@ declare const api: {
|
|
|
2158
2442
|
};
|
|
2159
2443
|
declare function initRecharge(opt?: InitOptions): void;
|
|
2160
2444
|
|
|
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,
|
|
2445
|
+
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 };
|