@wix/auto_sdk_get-paid_receipts 1.0.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/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +18 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +1 -0
- package/build/cjs/index.typings.js +18 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +1 -0
- package/build/cjs/meta.js +18 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/cjs/src/receipts-v1-receipt-receipts.context.d.ts +11 -0
- package/build/cjs/src/receipts-v1-receipt-receipts.context.js +21 -0
- package/build/cjs/src/receipts-v1-receipt-receipts.context.js.map +1 -0
- package/build/cjs/src/receipts-v1-receipt-receipts.http.d.ts +28 -0
- package/build/cjs/src/receipts-v1-receipt-receipts.http.js +286 -0
- package/build/cjs/src/receipts-v1-receipt-receipts.http.js.map +1 -0
- package/build/cjs/src/receipts-v1-receipt-receipts.meta.d.ts +27 -0
- package/build/cjs/src/receipts-v1-receipt-receipts.meta.js +161 -0
- package/build/cjs/src/receipts-v1-receipt-receipts.meta.js.map +1 -0
- package/build/cjs/src/receipts-v1-receipt-receipts.public.d.ts +72 -0
- package/build/cjs/src/receipts-v1-receipt-receipts.public.js +56 -0
- package/build/cjs/src/receipts-v1-receipt-receipts.public.js.map +1 -0
- package/build/cjs/src/receipts-v1-receipt-receipts.types.d.ts +915 -0
- package/build/cjs/src/receipts-v1-receipt-receipts.types.js +60 -0
- package/build/cjs/src/receipts-v1-receipt-receipts.types.js.map +1 -0
- package/build/cjs/src/receipts-v1-receipt-receipts.universal.d.ts +1072 -0
- package/build/cjs/src/receipts-v1-receipt-receipts.universal.js +446 -0
- package/build/cjs/src/receipts-v1-receipt-receipts.universal.js.map +1 -0
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +2 -0
- package/build/es/index.js.map +1 -0
- package/build/es/index.typings.d.ts +1 -0
- package/build/es/index.typings.js +2 -0
- package/build/es/index.typings.js.map +1 -0
- package/build/es/meta.d.ts +1 -0
- package/build/es/meta.js +2 -0
- package/build/es/meta.js.map +1 -0
- package/build/es/package.json +3 -0
- package/build/es/src/receipts-v1-receipt-receipts.context.d.ts +11 -0
- package/build/es/src/receipts-v1-receipt-receipts.context.js +11 -0
- package/build/es/src/receipts-v1-receipt-receipts.context.js.map +1 -0
- package/build/es/src/receipts-v1-receipt-receipts.http.d.ts +28 -0
- package/build/es/src/receipts-v1-receipt-receipts.http.js +276 -0
- package/build/es/src/receipts-v1-receipt-receipts.http.js.map +1 -0
- package/build/es/src/receipts-v1-receipt-receipts.meta.d.ts +27 -0
- package/build/es/src/receipts-v1-receipt-receipts.meta.js +128 -0
- package/build/es/src/receipts-v1-receipt-receipts.meta.js.map +1 -0
- package/build/es/src/receipts-v1-receipt-receipts.public.d.ts +72 -0
- package/build/es/src/receipts-v1-receipt-receipts.public.js +39 -0
- package/build/es/src/receipts-v1-receipt-receipts.public.js.map +1 -0
- package/build/es/src/receipts-v1-receipt-receipts.types.d.ts +915 -0
- package/build/es/src/receipts-v1-receipt-receipts.types.js +57 -0
- package/build/es/src/receipts-v1-receipt-receipts.types.js.map +1 -0
- package/build/es/src/receipts-v1-receipt-receipts.universal.d.ts +1072 -0
- package/build/es/src/receipts-v1-receipt-receipts.universal.js +413 -0
- package/build/es/src/receipts-v1-receipt-receipts.universal.js.map +1 -0
- package/build/internal/cjs/index.d.ts +1 -0
- package/build/internal/cjs/index.js +18 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +1 -0
- package/build/internal/cjs/index.typings.js +18 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +1 -0
- package/build/internal/cjs/meta.js +18 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/cjs/src/receipts-v1-receipt-receipts.context.d.ts +11 -0
- package/build/internal/cjs/src/receipts-v1-receipt-receipts.context.js +21 -0
- package/build/internal/cjs/src/receipts-v1-receipt-receipts.context.js.map +1 -0
- package/build/internal/cjs/src/receipts-v1-receipt-receipts.http.d.ts +28 -0
- package/build/internal/cjs/src/receipts-v1-receipt-receipts.http.js +286 -0
- package/build/internal/cjs/src/receipts-v1-receipt-receipts.http.js.map +1 -0
- package/build/internal/cjs/src/receipts-v1-receipt-receipts.meta.d.ts +27 -0
- package/build/internal/cjs/src/receipts-v1-receipt-receipts.meta.js +161 -0
- package/build/internal/cjs/src/receipts-v1-receipt-receipts.meta.js.map +1 -0
- package/build/internal/cjs/src/receipts-v1-receipt-receipts.public.d.ts +72 -0
- package/build/internal/cjs/src/receipts-v1-receipt-receipts.public.js +56 -0
- package/build/internal/cjs/src/receipts-v1-receipt-receipts.public.js.map +1 -0
- package/build/internal/cjs/src/receipts-v1-receipt-receipts.types.d.ts +915 -0
- package/build/internal/cjs/src/receipts-v1-receipt-receipts.types.js +60 -0
- package/build/internal/cjs/src/receipts-v1-receipt-receipts.types.js.map +1 -0
- package/build/internal/cjs/src/receipts-v1-receipt-receipts.universal.d.ts +1072 -0
- package/build/internal/cjs/src/receipts-v1-receipt-receipts.universal.js +446 -0
- package/build/internal/cjs/src/receipts-v1-receipt-receipts.universal.js.map +1 -0
- package/build/internal/es/index.d.ts +1 -0
- package/build/internal/es/index.js +2 -0
- package/build/internal/es/index.js.map +1 -0
- package/build/internal/es/index.typings.d.ts +1 -0
- package/build/internal/es/index.typings.js +2 -0
- package/build/internal/es/index.typings.js.map +1 -0
- package/build/internal/es/meta.d.ts +1 -0
- package/build/internal/es/meta.js +2 -0
- package/build/internal/es/meta.js.map +1 -0
- package/build/internal/es/src/receipts-v1-receipt-receipts.context.d.ts +11 -0
- package/build/internal/es/src/receipts-v1-receipt-receipts.context.js +11 -0
- package/build/internal/es/src/receipts-v1-receipt-receipts.context.js.map +1 -0
- package/build/internal/es/src/receipts-v1-receipt-receipts.http.d.ts +28 -0
- package/build/internal/es/src/receipts-v1-receipt-receipts.http.js +276 -0
- package/build/internal/es/src/receipts-v1-receipt-receipts.http.js.map +1 -0
- package/build/internal/es/src/receipts-v1-receipt-receipts.meta.d.ts +27 -0
- package/build/internal/es/src/receipts-v1-receipt-receipts.meta.js +128 -0
- package/build/internal/es/src/receipts-v1-receipt-receipts.meta.js.map +1 -0
- package/build/internal/es/src/receipts-v1-receipt-receipts.public.d.ts +72 -0
- package/build/internal/es/src/receipts-v1-receipt-receipts.public.js +39 -0
- package/build/internal/es/src/receipts-v1-receipt-receipts.public.js.map +1 -0
- package/build/internal/es/src/receipts-v1-receipt-receipts.types.d.ts +915 -0
- package/build/internal/es/src/receipts-v1-receipt-receipts.types.js +57 -0
- package/build/internal/es/src/receipts-v1-receipt-receipts.types.js.map +1 -0
- package/build/internal/es/src/receipts-v1-receipt-receipts.universal.d.ts +1072 -0
- package/build/internal/es/src/receipts-v1-receipt-receipts.universal.js +413 -0
- package/build/internal/es/src/receipts-v1-receipt-receipts.universal.js.map +1 -0
- package/meta/package.json +3 -0
- package/package.json +52 -0
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.updateExtendedFields = exports.getLatestReceiptNumber = exports.sendReceiptEmail = exports.regenerateReceiptDocument = exports.queryReceipts = exports.getReceipt = exports.createReceipt = exports.WebhookIdentityType = exports.SortOrder = exports.RequestOrigin = exports.DocumentStatus = exports.VatType = exports.SubdivisionType = exports.ReceiptOrderType = void 0;
|
|
27
|
+
const transform_error_1 = require("@wix/sdk-runtime/transform-error");
|
|
28
|
+
const query_builder_1 = require("@wix/sdk-runtime/query-builder");
|
|
29
|
+
const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
30
|
+
const ambassadorWixReceiptsV1Receipt = __importStar(require("./receipts-v1-receipt-receipts.http.js"));
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
const address_1 = require("@wix/sdk-runtime/transformations/address");
|
|
33
|
+
const address_2 = require("@wix/sdk-runtime/transformations/address");
|
|
34
|
+
const image_1 = require("@wix/sdk-runtime/transformations/image");
|
|
35
|
+
const image_2 = require("@wix/sdk-runtime/transformations/image");
|
|
36
|
+
const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
37
|
+
var ReceiptOrderType;
|
|
38
|
+
(function (ReceiptOrderType) {
|
|
39
|
+
ReceiptOrderType["UNKNOWN_ORDER_TYPE"] = "UNKNOWN_ORDER_TYPE";
|
|
40
|
+
ReceiptOrderType["WIX_PAYMENT"] = "WIX_PAYMENT";
|
|
41
|
+
ReceiptOrderType["WIX_ECOM"] = "WIX_ECOM";
|
|
42
|
+
})(ReceiptOrderType || (exports.ReceiptOrderType = ReceiptOrderType = {}));
|
|
43
|
+
var SubdivisionType;
|
|
44
|
+
(function (SubdivisionType) {
|
|
45
|
+
SubdivisionType["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
|
|
46
|
+
/** State */
|
|
47
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
|
|
48
|
+
/** County */
|
|
49
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_2"] = "ADMINISTRATIVE_AREA_LEVEL_2";
|
|
50
|
+
/** City/town */
|
|
51
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_3"] = "ADMINISTRATIVE_AREA_LEVEL_3";
|
|
52
|
+
/** Neighborhood/quarter */
|
|
53
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_4"] = "ADMINISTRATIVE_AREA_LEVEL_4";
|
|
54
|
+
/** Street/block */
|
|
55
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_5"] = "ADMINISTRATIVE_AREA_LEVEL_5";
|
|
56
|
+
/** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
|
|
57
|
+
SubdivisionType["COUNTRY"] = "COUNTRY";
|
|
58
|
+
})(SubdivisionType || (exports.SubdivisionType = SubdivisionType = {}));
|
|
59
|
+
/** tax info types */
|
|
60
|
+
var VatType;
|
|
61
|
+
(function (VatType) {
|
|
62
|
+
VatType["UNSPECIFIED"] = "UNSPECIFIED";
|
|
63
|
+
/** CPF - for individual tax payers. */
|
|
64
|
+
VatType["CPF"] = "CPF";
|
|
65
|
+
/** CNPJ - for corporations */
|
|
66
|
+
VatType["CNPJ"] = "CNPJ";
|
|
67
|
+
})(VatType || (exports.VatType = VatType = {}));
|
|
68
|
+
var DocumentStatus;
|
|
69
|
+
(function (DocumentStatus) {
|
|
70
|
+
DocumentStatus["UNKNOWN_DOCUMENT_STATUS"] = "UNKNOWN_DOCUMENT_STATUS";
|
|
71
|
+
DocumentStatus["PROCESSING"] = "PROCESSING";
|
|
72
|
+
DocumentStatus["AVAILABLE"] = "AVAILABLE";
|
|
73
|
+
DocumentStatus["FAILED"] = "FAILED";
|
|
74
|
+
})(DocumentStatus || (exports.DocumentStatus = DocumentStatus = {}));
|
|
75
|
+
var RequestOrigin;
|
|
76
|
+
(function (RequestOrigin) {
|
|
77
|
+
RequestOrigin["INITIAL"] = "INITIAL";
|
|
78
|
+
RequestOrigin["MANUAL"] = "MANUAL";
|
|
79
|
+
})(RequestOrigin || (exports.RequestOrigin = RequestOrigin = {}));
|
|
80
|
+
var SortOrder;
|
|
81
|
+
(function (SortOrder) {
|
|
82
|
+
SortOrder["ASC"] = "ASC";
|
|
83
|
+
SortOrder["DESC"] = "DESC";
|
|
84
|
+
})(SortOrder || (exports.SortOrder = SortOrder = {}));
|
|
85
|
+
var WebhookIdentityType;
|
|
86
|
+
(function (WebhookIdentityType) {
|
|
87
|
+
WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
|
|
88
|
+
WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
89
|
+
WebhookIdentityType["MEMBER"] = "MEMBER";
|
|
90
|
+
WebhookIdentityType["WIX_USER"] = "WIX_USER";
|
|
91
|
+
WebhookIdentityType["APP"] = "APP";
|
|
92
|
+
})(WebhookIdentityType || (exports.WebhookIdentityType = WebhookIdentityType = {}));
|
|
93
|
+
/**
|
|
94
|
+
* Creates a Receipt.
|
|
95
|
+
*
|
|
96
|
+
* The request body must include: currency, source reference, line items, payment, totals.
|
|
97
|
+
* Receipt number will not be assigned on the create response. Number will be assigned eventually but before the
|
|
98
|
+
* document file is created.
|
|
99
|
+
* @param receipt - Receipt to be created.
|
|
100
|
+
* @public
|
|
101
|
+
* @documentationMaturity preview
|
|
102
|
+
* @requiredField receipt
|
|
103
|
+
* @requiredField receipt.currency
|
|
104
|
+
* @requiredField receipt.lineItems
|
|
105
|
+
* @requiredField receipt.lineItems._id
|
|
106
|
+
* @requiredField receipt.lineItems.price
|
|
107
|
+
* @requiredField receipt.lineItems.quantity
|
|
108
|
+
* @requiredField receipt.lineItems.totals
|
|
109
|
+
* @requiredField receipt.lineItems.totals.totalPriceBeforeTax
|
|
110
|
+
* @requiredField receipt.payment
|
|
111
|
+
* @requiredField receipt.payment.amount
|
|
112
|
+
* @requiredField receipt.payment.paymentMethod
|
|
113
|
+
* @requiredField receipt.payment.transactionDate
|
|
114
|
+
* @requiredField receipt.sourceReference
|
|
115
|
+
* @requiredField receipt.sourceReference.appId
|
|
116
|
+
* @requiredField receipt.sourceReference.externalReferenceId
|
|
117
|
+
* @requiredField receipt.sourceReference.receiptOrderType
|
|
118
|
+
* @requiredField receipt.sourceReference.wixEcomOrder.transactionId
|
|
119
|
+
* @requiredField receipt.sourceReference.wixPaymentOrder.transactionId
|
|
120
|
+
* @requiredField receipt.totals
|
|
121
|
+
* @requiredField receipt.totals.subtotal
|
|
122
|
+
* @requiredField receipt.totals.total
|
|
123
|
+
* @permissionId RECEIPTS.RECEIPT_CREATE
|
|
124
|
+
* @returns The created Receipt.
|
|
125
|
+
* @fqn wix.receipts.v1.Receipts.CreateReceipt
|
|
126
|
+
*/
|
|
127
|
+
async function createReceipt(receipt) {
|
|
128
|
+
// @ts-ignore
|
|
129
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
130
|
+
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ receipt: receipt }), [
|
|
131
|
+
{
|
|
132
|
+
transformFn: address_1.transformSDKAddressToRESTAddress,
|
|
133
|
+
paths: [
|
|
134
|
+
{ path: 'receipt.businessDetails.address' },
|
|
135
|
+
{ path: 'receipt.customer.billingAddress' },
|
|
136
|
+
{ path: 'receipt.customer.shippingAddress' },
|
|
137
|
+
],
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
transformFn: image_1.transformSDKImageToRESTImage,
|
|
141
|
+
paths: [{ path: 'receipt.businessDetails.logo' }],
|
|
142
|
+
},
|
|
143
|
+
]);
|
|
144
|
+
const reqOpts = ambassadorWixReceiptsV1Receipt.createReceipt(payload);
|
|
145
|
+
sideEffects?.onSiteCall?.();
|
|
146
|
+
try {
|
|
147
|
+
const result = await httpClient.request(reqOpts);
|
|
148
|
+
sideEffects?.onSuccess?.(result);
|
|
149
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
150
|
+
{
|
|
151
|
+
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
152
|
+
paths: [
|
|
153
|
+
{ path: 'receipt.businessDetails.address' },
|
|
154
|
+
{ path: 'receipt.customer.billingAddress' },
|
|
155
|
+
{ path: 'receipt.customer.shippingAddress' },
|
|
156
|
+
],
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
160
|
+
paths: [{ path: 'receipt.businessDetails.logo' }],
|
|
161
|
+
},
|
|
162
|
+
]))?.receipt;
|
|
163
|
+
}
|
|
164
|
+
catch (err) {
|
|
165
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
166
|
+
spreadPathsToArguments: {},
|
|
167
|
+
explicitPathsToArguments: { receipt: '$[0]' },
|
|
168
|
+
singleArgumentUnchanged: false,
|
|
169
|
+
}, ['receipt']);
|
|
170
|
+
sideEffects?.onError?.(err);
|
|
171
|
+
throw transformedError;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
exports.createReceipt = createReceipt;
|
|
175
|
+
/**
|
|
176
|
+
* Retrieves a Receipt.
|
|
177
|
+
* @param receiptId - Id of the Receipt to retrieve.
|
|
178
|
+
* @public
|
|
179
|
+
* @documentationMaturity preview
|
|
180
|
+
* @requiredField receiptId
|
|
181
|
+
* @permissionId RECEIPTS.RECEIPT_READ
|
|
182
|
+
* @returns The requested Receipt.
|
|
183
|
+
* @fqn wix.receipts.v1.Receipts.GetReceipt
|
|
184
|
+
*/
|
|
185
|
+
async function getReceipt(receiptId) {
|
|
186
|
+
// @ts-ignore
|
|
187
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
188
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
189
|
+
receiptId: receiptId,
|
|
190
|
+
});
|
|
191
|
+
const reqOpts = ambassadorWixReceiptsV1Receipt.getReceipt(payload);
|
|
192
|
+
sideEffects?.onSiteCall?.();
|
|
193
|
+
try {
|
|
194
|
+
const result = await httpClient.request(reqOpts);
|
|
195
|
+
sideEffects?.onSuccess?.(result);
|
|
196
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
197
|
+
{
|
|
198
|
+
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
199
|
+
paths: [
|
|
200
|
+
{ path: 'receipt.businessDetails.address' },
|
|
201
|
+
{ path: 'receipt.customer.billingAddress' },
|
|
202
|
+
{ path: 'receipt.customer.shippingAddress' },
|
|
203
|
+
],
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
207
|
+
paths: [{ path: 'receipt.businessDetails.logo' }],
|
|
208
|
+
},
|
|
209
|
+
]))?.receipt;
|
|
210
|
+
}
|
|
211
|
+
catch (err) {
|
|
212
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
213
|
+
spreadPathsToArguments: {},
|
|
214
|
+
explicitPathsToArguments: { receiptId: '$[0]' },
|
|
215
|
+
singleArgumentUnchanged: false,
|
|
216
|
+
}, ['receiptId']);
|
|
217
|
+
sideEffects?.onError?.(err);
|
|
218
|
+
throw transformedError;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
exports.getReceipt = getReceipt;
|
|
222
|
+
/**
|
|
223
|
+
* Retrieves a list of up to 100 Receipts, given the provided [paging, filtering, and sorting][1].
|
|
224
|
+
*
|
|
225
|
+
* Define queries using WQL - Wix Query Language. To learn how to query Receipts, see [API Query Language][2].
|
|
226
|
+
*
|
|
227
|
+
* [1]: https://dev.wix.com/api/rest/getting-started/sorting-and-paging
|
|
228
|
+
* [2]: https://dev.wix.com/api/rest/getting-started/api-query-language
|
|
229
|
+
* @public
|
|
230
|
+
* @documentationMaturity preview
|
|
231
|
+
* @permissionId RECEIPTS.RECEIPT_READ
|
|
232
|
+
* @fqn wix.receipts.v1.Receipts.QueryReceipts
|
|
233
|
+
*/
|
|
234
|
+
function queryReceipts() {
|
|
235
|
+
// @ts-ignore
|
|
236
|
+
const { httpClient, sideEffects } = arguments[0];
|
|
237
|
+
return (0, query_builder_1.queryBuilder)({
|
|
238
|
+
func: async (payload) => {
|
|
239
|
+
const reqOpts = ambassadorWixReceiptsV1Receipt.queryReceipts(payload);
|
|
240
|
+
sideEffects?.onSiteCall?.();
|
|
241
|
+
try {
|
|
242
|
+
const result = await httpClient.request(reqOpts);
|
|
243
|
+
sideEffects?.onSuccess?.(result);
|
|
244
|
+
return result;
|
|
245
|
+
}
|
|
246
|
+
catch (err) {
|
|
247
|
+
sideEffects?.onError?.(err);
|
|
248
|
+
throw err;
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
requestTransformer: (query) => {
|
|
252
|
+
const args = [query, {}];
|
|
253
|
+
return (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
254
|
+
...args?.[1],
|
|
255
|
+
query: args?.[0],
|
|
256
|
+
});
|
|
257
|
+
},
|
|
258
|
+
responseTransformer: ({ data }) => {
|
|
259
|
+
const transformedData = (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(data, [
|
|
260
|
+
{
|
|
261
|
+
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
262
|
+
paths: [
|
|
263
|
+
{ path: 'receipts.businessDetails.address' },
|
|
264
|
+
{ path: 'receipts.customer.billingAddress' },
|
|
265
|
+
{ path: 'receipts.customer.shippingAddress' },
|
|
266
|
+
],
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
270
|
+
paths: [{ path: 'receipts.businessDetails.logo' }],
|
|
271
|
+
},
|
|
272
|
+
]));
|
|
273
|
+
return {
|
|
274
|
+
items: transformedData?.receipts,
|
|
275
|
+
pagingMetadata: transformedData?.pagingMetadata,
|
|
276
|
+
};
|
|
277
|
+
},
|
|
278
|
+
errorTransformer: (err) => {
|
|
279
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
280
|
+
spreadPathsToArguments: {},
|
|
281
|
+
explicitPathsToArguments: { query: '$[0]' },
|
|
282
|
+
singleArgumentUnchanged: false,
|
|
283
|
+
});
|
|
284
|
+
throw transformedError;
|
|
285
|
+
},
|
|
286
|
+
pagingMethod: 'CURSOR',
|
|
287
|
+
transformationPaths: {},
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
exports.queryReceipts = queryReceipts;
|
|
291
|
+
/**
|
|
292
|
+
* Retries generating document if its status is FAILED.
|
|
293
|
+
* @param receiptId - Receipt id.
|
|
294
|
+
* @public
|
|
295
|
+
* @documentationMaturity preview
|
|
296
|
+
* @requiredField receiptId
|
|
297
|
+
* @permissionId RECEIPTS.RECEIPT_UPDATE
|
|
298
|
+
* @fqn wix.receipts.v1.Receipts.RegenerateReceiptDocument
|
|
299
|
+
*/
|
|
300
|
+
async function regenerateReceiptDocument(receiptId) {
|
|
301
|
+
// @ts-ignore
|
|
302
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
303
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
304
|
+
receiptId: receiptId,
|
|
305
|
+
});
|
|
306
|
+
const reqOpts = ambassadorWixReceiptsV1Receipt.regenerateReceiptDocument(payload);
|
|
307
|
+
sideEffects?.onSiteCall?.();
|
|
308
|
+
try {
|
|
309
|
+
const result = await httpClient.request(reqOpts);
|
|
310
|
+
sideEffects?.onSuccess?.(result);
|
|
311
|
+
}
|
|
312
|
+
catch (err) {
|
|
313
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
314
|
+
spreadPathsToArguments: {},
|
|
315
|
+
explicitPathsToArguments: { receiptId: '$[0]' },
|
|
316
|
+
singleArgumentUnchanged: false,
|
|
317
|
+
}, ['receiptId']);
|
|
318
|
+
sideEffects?.onError?.(err);
|
|
319
|
+
throw transformedError;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
exports.regenerateReceiptDocument = regenerateReceiptDocument;
|
|
323
|
+
/**
|
|
324
|
+
* Sends email with Receipt.
|
|
325
|
+
* @param receiptId - Id of the receipt to send to recipients.
|
|
326
|
+
* @public
|
|
327
|
+
* @documentationMaturity preview
|
|
328
|
+
* @requiredField receiptId
|
|
329
|
+
* @permissionId RECEIPTS.RECEIPT_SEND
|
|
330
|
+
* @fqn wix.receipts.v1.Receipts.SendReceiptEmail
|
|
331
|
+
*/
|
|
332
|
+
async function sendReceiptEmail(receiptId, options) {
|
|
333
|
+
// @ts-ignore
|
|
334
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
335
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
336
|
+
receiptId: receiptId,
|
|
337
|
+
contactId: options?.contactId,
|
|
338
|
+
});
|
|
339
|
+
const reqOpts = ambassadorWixReceiptsV1Receipt.sendReceiptEmail(payload);
|
|
340
|
+
sideEffects?.onSiteCall?.();
|
|
341
|
+
try {
|
|
342
|
+
const result = await httpClient.request(reqOpts);
|
|
343
|
+
sideEffects?.onSuccess?.(result);
|
|
344
|
+
}
|
|
345
|
+
catch (err) {
|
|
346
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
347
|
+
spreadPathsToArguments: {},
|
|
348
|
+
explicitPathsToArguments: {
|
|
349
|
+
receiptId: '$[0]',
|
|
350
|
+
contactId: '$[1].contactId',
|
|
351
|
+
},
|
|
352
|
+
singleArgumentUnchanged: false,
|
|
353
|
+
}, ['receiptId', 'options']);
|
|
354
|
+
sideEffects?.onError?.(err);
|
|
355
|
+
throw transformedError;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
exports.sendReceiptEmail = sendReceiptEmail;
|
|
359
|
+
/**
|
|
360
|
+
* Returns latest number for a given prefix.
|
|
361
|
+
* @public
|
|
362
|
+
* @documentationMaturity preview
|
|
363
|
+
* @permissionId RECEIPTS.RECEIPT_READ
|
|
364
|
+
* @fqn wix.receipts.v1.Receipts.GetLatestReceiptNumber
|
|
365
|
+
*/
|
|
366
|
+
async function getLatestReceiptNumber(options) {
|
|
367
|
+
// @ts-ignore
|
|
368
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
369
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
370
|
+
prefix: options?.prefix,
|
|
371
|
+
});
|
|
372
|
+
const reqOpts = ambassadorWixReceiptsV1Receipt.getLatestReceiptNumber(payload);
|
|
373
|
+
sideEffects?.onSiteCall?.();
|
|
374
|
+
try {
|
|
375
|
+
const result = await httpClient.request(reqOpts);
|
|
376
|
+
sideEffects?.onSuccess?.(result);
|
|
377
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
378
|
+
}
|
|
379
|
+
catch (err) {
|
|
380
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
381
|
+
spreadPathsToArguments: {},
|
|
382
|
+
explicitPathsToArguments: { prefix: '$[0].prefix' },
|
|
383
|
+
singleArgumentUnchanged: false,
|
|
384
|
+
}, ['options']);
|
|
385
|
+
sideEffects?.onError?.(err);
|
|
386
|
+
throw transformedError;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
exports.getLatestReceiptNumber = getLatestReceiptNumber;
|
|
390
|
+
/**
|
|
391
|
+
* Updates extended fields of a Receipt without incrementing revision.
|
|
392
|
+
* @param _id - ID of the entity to update.
|
|
393
|
+
* @param namespace - Identifier for the app whose extended fields are being updated.
|
|
394
|
+
* @public
|
|
395
|
+
* @documentationMaturity preview
|
|
396
|
+
* @requiredField _id
|
|
397
|
+
* @requiredField namespace
|
|
398
|
+
* @requiredField options
|
|
399
|
+
* @requiredField options.namespaceData
|
|
400
|
+
* @permissionId RECEIPTS.RECEIPT_UPDATE
|
|
401
|
+
* @fqn wix.receipts.v1.Receipts.UpdateExtendedFields
|
|
402
|
+
*/
|
|
403
|
+
async function updateExtendedFields(_id, namespace, options) {
|
|
404
|
+
// @ts-ignore
|
|
405
|
+
const { httpClient, sideEffects } = arguments[3];
|
|
406
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
407
|
+
id: _id,
|
|
408
|
+
namespace: namespace,
|
|
409
|
+
namespaceData: options?.namespaceData,
|
|
410
|
+
});
|
|
411
|
+
const reqOpts = ambassadorWixReceiptsV1Receipt.updateExtendedFields(payload);
|
|
412
|
+
sideEffects?.onSiteCall?.();
|
|
413
|
+
try {
|
|
414
|
+
const result = await httpClient.request(reqOpts);
|
|
415
|
+
sideEffects?.onSuccess?.(result);
|
|
416
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
417
|
+
{
|
|
418
|
+
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
419
|
+
paths: [
|
|
420
|
+
{ path: 'receipt.businessDetails.address' },
|
|
421
|
+
{ path: 'receipt.customer.billingAddress' },
|
|
422
|
+
{ path: 'receipt.customer.shippingAddress' },
|
|
423
|
+
],
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
427
|
+
paths: [{ path: 'receipt.businessDetails.logo' }],
|
|
428
|
+
},
|
|
429
|
+
]));
|
|
430
|
+
}
|
|
431
|
+
catch (err) {
|
|
432
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
433
|
+
spreadPathsToArguments: {},
|
|
434
|
+
explicitPathsToArguments: {
|
|
435
|
+
id: '$[0]',
|
|
436
|
+
namespace: '$[1]',
|
|
437
|
+
namespaceData: '$[2].namespaceData',
|
|
438
|
+
},
|
|
439
|
+
singleArgumentUnchanged: false,
|
|
440
|
+
}, ['_id', 'namespace', 'options']);
|
|
441
|
+
sideEffects?.onError?.(err);
|
|
442
|
+
throw transformedError;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
exports.updateExtendedFields = updateExtendedFields;
|
|
446
|
+
//# sourceMappingURL=receipts-v1-receipt-receipts.universal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"receipts-v1-receipt-receipts.universal.js","sourceRoot":"","sources":["../../../src/receipts-v1-receipt-receipts.universal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sEAAuF;AACvF,kEAA8D;AAC9D,oFAGiD;AAEjD,uGAAyF;AACzF,aAAa;AACb,sEAA4F;AAC5F,sEAA4F;AAC5F,kEAAsF;AACtF,kEAAsF;AACtF,sFAAkF;AAgJlF,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,6DAAyC,CAAA;IACzC,+CAA2B,CAAA;IAC3B,yCAAqB,CAAA;AACvB,CAAC,EAJW,gBAAgB,gCAAhB,gBAAgB,QAI3B;AA4ED,IAAY,eAcX;AAdD,WAAY,eAAe;IACzB,wEAAqD,CAAA;IACrD,YAAY;IACZ,8EAA2D,CAAA;IAC3D,aAAa;IACb,8EAA2D,CAAA;IAC3D,gBAAgB;IAChB,8EAA2D,CAAA;IAC3D,2BAA2B;IAC3B,8EAA2D,CAAA;IAC3D,mBAAmB;IACnB,8EAA2D,CAAA;IAC3D,8IAA8I;IAC9I,sCAAmB,CAAA;AACrB,CAAC,EAdW,eAAe,+BAAf,eAAe,QAc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W,EAAE,UAAU,EAAE,EAAE,CAAC;IAC5B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACjD,WAAW,EAAE,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC;QAEjC,OAAO,IAAA,gEAAuC,EAC5C,IAAA,gCAAc,EAAC,MAAM,CAAC,IAAI,EAAE;YAC1B;gBACE,WAAW,EAAE,0CAAgC;gBAC7C,KAAK,EAAE;oBACL,EAAE,IAAI,EAAE,iCAAiC,EAAE;oBAC3C,EAAE,IAAI,EAAE,iCAAiC,EAAE;oBAC3C,EAAE,IAAI,EAAE,kCAAkC,EAAE;iBAC7C;aACF;YACD;gBACE,WAAW,EAAE,oCAA4B;gBACzC,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,8BAA8B,EAAE,CAAC;aAClD;SACF,CAAC,CACF,CAAC;IACL,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,MAAM,gBAAgB,GAAG,IAAA,gCAAiB,EACxC,GAAG,EACH;YACE,sBAAsB,EAAE,EAAE;YAC1B,wBAAwB,EAAE;gBACxB,EAAE,EAAE,MAAM;gBACV,SAAS,EAAE,MAAM;gBACjB,aAAa,EAAE,oBAAoB;aACpC;YACD,uBAAuB,EAAE,KAAK;SAC/B,EACD,CAAC,KAAK,EAAE,WAAW,EAAE,SAAS,CAAC,CAChC,CAAC;QACF,WAAW,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QAE5B,MAAM,gBAAgB,CAAC;IACzB,CAAC;AACH,CAAC;AA5DD,oDA4DC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/receipts-v1-receipt-receipts.context.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,+CAA+C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/receipts-v1-receipt-receipts.universal.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../index.typings.ts"],"names":[],"mappings":"AAAA,cAAc,iDAAiD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/receipts-v1-receipt-receipts.meta.js';
|
package/build/es/meta.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":"AAAA,cAAc,4CAA4C,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createReceipt as publicCreateReceipt, getReceipt as publicGetReceipt, queryReceipts as publicQueryReceipts, regenerateReceiptDocument as publicRegenerateReceiptDocument, sendReceiptEmail as publicSendReceiptEmail, getLatestReceiptNumber as publicGetLatestReceiptNumber, updateExtendedFields as publicUpdateExtendedFields } from './receipts-v1-receipt-receipts.public.js';
|
|
2
|
+
import { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';
|
|
3
|
+
export declare const createReceipt: MaybeContext<BuildRESTFunction<typeof publicCreateReceipt> & typeof publicCreateReceipt>;
|
|
4
|
+
export declare const getReceipt: MaybeContext<BuildRESTFunction<typeof publicGetReceipt> & typeof publicGetReceipt>;
|
|
5
|
+
export declare const queryReceipts: MaybeContext<BuildRESTFunction<typeof publicQueryReceipts> & typeof publicQueryReceipts>;
|
|
6
|
+
export declare const regenerateReceiptDocument: MaybeContext<BuildRESTFunction<typeof publicRegenerateReceiptDocument> & typeof publicRegenerateReceiptDocument>;
|
|
7
|
+
export declare const sendReceiptEmail: MaybeContext<BuildRESTFunction<typeof publicSendReceiptEmail> & typeof publicSendReceiptEmail>;
|
|
8
|
+
export declare const getLatestReceiptNumber: MaybeContext<BuildRESTFunction<typeof publicGetLatestReceiptNumber> & typeof publicGetLatestReceiptNumber>;
|
|
9
|
+
export declare const updateExtendedFields: MaybeContext<BuildRESTFunction<typeof publicUpdateExtendedFields> & typeof publicUpdateExtendedFields>;
|
|
10
|
+
export { ReceiptOrderType, SubdivisionType, VatType, DocumentStatus, RequestOrigin, SortOrder, WebhookIdentityType, } from './receipts-v1-receipt-receipts.universal.js';
|
|
11
|
+
export { Receipt, Numbering, RegionalProperties, Locale, SourceReference, SourceReferenceOrderOneOf, WixPayment, WixEcom, BusinessDetails, Address, AddressStreetOneOf, StreetAddress, AddressLocation, Subdivision, StandardDetails, Customer, FullAddressContactDetails, VatId, LineItem, LineItemTax, LineItemTotals, ShippingInfo, ShippingTax, AdditionalFee, AdditionalFeeTax, Discount, Payment, Totals, Tax, CustomFields, CustomField, FooterCustomField, Document, ExtendedFields, ReceiptDocumentProcess, ReceiptNumberingProcess, ReceiptDocumentHandled, ReceiptDocumentHandledResultOneOf, Succeeded, Failed, GenerateReceiptDocument, Sent, CreateReceiptRequest, CreateReceiptResponse, GetReceiptRequest, GetReceiptResponse, QueryReceiptsRequest, CursorQuery, CursorQueryPagingMethodOneOf, Sorting, CursorPaging, QueryReceiptsResponse, CursorPagingMetadata, Cursors, RegenerateReceiptDocumentRequest, RegenerateReceiptDocumentResponse, SendReceiptEmailRequest, SendReceiptEmailResponse, GetLatestReceiptNumberRequest, GetLatestReceiptNumberResponse, UpdateExtendedFieldsRequest, UpdateExtendedFieldsResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, RestoreInfo, EntityUpdatedEvent, EntityDeletedEvent, ActionEvent, Empty, MessageEnvelope, IdentificationData, IdentificationDataIdOneOf, ReceiptNonNullableFields, CreateReceiptResponseNonNullableFields, GetReceiptResponseNonNullableFields, QueryReceiptsResponseNonNullableFields, UpdateExtendedFieldsResponseNonNullableFields, ReceiptsQueryResult, ReceiptsQueryBuilder, SendReceiptEmailOptions, GetLatestReceiptNumberOptions, UpdateExtendedFieldsOptions, } from './receipts-v1-receipt-receipts.universal.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createReceipt as publicCreateReceipt, getReceipt as publicGetReceipt, queryReceipts as publicQueryReceipts, regenerateReceiptDocument as publicRegenerateReceiptDocument, sendReceiptEmail as publicSendReceiptEmail, getLatestReceiptNumber as publicGetLatestReceiptNumber, updateExtendedFields as publicUpdateExtendedFields, } from './receipts-v1-receipt-receipts.public.js';
|
|
2
|
+
import { createRESTModule } from '@wix/sdk-runtime/rest-modules';
|
|
3
|
+
export const createReceipt = /*#__PURE__*/ createRESTModule(publicCreateReceipt);
|
|
4
|
+
export const getReceipt = /*#__PURE__*/ createRESTModule(publicGetReceipt);
|
|
5
|
+
export const queryReceipts = /*#__PURE__*/ createRESTModule(publicQueryReceipts);
|
|
6
|
+
export const regenerateReceiptDocument = /*#__PURE__*/ createRESTModule(publicRegenerateReceiptDocument);
|
|
7
|
+
export const sendReceiptEmail = /*#__PURE__*/ createRESTModule(publicSendReceiptEmail);
|
|
8
|
+
export const getLatestReceiptNumber = /*#__PURE__*/ createRESTModule(publicGetLatestReceiptNumber);
|
|
9
|
+
export const updateExtendedFields = /*#__PURE__*/ createRESTModule(publicUpdateExtendedFields);
|
|
10
|
+
export { ReceiptOrderType, SubdivisionType, VatType, DocumentStatus, RequestOrigin, SortOrder, WebhookIdentityType, } from './receipts-v1-receipt-receipts.universal.js';
|
|
11
|
+
//# sourceMappingURL=receipts-v1-receipt-receipts.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"receipts-v1-receipt-receipts.context.js","sourceRoot":"","sources":["../../../src/receipts-v1-receipt-receipts.context.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,IAAI,mBAAmB,EACpC,UAAU,IAAI,gBAAgB,EAC9B,aAAa,IAAI,mBAAmB,EACpC,yBAAyB,IAAI,+BAA+B,EAC5D,gBAAgB,IAAI,sBAAsB,EAC1C,sBAAsB,IAAI,4BAA4B,EACtD,oBAAoB,IAAI,0BAA0B,GACnD,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,MAAM,CAAC,MAAM,aAAa,GAEtB,aAAa,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,CAAC;AACxD,MAAM,CAAC,MAAM,UAAU,GAEnB,aAAa,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;AACrD,MAAM,CAAC,MAAM,aAAa,GAEtB,aAAa,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,CAAC;AACxD,MAAM,CAAC,MAAM,yBAAyB,GAGlC,aAAa,CAAC,gBAAgB,CAAC,+BAA+B,CAAC,CAAC;AACpE,MAAM,CAAC,MAAM,gBAAgB,GAGzB,aAAa,CAAC,gBAAgB,CAAC,sBAAsB,CAAC,CAAC;AAC3D,MAAM,CAAC,MAAM,sBAAsB,GAG/B,aAAa,CAAC,gBAAgB,CAAC,4BAA4B,CAAC,CAAC;AACjE,MAAM,CAAC,MAAM,oBAAoB,GAG7B,aAAa,CAAC,gBAAgB,CAAC,0BAA0B,CAAC,CAAC;AAE/D,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,OAAO,EACP,cAAc,EACd,aAAa,EACb,SAAS,EACT,mBAAmB,GACpB,MAAM,6CAA6C,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { RequestOptionsFactory } from '@wix/sdk-types';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a Receipt.
|
|
4
|
+
*
|
|
5
|
+
* The request body must include: currency, source reference, line items, payment, totals.
|
|
6
|
+
* Receipt number will not be assigned on the create response. Number will be assigned eventually but before the
|
|
7
|
+
* document file is created.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createReceipt(payload: object): RequestOptionsFactory<any>;
|
|
10
|
+
/** Retrieves a Receipt. */
|
|
11
|
+
export declare function getReceipt(payload: object): RequestOptionsFactory<any>;
|
|
12
|
+
/**
|
|
13
|
+
* Retrieves a list of up to 100 Receipts, given the provided [paging, filtering, and sorting][1].
|
|
14
|
+
*
|
|
15
|
+
* Define queries using WQL - Wix Query Language. To learn how to query Receipts, see [API Query Language][2].
|
|
16
|
+
*
|
|
17
|
+
* [1]: https://dev.wix.com/api/rest/getting-started/sorting-and-paging
|
|
18
|
+
* [2]: https://dev.wix.com/api/rest/getting-started/api-query-language
|
|
19
|
+
*/
|
|
20
|
+
export declare function queryReceipts(payload: object): RequestOptionsFactory<any>;
|
|
21
|
+
/** Retries generating document if its status is FAILED. */
|
|
22
|
+
export declare function regenerateReceiptDocument(payload: object): RequestOptionsFactory<any>;
|
|
23
|
+
/** Sends email with Receipt. */
|
|
24
|
+
export declare function sendReceiptEmail(payload: object): RequestOptionsFactory<any>;
|
|
25
|
+
/** Returns latest number for a given prefix. */
|
|
26
|
+
export declare function getLatestReceiptNumber(payload: object): RequestOptionsFactory<any>;
|
|
27
|
+
/** Updates extended fields of a Receipt without incrementing revision. */
|
|
28
|
+
export declare function updateExtendedFields(payload: object): RequestOptionsFactory<any>;
|