@rechargeapps/storefront-client 1.6.1 → 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/bundle.js +3 -2
- package/dist/cjs/api/bundle.js.map +1 -1
- 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/bundle.js +3 -2
- package/dist/esm/api/bundle.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 +503 -223
- 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: {
|
|
@@ -339,10 +417,13 @@ interface UpdateBundlePurchaseItem extends UpdateSubscriptionRequest {
|
|
|
339
417
|
interface BundlePurchaseItem extends Subscription {
|
|
340
418
|
items: BundleSelectionItem[];
|
|
341
419
|
}
|
|
420
|
+
interface BundlePurchaseItemParams {
|
|
421
|
+
commit?: boolean;
|
|
422
|
+
}
|
|
342
423
|
|
|
343
424
|
interface AddonSettings {
|
|
344
|
-
collectionId: string;
|
|
345
425
|
collectionHandle: string;
|
|
426
|
+
collectionId: string;
|
|
346
427
|
enabled: boolean;
|
|
347
428
|
}
|
|
348
429
|
interface AddToCartCallbackSettings {
|
|
@@ -455,6 +536,7 @@ interface BundleVariant {
|
|
|
455
536
|
created_at: IsoDateString;
|
|
456
537
|
}
|
|
457
538
|
interface BundleProduct {
|
|
539
|
+
created_at: IsoDateString;
|
|
458
540
|
custom_prices: boolean;
|
|
459
541
|
customization_window_disabled_message: string | null;
|
|
460
542
|
customization_window: number | null;
|
|
@@ -463,15 +545,14 @@ interface BundleProduct {
|
|
|
463
545
|
external_product_id: string;
|
|
464
546
|
id: number;
|
|
465
547
|
is_customizable: boolean;
|
|
548
|
+
layout_settings: BundleProductLayoutSettings;
|
|
466
549
|
layout_settings_version: '2021-11';
|
|
467
550
|
max_quantity_per_variant: number | null;
|
|
551
|
+
price_rule: BundlePriceRule | null;
|
|
468
552
|
reset_box_contents: boolean;
|
|
469
553
|
title: string;
|
|
470
554
|
updated_at: IsoDateString;
|
|
471
|
-
created_at: IsoDateString;
|
|
472
|
-
layout_settings: BundleProductLayoutSettings;
|
|
473
555
|
variants: BundleVariant[];
|
|
474
|
-
price_rule: BundlePriceRule | null;
|
|
475
556
|
}
|
|
476
557
|
|
|
477
558
|
type SubscriptionStatus = 'active' | 'cancelled' | 'expired';
|
|
@@ -667,6 +748,9 @@ interface Subscription_2021_01 {
|
|
|
667
748
|
status: 'ACTIVE' | 'CANCELLED' | 'EXPIRED';
|
|
668
749
|
}
|
|
669
750
|
|
|
751
|
+
type CustomerNotification = 'SHOPIFY_UPDATE_PAYMENT_INFO';
|
|
752
|
+
type CustomerNotificationType = 'email' | 'sms';
|
|
753
|
+
type CustomerNotificationTemplate = 'shopify_update_payment_information';
|
|
670
754
|
type CustomerIncludes = 'addresses' | 'metafields' | 'payment_methods' | 'subscriptions';
|
|
671
755
|
interface GetCustomerOptions {
|
|
672
756
|
include?: CustomerIncludes[];
|
|
@@ -721,7 +805,7 @@ interface DeliveryLineItem extends Omit<LineItem, 'external_inventory_policy' |
|
|
|
721
805
|
/** Value is set to true if the order is skipped. */
|
|
722
806
|
is_skipped: boolean;
|
|
723
807
|
/** The type of the plan. May return null value in certain cases. */
|
|
724
|
-
plan_type:
|
|
808
|
+
plan_type: PlanType;
|
|
725
809
|
/** Value is set to true if it is a prepaid item */
|
|
726
810
|
is_prepaid: boolean;
|
|
727
811
|
/** The name of the product in a store’s catalog. */
|
|
@@ -1310,9 +1394,379 @@ interface RequestOptions extends GetRequestOptions, CRUDRequestOptions {
|
|
|
1310
1394
|
headers?: RequestHeaders;
|
|
1311
1395
|
}
|
|
1312
1396
|
|
|
1313
|
-
type
|
|
1314
|
-
type
|
|
1397
|
+
type ProductInclude = 'collections';
|
|
1398
|
+
type ProductSource = 'all' | 'in_recharge' | 'not_in_recharge';
|
|
1399
|
+
type PublishStatus = 'published' | 'unpublished' | 'any';
|
|
1315
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';
|
|
1316
1770
|
interface BundleTranslations {
|
|
1317
1771
|
cpb_add: string;
|
|
1318
1772
|
cpb_add_items_to_continue: string;
|
|
@@ -1398,11 +1852,18 @@ interface Translations {
|
|
|
1398
1852
|
}
|
|
1399
1853
|
type WidgetTemplateType = 'radio' | 'checkbox' | 'button_group' | 'radio_group';
|
|
1400
1854
|
type WidgetIconColor = '#191D48' | 'white' | 'black' | '#ffffff';
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
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;
|
|
1404
1865
|
meta: {
|
|
1405
|
-
version: '
|
|
1866
|
+
version: T extends CDNProductQuery_2020_12 ? CDNProductQuery_2020_12['version'] : CDNProductQuery_2022_06['version'];
|
|
1406
1867
|
};
|
|
1407
1868
|
}
|
|
1408
1869
|
interface CDNProductKeyObject {
|
|
@@ -1419,68 +1880,14 @@ interface CDNProductsAndSettingsResource {
|
|
|
1419
1880
|
message: string;
|
|
1420
1881
|
};
|
|
1421
1882
|
}
|
|
1422
|
-
interface
|
|
1423
|
-
order_interval_frequency: string | number;
|
|
1424
|
-
created_at?: IsoDateString;
|
|
1425
|
-
order_interval_unit_type: IntervalUnit;
|
|
1426
|
-
updated_at?: IsoDateString;
|
|
1427
|
-
id: number;
|
|
1428
|
-
selling_plan_id: number;
|
|
1429
|
-
selling_plan_name: string;
|
|
1430
|
-
price_adjustments_value_type: PriceAdjustmentsType;
|
|
1431
|
-
price_adjustments_value: number;
|
|
1432
|
-
}
|
|
1433
|
-
interface CDNSellingPlanGroup {
|
|
1434
|
-
selling_plan_group_id: string | number;
|
|
1435
|
-
selling_plans: CDNSellingPlan[];
|
|
1436
|
-
subscription_product_id: number;
|
|
1437
|
-
}
|
|
1438
|
-
interface CDNSubscriptionOption {
|
|
1439
|
-
storefront_purchase_options: StorefrontPurchaseOption;
|
|
1440
|
-
updated_at: IsoDateString;
|
|
1441
|
-
is_prepaid?: boolean;
|
|
1442
|
-
}
|
|
1443
|
-
interface CDNSellingPlanAllocations {
|
|
1444
|
-
selling_plan_group_id: string | number;
|
|
1445
|
-
selling_plan_id: number;
|
|
1446
|
-
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'> {
|
|
1447
1884
|
}
|
|
1448
|
-
interface
|
|
1449
|
-
compare_at_price: string | null;
|
|
1450
|
-
unit_price: string;
|
|
1451
|
-
discounted_price: string;
|
|
1452
|
-
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'> {
|
|
1453
1886
|
}
|
|
1454
|
-
interface
|
|
1455
|
-
id: number;
|
|
1456
|
-
label: string;
|
|
1457
|
-
}
|
|
1458
|
-
interface CDNVariant {
|
|
1459
|
-
id: number;
|
|
1460
|
-
option_values: CDNVariantOptionValue[];
|
|
1461
|
-
prices: CDNPrices;
|
|
1462
|
-
selling_plan_allocations: CDNSellingPlanAllocations[];
|
|
1463
|
-
}
|
|
1464
|
-
interface CDNProductOptionValue {
|
|
1465
|
-
id?: number | null;
|
|
1466
|
-
label: string;
|
|
1467
|
-
position: number;
|
|
1468
|
-
}
|
|
1469
|
-
interface CDNProductOption {
|
|
1470
|
-
id: number;
|
|
1471
|
-
name: string;
|
|
1472
|
-
position: number;
|
|
1473
|
-
values: CDNProductOptionValue[];
|
|
1474
|
-
}
|
|
1475
|
-
interface CDNProductRaw {
|
|
1476
|
-
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'> {
|
|
1477
1888
|
bundle_product?: CDNBundleSettings | null;
|
|
1478
|
-
external_product_id: number;
|
|
1479
|
-
in_recharge: boolean;
|
|
1480
|
-
options: CDNProductOption[];
|
|
1481
|
-
variants: CDNVariant[];
|
|
1482
1889
|
subscription_options: CDNSubscriptionOption;
|
|
1483
|
-
|
|
1890
|
+
variants: CDNVariant[];
|
|
1484
1891
|
}
|
|
1485
1892
|
interface CDNProduct extends CDNProductRaw {
|
|
1486
1893
|
/** @deprecated */
|
|
@@ -1568,94 +1975,31 @@ interface CDNStoreSettings {
|
|
|
1568
1975
|
zero_decimal_currency?: boolean;
|
|
1569
1976
|
};
|
|
1570
1977
|
}
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
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
|
+
}[];
|
|
1576
1988
|
}
|
|
1577
|
-
interface
|
|
1578
|
-
data?: {
|
|
1579
|
-
optionsMeta: {
|
|
1580
|
-
[key: string]: CDNBundleStepOption;
|
|
1581
|
-
};
|
|
1582
|
-
};
|
|
1583
|
-
disable: boolean;
|
|
1584
|
-
index: string;
|
|
1585
|
-
name: string;
|
|
1586
|
-
title: string;
|
|
1587
|
-
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'> {
|
|
1588
1990
|
}
|
|
1589
|
-
interface
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
};
|
|
1594
|
-
addons: {
|
|
1595
|
-
collectionHandle: string;
|
|
1596
|
-
collectionId: string;
|
|
1597
|
-
enabled: boolean;
|
|
1598
|
-
};
|
|
1599
|
-
collapsibleSections: boolean;
|
|
1600
|
-
crossSells: {
|
|
1601
|
-
collectionId: string;
|
|
1602
|
-
enabled: boolean;
|
|
1603
|
-
collectionHandle: string;
|
|
1604
|
-
};
|
|
1605
|
-
defaultFrequency: string;
|
|
1606
|
-
defaultVariantId: string;
|
|
1607
|
-
description: string;
|
|
1608
|
-
filters: any[];
|
|
1609
|
-
learnMoreModal: boolean;
|
|
1610
|
-
published: boolean;
|
|
1611
|
-
showVariants: boolean;
|
|
1612
|
-
template: 'one-page' | 'multi-step';
|
|
1613
|
-
templateSettings: {
|
|
1614
|
-
onePage: {
|
|
1615
|
-
frequencySelector: 'dropdown';
|
|
1616
|
-
};
|
|
1617
|
-
multiStep?: {
|
|
1618
|
-
steps: CDNBundleStep[];
|
|
1619
|
-
optionImages: string;
|
|
1620
|
-
};
|
|
1621
|
-
};
|
|
1622
|
-
title: string;
|
|
1623
|
-
visibility: {
|
|
1624
|
-
portal: boolean;
|
|
1625
|
-
signup: boolean;
|
|
1626
|
-
};
|
|
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[];
|
|
1627
1995
|
}
|
|
1628
|
-
interface CDNBundleVariantOptionSource {
|
|
1629
|
-
id: number;
|
|
1996
|
+
interface CDNBundleVariantOptionSource extends Omit<BundleVariantOptionSource, 'created_at' | 'option_source_id' | 'position' | 'source_platform' | 'updated_at'> {
|
|
1630
1997
|
collection_id: string;
|
|
1631
|
-
quantity_max: number | null;
|
|
1632
|
-
quantity_min: number | null;
|
|
1633
1998
|
}
|
|
1634
|
-
interface
|
|
1635
|
-
id: number;
|
|
1636
|
-
quantity: number;
|
|
1637
|
-
external_variant_id: string;
|
|
1638
|
-
}
|
|
1639
|
-
interface CDNBundleVariant {
|
|
1640
|
-
enabled: boolean;
|
|
1641
|
-
external_variant_id: string;
|
|
1642
|
-
id: number;
|
|
1643
|
-
items_count: number;
|
|
1999
|
+
interface CDNBundleVariant extends Omit<BundleVariant, 'created_at' | 'option_sources' | 'position' | 'ranges' | 'selection_defaults' | 'title' | 'updated_at'> {
|
|
1644
2000
|
option_sources: CDNBundleVariantOptionSource[];
|
|
1645
|
-
selection_defaults?: CDNBundleVariantSelectionDefault[];
|
|
1646
2001
|
}
|
|
1647
|
-
interface CDNBundleSettings {
|
|
1648
|
-
customization_window_disabled_message: string | null;
|
|
1649
|
-
customization_window?: number;
|
|
1650
|
-
default_bundle_variant_id?: number;
|
|
1651
|
-
description: string | null;
|
|
1652
|
-
external_product_id: string;
|
|
1653
|
-
id: number;
|
|
1654
|
-
is_customizable?: boolean;
|
|
1655
|
-
layout_settings: CDNBundleLayoutSettings;
|
|
1656
|
-
layout_settings_version: '2021-11';
|
|
1657
|
-
max_quantity_per_variant: number | null;
|
|
1658
|
-
reset_box_contents?: boolean;
|
|
2002
|
+
interface CDNBundleSettings extends Omit<BundleProduct, 'created_at' | 'custom_prices' | 'price_rule' | 'title' | 'updated_at' | 'variants'> {
|
|
1659
2003
|
variants: CDNBundleVariant[];
|
|
1660
2004
|
}
|
|
1661
2005
|
|
|
@@ -1934,74 +2278,6 @@ interface InitOptions {
|
|
|
1934
2278
|
loginRetryFn?: () => Promise<Session | undefined>;
|
|
1935
2279
|
}
|
|
1936
2280
|
|
|
1937
|
-
interface ChannelSettings {
|
|
1938
|
-
api: {
|
|
1939
|
-
display: boolean;
|
|
1940
|
-
};
|
|
1941
|
-
checkout_page: {
|
|
1942
|
-
display: boolean;
|
|
1943
|
-
};
|
|
1944
|
-
customer_portal: {
|
|
1945
|
-
display: boolean;
|
|
1946
|
-
};
|
|
1947
|
-
merchant_portal: {
|
|
1948
|
-
display: boolean;
|
|
1949
|
-
};
|
|
1950
|
-
}
|
|
1951
|
-
interface SubscriptionPreferences {
|
|
1952
|
-
charge_interval_frequency: number;
|
|
1953
|
-
cutoff_day_of_month: null | number;
|
|
1954
|
-
cutoff_day_of_week: null | number;
|
|
1955
|
-
expire_after_specific_number_of_charges: null | number;
|
|
1956
|
-
interval_unit: 'day' | 'week' | 'month';
|
|
1957
|
-
order_day_of_month: number;
|
|
1958
|
-
order_day_of_week: null | number;
|
|
1959
|
-
order_interval_frequency: number;
|
|
1960
|
-
}
|
|
1961
|
-
type PlanType = 'subscription' | 'prepaid' | 'onetime';
|
|
1962
|
-
interface Plan {
|
|
1963
|
-
/** Unique numeric identifier for the Plan. */
|
|
1964
|
-
id: number;
|
|
1965
|
-
/** An object containing the availability of the plan through various supported channels. */
|
|
1966
|
-
channel_settings: ChannelSettings;
|
|
1967
|
-
/** The time the plan was created. */
|
|
1968
|
-
created_at: IsoDateString;
|
|
1969
|
-
/** If deleted, the time the plan was deleted. */
|
|
1970
|
-
deleted_at: IsoDateString;
|
|
1971
|
-
/** The discount amount applied to the product price when purchased through this Plan. All Plans for a product must have the same discount amount. */
|
|
1972
|
-
discount_amount: string;
|
|
1973
|
-
/** Used in combination with discount amount to determine the discount applied on a product price when purchased through this Plan. */
|
|
1974
|
-
discount_type: 'percentage';
|
|
1975
|
-
/** An object containing the product id as it appears in external platforms. */
|
|
1976
|
-
external_product_id: ExternalId;
|
|
1977
|
-
/** The number indicating the order which the plan will be in a list of related plans. */
|
|
1978
|
-
sort_order: number;
|
|
1979
|
-
/** An object containing the various subscription preferences associated with this plan. */
|
|
1980
|
-
subscription_preferences: SubscriptionPreferences;
|
|
1981
|
-
/** The title of the plan. All Plans for a product must have the same title. */
|
|
1982
|
-
title: string;
|
|
1983
|
-
/** The type of the plan. Products with a prepaid plan cannot have plans of other types. */
|
|
1984
|
-
type: PlanType;
|
|
1985
|
-
/** The time the plan was last updated. */
|
|
1986
|
-
updated_at: IsoDateString;
|
|
1987
|
-
}
|
|
1988
|
-
interface PlansResponse {
|
|
1989
|
-
next_cursor: null | string;
|
|
1990
|
-
previous_cursor: null | string;
|
|
1991
|
-
plans: Plan[];
|
|
1992
|
-
}
|
|
1993
|
-
type PlanSortBy = 'id-asc' | 'id-desc' | 'updated_at-asc' | 'updated_at-desc';
|
|
1994
|
-
interface PlanListParams extends ListParams<PlanSortBy> {
|
|
1995
|
-
/** Return the Plans linked to the Product record in Recharge with the indicated external_product_id */
|
|
1996
|
-
external_product_id?: string | number;
|
|
1997
|
-
/** Return the plans updated before the given date. */
|
|
1998
|
-
updated_at_max?: IsoDateString;
|
|
1999
|
-
/** Return the plans updated after the given date. */
|
|
2000
|
-
updated_at_min?: IsoDateString;
|
|
2001
|
-
/** Return the plans that are of a specific type. */
|
|
2002
|
-
type?: PlanType;
|
|
2003
|
-
}
|
|
2004
|
-
|
|
2005
2281
|
declare function getCharge(session: Session, id: number | string, options?: GetChargeOptions): Promise<Charge>;
|
|
2006
2282
|
/** Lists charges */
|
|
2007
2283
|
declare function listCharges(session: Session, query?: ChargeListParams): Promise<ChargeListResponse>;
|
|
@@ -2022,7 +2298,7 @@ declare function skipCharge(session: Session, id: number | string, purchaseItemI
|
|
|
2022
2298
|
declare function unskipCharge(session: Session, id: number | string, purchaseItemIds: (string | number)[]): Promise<Charge>;
|
|
2023
2299
|
declare function processCharge(session: Session, id: number | string): Promise<Charge>;
|
|
2024
2300
|
|
|
2025
|
-
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>>;
|
|
2026
2302
|
declare function getCDNStoreSettings(): Promise<CDNStoreSettings>;
|
|
2027
2303
|
declare function getCDNWidgetSettings(): Promise<CDNWidgetSettings>;
|
|
2028
2304
|
declare function getCDNProductsAndSettings(): Promise<CDNProductsAndSettings>;
|
|
@@ -2046,7 +2322,7 @@ declare function listBundleSelections(session: Session, query?: BundleSelectionL
|
|
|
2046
2322
|
declare function createBundleSelection(session: Session, createRequest: CreateBundleSelectionRequest): Promise<BundleSelection>;
|
|
2047
2323
|
declare function updateBundleSelection(session: Session, id: string | number, updateRequest: UpdateBundleSelectionRequest): Promise<BundleSelection>;
|
|
2048
2324
|
declare function deleteBundleSelection(session: Session, id: string | number): Promise<void>;
|
|
2049
|
-
declare function updateBundle(session: Session, purchase_item_id: string | number, updateRequest: UpdateBundlePurchaseItem): Promise<BundlePurchaseItem>;
|
|
2325
|
+
declare function updateBundle(session: Session, purchase_item_id: string | number, updateRequest: UpdateBundlePurchaseItem, query?: BundlePurchaseItemParams): Promise<BundlePurchaseItem>;
|
|
2050
2326
|
|
|
2051
2327
|
/** @internal Retrieves membership information for passed in id */
|
|
2052
2328
|
declare function getMembership(session: Session, id: string | number): Promise<Membership>;
|
|
@@ -2089,6 +2365,9 @@ declare function listPaymentMethods(session: Session, query?: PaymentMethodListP
|
|
|
2089
2365
|
declare function getPlan(session: Session, id: string | number): Promise<Plan>;
|
|
2090
2366
|
declare function listPlans(session: Session, query?: PlanListParams): Promise<PlansResponse>;
|
|
2091
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
|
+
|
|
2092
2371
|
declare function getSubscription(session: Session, id: string | number, options?: GetSubscriptionOptions): Promise<Subscription>;
|
|
2093
2372
|
declare function listSubscriptions(session: Session, query?: SubscriptionListParams): Promise<SubscriptionsResponse>;
|
|
2094
2373
|
/**
|
|
@@ -2146,6 +2425,7 @@ declare function getCustomer(session: Session, options?: GetCustomerOptions): Pr
|
|
|
2146
2425
|
declare function updateCustomer(session: Session, updateRequest: UpdateCustomerRequest): Promise<Customer>;
|
|
2147
2426
|
declare function getDeliverySchedule(session: Session, query?: CustomerDeliveryScheduleParams): Promise<Delivery[]>;
|
|
2148
2427
|
declare function getCustomerPortalAccess(session: Session): Promise<CustomerPortalAccessResponse>;
|
|
2428
|
+
declare function sendCustomerNotification(session: Session, notification: CustomerNotification): Promise<void>;
|
|
2149
2429
|
|
|
2150
2430
|
declare const api: {
|
|
2151
2431
|
get<T>(url: string, requestOptions?: GetRequestOptions): Promise<T>;
|
|
@@ -2155,4 +2435,4 @@ declare const api: {
|
|
|
2155
2435
|
};
|
|
2156
2436
|
declare function initRecharge(opt?: InitOptions): void;
|
|
2157
2437
|
|
|
2158
|
-
export { ActivateMembershipRequest, Address, AddressIncludes, AddressListParams, AddressListResponse, AddressResponse, AddressSortBy, AnalyticsData, AssociatedAddress, BasicSubscriptionParams, BooleanLike, BooleanNumbers, BooleanString, BooleanStringNumbers, BundleAppProxy, BundleProduct, BundlePurchaseItem, 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 };
|