@wix/auto_sdk_ecom_checkout-templates 1.0.36 → 1.0.37

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.
Files changed (134) hide show
  1. package/build/{cjs/src/ecom-v1-checkout-template-checkout-templates.types.d.ts → ecom-v1-checkout-template-checkout-templates.universal-DZSQyXAS.d.mts} +400 -276
  2. package/build/{internal/cjs/src/ecom-v1-checkout-template-checkout-templates.types.d.ts → ecom-v1-checkout-template-checkout-templates.universal-DZSQyXAS.d.ts} +400 -276
  3. package/build/index.d.mts +136 -0
  4. package/build/index.d.ts +136 -0
  5. package/build/index.js +1209 -0
  6. package/build/index.js.map +1 -0
  7. package/build/index.mjs +1149 -0
  8. package/build/index.mjs.map +1 -0
  9. package/build/internal/{cjs/src/ecom-v1-checkout-template-checkout-templates.universal.d.ts → ecom-v1-checkout-template-checkout-templates.universal-DQx0Jt-F.d.mts} +209 -450
  10. package/build/internal/{es/src/ecom-v1-checkout-template-checkout-templates.universal.d.ts → ecom-v1-checkout-template-checkout-templates.universal-DQx0Jt-F.d.ts} +209 -450
  11. package/build/internal/index.d.mts +136 -0
  12. package/build/internal/index.d.ts +136 -0
  13. package/build/internal/index.js +1209 -0
  14. package/build/internal/index.js.map +1 -0
  15. package/build/internal/index.mjs +1149 -0
  16. package/build/internal/index.mjs.map +1 -0
  17. package/build/internal/meta.d.mts +810 -0
  18. package/build/internal/meta.d.ts +810 -0
  19. package/build/internal/meta.js +491 -0
  20. package/build/internal/meta.js.map +1 -0
  21. package/build/internal/meta.mjs +458 -0
  22. package/build/internal/meta.mjs.map +1 -0
  23. package/build/meta.d.mts +810 -0
  24. package/build/meta.d.ts +810 -0
  25. package/build/meta.js +491 -0
  26. package/build/meta.js.map +1 -0
  27. package/build/meta.mjs +458 -0
  28. package/build/meta.mjs.map +1 -0
  29. package/package.json +12 -11
  30. package/build/cjs/index.d.ts +0 -1
  31. package/build/cjs/index.js +0 -18
  32. package/build/cjs/index.js.map +0 -1
  33. package/build/cjs/index.typings.d.ts +0 -1
  34. package/build/cjs/index.typings.js +0 -18
  35. package/build/cjs/index.typings.js.map +0 -1
  36. package/build/cjs/meta.d.ts +0 -1
  37. package/build/cjs/meta.js +0 -18
  38. package/build/cjs/meta.js.map +0 -1
  39. package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.context.d.ts +0 -32
  40. package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.context.js +0 -61
  41. package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.context.js.map +0 -1
  42. package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.http.d.ts +0 -68
  43. package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.http.js +0 -390
  44. package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.http.js.map +0 -1
  45. package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.meta.d.ts +0 -29
  46. package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.meta.js +0 -161
  47. package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.meta.js.map +0 -1
  48. package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.public.d.ts +0 -112
  49. package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.public.js +0 -271
  50. package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.public.js.map +0 -1
  51. package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.types.js +0 -261
  52. package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.types.js.map +0 -1
  53. package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.universal.d.ts +0 -3161
  54. package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.universal.js +0 -730
  55. package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.universal.js.map +0 -1
  56. package/build/es/index.d.ts +0 -1
  57. package/build/es/index.js +0 -2
  58. package/build/es/index.js.map +0 -1
  59. package/build/es/index.typings.d.ts +0 -1
  60. package/build/es/index.typings.js +0 -2
  61. package/build/es/index.typings.js.map +0 -1
  62. package/build/es/meta.d.ts +0 -1
  63. package/build/es/meta.js +0 -2
  64. package/build/es/meta.js.map +0 -1
  65. package/build/es/package.json +0 -3
  66. package/build/es/src/ecom-v1-checkout-template-checkout-templates.context.d.ts +0 -32
  67. package/build/es/src/ecom-v1-checkout-template-checkout-templates.context.js +0 -32
  68. package/build/es/src/ecom-v1-checkout-template-checkout-templates.context.js.map +0 -1
  69. package/build/es/src/ecom-v1-checkout-template-checkout-templates.http.d.ts +0 -68
  70. package/build/es/src/ecom-v1-checkout-template-checkout-templates.http.js +0 -380
  71. package/build/es/src/ecom-v1-checkout-template-checkout-templates.http.js.map +0 -1
  72. package/build/es/src/ecom-v1-checkout-template-checkout-templates.meta.d.ts +0 -29
  73. package/build/es/src/ecom-v1-checkout-template-checkout-templates.meta.js +0 -128
  74. package/build/es/src/ecom-v1-checkout-template-checkout-templates.meta.js.map +0 -1
  75. package/build/es/src/ecom-v1-checkout-template-checkout-templates.public.d.ts +0 -112
  76. package/build/es/src/ecom-v1-checkout-template-checkout-templates.public.js +0 -235
  77. package/build/es/src/ecom-v1-checkout-template-checkout-templates.public.js.map +0 -1
  78. package/build/es/src/ecom-v1-checkout-template-checkout-templates.types.d.ts +0 -2794
  79. package/build/es/src/ecom-v1-checkout-template-checkout-templates.types.js +0 -258
  80. package/build/es/src/ecom-v1-checkout-template-checkout-templates.types.js.map +0 -1
  81. package/build/es/src/ecom-v1-checkout-template-checkout-templates.universal.d.ts +0 -3161
  82. package/build/es/src/ecom-v1-checkout-template-checkout-templates.universal.js +0 -697
  83. package/build/es/src/ecom-v1-checkout-template-checkout-templates.universal.js.map +0 -1
  84. package/build/internal/cjs/index.d.ts +0 -1
  85. package/build/internal/cjs/index.js +0 -18
  86. package/build/internal/cjs/index.js.map +0 -1
  87. package/build/internal/cjs/index.typings.d.ts +0 -1
  88. package/build/internal/cjs/index.typings.js +0 -18
  89. package/build/internal/cjs/index.typings.js.map +0 -1
  90. package/build/internal/cjs/meta.d.ts +0 -1
  91. package/build/internal/cjs/meta.js +0 -18
  92. package/build/internal/cjs/meta.js.map +0 -1
  93. package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.context.d.ts +0 -32
  94. package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.context.js +0 -61
  95. package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.context.js.map +0 -1
  96. package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.http.d.ts +0 -68
  97. package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.http.js +0 -390
  98. package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.http.js.map +0 -1
  99. package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.meta.d.ts +0 -29
  100. package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.meta.js +0 -161
  101. package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.meta.js.map +0 -1
  102. package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.public.d.ts +0 -112
  103. package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.public.js +0 -271
  104. package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.public.js.map +0 -1
  105. package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.types.js +0 -261
  106. package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.types.js.map +0 -1
  107. package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.universal.js +0 -730
  108. package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.universal.js.map +0 -1
  109. package/build/internal/es/index.d.ts +0 -1
  110. package/build/internal/es/index.js +0 -2
  111. package/build/internal/es/index.js.map +0 -1
  112. package/build/internal/es/index.typings.d.ts +0 -1
  113. package/build/internal/es/index.typings.js +0 -2
  114. package/build/internal/es/index.typings.js.map +0 -1
  115. package/build/internal/es/meta.d.ts +0 -1
  116. package/build/internal/es/meta.js +0 -2
  117. package/build/internal/es/meta.js.map +0 -1
  118. package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.context.d.ts +0 -32
  119. package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.context.js +0 -32
  120. package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.context.js.map +0 -1
  121. package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.http.d.ts +0 -68
  122. package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.http.js +0 -380
  123. package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.http.js.map +0 -1
  124. package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.meta.d.ts +0 -29
  125. package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.meta.js +0 -128
  126. package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.meta.js.map +0 -1
  127. package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.public.d.ts +0 -112
  128. package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.public.js +0 -235
  129. package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.public.js.map +0 -1
  130. package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.types.d.ts +0 -2794
  131. package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.types.js +0 -258
  132. package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.types.js.map +0 -1
  133. package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.universal.js +0 -697
  134. package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.universal.js.map +0 -1
@@ -1,697 +0,0 @@
1
- import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
2
- import { queryBuilder } from '@wix/sdk-runtime/query-builder';
3
- import { renameKeysFromSDKRequestToRESTRequest, renameKeysFromRESTResponseToSDKResponse, } from '@wix/sdk-runtime/rename-all-nested-keys';
4
- import * as ambassadorWixEcomV1CheckoutTemplate from './ecom-v1-checkout-template-checkout-templates.http.js';
5
- // @ts-ignore
6
- import { transformSDKImageToRESTImage } from '@wix/sdk-runtime/transformations/image';
7
- import { transformRESTImageToSDKImage } from '@wix/sdk-runtime/transformations/image';
8
- import { transformSDKPageURLV2ToRESTPageURLV2 } from '@wix/sdk-runtime/transformations/page-url-v2';
9
- import { transformRESTPageURLV2ToSDKPageURLV2 } from '@wix/sdk-runtime/transformations/page-url-v2';
10
- import { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';
11
- export var Status;
12
- (function (Status) {
13
- Status["UNKNOWN_STATUS"] = "UNKNOWN_STATUS";
14
- Status["ACTIVE"] = "ACTIVE";
15
- Status["INACTIVE"] = "INACTIVE";
16
- })(Status || (Status = {}));
17
- export var DescriptionLineType;
18
- (function (DescriptionLineType) {
19
- /** Unrecognized type. */
20
- DescriptionLineType["UNRECOGNISED"] = "UNRECOGNISED";
21
- /** Plain text type. */
22
- DescriptionLineType["PLAIN_TEXT"] = "PLAIN_TEXT";
23
- /** Color type. */
24
- DescriptionLineType["COLOR"] = "COLOR";
25
- })(DescriptionLineType || (DescriptionLineType = {}));
26
- /** Type of selected payment option for catalog item */
27
- export var PaymentOptionType;
28
- (function (PaymentOptionType) {
29
- /** The entire payment for this item happens as part of the checkout. */
30
- PaymentOptionType["FULL_PAYMENT_ONLINE"] = "FULL_PAYMENT_ONLINE";
31
- /** The entire payment for this item happens after checkout. For example, when using cash, check, or other offline payment methods. */
32
- PaymentOptionType["FULL_PAYMENT_OFFLINE"] = "FULL_PAYMENT_OFFLINE";
33
- /** Payment for this item is done by charging a membership. When selected, `price` is `0`. */
34
- PaymentOptionType["MEMBERSHIP"] = "MEMBERSHIP";
35
- /** Partial payment to be paid upfront during checkout. The initial amount to be paid for each line item is specified in `depositAmount`. */
36
- PaymentOptionType["DEPOSIT_ONLINE"] = "DEPOSIT_ONLINE";
37
- /** Payment for this item can only be done by charging a membership and must be manually redeemed in the dashboard by the site admin. When selected, `price` is `0`. */
38
- PaymentOptionType["MEMBERSHIP_OFFLINE"] = "MEMBERSHIP_OFFLINE";
39
- })(PaymentOptionType || (PaymentOptionType = {}));
40
- export var ItemTypeItemType;
41
- (function (ItemTypeItemType) {
42
- ItemTypeItemType["UNRECOGNISED"] = "UNRECOGNISED";
43
- ItemTypeItemType["PHYSICAL"] = "PHYSICAL";
44
- ItemTypeItemType["DIGITAL"] = "DIGITAL";
45
- ItemTypeItemType["GIFT_CARD"] = "GIFT_CARD";
46
- ItemTypeItemType["SERVICE"] = "SERVICE";
47
- })(ItemTypeItemType || (ItemTypeItemType = {}));
48
- /** Frequency unit of recurring payment */
49
- export var SubscriptionFrequency;
50
- (function (SubscriptionFrequency) {
51
- SubscriptionFrequency["UNDEFINED"] = "UNDEFINED";
52
- SubscriptionFrequency["DAY"] = "DAY";
53
- SubscriptionFrequency["WEEK"] = "WEEK";
54
- SubscriptionFrequency["MONTH"] = "MONTH";
55
- SubscriptionFrequency["YEAR"] = "YEAR";
56
- })(SubscriptionFrequency || (SubscriptionFrequency = {}));
57
- export var FileType;
58
- (function (FileType) {
59
- FileType["UNSPECIFIED"] = "UNSPECIFIED";
60
- FileType["SECURE_PICTURE"] = "SECURE_PICTURE";
61
- FileType["SECURE_VIDEO"] = "SECURE_VIDEO";
62
- FileType["SECURE_DOCUMENT"] = "SECURE_DOCUMENT";
63
- FileType["SECURE_MUSIC"] = "SECURE_MUSIC";
64
- FileType["SECURE_ARCHIVE"] = "SECURE_ARCHIVE";
65
- })(FileType || (FileType = {}));
66
- export var TaxableAddressType;
67
- (function (TaxableAddressType) {
68
- TaxableAddressType["UNKNOWN_TAXABLE_ADDRESS"] = "UNKNOWN_TAXABLE_ADDRESS";
69
- TaxableAddressType["BUSINESS"] = "BUSINESS";
70
- TaxableAddressType["BILLING"] = "BILLING";
71
- TaxableAddressType["SHIPPING"] = "SHIPPING";
72
- })(TaxableAddressType || (TaxableAddressType = {}));
73
- /** JurisdictionType represents the type of the jurisdiction in which this tax detail applies (e.g. Country,State,County,City,Special). */
74
- export var JurisdictionType;
75
- (function (JurisdictionType) {
76
- JurisdictionType["UNDEFINED"] = "UNDEFINED";
77
- JurisdictionType["COUNTRY"] = "COUNTRY";
78
- JurisdictionType["STATE"] = "STATE";
79
- JurisdictionType["COUNTY"] = "COUNTY";
80
- JurisdictionType["CITY"] = "CITY";
81
- JurisdictionType["SPECIAL"] = "SPECIAL";
82
- })(JurisdictionType || (JurisdictionType = {}));
83
- export var ItemAvailabilityStatus;
84
- (function (ItemAvailabilityStatus) {
85
- ItemAvailabilityStatus["AVAILABLE"] = "AVAILABLE";
86
- /** Item does not exist. */
87
- ItemAvailabilityStatus["NOT_FOUND"] = "NOT_FOUND";
88
- /** Item is not in stock. */
89
- ItemAvailabilityStatus["NOT_AVAILABLE"] = "NOT_AVAILABLE";
90
- /** Available quantity is less than requested. */
91
- ItemAvailabilityStatus["PARTIALLY_AVAILABLE"] = "PARTIALLY_AVAILABLE";
92
- })(ItemAvailabilityStatus || (ItemAvailabilityStatus = {}));
93
- /** tax info types */
94
- export var VatType;
95
- (function (VatType) {
96
- VatType["UNSPECIFIED"] = "UNSPECIFIED";
97
- /** CPF - for individual tax payers. */
98
- VatType["CPF"] = "CPF";
99
- /** CNPJ - for corporations */
100
- VatType["CNPJ"] = "CNPJ";
101
- })(VatType || (VatType = {}));
102
- export var PickupMethod;
103
- (function (PickupMethod) {
104
- PickupMethod["UNKNOWN_METHOD"] = "UNKNOWN_METHOD";
105
- PickupMethod["STORE_PICKUP"] = "STORE_PICKUP";
106
- PickupMethod["PICKUP_POINT"] = "PICKUP_POINT";
107
- })(PickupMethod || (PickupMethod = {}));
108
- export var ChargeType;
109
- (function (ChargeType) {
110
- ChargeType["HANDLING_FEE"] = "HANDLING_FEE";
111
- ChargeType["INSURANCE"] = "INSURANCE";
112
- })(ChargeType || (ChargeType = {}));
113
- export var RuleType;
114
- (function (RuleType) {
115
- RuleType["VALIDATION"] = "VALIDATION";
116
- RuleType["OTHER"] = "OTHER";
117
- RuleType["MAX"] = "MAX";
118
- RuleType["MIN"] = "MIN";
119
- RuleType["MAX_LENGTH"] = "MAX_LENGTH";
120
- RuleType["MIN_LENGTH"] = "MIN_LENGTH";
121
- RuleType["MAX_SIZE"] = "MAX_SIZE";
122
- RuleType["MIN_SIZE"] = "MIN_SIZE";
123
- RuleType["FORMAT"] = "FORMAT";
124
- RuleType["DECIMAL_LTE"] = "DECIMAL_LTE";
125
- RuleType["DECIMAL_GTE"] = "DECIMAL_GTE";
126
- RuleType["DECIMAL_LT"] = "DECIMAL_LT";
127
- RuleType["DECIMAL_GT"] = "DECIMAL_GT";
128
- RuleType["DECIMAL_MAX_SCALE"] = "DECIMAL_MAX_SCALE";
129
- RuleType["INVALID_ENUM_VALUE"] = "INVALID_ENUM_VALUE";
130
- RuleType["REQUIRED_FIELD"] = "REQUIRED_FIELD";
131
- RuleType["FIELD_NOT_ALLOWED"] = "FIELD_NOT_ALLOWED";
132
- RuleType["ONE_OF_ALIGNMENT"] = "ONE_OF_ALIGNMENT";
133
- RuleType["EXACT_LENGTH"] = "EXACT_LENGTH";
134
- RuleType["EXACT_SIZE"] = "EXACT_SIZE";
135
- RuleType["REQUIRED_ONE_OF_FIELD"] = "REQUIRED_ONE_OF_FIELD";
136
- })(RuleType || (RuleType = {}));
137
- export var DiscountType;
138
- (function (DiscountType) {
139
- DiscountType["GLOBAL"] = "GLOBAL";
140
- DiscountType["SPECIFIC_ITEMS"] = "SPECIFIC_ITEMS";
141
- DiscountType["SHIPPING"] = "SHIPPING";
142
- })(DiscountType || (DiscountType = {}));
143
- export var WeightUnit;
144
- (function (WeightUnit) {
145
- /** Weight unit can't be classified due to an error. */
146
- WeightUnit["UNSPECIFIED_WEIGHT_UNIT"] = "UNSPECIFIED_WEIGHT_UNIT";
147
- /** Kilograms. */
148
- WeightUnit["KG"] = "KG";
149
- /** Pounds. */
150
- WeightUnit["LB"] = "LB";
151
- })(WeightUnit || (WeightUnit = {}));
152
- export var RateType;
153
- (function (RateType) {
154
- /** no tax being collected for this request due to location of purchase */
155
- RateType["NO_TAX_COLLECTED"] = "NO_TAX_COLLECTED";
156
- /** manual rate used for calculation */
157
- RateType["MANUAL_RATE"] = "MANUAL_RATE";
158
- /** autotax rate used for calculation */
159
- RateType["AUTO_RATE"] = "AUTO_RATE";
160
- /** fallback rate used for calculation */
161
- RateType["FALLBACK_RATE"] = "FALLBACK_RATE";
162
- })(RateType || (RateType = {}));
163
- export var ManualCalculationReason;
164
- (function (ManualCalculationReason) {
165
- /** user set calculator in Business Manager to be Manual */
166
- ManualCalculationReason["GLOBAL_SETTING_TO_MANUAL"] = "GLOBAL_SETTING_TO_MANUAL";
167
- /** specific region is on manual even though Global setting is Auto-tax */
168
- ManualCalculationReason["REGION_SETTING_TO_MANUAL"] = "REGION_SETTING_TO_MANUAL";
169
- })(ManualCalculationReason || (ManualCalculationReason = {}));
170
- export var FallbackReason;
171
- (function (FallbackReason) {
172
- /** auto-tax failed to be calculated */
173
- FallbackReason["AUTO_TAX_FAILED"] = "AUTO_TAX_FAILED";
174
- /** auto-tax was temporarily deactivated on a system-level */
175
- FallbackReason["AUTO_TAX_DEACTIVATED"] = "AUTO_TAX_DEACTIVATED";
176
- })(FallbackReason || (FallbackReason = {}));
177
- export var ChannelType;
178
- (function (ChannelType) {
179
- /** Unspecified sales channel. This value is not supported. */
180
- ChannelType["UNSPECIFIED"] = "UNSPECIFIED";
181
- /** A web client. */
182
- ChannelType["WEB"] = "WEB";
183
- /** [Point of sale solutions](https://support.wix.com/en/wix-mobile-pos-2196395). */
184
- ChannelType["POS"] = "POS";
185
- /** [eBay shop](https://support.wix.com/en/article/wix-stores-connecting-and-setting-up-an-ebay-shop). */
186
- ChannelType["EBAY"] = "EBAY";
187
- /** [Amazon shop](https://support.wix.com/en/article/wix-stores-connecting-and-setting-up-an-amazon-shop). */
188
- ChannelType["AMAZON"] = "AMAZON";
189
- /** Other sales platform. */
190
- ChannelType["OTHER_PLATFORM"] = "OTHER_PLATFORM";
191
- /** [Wix Owner app](https://support.wix.com/article/wix-owner-app-an-overview). */
192
- ChannelType["WIX_APP_STORE"] = "WIX_APP_STORE";
193
- /** Wix Invoices app in [your dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Finvoices/settings/general-settings) */
194
- ChannelType["WIX_INVOICES"] = "WIX_INVOICES";
195
- /** Wix merchant backoffice. */
196
- ChannelType["BACKOFFICE_MERCHANT"] = "BACKOFFICE_MERCHANT";
197
- /** Wish sales channel. */
198
- ChannelType["WISH"] = "WISH";
199
- /** [ClassPass sales channel](https://support.wix.com/en/article/wix-bookings-letting-clients-book-your-services-with-classpass). */
200
- ChannelType["CLASS_PASS"] = "CLASS_PASS";
201
- /** Global-E sales channel. */
202
- ChannelType["GLOBAL_E"] = "GLOBAL_E";
203
- /** [Facebook shop](https://support.wix.com/en/article/wix-stores-changes-to-facebook-shops). */
204
- ChannelType["FACEBOOK"] = "FACEBOOK";
205
- /** [Etsy sales channel](https://support.wix.com/en/article/wix-stores-request-adding-etsy-as-a-sales-channel). */
206
- ChannelType["ETSY"] = "ETSY";
207
- /** [TikTok sales channel](https://support.wix.com/en/article/wix-stores-request-adding-tiktok-as-a-sales-channel). */
208
- ChannelType["TIKTOK"] = "TIKTOK";
209
- /** [Faire marketplace integration](https://support.wix.com/en/article/wix-stores-creating-a-faire-store-using-the-faire-integration-app). */
210
- ChannelType["FAIRE_COM"] = "FAIRE_COM";
211
- })(ChannelType || (ChannelType = {}));
212
- export var AdditionalFeeSource;
213
- (function (AdditionalFeeSource) {
214
- AdditionalFeeSource["UNKNOWN_ADDITIONAL_FEE_SOURCE"] = "UNKNOWN_ADDITIONAL_FEE_SOURCE";
215
- /** The additional fee was added by an additional fee service plugin */
216
- AdditionalFeeSource["SERVICE_PLUGIN"] = "SERVICE_PLUGIN";
217
- /** The additional fee was added on the item either via the catalog or on custom line item */
218
- AdditionalFeeSource["ITEM"] = "ITEM";
219
- /** The additional fee was added manually on the request */
220
- AdditionalFeeSource["MANUAL"] = "MANUAL";
221
- /** The additional fee was added by the shipping provider */
222
- AdditionalFeeSource["SHIPPING"] = "SHIPPING";
223
- })(AdditionalFeeSource || (AdditionalFeeSource = {}));
224
- export var Severity;
225
- (function (Severity) {
226
- /** The user is allowed to move forward in the flow. */
227
- Severity["WARNING"] = "WARNING";
228
- /**
229
- * The user is blocked from moving forward in the flow.
230
- * For example, if callerContext is CART - moving to checkout is blocked. if callerContext is CHECKOUT, placing an order is blocked.
231
- */
232
- Severity["ERROR"] = "ERROR";
233
- })(Severity || (Severity = {}));
234
- /** Available locations on the webpage */
235
- export var NameInOther;
236
- (function (NameInOther) {
237
- /** Default location, in case no specific location is specified. */
238
- NameInOther["OTHER_DEFAULT"] = "OTHER_DEFAULT";
239
- })(NameInOther || (NameInOther = {}));
240
- /** Available locations on the line item */
241
- export var NameInLineItem;
242
- (function (NameInLineItem) {
243
- /** Default location, in case no specific location is specified. */
244
- NameInLineItem["LINE_ITEM_DEFAULT"] = "LINE_ITEM_DEFAULT";
245
- })(NameInLineItem || (NameInLineItem = {}));
246
- export var SuggestedFix;
247
- (function (SuggestedFix) {
248
- /** No suggested fix is specified. The user should refer to the violation description to resolve the issue. */
249
- SuggestedFix["UNKNOWN_SUGGESTED_FIX"] = "UNKNOWN_SUGGESTED_FIX";
250
- /** The line item should be removed from the cart or checkout to resolve the violation. */
251
- SuggestedFix["REMOVE_LINE_ITEM"] = "REMOVE_LINE_ITEM";
252
- })(SuggestedFix || (SuggestedFix = {}));
253
- export var SortOrder;
254
- (function (SortOrder) {
255
- /** Ascending order. */
256
- SortOrder["ASC"] = "ASC";
257
- /** Descending order. */
258
- SortOrder["DESC"] = "DESC";
259
- })(SortOrder || (SortOrder = {}));
260
- export var WebhookIdentityType;
261
- (function (WebhookIdentityType) {
262
- WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
263
- WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
264
- WebhookIdentityType["MEMBER"] = "MEMBER";
265
- WebhookIdentityType["WIX_USER"] = "WIX_USER";
266
- WebhookIdentityType["APP"] = "APP";
267
- })(WebhookIdentityType || (WebhookIdentityType = {}));
268
- /**
269
- * Creates a checkout template.
270
- *
271
- * A checkout template is used to create a new checkout that will include predefined information. For example, a single link with
272
- * a `checkoutTemplateId` can be shared with customers and each time the link is clicked, a new checkout page will be created
273
- * for that customer with certain checkout information already populated.
274
- *
275
- * The customizable features include the option to allow or to lock coupon codes or gift cards. For example, if a store owner is
276
- * using the checkout template to offer a flash sale to their social media followers, they may want to lock the option to apply an
277
- * additional coupon on top of the sale being offered. If so, they can set `customization.lockedCoupon` to `true`.
278
- *
279
- * A checkout can be created with a checkout template by calling Create Checkout From Template.
280
- * The site may add further customizations to the new checkout and then redirect the customer using the new checkout's `checkoutUrl`.
281
- * @param checkoutTemplate - Checkout template to create.
282
- * @public
283
- * @requiredField checkoutTemplate
284
- * @requiredField checkoutTemplate.customLineItems.descriptionLines.name
285
- * @requiredField checkoutTemplate.customLineItems.descriptionLines.value
286
- * @requiredField checkoutTemplate.customLineItems.itemType
287
- * @requiredField checkoutTemplate.customLineItems.productName
288
- * @requiredField checkoutTemplate.customLineItems.quantity
289
- * @requiredField checkoutTemplate.lineItems.catalogReference
290
- * @requiredField checkoutTemplate.lineItems.catalogReference.appId
291
- * @requiredField checkoutTemplate.lineItems.catalogReference.catalogItemId
292
- * @requiredField checkoutTemplate.lineItems.quantity
293
- * @permissionId ECOM.CHECKOUT_TEMPLATE_CREATE
294
- * @permissionScope Manage Stores - all permissions
295
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
296
- * @permissionScope Manage Stores
297
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
298
- * @permissionScope Manage Restaurants - all permissions
299
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
300
- * @permissionScope Manage eCommerce - all permissions
301
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
302
- * @applicableIdentity APP
303
- * @returns Created checkout template.
304
- * @fqn wix.ecom.checkout_template.api.v1.CheckoutTemplateService.CreateCheckoutTemplate
305
- */
306
- export async function createCheckoutTemplate(checkoutTemplate) {
307
- // @ts-ignore
308
- const { httpClient, sideEffects } = arguments[1];
309
- const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
310
- checkoutTemplate: checkoutTemplate,
311
- }), [
312
- {
313
- transformFn: transformSDKImageToRESTImage,
314
- paths: [
315
- { path: 'checkoutTemplate.lineItems.catalogOverrideFields.image' },
316
- { path: 'checkoutTemplate.customLineItems.media' },
317
- ],
318
- },
319
- {
320
- transformFn: transformSDKPageURLV2ToRESTPageURLV2,
321
- paths: [{ path: 'checkoutTemplate.customLineItems.url' }],
322
- },
323
- ]);
324
- const reqOpts = ambassadorWixEcomV1CheckoutTemplate.createCheckoutTemplate(payload);
325
- sideEffects?.onSiteCall?.();
326
- try {
327
- const result = await httpClient.request(reqOpts);
328
- sideEffects?.onSuccess?.(result);
329
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
330
- {
331
- transformFn: transformRESTImageToSDKImage,
332
- paths: [
333
- { path: 'checkoutTemplate.lineItems.catalogOverrideFields.image' },
334
- { path: 'checkoutTemplate.customLineItems.media' },
335
- ],
336
- },
337
- {
338
- transformFn: transformRESTPageURLV2ToSDKPageURLV2,
339
- paths: [{ path: 'checkoutTemplate.customLineItems.url' }],
340
- },
341
- ]))?.checkoutTemplate;
342
- }
343
- catch (err) {
344
- const transformedError = sdkTransformError(err, {
345
- spreadPathsToArguments: {},
346
- explicitPathsToArguments: { checkoutTemplate: '$[0]' },
347
- singleArgumentUnchanged: false,
348
- }, ['checkoutTemplate']);
349
- sideEffects?.onError?.(err);
350
- throw transformedError;
351
- }
352
- }
353
- /**
354
- * Retrieves a checkout template.
355
- * @param checkoutTemplateId - ID of the checkout template to retrieve.
356
- * @public
357
- * @requiredField checkoutTemplateId
358
- * @permissionId ECOM.CHECKOUT_TEMPLATE_READ
359
- * @permissionScope Manage Stores - all permissions
360
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
361
- * @permissionScope Manage Stores
362
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
363
- * @permissionScope Manage Restaurants - all permissions
364
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
365
- * @permissionScope Manage eCommerce - all permissions
366
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
367
- * @applicableIdentity APP
368
- * @returns Retrieved checkout template.
369
- * @fqn wix.ecom.checkout_template.api.v1.CheckoutTemplateService.GetCheckoutTemplate
370
- */
371
- export async function getCheckoutTemplate(checkoutTemplateId) {
372
- // @ts-ignore
373
- const { httpClient, sideEffects } = arguments[1];
374
- const payload = renameKeysFromSDKRequestToRESTRequest({
375
- checkoutTemplateId: checkoutTemplateId,
376
- });
377
- const reqOpts = ambassadorWixEcomV1CheckoutTemplate.getCheckoutTemplate(payload);
378
- sideEffects?.onSiteCall?.();
379
- try {
380
- const result = await httpClient.request(reqOpts);
381
- sideEffects?.onSuccess?.(result);
382
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
383
- {
384
- transformFn: transformRESTImageToSDKImage,
385
- paths: [
386
- { path: 'checkoutTemplate.lineItems.catalogOverrideFields.image' },
387
- { path: 'checkoutTemplate.customLineItems.media' },
388
- ],
389
- },
390
- {
391
- transformFn: transformRESTPageURLV2ToSDKPageURLV2,
392
- paths: [{ path: 'checkoutTemplate.customLineItems.url' }],
393
- },
394
- ]))?.checkoutTemplate;
395
- }
396
- catch (err) {
397
- const transformedError = sdkTransformError(err, {
398
- spreadPathsToArguments: {},
399
- explicitPathsToArguments: { checkoutTemplateId: '$[0]' },
400
- singleArgumentUnchanged: false,
401
- }, ['checkoutTemplateId']);
402
- sideEffects?.onError?.(err);
403
- throw transformedError;
404
- }
405
- }
406
- /**
407
- * Updates a checkout template.
408
- *
409
- * If the info in a checkout template is updated, only new checkouts created from this template will include the updated items. Checkouts previously
410
- * created from this template before the update will not be affected.
411
- * @param _id - Checkout template ID.
412
- * @public
413
- * @requiredField _id
414
- * @requiredField checkoutTemplate
415
- * @param checkoutTemplate - Checkout template info to update.
416
- * @permissionId ECOM.CHECKOUT_TEMPLATE_UPDATE
417
- * @permissionScope Manage Stores - all permissions
418
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
419
- * @permissionScope Manage Stores
420
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
421
- * @permissionScope Manage Restaurants - all permissions
422
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
423
- * @permissionScope Manage eCommerce - all permissions
424
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
425
- * @applicableIdentity APP
426
- * @returns Updated checkout template.
427
- * @fqn wix.ecom.checkout_template.api.v1.CheckoutTemplateService.UpdateCheckoutTemplate
428
- */
429
- export async function updateCheckoutTemplate(_id, checkoutTemplate) {
430
- // @ts-ignore
431
- const { httpClient, sideEffects } = arguments[2];
432
- const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
433
- checkoutTemplate: { ...checkoutTemplate, id: _id },
434
- }), [
435
- {
436
- transformFn: transformSDKImageToRESTImage,
437
- paths: [
438
- { path: 'checkoutTemplate.lineItems.catalogOverrideFields.image' },
439
- { path: 'checkoutTemplate.customLineItems.media' },
440
- ],
441
- },
442
- {
443
- transformFn: transformSDKPageURLV2ToRESTPageURLV2,
444
- paths: [{ path: 'checkoutTemplate.customLineItems.url' }],
445
- },
446
- ]);
447
- const reqOpts = ambassadorWixEcomV1CheckoutTemplate.updateCheckoutTemplate(payload);
448
- sideEffects?.onSiteCall?.();
449
- try {
450
- const result = await httpClient.request(reqOpts);
451
- sideEffects?.onSuccess?.(result);
452
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
453
- {
454
- transformFn: transformRESTImageToSDKImage,
455
- paths: [
456
- { path: 'checkoutTemplate.lineItems.catalogOverrideFields.image' },
457
- { path: 'checkoutTemplate.customLineItems.media' },
458
- ],
459
- },
460
- {
461
- transformFn: transformRESTPageURLV2ToSDKPageURLV2,
462
- paths: [{ path: 'checkoutTemplate.customLineItems.url' }],
463
- },
464
- ]))?.checkoutTemplate;
465
- }
466
- catch (err) {
467
- const transformedError = sdkTransformError(err, {
468
- spreadPathsToArguments: { checkoutTemplate: '$[1]' },
469
- explicitPathsToArguments: { 'checkoutTemplate.id': '$[0]' },
470
- singleArgumentUnchanged: false,
471
- }, ['_id', 'checkoutTemplate']);
472
- sideEffects?.onError?.(err);
473
- throw transformedError;
474
- }
475
- }
476
- /**
477
- * Deletes a checkout template.
478
- *
479
- * If a checkout template is deleted and a customer attempts to create a checkout with that `checkoutTemplateId` then
480
- * the customer will be redirected to the domain site.
481
- * @param checkoutTemplateId - ID of the checkout template to delete.
482
- * @public
483
- * @requiredField checkoutTemplateId
484
- * @permissionId ECOM.CHECKOUT_TEMPLATE_DELETE
485
- * @permissionScope Manage Stores - all permissions
486
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
487
- * @permissionScope Manage Stores
488
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
489
- * @permissionScope Manage Restaurants - all permissions
490
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
491
- * @permissionScope Manage eCommerce - all permissions
492
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
493
- * @applicableIdentity APP
494
- * @fqn wix.ecom.checkout_template.api.v1.CheckoutTemplateService.DeleteCheckoutTemplate
495
- */
496
- export async function deleteCheckoutTemplate(checkoutTemplateId) {
497
- // @ts-ignore
498
- const { httpClient, sideEffects } = arguments[1];
499
- const payload = renameKeysFromSDKRequestToRESTRequest({
500
- checkoutTemplateId: checkoutTemplateId,
501
- });
502
- const reqOpts = ambassadorWixEcomV1CheckoutTemplate.deleteCheckoutTemplate(payload);
503
- sideEffects?.onSiteCall?.();
504
- try {
505
- const result = await httpClient.request(reqOpts);
506
- sideEffects?.onSuccess?.(result);
507
- }
508
- catch (err) {
509
- const transformedError = sdkTransformError(err, {
510
- spreadPathsToArguments: {},
511
- explicitPathsToArguments: { checkoutTemplateId: '$[0]' },
512
- singleArgumentUnchanged: false,
513
- }, ['checkoutTemplateId']);
514
- sideEffects?.onError?.(err);
515
- throw transformedError;
516
- }
517
- }
518
- /**
519
- * Creates a query to retrieve a list of checkout templates.
520
- *
521
- * The `queryCheckoutTemplates()` function builds a query to retrieve a list of checkout templates and returns a `CheckoutTemplatesQueryBuilder` object.
522
- *
523
- * The returned object contains the query definition, which is typically used to run the query using the `find()` function.
524
- *
525
- * You can refine the query by chaining `CheckoutTemplatesQueryBuilder` functions onto the query. `CheckoutTemplatesQueryBuilder` functions enable you to sort, filter, and control the results that `queryCheckoutTemplates()` returns.
526
- *
527
- * `queryCheckoutTemplates()` runs with the following `CheckoutTemplatesQueryBuilder` default that you can override:
528
- * + `ascending("_id")`
529
- *
530
- * The functions that are chained to `queryCheckoutTemplates()` are applied in the order they are called. For example, if you apply `ascending("status")` and then `ascending("_id")`, the results are sorted first by the `"status"`, and then, if there are multiple results with the same `"status"`, the items are sorted by `"_id"`.
531
- *
532
- * The following `CheckoutTemplatesQueryBuilder` functions are supported for the `queryCheckoutTemplates()` function. For a full description of the checkout template object, see the object returned for the `items` property in `CheckoutTemplatesQueryResult`.
533
- * @public
534
- * @permissionScope Manage Stores - all permissions
535
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
536
- * @permissionScope Manage Stores
537
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
538
- * @permissionScope Manage Restaurants - all permissions
539
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
540
- * @permissionScope Manage eCommerce - all permissions
541
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
542
- * @permissionId ECOM.CHECKOUT_TEMPLATE_READ
543
- * @applicableIdentity APP
544
- * @fqn wix.ecom.checkout_template.api.v1.CheckoutTemplateService.QueryCheckoutTemplates
545
- */
546
- export function queryCheckoutTemplates() {
547
- // @ts-ignore
548
- const { httpClient, sideEffects } = arguments[0];
549
- return queryBuilder({
550
- func: async (payload) => {
551
- const reqOpts = ambassadorWixEcomV1CheckoutTemplate.queryCheckoutTemplates(payload);
552
- sideEffects?.onSiteCall?.();
553
- try {
554
- const result = await httpClient.request(reqOpts);
555
- sideEffects?.onSuccess?.(result);
556
- return result;
557
- }
558
- catch (err) {
559
- sideEffects?.onError?.(err);
560
- throw err;
561
- }
562
- },
563
- requestTransformer: (query) => {
564
- const args = [query, {}];
565
- return renameKeysFromSDKRequestToRESTRequest({
566
- ...args?.[1],
567
- query: args?.[0],
568
- });
569
- },
570
- responseTransformer: ({ data, }) => {
571
- const transformedData = renameKeysFromRESTResponseToSDKResponse(transformPaths(data, [
572
- {
573
- transformFn: transformRESTImageToSDKImage,
574
- paths: [
575
- {
576
- path: 'checkoutTemplates.lineItems.catalogOverrideFields.image',
577
- },
578
- { path: 'checkoutTemplates.customLineItems.media' },
579
- ],
580
- },
581
- {
582
- transformFn: transformRESTPageURLV2ToSDKPageURLV2,
583
- paths: [{ path: 'checkoutTemplates.customLineItems.url' }],
584
- },
585
- ]));
586
- return {
587
- items: transformedData?.checkoutTemplates,
588
- pagingMetadata: transformedData?.pagingMetadata,
589
- };
590
- },
591
- errorTransformer: (err) => {
592
- const transformedError = sdkTransformError(err, {
593
- spreadPathsToArguments: {},
594
- explicitPathsToArguments: { query: '$[0]' },
595
- singleArgumentUnchanged: false,
596
- });
597
- throw transformedError;
598
- },
599
- pagingMethod: 'CURSOR',
600
- transformationPaths: {},
601
- });
602
- }
603
- /**
604
- * Creates a new checkout based on the checkout template.
605
- *
606
- * Before using this method, you must have a checkout template available. Create a checkout template with Create Checkout Template.
607
- *
608
- * The customer can be directed to the new checkout using the checkout's `checkoutUrl`.
609
- * @param checkoutTemplateId - ID of the checkout template to use to create a checkout from.
610
- * @param siteId - ID of the site associated with the checkout template.
611
- * @public
612
- * @requiredField checkoutTemplateId
613
- * @requiredField siteId
614
- * @permissionId ECOM.CHECKOUT_TEMPLATE_CREATE_CHECKOUT
615
- * @permissionScope Manage Stores - all permissions
616
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
617
- * @permissionScope Manage Stores
618
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
619
- * @permissionScope Manage Restaurants - all permissions
620
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
621
- * @permissionScope Manage eCommerce - all permissions
622
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
623
- * @applicableIdentity APP
624
- * @applicableIdentity VISITOR
625
- * @fqn wix.ecom.checkout_template.api.v1.CheckoutTemplateService.CreateCheckoutFromTemplate
626
- */
627
- export async function createCheckoutFromTemplate(checkoutTemplateId, siteId) {
628
- // @ts-ignore
629
- const { httpClient, sideEffects } = arguments[2];
630
- const payload = renameKeysFromSDKRequestToRESTRequest({
631
- checkoutTemplateId: checkoutTemplateId,
632
- siteId: siteId,
633
- });
634
- const reqOpts = ambassadorWixEcomV1CheckoutTemplate.createCheckoutFromTemplate(payload);
635
- sideEffects?.onSiteCall?.();
636
- try {
637
- const result = await httpClient.request(reqOpts);
638
- sideEffects?.onSuccess?.(result);
639
- return renameKeysFromRESTResponseToSDKResponse(result.data);
640
- }
641
- catch (err) {
642
- const transformedError = sdkTransformError(err, {
643
- spreadPathsToArguments: {},
644
- explicitPathsToArguments: {
645
- checkoutTemplateId: '$[0]',
646
- siteId: '$[1]',
647
- },
648
- singleArgumentUnchanged: false,
649
- }, ['checkoutTemplateId', 'siteId']);
650
- sideEffects?.onError?.(err);
651
- throw transformedError;
652
- }
653
- }
654
- /**
655
- * Creates a new checkout based on the checkout template and redirects to the new checkout page.
656
- *
657
- * Before using this method, you must have a checkout template available. Create a checkout template with Create Checkout Template.
658
- *
659
- * To build a URL that uses this method, follow this format:
660
- * `https://www.wixapis.com/ecom/v1/checkout-templates/{checkoutTemplateId}/create-and-redirect-to-checkout?siteId={siteId}`
661
- *
662
- * To create a checkout but not automatically redirect to the checkout page, use Create Checkout From Template.
663
- * @param checkoutTemplateId - ID of the checkout template to use to create a checkout.
664
- * @param siteId - ID of the site associated with the checkout template.
665
- * @public
666
- * @requiredField checkoutTemplateId
667
- * @requiredField siteId
668
- * @fqn wix.ecom.checkout_template.api.v1.CheckoutTemplateService.CreateAndRedirectToCheckout
669
- */
670
- export async function createAndRedirectToCheckout(checkoutTemplateId, siteId) {
671
- // @ts-ignore
672
- const { httpClient, sideEffects } = arguments[2];
673
- const payload = renameKeysFromSDKRequestToRESTRequest({
674
- checkoutTemplateId: checkoutTemplateId,
675
- siteId: siteId,
676
- });
677
- const reqOpts = ambassadorWixEcomV1CheckoutTemplate.createAndRedirectToCheckout(payload);
678
- sideEffects?.onSiteCall?.();
679
- try {
680
- const result = await httpClient.request(reqOpts);
681
- sideEffects?.onSuccess?.(result);
682
- return renameKeysFromRESTResponseToSDKResponse(result.data);
683
- }
684
- catch (err) {
685
- const transformedError = sdkTransformError(err, {
686
- spreadPathsToArguments: {},
687
- explicitPathsToArguments: {
688
- checkoutTemplateId: '$[0]',
689
- siteId: '$[1]',
690
- },
691
- singleArgumentUnchanged: false,
692
- }, ['checkoutTemplateId', 'siteId']);
693
- sideEffects?.onError?.(err);
694
- throw transformedError;
695
- }
696
- }
697
- //# sourceMappingURL=ecom-v1-checkout-template-checkout-templates.universal.js.map