@wix/auto_sdk_get-paid_receipts 1.0.268 → 1.0.269
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.js.map +1 -1
- package/build/cjs/index.typings.d.ts +0 -6
- package/build/cjs/index.typings.js.map +1 -1
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +0 -6
- package/build/es/index.typings.mjs.map +1 -1
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +0 -6
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +0 -6
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../index.ts","../../../src/receipts-v1-receipt-receipts.public.ts","../../../src/receipts-v1-receipt-receipts.universal.ts","../../../src/receipts-v1-receipt-receipts.http.ts","../../../src/receipts-v1-receipt-receipts.context.ts"],"sourcesContent":["export * from './src/receipts-v1-receipt-receipts.context.js';\n","import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { transformRESTAddressToSDKAddress } from '@wix/sdk-runtime/transformations/address';\nimport { transformRESTImageToSDKImage } from '@wix/sdk-runtime/transformations/image';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { EventDefinition, HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n CreateReceiptApplicationErrors,\n GetLatestReceiptNumberOptions,\n GetLatestReceiptNumberResponse,\n QueryReceiptsResponse,\n Receipt,\n ReceiptCreatedEnvelope,\n ReceiptQuery,\n ReceiptSentEnvelope,\n ReceiptUpdatedEnvelope,\n ReceiptsQueryBuilder,\n RegenerateReceiptDocumentApplicationErrors,\n SendReceiptEmailApplicationErrors,\n SendReceiptEmailOptions,\n UpdateExtendedFieldsOptions,\n UpdateExtendedFieldsResponse,\n createReceipt as universalCreateReceipt,\n getLatestReceiptNumber as universalGetLatestReceiptNumber,\n getReceipt as universalGetReceipt,\n queryReceipts as universalQueryReceipts,\n regenerateReceiptDocument as universalRegenerateReceiptDocument,\n sendReceiptEmail as universalSendReceiptEmail,\n typedQueryReceipts as universalTypedQueryReceipts,\n updateExtendedFields as universalUpdateExtendedFields,\n} from './receipts-v1-receipt-receipts.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/get-paid' };\n\nexport function createReceipt(httpClient: HttpClient): CreateReceiptSignature {\n return (\n receipt: NonNullablePaths<\n Receipt,\n | `currency`\n | `lineItems`\n | `lineItems.${number}._id`\n | `lineItems.${number}.price`\n | `lineItems.${number}.quantity`\n | `lineItems.${number}.totals`\n | `lineItems.${number}.totals.totalPriceBeforeTax`\n | `payment`\n | `payment.amount`\n | `payment.paymentMethod`\n | `payment.transactionDate`\n | `sourceReference`\n | `sourceReference.appId`\n | `sourceReference.externalReferenceId`\n | `sourceReference.receiptOrderType`\n | `sourceReference.wixEcomOrder.orderId`\n | `sourceReference.wixEcomOrder.transactionId`\n | `sourceReference.wixPaymentOrder.orderId`\n | `sourceReference.wixPaymentOrder.transactionId`\n | `totals`\n | `totals.subtotal`\n | `totals.total`,\n 5\n >\n ) =>\n universalCreateReceipt(\n receipt,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateReceiptSignature {\n /**\n * Creates a receipt.\n *\n * Receipt number is assigned later and will be provided in the Get Receipt response.\n * @param - Receipt to create.\n * @returns Created receipt.\n */\n (\n receipt: NonNullablePaths<\n Receipt,\n | `currency`\n | `lineItems`\n | `lineItems.${number}._id`\n | `lineItems.${number}.price`\n | `lineItems.${number}.quantity`\n | `lineItems.${number}.totals`\n | `lineItems.${number}.totals.totalPriceBeforeTax`\n | `payment`\n | `payment.amount`\n | `payment.paymentMethod`\n | `payment.transactionDate`\n | `sourceReference`\n | `sourceReference.appId`\n | `sourceReference.externalReferenceId`\n | `sourceReference.receiptOrderType`\n | `sourceReference.wixEcomOrder.orderId`\n | `sourceReference.wixEcomOrder.transactionId`\n | `sourceReference.wixPaymentOrder.orderId`\n | `sourceReference.wixPaymentOrder.transactionId`\n | `totals`\n | `totals.subtotal`\n | `totals.total`,\n 5\n >\n ): Promise<\n NonNullablePaths<\n Receipt,\n | `numbering.displayNumber`\n | `regionalProperties.locale.languageCode`\n | `currency`\n | `sourceReference.wixPaymentOrder.orderId`\n | `sourceReference.wixPaymentOrder.transactionId`\n | `sourceReference.wixEcomOrder.orderId`\n | `sourceReference.wixEcomOrder.transactionId`\n | `sourceReference.appId`\n | `sourceReference.externalReferenceId`\n | `sourceReference.receiptOrderType`\n | `businessDetails.address.streetAddress.number`\n | `businessDetails.address.streetAddress.name`\n | `businessDetails.address.streetAddress.apt`\n | `customer.contactDetails.vatId._id`\n | `customer.contactDetails.vatId.type`\n | `lineItems`\n | `shippingInfo.title`\n | `shippingInfo.priceBeforeTax`\n | `shippingInfo.priceAfterTax`\n | `shippingInfo.taxBreakdown`\n | `shippingInfo.taxBreakdown.${number}.name`\n | `shippingInfo.taxBreakdown.${number}.rate`\n | `shippingInfo.taxBreakdown.${number}.amount`\n | `additionalFees`\n | `additionalFees.${number}.name`\n | `additionalFees.${number}.priceBeforeTax`\n | `additionalFees.${number}.priceAfterTax`\n | `discounts`\n | `discounts.${number}.name`\n | `discounts.${number}.amount`\n | `payment.paymentMethod`\n | `payment.amount`\n | `taxBreakdown`\n | `taxBreakdown.${number}.name`\n | `taxBreakdown.${number}.rate`\n | `taxBreakdown.${number}.taxAmount`\n | `taxBreakdown.${number}.taxableAmount`\n | `customFields.headerCustomFields`\n | `customFields.headerCustomFields.${number}.value`\n | `customFields.businessCustomFields`\n | `customFields.customerCustomFields`\n | `customFields.footerCustomFields`\n | `customFields.footerCustomFields.${number}.title`\n | `document.status`,\n 5\n > & {\n __applicationErrorsType?: CreateReceiptApplicationErrors;\n }\n >;\n}\n\nexport function getReceipt(httpClient: HttpClient): GetReceiptSignature {\n return (receiptId: string) =>\n universalGetReceipt(\n receiptId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetReceiptSignature {\n /**\n * Retrieves a receipt.\n * @param - Receipt ID.\n * @returns Requested receipt.\n */\n (receiptId: string): Promise<\n NonNullablePaths<\n Receipt,\n | `numbering.displayNumber`\n | `regionalProperties.locale.languageCode`\n | `currency`\n | `sourceReference.wixPaymentOrder.orderId`\n | `sourceReference.wixPaymentOrder.transactionId`\n | `sourceReference.wixEcomOrder.orderId`\n | `sourceReference.wixEcomOrder.transactionId`\n | `sourceReference.appId`\n | `sourceReference.externalReferenceId`\n | `sourceReference.receiptOrderType`\n | `businessDetails.address.streetAddress.number`\n | `businessDetails.address.streetAddress.name`\n | `businessDetails.address.streetAddress.apt`\n | `customer.contactDetails.vatId._id`\n | `customer.contactDetails.vatId.type`\n | `lineItems`\n | `shippingInfo.title`\n | `shippingInfo.priceBeforeTax`\n | `shippingInfo.priceAfterTax`\n | `shippingInfo.taxBreakdown`\n | `shippingInfo.taxBreakdown.${number}.name`\n | `shippingInfo.taxBreakdown.${number}.rate`\n | `shippingInfo.taxBreakdown.${number}.amount`\n | `additionalFees`\n | `additionalFees.${number}.name`\n | `additionalFees.${number}.priceBeforeTax`\n | `additionalFees.${number}.priceAfterTax`\n | `discounts`\n | `discounts.${number}.name`\n | `discounts.${number}.amount`\n | `payment.paymentMethod`\n | `payment.amount`\n | `taxBreakdown`\n | `taxBreakdown.${number}.name`\n | `taxBreakdown.${number}.rate`\n | `taxBreakdown.${number}.taxAmount`\n | `taxBreakdown.${number}.taxableAmount`\n | `customFields.headerCustomFields`\n | `customFields.headerCustomFields.${number}.value`\n | `customFields.businessCustomFields`\n | `customFields.customerCustomFields`\n | `customFields.footerCustomFields`\n | `customFields.footerCustomFields.${number}.title`\n | `document.status`,\n 5\n >\n >;\n}\n\nexport function queryReceipts(httpClient: HttpClient): QueryReceiptsSignature {\n return () =>\n universalQueryReceipts(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface QueryReceiptsSignature {\n /**\n * Retrieves a list of up to 100 receipts, given the specified filtering, paging, and sorting ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/api-query-language) | [REST](https://dev.wix.com/api/rest/getting-started/api-query-language)).\n */\n (): ReceiptsQueryBuilder;\n}\n\nexport function typedQueryReceipts(\n httpClient: HttpClient\n): TypedQueryReceiptsSignature {\n return (query: ReceiptQuery) =>\n universalTypedQueryReceipts(\n query,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface TypedQueryReceiptsSignature {\n /** */\n (query: ReceiptQuery): Promise<\n NonNullablePaths<\n QueryReceiptsResponse,\n | `receipts`\n | `receipts.${number}.numbering.displayNumber`\n | `receipts.${number}.regionalProperties.locale.languageCode`\n | `receipts.${number}.currency`\n | `receipts.${number}.sourceReference.wixPaymentOrder.orderId`\n | `receipts.${number}.sourceReference.wixPaymentOrder.transactionId`\n | `receipts.${number}.sourceReference.wixEcomOrder.orderId`\n | `receipts.${number}.sourceReference.wixEcomOrder.transactionId`\n | `receipts.${number}.sourceReference.appId`\n | `receipts.${number}.sourceReference.externalReferenceId`\n | `receipts.${number}.sourceReference.receiptOrderType`\n | `receipts.${number}.shippingInfo.title`\n | `receipts.${number}.shippingInfo.priceBeforeTax`\n | `receipts.${number}.shippingInfo.priceAfterTax`\n | `receipts.${number}.payment.paymentMethod`\n | `receipts.${number}.payment.amount`\n | `receipts.${number}.document.status`,\n 6\n >\n >;\n}\n\nexport function regenerateReceiptDocument(\n httpClient: HttpClient\n): RegenerateReceiptDocumentSignature {\n return (receiptId: string) =>\n universalRegenerateReceiptDocument(\n receiptId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface RegenerateReceiptDocumentSignature {\n /**\n * Retries generating a receipt document that has a `FAILED` or stuck in `PROCESSING` status.\n *\n * Note that you can access a receipt document with an `AVAILABLE` status with the URL provided in `document.downloadUrl` without regenerating.\n * @param - Receipt ID.\n */\n (receiptId: string): Promise<\n void & {\n __applicationErrorsType?: RegenerateReceiptDocumentApplicationErrors;\n }\n >;\n}\n\nexport function sendReceiptEmail(\n httpClient: HttpClient\n): SendReceiptEmailSignature {\n return (receiptId: string, options?: SendReceiptEmailOptions) =>\n universalSendReceiptEmail(\n receiptId,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface SendReceiptEmailSignature {\n /**\n * Sends the receipt to the specified recipient in an email.\n *\n * Specifying a contact ID is required only when no contact ID was specified upon receipt creation.\n *\n * Note that if the specified contact ID doesn't have an associated email address, the call will fail.\n * @param - Receipt ID to send.\n * @param - Field options. The `contactId` object must be passed if one was not already specified upon receipt creation.\n */\n (receiptId: string, options?: SendReceiptEmailOptions): Promise<\n void & {\n __applicationErrorsType?: SendReceiptEmailApplicationErrors;\n }\n >;\n}\n\nexport function getLatestReceiptNumber(\n httpClient: HttpClient\n): GetLatestReceiptNumberSignature {\n return (options?: GetLatestReceiptNumberOptions) =>\n universalGetLatestReceiptNumber(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetLatestReceiptNumberSignature {\n /**\n * Retrieves the highest receipt number currently in use (the sequential identifier displayed between the prefix and suffix in receipt display numbers).\n * Can be filtered by prefix.\n *\n * Receipt numbering is managed in the Receipts Settings API.\n * @param - Field options.\n */\n (\n options?: GetLatestReceiptNumberOptions\n ): Promise<GetLatestReceiptNumberResponse>;\n}\n\nexport function updateExtendedFields(\n httpClient: HttpClient\n): UpdateExtendedFieldsSignature {\n return (\n _id: string,\n namespace: string,\n options: NonNullablePaths<UpdateExtendedFieldsOptions, `namespaceData`, 2>\n ) =>\n universalUpdateExtendedFields(\n _id,\n namespace,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateExtendedFieldsSignature {\n /**\n * Updates extended fields of a receipt, without incrementing revision.\n * @param - ID of the entity to update.\n * @param - Identifier for the app whose extended fields are being updated.\n * @param - Field options. The `namespaceData` object **must** be passed.\n */\n (\n _id: string,\n namespace: string,\n options: NonNullablePaths<UpdateExtendedFieldsOptions, `namespaceData`, 2>\n ): Promise<\n NonNullablePaths<\n UpdateExtendedFieldsResponse,\n | `receipt.numbering.displayNumber`\n | `receipt.regionalProperties.locale.languageCode`\n | `receipt.currency`\n | `receipt.sourceReference.wixPaymentOrder.orderId`\n | `receipt.sourceReference.wixPaymentOrder.transactionId`\n | `receipt.sourceReference.wixEcomOrder.orderId`\n | `receipt.sourceReference.wixEcomOrder.transactionId`\n | `receipt.sourceReference.appId`\n | `receipt.sourceReference.externalReferenceId`\n | `receipt.sourceReference.receiptOrderType`\n | `receipt.businessDetails.address.streetAddress.number`\n | `receipt.businessDetails.address.streetAddress.name`\n | `receipt.businessDetails.address.streetAddress.apt`\n | `receipt.customer.contactDetails.vatId._id`\n | `receipt.customer.contactDetails.vatId.type`\n | `receipt.lineItems`\n | `receipt.shippingInfo.title`\n | `receipt.shippingInfo.priceBeforeTax`\n | `receipt.shippingInfo.priceAfterTax`\n | `receipt.shippingInfo.taxBreakdown`\n | `receipt.shippingInfo.taxBreakdown.${number}.name`\n | `receipt.shippingInfo.taxBreakdown.${number}.rate`\n | `receipt.shippingInfo.taxBreakdown.${number}.amount`\n | `receipt.additionalFees`\n | `receipt.additionalFees.${number}.name`\n | `receipt.additionalFees.${number}.priceBeforeTax`\n | `receipt.additionalFees.${number}.priceAfterTax`\n | `receipt.discounts`\n | `receipt.discounts.${number}.name`\n | `receipt.discounts.${number}.amount`\n | `receipt.payment.paymentMethod`\n | `receipt.payment.amount`\n | `receipt.taxBreakdown`\n | `receipt.taxBreakdown.${number}.name`\n | `receipt.taxBreakdown.${number}.rate`\n | `receipt.taxBreakdown.${number}.taxAmount`\n | `receipt.taxBreakdown.${number}.taxableAmount`\n | `receipt.customFields.headerCustomFields`\n | `receipt.customFields.headerCustomFields.${number}.value`\n | `receipt.customFields.businessCustomFields`\n | `receipt.customFields.customerCustomFields`\n | `receipt.customFields.footerCustomFields`\n | `receipt.customFields.footerCustomFields.${number}.title`\n | `receipt.document.status`,\n 6\n >\n >;\n}\n\nexport const onReceiptCreated = EventDefinition(\n 'wix.receipts.v1.receipt_created',\n true,\n (event: ReceiptCreatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'entity.createdDate' },\n { path: 'entity.updatedDate' },\n { path: 'entity.payment.transactionDate' },\n { path: 'entity.document.startGenerationTime' },\n { path: 'metadata.eventTime' },\n ],\n },\n {\n transformFn: transformRESTAddressToSDKAddress,\n paths: [\n { path: 'entity.businessDetails.address' },\n { path: 'entity.customer.billingAddress' },\n { path: 'entity.customer.shippingAddress' },\n ],\n },\n {\n transformFn: transformRESTImageToSDKImage,\n paths: [{ path: 'entity.businessDetails.logo' }],\n },\n ])\n )\n)<ReceiptCreatedEnvelope>();\nexport const onReceiptSent = EventDefinition(\n 'wix.receipts.v1.receipt_sent',\n true,\n (event: ReceiptSentEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'data.receipt.createdDate' },\n { path: 'data.receipt.updatedDate' },\n { path: 'data.receipt.payment.transactionDate' },\n { path: 'data.receipt.document.startGenerationTime' },\n { path: 'metadata.eventTime' },\n ],\n },\n {\n transformFn: transformRESTAddressToSDKAddress,\n paths: [\n { path: 'data.receipt.businessDetails.address' },\n { path: 'data.receipt.customer.billingAddress' },\n { path: 'data.receipt.customer.shippingAddress' },\n ],\n },\n {\n transformFn: transformRESTImageToSDKImage,\n paths: [{ path: 'data.receipt.businessDetails.logo' }],\n },\n ])\n )\n)<ReceiptSentEnvelope>();\nexport const onReceiptUpdated = EventDefinition(\n 'wix.receipts.v1.receipt_updated',\n true,\n (event: ReceiptUpdatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'entity.createdDate' },\n { path: 'entity.updatedDate' },\n { path: 'entity.payment.transactionDate' },\n { path: 'entity.document.startGenerationTime' },\n { path: 'metadata.eventTime' },\n { path: 'modifiedFields.createdDate' },\n { path: 'modifiedFields.updatedDate' },\n { path: 'modifiedFields.payment.transactionDate' },\n { path: 'modifiedFields.document.startGenerationTime' },\n ],\n },\n {\n transformFn: transformRESTAddressToSDKAddress,\n paths: [\n { path: 'entity.businessDetails.address' },\n { path: 'entity.customer.billingAddress' },\n { path: 'entity.customer.shippingAddress' },\n { path: 'modifiedFields.businessDetails.address' },\n { path: 'modifiedFields.customer.billingAddress' },\n { path: 'modifiedFields.customer.shippingAddress' },\n ],\n },\n {\n transformFn: transformRESTImageToSDKImage,\n paths: [\n { path: 'entity.businessDetails.logo' },\n { path: 'modifiedFields.businessDetails.logo' },\n ],\n },\n ])\n )\n)<ReceiptUpdatedEnvelope>();\n\nexport {\n ActionEvent,\n AdditionalFee,\n AdditionalFeeTax,\n Address,\n AddressLocation,\n AddressStreetOneOf,\n BaseEventMetadata,\n BusinessDetails,\n CreateReceiptRequest,\n CreateReceiptResponse,\n CursorPaging,\n CursorPagingMetadata,\n CursorQuery,\n CursorQueryPagingMethodOneOf,\n Cursors,\n CustomField,\n CustomFields,\n Customer,\n Discount,\n Document,\n DocumentStatus,\n DomainEvent,\n DomainEventBodyOneOf,\n Empty,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n ExtendedFields,\n Failed,\n FooterCustomField,\n FullAddressContactDetails,\n GenerateReceiptDocument,\n GetLatestReceiptNumberOptions,\n GetLatestReceiptNumberRequest,\n GetLatestReceiptNumberResponse,\n GetReceiptRequest,\n GetReceiptResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n LineItem,\n LineItemTax,\n LineItemTotals,\n Locale,\n MessageEnvelope,\n Numbering,\n Payment,\n QueryReceiptsRequest,\n QueryReceiptsResponse,\n Receipt,\n ReceiptCreatedEnvelope,\n ReceiptDocumentHandled,\n ReceiptDocumentHandledResultOneOf,\n ReceiptDocumentProcess,\n ReceiptNumberingProcess,\n ReceiptOrderType,\n ReceiptQuerySpec,\n ReceiptSentEnvelope,\n ReceiptUpdatedEnvelope,\n ReceiptsQueryBuilder,\n ReceiptsQueryResult,\n RegenerateReceiptDocumentRequest,\n RegenerateReceiptDocumentResponse,\n RegionalProperties,\n RequestOrigin,\n RestoreInfo,\n SendReceiptEmailOptions,\n SendReceiptEmailRequest,\n SendReceiptEmailResponse,\n Sent,\n ShippingAddressContactDetails,\n ShippingInfo,\n ShippingTax,\n SortOrder,\n Sorting,\n SourceReference,\n SourceReferenceOrderOneOf,\n StandardDetails,\n StreetAddress,\n Subdivision,\n SubdivisionType,\n Succeeded,\n Tax,\n Totals,\n UpdateExtendedFieldsOptions,\n UpdateExtendedFieldsRequest,\n UpdateExtendedFieldsResponse,\n UpdateReceiptRequest,\n UpdateReceiptResponse,\n VatId,\n VatType,\n WebhookIdentityType,\n WixEcom,\n WixPayment,\n} from './receipts-v1-receipt-receipts.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { queryBuilder } from '@wix/sdk-runtime/query-builder';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport {\n HttpClient,\n HttpResponse,\n NonNullablePaths,\n QuerySpec,\n Query as QuerySdkType,\n} from '@wix/sdk-types';\nimport * as ambassadorWixReceiptsV1Receipt from './receipts-v1-receipt-receipts.http.js';\n// @ts-ignore\nimport { transformSDKAddressToRESTAddress } from '@wix/sdk-runtime/transformations/address';\nimport { transformRESTAddressToSDKAddress } from '@wix/sdk-runtime/transformations/address';\nimport { transformSDKImageToRESTImage } from '@wix/sdk-runtime/transformations/image';\nimport { transformRESTImageToSDKImage } from '@wix/sdk-runtime/transformations/image';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\n\n/**\n * A receipt is a document that confirms a Wix user has received money or property as payment following a sale, transfer of goods, or provision of a service.\n * Read more about [receipts](https://support.wix.com/en/article/wix-receipts-adding-and-setting-up-your-receipts).\n */\nexport interface Receipt {\n /**\n * Receipt ID.\n * @format GUID\n * @readonly\n * @immutable\n */\n _id?: string | null;\n /**\n * Revision number, which increments by 1 each time the receipt is updated.\n * To prevent conflicting changes,\n * the current revision must be passed when updating the receipt.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the receipt was created.\n * @readonly\n * @immutable\n */\n _createdDate?: Date | null;\n /**\n * Date and time the receipt was last updated.\n * Relevant updates include receipt regeneratation and number allocation changes. Updates to financial information are not stored.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * Receipt numbering.\n * @readonly\n */\n numbering?: Numbering;\n /**\n * Regional properties pertaining to the receipt.\n * When regional properties are not provided, defaults are taken from the site's properties, available in the Site Properties API.\n * @immutable\n */\n regionalProperties?: RegionalProperties;\n /**\n * Currency code in [ISO-4217 alphabetic](https://www.iso.org/iso-4217-currency-codes.html) format.\n * @format CURRENCY\n */\n currency?: string;\n /**\n * Details about the associated Wix eCommerce or Wix Payments order.\n * @immutable\n */\n sourceReference?: SourceReference;\n /**\n * Business details.\n * When business properties are not provided, defaults are taken from the site's properties, available in the Site Properties API.\n */\n businessDetails?: BusinessDetails;\n /** Customer details. */\n customer?: Customer;\n /**\n * Line item details.\n * @minSize 1\n * @maxSize 300\n */\n lineItems?: LineItem[];\n /** Shipping info. */\n shippingInfo?: ShippingInfo;\n /**\n * Additional fees.\n * @maxSize 100\n */\n additionalFees?: AdditionalFee[];\n /**\n * Discounts.\n * @maxSize 320\n */\n discounts?: Discount[];\n /** Payment details. */\n payment?: Payment;\n /** Summaries of totals including tax, shipping, additional fees and discounts. */\n totals?: Totals;\n /**\n * Tax and taxable amounts breakdowns.\n * @maxSize 100\n */\n taxBreakdown?: Tax[];\n /** Indicates if there were exempt from tax. */\n taxExempt?: boolean | null;\n /**\n * Receipt preset ID.\n * Defaults to the default receipt preset ID, available with Get Default Receipt Preset ID.\n * @format GUID\n */\n presetId?: string | null;\n /**\n * Custom fields for this receipt.\n * Values appear on the receipt in the specified order.\n */\n customFields?: CustomFields;\n /**\n * Document details.\n * @readonly\n */\n document?: Document;\n /**\n * Custom field data for the receipt.\n * Extended fields must be configured in the app dashboard before they can be accessed with API calls.\n */\n extendedFields?: ExtendedFields;\n}\n\nexport interface Numbering {\n /** Receipt number. */\n number?: number | null;\n /**\n * Receipt prefix that will be displayed before the receipt number.\n * @minLength 1\n * @maxLength 10\n */\n prefix?: string | null;\n /**\n * Receipt suffix that will be displayed after the receipt number.\n * @minLength 1\n * @maxLength 10\n */\n suffix?: string | null;\n /**\n * Full receipt display number, in [prefix][number][suffix] format.\n * @readonly\n * @maxLength 30\n */\n displayNumber?: string;\n}\n\nexport interface RegionalProperties {\n /** Locale. Determines formating of numbers, dates and times. */\n locale?: Locale;\n /**\n * Time zone. Determines offset of dates and times.\n * @maxLength 32\n */\n timeZone?: string | null;\n /**\n * Receipt language. Determines the language of receipt static content (i.e. field and column titles). If not provided, defaults to locale's language.\n * Two-letter language code in [ISO-639-1 alpha-2](https://en.wikipedia.org/wiki/ISO_639-1) format.\n * @format LANGUAGE\n */\n language?: string | null;\n}\n\nexport interface Locale {\n /**\n * Two-letter language code in [ISO-639-1 alpha-2](https://en.wikipedia.org/wiki/ISO_639-1) format.\n * For example: `en`, `de`, `ja`.\n * @format LANGUAGE\n */\n languageCode?: string;\n /**\n * Two-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#officially_assigned_code_elements) format.\n * For example: `US`, `DE`, `JP`.\n * @format COUNTRY\n */\n country?: string | null;\n}\n\nexport interface SourceReference extends SourceReferenceOrderOneOf {\n /**\n * Wix Payments order.\n * @immutable\n */\n wixPaymentOrder?: WixPayment;\n /**\n * Wix eCommerce order.\n * @immutable\n */\n wixEcomOrder?: WixEcom;\n /**\n * ID of the app that generated the receipt.\n * @format GUID\n * @immutable\n */\n appId?: string;\n /**\n * External reference ID.\n * For example: Wix eCommerce `orderId`, Wix Events `eventId`.\n * @format GUID\n * @immutable\n */\n externalReferenceId?: string;\n /**\n * Order type.\n * @immutable\n */\n receiptOrderType?: ReceiptOrderTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface SourceReferenceOrderOneOf {\n /**\n * Wix Payments order.\n * @immutable\n */\n wixPaymentOrder?: WixPayment;\n /**\n * Wix eCommerce order.\n * @immutable\n */\n wixEcomOrder?: WixEcom;\n}\n\nexport enum ReceiptOrderType {\n UNKNOWN_ORDER_TYPE = 'UNKNOWN_ORDER_TYPE',\n WIX_PAYMENT = 'WIX_PAYMENT',\n WIX_ECOM = 'WIX_ECOM',\n}\n\n/** @enumType */\nexport type ReceiptOrderTypeWithLiterals =\n | ReceiptOrderType\n | 'UNKNOWN_ORDER_TYPE'\n | 'WIX_PAYMENT'\n | 'WIX_ECOM';\n\nexport interface WixPayment {\n /**\n * Wix Payments order ID.\n * @format GUID\n * @immutable\n */\n orderId?: string;\n /**\n * Wix Payments transaction ID.\n * @format GUID\n * @immutable\n */\n transactionId?: string;\n}\n\nexport interface WixEcom {\n /**\n * Wix eCommerce order ID.\n * @format GUID\n * @immutable\n */\n orderId?: string;\n /**\n * Wix eCommerce transaction ID.\n * @format GUID\n * @immutable\n */\n transactionId?: string;\n}\n\nexport interface BusinessDetails {\n /**\n * Business name.\n * @maxLength 60\n * @immutable\n */\n name?: string | null;\n /**\n * Business email.\n * @format EMAIL\n * @immutable\n */\n email?: string | null;\n /**\n * Business phone.\n * @format PHONE\n * @immutable\n */\n phone?: string | null;\n /**\n * Business address.\n * @immutable\n */\n address?: Address;\n /**\n * Business logo.\n * @immutable\n */\n logo?: string;\n}\n\n/** Physical address */\nexport interface Address extends AddressStreetOneOf {\n /** Street name and number. */\n streetAddress?: StreetAddress;\n /** Main address line, usually street and number as free text. */\n addressLine1?: string | null;\n /**\n * Country code.\n * @format COUNTRY\n */\n country?: string | null;\n /** Subdivision shorthand. Usually, a short code (2 or 3 letters) that represents a state, region, prefecture, or province. e.g. NY */\n subdivision?: string | null;\n /** City name. */\n city?: string | null;\n /** Zip/postal code. */\n postalCode?: string | null;\n /** Free text providing more detailed address info. Usually contains Apt, Suite, and Floor. */\n addressLine2?: string | null;\n}\n\n/** @oneof */\nexport interface AddressStreetOneOf {\n /** Street name and number. */\n streetAddress?: StreetAddress;\n /** Main address line, usually street and number as free text. */\n addressLine?: string | null;\n}\n\nexport interface StreetAddress {\n /** Street number. */\n number?: string;\n /** Street name. */\n name?: string;\n /** Apartment number. */\n apt?: string;\n}\n\nexport interface AddressLocation {\n /** Address latitude. */\n latitude?: number | null;\n /** Address longitude. */\n longitude?: number | null;\n}\n\nexport interface Subdivision {\n /** Short subdivision code. */\n code?: string;\n /** Subdivision full name. */\n name?: string;\n}\n\nexport enum SubdivisionType {\n UNKNOWN_SUBDIVISION_TYPE = 'UNKNOWN_SUBDIVISION_TYPE',\n /** State */\n ADMINISTRATIVE_AREA_LEVEL_1 = 'ADMINISTRATIVE_AREA_LEVEL_1',\n /** County */\n ADMINISTRATIVE_AREA_LEVEL_2 = 'ADMINISTRATIVE_AREA_LEVEL_2',\n /** City/town */\n ADMINISTRATIVE_AREA_LEVEL_3 = 'ADMINISTRATIVE_AREA_LEVEL_3',\n /** Neighborhood/quarter */\n ADMINISTRATIVE_AREA_LEVEL_4 = 'ADMINISTRATIVE_AREA_LEVEL_4',\n /** Street/block */\n ADMINISTRATIVE_AREA_LEVEL_5 = 'ADMINISTRATIVE_AREA_LEVEL_5',\n /** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */\n COUNTRY = 'COUNTRY',\n}\n\n/** @enumType */\nexport type SubdivisionTypeWithLiterals =\n | SubdivisionType\n | 'UNKNOWN_SUBDIVISION_TYPE'\n | 'ADMINISTRATIVE_AREA_LEVEL_1'\n | 'ADMINISTRATIVE_AREA_LEVEL_2'\n | 'ADMINISTRATIVE_AREA_LEVEL_3'\n | 'ADMINISTRATIVE_AREA_LEVEL_4'\n | 'ADMINISTRATIVE_AREA_LEVEL_5'\n | 'COUNTRY';\n\n/** Subdivision Concordance values */\nexport interface StandardDetails {\n /**\n * subdivision iso-3166-2 code according to [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2). e.g. US-NY, GB-SCT, NO-30\n * @maxLength 20\n */\n iso31662?: string | null;\n}\n\nexport interface Customer {\n /**\n * Customer's contact ID.\n * @format GUID\n */\n contactId?: string | null;\n /** Customer's contact details. */\n contactDetails?: FullAddressContactDetails;\n /** Customer's billing address. */\n billingAddress?: Address;\n /** Customer's shipping address. */\n shippingAddress?: Address;\n /** Shipping address contact details. Allows to have a separate contact details (name, email, etc.) for the shipping address. */\n shippingAddressContactDetails?: ShippingAddressContactDetails;\n}\n\n/** Full contact details for an address */\nexport interface FullAddressContactDetails {\n /** Contact's first name. */\n firstName?: string | null;\n /** Contact's last name. */\n lastName?: string | null;\n /** Contact's phone number. */\n phone?: string | null;\n /** Contact's company name. */\n company?: string | null;\n /** Email associated with the address. */\n email?: string | null;\n /** Tax info. Currently usable only in Brazil. */\n vatId?: VatId;\n}\n\nexport interface VatId {\n /** Customer's tax ID. */\n _id?: string;\n /**\n * Tax type.\n *\n * Supported values:\n * + `CPF`: for individual tax payers\n * + `CNPJ`: for corporations\n */\n type?: VatTypeWithLiterals;\n}\n\n/** tax info types */\nexport enum VatType {\n UNSPECIFIED = 'UNSPECIFIED',\n /** CPF - for individual tax payers. */\n CPF = 'CPF',\n /** CNPJ - for corporations */\n CNPJ = 'CNPJ',\n}\n\n/** @enumType */\nexport type VatTypeWithLiterals = VatType | 'UNSPECIFIED' | 'CPF' | 'CNPJ';\n\n/** Shipping contact details for an address */\nexport interface ShippingAddressContactDetails {\n /** Contact's first name. */\n firstName?: string | null;\n /** Contact's last name. */\n lastName?: string | null;\n /** Contact's phone number. */\n phone?: string | null;\n /** Contact's company name. */\n company?: string | null;\n /** Email associated with the address. */\n email?: string | null;\n}\n\nexport interface LineItem {\n /**\n * Line item ID.\n * @format GUID\n */\n _id?: string | null;\n /**\n * Line item name.\n * @maxLength 400\n */\n name?: string | null;\n /**\n * Line item description.\n * @maxLength 600\n */\n description?: string | null;\n /**\n * Line item quantity.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:100000, maxScale:15 }\n */\n quantity?: string | null;\n /**\n * Line item unit price per unit after discounts.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:-1000000000000000, lte:1000000000000000, maxScale:4 }\n */\n price?: string | null;\n /**\n * Line item price per unit before discounts.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:-1000000000000000, lte:1000000000000000, maxScale:4 }\n */\n priceBeforeDiscounts?: string | null;\n /**\n * Line item tax breakdown.\n * @maxSize 7\n */\n taxBreakdown?: LineItemTax[];\n /** Line item totals. */\n totals?: LineItemTotals;\n}\n\nexport interface LineItemTax {\n /**\n * Tax name.\n * @maxLength 200\n */\n taxName?: string;\n /**\n * Tax rate percentage.\n * For example: 0.1000 means 10% tax, and 2.1000 means 210% tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, maxScale:6 }\n */\n taxRate?: string;\n /**\n * Amount of the line item price that is taxable.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n taxableAmount?: string;\n /**\n * Amount of tax calculated for this line item.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n taxAmount?: string;\n /**\n * Exempt amount from tax calculated for this line item.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n exemptAmount?: string | null;\n}\n\nexport interface LineItemTotals {\n /**\n * Line item total discount.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n totalDiscount?: string | null;\n /**\n * Line item total price after discounts and before taxes.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:-1000000000000000, lte:1000000000000000, maxScale:4 }\n */\n totalPriceBeforeTax?: string | null;\n /**\n * Line item total applied tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n totalTax?: string | null;\n /**\n * Line item total price after taxes and discounts.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:-1000000000000000, lte:1000000000000000, maxScale:4 }\n */\n totalPriceAfterTax?: string | null;\n /**\n * Line item total price that was exempt from tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n totalExemptAmount?: string | null;\n}\n\nexport interface ShippingInfo {\n /**\n * Shipping title.\n * @maxLength 250\n */\n title?: string;\n /**\n * Shipping amount after discounts (when relevant), and before tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n priceBeforeTax?: string;\n /**\n * Shipping price after all discounts (if any exist), and after tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n priceAfterTax?: string;\n /**\n * Shipping tax breakdown.\n * @maxSize 10\n */\n taxBreakdown?: ShippingTax[];\n /**\n * Shipping price that was exempt from tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n exemptAmount?: string | null;\n}\n\nexport interface ShippingTax {\n /**\n * Tax name.\n * @maxLength 200\n */\n name?: string;\n /**\n * Tax rate percentage.\n * Example: 0.1000 signifies 10% tax and 2.1000 signifies 210% tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, maxScale:6 }\n */\n rate?: string;\n /**\n * Tax amount.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n amount?: string;\n /**\n * Exempt amount from tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n exemptAmount?: string | null;\n}\n\nexport interface AdditionalFee {\n /**\n * Additional fee name.\n * @minLength 1\n * @maxLength 50\n */\n name?: string;\n /**\n * Additional fee price before taxes.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n priceBeforeTax?: string;\n /**\n * Additional fee amount after taxes.\n * If no taxes apply to this fee, this will be the same as `priceBeforeTax`.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n priceAfterTax?: string;\n /**\n * Additional fee tax breakdown.\n * @maxSize 10\n */\n taxBreakdown?: AdditionalFeeTax[];\n /**\n * Additional fee price that was exempt from tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n exemptAmount?: string | null;\n}\n\nexport interface AdditionalFeeTax {\n /**\n * Tax name.\n * @maxLength 200\n */\n name?: string;\n /**\n * Tax rate.\n * Example: 0.1000 signifies 10% tax and 2.1000 signifies 210% tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, maxScale:6 }\n */\n rate?: string;\n /**\n * Tax amount.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n amount?: string;\n /**\n * Exempt amount from tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n exemptAmount?: string | null;\n}\n\nexport interface Discount {\n /**\n * Deprecated: Use `display_name` instead.\n * @maxLength 400\n * @deprecated Deprecated: Use `display_name` instead.\n * @replacedBy display_name\n * @targetRemovalDate 2025-06-01\n */\n name?: string;\n /**\n * Discount amount.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n amount?: string;\n /**\n * Discount name.\n * @minLength 1\n * @maxLength 400\n */\n displayName?: string | null;\n}\n\nexport interface Payment {\n /**\n * Payment method.\n * @maxLength 200\n */\n paymentMethod?: string;\n /**\n * Payment details.\n * @maxLength 200\n */\n paymentMethodDetails?: string | null;\n /**\n * Payment amount.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n amount?: string;\n /** Payment transaction date. */\n transactionDate?: Date | null;\n}\n\nexport interface Totals {\n /**\n * Subtotal of all line items, before discounts and before taxes.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n subtotal?: string | null;\n /**\n * Shipping price, before discounts and tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n shipping?: string | null;\n /**\n * Discount amount.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n discount?: string | null;\n /**\n * Additional fee amount, before discounts and tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n additionalFees?: string | null;\n /**\n * Tax amount.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n tax?: string | null;\n /**\n * Total amount after all calculations. Equates to: subtotal - discounts + taxes + shipping + additional_fees.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n total?: string | null;\n /**\n * Total amount that was exempt from tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n exempt?: string | null;\n}\n\nexport interface Tax {\n /**\n * Tax name.\n * @maxLength 200\n */\n name?: string;\n /**\n * Tax rate percentage, as a positive decimal numeral. For example, \"0.13\".\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, maxScale:6 }\n */\n rate?: string;\n /**\n * Tax amount.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n taxAmount?: string;\n /**\n * Taxable amount this tax applies to.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n taxableAmount?: string;\n /**\n * Exempt amount from tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n exemptAmount?: string | null;\n}\n\nexport interface CustomFields {\n /**\n * Header custom fields.\n * @maxSize 4\n */\n headerCustomFields?: CustomField[];\n /**\n * Business custom fields.\n * @maxSize 4\n */\n businessCustomFields?: CustomField[];\n /**\n * Customer custom fields.\n * @maxSize 4\n */\n customerCustomFields?: CustomField[];\n /**\n * Footer custom fields.\n * @maxSize 4\n */\n footerCustomFields?: FooterCustomField[];\n}\n\nexport interface CustomField {\n /**\n * Title.\n * @minLength 1\n * @maxLength 100\n */\n title?: string | null;\n /**\n * Value.\n * @maxLength 100\n */\n value?: string;\n}\n\nexport interface FooterCustomField {\n /**\n * Title.\n * @minLength 1\n * @maxLength 200\n */\n title?: string;\n /**\n * Value.\n * @maxLength 5000\n */\n value?: string | null;\n}\n\nexport interface Document {\n /** Document status. */\n status?: DocumentStatusWithLiterals;\n /**\n * Document download URL.\n * @format WEB_URL\n */\n downloadUrl?: string | null;\n /** Document start generation time. */\n startGenerationTime?: Date | null;\n}\n\nexport enum DocumentStatus {\n /** Generation status is unknown. */\n UNKNOWN_DOCUMENT_STATUS = 'UNKNOWN_DOCUMENT_STATUS',\n /** Generation is in progress. Call Get Receipt after 6-10 seconds to check the updated status. */\n PROCESSING = 'PROCESSING',\n /** Generation was successful. You can downloaded the document using the `downloadUrl`. */\n AVAILABLE = 'AVAILABLE',\n /** Generation has failed. You can retrigger document generation by calling Regenerate Receipt Document. */\n FAILED = 'FAILED',\n}\n\n/** @enumType */\nexport type DocumentStatusWithLiterals =\n | DocumentStatus\n | 'UNKNOWN_DOCUMENT_STATUS'\n | 'PROCESSING'\n | 'AVAILABLE'\n | 'FAILED';\n\nexport interface ExtendedFields {\n /**\n * Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\n * The value of each key is structured according to the schema defined when the extended fields were configured.\n *\n * You can only access fields for which you have the appropriate permissions.\n *\n * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).\n */\n namespaces?: Record<string, Record<string, any>>;\n}\n\nexport interface Sent {\n /** Receipt that was sent. */\n receipt?: Receipt;\n /** Receipt was sent in automatic or manual flow. */\n automatic?: boolean;\n}\n\nexport interface UpdateReceiptRequest {\n /** Receipt. */\n receipt?: Receipt;\n}\n\nexport interface UpdateReceiptResponse {\n /** Receipt. */\n receipt?: Receipt;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface ReceiptDocumentProcess {\n /**\n * Receipt Id.\n * @format GUID\n */\n receiptId?: string;\n /**\n * Media Document Id.\n * @format GUID\n */\n documentId?: string;\n /**\n * Existing File Id that will be deleted after the document is generated.\n * @maxLength 100\n */\n existingFileId?: string | null;\n}\n\nexport interface ReceiptNumberingProcess {\n /**\n * Receipt Id.\n * @format GUID\n */\n receiptId?: string;\n}\n\nexport interface ReceiptDocumentHandled\n extends ReceiptDocumentHandledResultOneOf {\n /** Populated only if receipt document handling has succeeded. */\n succeeded?: Succeeded;\n /** Populated only if receipt document handling has failed. */\n failed?: Failed;\n}\n\n/** @oneof */\nexport interface ReceiptDocumentHandledResultOneOf {\n /** Populated only if receipt document handling has succeeded. */\n succeeded?: Succeeded;\n /** Populated only if receipt document handling has failed. */\n failed?: Failed;\n}\n\nexport interface Succeeded {\n /**\n * Receipt Id.\n * @format GUID\n */\n receiptId?: string;\n /**\n * Media file Id.\n * @maxLength 100\n */\n mediaFileId?: string;\n /**\n * Download URL.\n * @maxLength 200\n */\n downloadUrl?: string;\n}\n\nexport interface Failed {\n /**\n * Receipt Id.\n * @format GUID\n */\n receiptId?: string;\n}\n\nexport interface GenerateReceiptDocument {\n /**\n * Receipt Id.\n * @format GUID\n */\n receiptId?: string;\n /** Shows how request for document generation was made. */\n requestOrigin?: RequestOriginWithLiterals;\n}\n\nexport enum RequestOrigin {\n INITIAL = 'INITIAL',\n MANUAL = 'MANUAL',\n}\n\n/** @enumType */\nexport type RequestOriginWithLiterals = RequestOrigin | 'INITIAL' | 'MANUAL';\n\nexport interface CreateReceiptRequest {\n /** Receipt to create. */\n receipt: Receipt;\n}\n\nexport interface CreateReceiptResponse {\n /** Created receipt. */\n receipt?: Receipt;\n}\n\nexport interface GetReceiptRequest {\n /**\n * Receipt ID.\n * @format GUID\n */\n receiptId: string;\n}\n\nexport interface GetReceiptResponse {\n /** Requested receipt. */\n receipt?: Receipt;\n}\n\nexport interface QueryReceiptsRequest {\n /** Query options. */\n query?: CursorQuery;\n}\n\nexport interface CursorQuery extends CursorQueryPagingMethodOneOf {\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging;\n /**\n * Filter object in the following format:\n * `\"filter\" : {\n * \"fieldName1\": \"value1\",\n * \"fieldName2\":{\"$operator\":\"value2\"}\n * }`\n * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`\n */\n filter?: Record<string, any> | null;\n /**\n * Sort object in the following format:\n * `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]`\n * @maxSize 5\n */\n sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface CursorQueryPagingMethodOneOf {\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n /**\n * Name of the field to sort by.\n * @maxLength 512\n */\n fieldName?: string;\n /** Sort order. */\n order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return in the results.\n * @max 100\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface QueryReceiptsResponse {\n /** Requested receipts. */\n receipts?: Receipt[];\n /** Paging metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in the response. */\n count?: number | null;\n /** Cursor strings that point to the next page, previous page, or both. */\n cursors?: Cursors;\n /**\n * Whether there are more pages to retrieve following the current page.\n *\n * + `true`: Another page of results can be retrieved.\n * + `false`: This is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\n}\n\nexport interface RegenerateReceiptDocumentRequest {\n /**\n * Receipt ID.\n * @format GUID\n */\n receiptId: string;\n}\n\nexport interface RegenerateReceiptDocumentResponse {}\n\nexport interface SendReceiptEmailRequest {\n /**\n * Receipt ID to send.\n * @format GUID\n */\n receiptId: string;\n /**\n * Recipient contact ID.\n * @format GUID\n */\n contactId?: string | null;\n}\n\nexport interface SendReceiptEmailResponse {}\n\nexport interface GetLatestReceiptNumberRequest {\n /**\n * Receipt prefix to filter by.\n * @minLength 1\n * @maxLength 10\n */\n prefix?: string | null;\n}\n\nexport interface GetLatestReceiptNumberResponse {\n /** Receipt number. */\n number?: number | null;\n}\n\nexport interface UpdateExtendedFieldsRequest {\n /** ID of the entity to update. */\n _id: string;\n /** Identifier for the app whose extended fields are being updated. */\n namespace: string;\n /** Data to update. Structured according to the [schema](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields#json-schema-for-extended-fields) defined when the extended fields were configured. */\n namespaceData: Record<string, any> | null;\n}\n\nexport interface UpdateExtendedFieldsResponse {\n /** Updated receipt. */\n receipt?: Receipt;\n}\n\nexport interface Empty {}\n\n/** @docsIgnore */\nexport type CreateReceiptApplicationErrors =\n | {\n code?: 'APP_INSTALLATION_FAILED';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'NO_META_SITE';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'RECEIPT_PRESET_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n/** @docsIgnore */\nexport type RegenerateReceiptDocumentApplicationErrors = {\n code?: 'NOT_APPLICABLE_TO_REGENERATE';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type SendReceiptEmailApplicationErrors =\n | {\n code?: 'MISSING_CONTACT';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SEND_LIMIT_REACHED';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'NO_META_SITE';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'MISSING_DOCUMENT';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'MISSING_NUMBERING';\n description?: string;\n data?: Record<string, any>;\n };\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\nexport interface ReceiptCreatedEnvelope {\n entity: Receipt;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a receipt is created.\n * @permissionScope Manage Receipts\n * @permissionScopeId SCOPE.RECEIPTS.MANAGE\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionId RECEIPTS.RECEIPT_READ\n * @webhook\n * @eventType wix.receipts.v1.receipt_created\n * @slug created\n */\nexport declare function onReceiptCreated(\n handler: (event: ReceiptCreatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface ReceiptSentEnvelope {\n data: Sent;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a receipt is sent.\n * @permissionScope Manage Receipts\n * @permissionScopeId SCOPE.RECEIPTS.MANAGE\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionId RECEIPTS.RECEIPT_READ\n * @webhook\n * @eventType wix.receipts.v1.receipt_sent\n * @slug sent\n */\nexport declare function onReceiptSent(\n handler: (event: ReceiptSentEnvelope) => void | Promise<void>\n): void;\n\nexport interface ReceiptUpdatedEnvelope {\n entity: Receipt;\n metadata: EventMetadata;\n /** @hidden */\n modifiedFields: Record<string, any>;\n}\n\n/**\n * Triggered when a receipt's number allocation is updated or a receipt document is generated.\n * @permissionScope Manage Receipts\n * @permissionScopeId SCOPE.RECEIPTS.MANAGE\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionId RECEIPTS.RECEIPT_READ\n * @webhook\n * @eventType wix.receipts.v1.receipt_updated\n * @slug updated\n */\nexport declare function onReceiptUpdated(\n handler: (event: ReceiptUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Creates a receipt.\n *\n * Receipt number is assigned later and will be provided in the Get Receipt response.\n * @param receipt - Receipt to create.\n * @public\n * @requiredField receipt\n * @requiredField receipt.currency\n * @requiredField receipt.lineItems\n * @requiredField receipt.lineItems._id\n * @requiredField receipt.lineItems.price\n * @requiredField receipt.lineItems.quantity\n * @requiredField receipt.lineItems.totals\n * @requiredField receipt.lineItems.totals.totalPriceBeforeTax\n * @requiredField receipt.payment\n * @requiredField receipt.payment.amount\n * @requiredField receipt.payment.paymentMethod\n * @requiredField receipt.payment.transactionDate\n * @requiredField receipt.sourceReference\n * @requiredField receipt.sourceReference.appId\n * @requiredField receipt.sourceReference.externalReferenceId\n * @requiredField receipt.sourceReference.order.wixEcomOrder.orderId\n * @requiredField receipt.sourceReference.order.wixEcomOrder.transactionId\n * @requiredField receipt.sourceReference.order.wixPaymentOrder.orderId\n * @requiredField receipt.sourceReference.order.wixPaymentOrder.transactionId\n * @requiredField receipt.sourceReference.receiptOrderType\n * @requiredField receipt.totals\n * @requiredField receipt.totals.subtotal\n * @requiredField receipt.totals.total\n * @permissionId RECEIPTS.RECEIPT_CREATE\n * @applicableIdentity APP\n * @returns Created receipt.\n * @fqn wix.receipts.v1.Receipts.CreateReceipt\n */\nexport async function createReceipt(\n receipt: NonNullablePaths<\n Receipt,\n | `currency`\n | `lineItems`\n | `lineItems.${number}._id`\n | `lineItems.${number}.price`\n | `lineItems.${number}.quantity`\n | `lineItems.${number}.totals`\n | `lineItems.${number}.totals.totalPriceBeforeTax`\n | `payment`\n | `payment.amount`\n | `payment.paymentMethod`\n | `payment.transactionDate`\n | `sourceReference`\n | `sourceReference.appId`\n | `sourceReference.externalReferenceId`\n | `sourceReference.receiptOrderType`\n | `sourceReference.wixEcomOrder.orderId`\n | `sourceReference.wixEcomOrder.transactionId`\n | `sourceReference.wixPaymentOrder.orderId`\n | `sourceReference.wixPaymentOrder.transactionId`\n | `totals`\n | `totals.subtotal`\n | `totals.total`,\n 5\n >\n): Promise<\n NonNullablePaths<\n Receipt,\n | `numbering.displayNumber`\n | `regionalProperties.locale.languageCode`\n | `currency`\n | `sourceReference.wixPaymentOrder.orderId`\n | `sourceReference.wixPaymentOrder.transactionId`\n | `sourceReference.wixEcomOrder.orderId`\n | `sourceReference.wixEcomOrder.transactionId`\n | `sourceReference.appId`\n | `sourceReference.externalReferenceId`\n | `sourceReference.receiptOrderType`\n | `businessDetails.address.streetAddress.number`\n | `businessDetails.address.streetAddress.name`\n | `businessDetails.address.streetAddress.apt`\n | `customer.contactDetails.vatId._id`\n | `customer.contactDetails.vatId.type`\n | `lineItems`\n | `shippingInfo.title`\n | `shippingInfo.priceBeforeTax`\n | `shippingInfo.priceAfterTax`\n | `shippingInfo.taxBreakdown`\n | `shippingInfo.taxBreakdown.${number}.name`\n | `shippingInfo.taxBreakdown.${number}.rate`\n | `shippingInfo.taxBreakdown.${number}.amount`\n | `additionalFees`\n | `additionalFees.${number}.name`\n | `additionalFees.${number}.priceBeforeTax`\n | `additionalFees.${number}.priceAfterTax`\n | `discounts`\n | `discounts.${number}.name`\n | `discounts.${number}.amount`\n | `payment.paymentMethod`\n | `payment.amount`\n | `taxBreakdown`\n | `taxBreakdown.${number}.name`\n | `taxBreakdown.${number}.rate`\n | `taxBreakdown.${number}.taxAmount`\n | `taxBreakdown.${number}.taxableAmount`\n | `customFields.headerCustomFields`\n | `customFields.headerCustomFields.${number}.value`\n | `customFields.businessCustomFields`\n | `customFields.customerCustomFields`\n | `customFields.footerCustomFields`\n | `customFields.footerCustomFields.${number}.title`\n | `document.status`,\n 5\n > & {\n __applicationErrorsType?: CreateReceiptApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = transformPaths(\n renameKeysFromSDKRequestToRESTRequest({ receipt: receipt }),\n [\n {\n transformFn: transformSDKAddressToRESTAddress,\n paths: [\n { path: 'receipt.businessDetails.address' },\n { path: 'receipt.customer.billingAddress' },\n { path: 'receipt.customer.shippingAddress' },\n ],\n },\n {\n transformFn: transformSDKImageToRESTImage,\n paths: [{ path: 'receipt.businessDetails.logo' }],\n },\n ]\n );\n\n const reqOpts = ambassadorWixReceiptsV1Receipt.createReceipt(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(\n transformPaths(result.data, [\n {\n transformFn: transformRESTAddressToSDKAddress,\n paths: [\n { path: 'receipt.businessDetails.address' },\n { path: 'receipt.customer.billingAddress' },\n { path: 'receipt.customer.shippingAddress' },\n ],\n },\n {\n transformFn: transformRESTImageToSDKImage,\n paths: [{ path: 'receipt.businessDetails.logo' }],\n },\n ])\n )?.receipt!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { receipt: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['receipt']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a receipt.\n * @param receiptId - Receipt ID.\n * @public\n * @requiredField receiptId\n * @permissionId RECEIPTS.RECEIPT_READ\n * @applicableIdentity APP\n * @returns Requested receipt.\n * @fqn wix.receipts.v1.Receipts.GetReceipt\n */\nexport async function getReceipt(\n receiptId: string\n): Promise<\n NonNullablePaths<\n Receipt,\n | `numbering.displayNumber`\n | `regionalProperties.locale.languageCode`\n | `currency`\n | `sourceReference.wixPaymentOrder.orderId`\n | `sourceReference.wixPaymentOrder.transactionId`\n | `sourceReference.wixEcomOrder.orderId`\n | `sourceReference.wixEcomOrder.transactionId`\n | `sourceReference.appId`\n | `sourceReference.externalReferenceId`\n | `sourceReference.receiptOrderType`\n | `businessDetails.address.streetAddress.number`\n | `businessDetails.address.streetAddress.name`\n | `businessDetails.address.streetAddress.apt`\n | `customer.contactDetails.vatId._id`\n | `customer.contactDetails.vatId.type`\n | `lineItems`\n | `shippingInfo.title`\n | `shippingInfo.priceBeforeTax`\n | `shippingInfo.priceAfterTax`\n | `shippingInfo.taxBreakdown`\n | `shippingInfo.taxBreakdown.${number}.name`\n | `shippingInfo.taxBreakdown.${number}.rate`\n | `shippingInfo.taxBreakdown.${number}.amount`\n | `additionalFees`\n | `additionalFees.${number}.name`\n | `additionalFees.${number}.priceBeforeTax`\n | `additionalFees.${number}.priceAfterTax`\n | `discounts`\n | `discounts.${number}.name`\n | `discounts.${number}.amount`\n | `payment.paymentMethod`\n | `payment.amount`\n | `taxBreakdown`\n | `taxBreakdown.${number}.name`\n | `taxBreakdown.${number}.rate`\n | `taxBreakdown.${number}.taxAmount`\n | `taxBreakdown.${number}.taxableAmount`\n | `customFields.headerCustomFields`\n | `customFields.headerCustomFields.${number}.value`\n | `customFields.businessCustomFields`\n | `customFields.customerCustomFields`\n | `customFields.footerCustomFields`\n | `customFields.footerCustomFields.${number}.title`\n | `document.status`,\n 5\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n receiptId: receiptId,\n });\n\n const reqOpts = ambassadorWixReceiptsV1Receipt.getReceipt(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(\n transformPaths(result.data, [\n {\n transformFn: transformRESTAddressToSDKAddress,\n paths: [\n { path: 'receipt.businessDetails.address' },\n { path: 'receipt.customer.billingAddress' },\n { path: 'receipt.customer.shippingAddress' },\n ],\n },\n {\n transformFn: transformRESTImageToSDKImage,\n paths: [{ path: 'receipt.businessDetails.logo' }],\n },\n ])\n )?.receipt!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { receiptId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['receiptId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a list of up to 100 receipts, given the specified filtering, paging, and sorting ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/api-query-language) | [REST](https://dev.wix.com/api/rest/getting-started/api-query-language)).\n * @public\n * @permissionId RECEIPTS.RECEIPT_READ\n * @applicableIdentity APP\n * @fqn wix.receipts.v1.Receipts.QueryReceipts\n */\nexport function queryReceipts(): ReceiptsQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<\n Receipt,\n 'CURSOR',\n QueryReceiptsRequest,\n QueryReceiptsResponse\n >({\n func: async (payload: QueryReceiptsRequest) => {\n const reqOpts = ambassadorWixReceiptsV1Receipt.queryReceipts(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n return result;\n } catch (err) {\n sideEffects?.onError?.(err);\n throw err;\n }\n },\n requestTransformer: (query: QueryReceiptsRequest['query']) => {\n const args = [query, {}] as [QueryReceiptsRequest['query'], {}];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryReceiptsResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [\n {\n transformFn: transformRESTAddressToSDKAddress,\n paths: [\n { path: 'receipts.businessDetails.address' },\n { path: 'receipts.customer.billingAddress' },\n { path: 'receipts.customer.shippingAddress' },\n ],\n },\n {\n transformFn: transformRESTImageToSDKImage,\n paths: [{ path: 'receipts.businessDetails.logo' }],\n },\n ])\n );\n\n return {\n items: transformedData?.receipts,\n pagingMetadata: transformedData?.pagingMetadata,\n };\n },\n errorTransformer: (err: unknown) => {\n const transformedError = sdkTransformError(err, {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n });\n\n throw transformedError;\n },\n pagingMethod: 'CURSOR',\n transformationPaths: {},\n });\n}\n\ninterface QueryCursorResult {\n cursors: Cursors;\n hasNext: () => boolean;\n hasPrev: () => boolean;\n length: number;\n pageSize: number;\n}\n\nexport interface ReceiptsQueryResult extends QueryCursorResult {\n items: Receipt[];\n query: ReceiptsQueryBuilder;\n next: () => Promise<ReceiptsQueryResult>;\n prev: () => Promise<ReceiptsQueryResult>;\n}\n\nexport interface ReceiptsQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n eq: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'numbering.number'\n | 'numbering.prefix'\n | 'numbering.suffix'\n | 'sourceReference.wixPaymentOrder.transactionId'\n | 'sourceReference.wixEcomOrder.transactionId'\n | 'sourceReference.appId'\n | 'sourceReference.externalReferenceId',\n value: any\n ) => ReceiptsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ne: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'numbering.number'\n | 'numbering.prefix'\n | 'numbering.suffix'\n | 'sourceReference.wixPaymentOrder.transactionId'\n | 'sourceReference.wixEcomOrder.transactionId'\n | 'sourceReference.appId'\n | 'sourceReference.externalReferenceId',\n value: any\n ) => ReceiptsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ge: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'numbering.number'\n | 'numbering.prefix'\n | 'numbering.suffix'\n | 'sourceReference.wixPaymentOrder.transactionId'\n | 'sourceReference.wixEcomOrder.transactionId'\n | 'sourceReference.appId'\n | 'sourceReference.externalReferenceId',\n value: any\n ) => ReceiptsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n gt: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'numbering.number'\n | 'numbering.prefix'\n | 'numbering.suffix'\n | 'sourceReference.wixPaymentOrder.transactionId'\n | 'sourceReference.wixEcomOrder.transactionId'\n | 'sourceReference.appId'\n | 'sourceReference.externalReferenceId',\n value: any\n ) => ReceiptsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n le: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'numbering.number'\n | 'numbering.prefix'\n | 'numbering.suffix'\n | 'sourceReference.wixPaymentOrder.transactionId'\n | 'sourceReference.wixEcomOrder.transactionId'\n | 'sourceReference.appId'\n | 'sourceReference.externalReferenceId',\n value: any\n ) => ReceiptsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n lt: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'numbering.number'\n | 'numbering.prefix'\n | 'numbering.suffix'\n | 'sourceReference.wixPaymentOrder.transactionId'\n | 'sourceReference.wixEcomOrder.transactionId'\n | 'sourceReference.appId'\n | 'sourceReference.externalReferenceId',\n value: any\n ) => ReceiptsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `string`.\n * @param string - String to compare against. Case-insensitive.\n */\n startsWith: (\n propertyName:\n | '_id'\n | 'numbering.prefix'\n | 'numbering.suffix'\n | 'sourceReference.wixPaymentOrder.transactionId'\n | 'sourceReference.wixEcomOrder.transactionId'\n | 'sourceReference.appId'\n | 'sourceReference.externalReferenceId',\n value: string\n ) => ReceiptsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `values`.\n * @param values - List of values to compare against.\n */\n hasSome: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'numbering.number'\n | 'numbering.prefix'\n | 'numbering.suffix'\n | 'sourceReference.wixPaymentOrder.transactionId'\n | 'sourceReference.wixEcomOrder.transactionId'\n | 'sourceReference.appId'\n | 'sourceReference.externalReferenceId',\n value: any[]\n ) => ReceiptsQueryBuilder;\n in: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'numbering.number'\n | 'numbering.prefix'\n | 'numbering.suffix'\n | 'sourceReference.wixPaymentOrder.transactionId'\n | 'sourceReference.wixEcomOrder.transactionId'\n | 'sourceReference.appId'\n | 'sourceReference.externalReferenceId',\n value: any\n ) => ReceiptsQueryBuilder;\n exists: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'numbering.number'\n | 'numbering.prefix'\n | 'numbering.suffix'\n | 'sourceReference.wixPaymentOrder.transactionId'\n | 'sourceReference.wixEcomOrder.transactionId'\n | 'sourceReference.appId'\n | 'sourceReference.externalReferenceId',\n value: boolean\n ) => ReceiptsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n ascending: (\n ...propertyNames: Array<\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'numbering.number'\n | 'numbering.prefix'\n | 'numbering.suffix'\n | 'numbering.displayNumber'\n | 'sourceReference.wixPaymentOrder.transactionId'\n | 'sourceReference.wixEcomOrder.transactionId'\n | 'sourceReference.appId'\n | 'sourceReference.externalReferenceId'\n >\n ) => ReceiptsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n descending: (\n ...propertyNames: Array<\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'numbering.number'\n | 'numbering.prefix'\n | 'numbering.suffix'\n | 'numbering.displayNumber'\n | 'sourceReference.wixPaymentOrder.transactionId'\n | 'sourceReference.wixEcomOrder.transactionId'\n | 'sourceReference.appId'\n | 'sourceReference.externalReferenceId'\n >\n ) => ReceiptsQueryBuilder;\n /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */\n limit: (limit: number) => ReceiptsQueryBuilder;\n /** @param cursor - A pointer to specific record */\n skipTo: (cursor: string) => ReceiptsQueryBuilder;\n find: () => Promise<ReceiptsQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn wix.receipts.v1.Receipts.QueryReceipts\n * @requiredField query\n */\nexport async function typedQueryReceipts(\n query: ReceiptQuery\n): Promise<\n NonNullablePaths<\n QueryReceiptsResponse,\n | `receipts`\n | `receipts.${number}.numbering.displayNumber`\n | `receipts.${number}.regionalProperties.locale.languageCode`\n | `receipts.${number}.currency`\n | `receipts.${number}.sourceReference.wixPaymentOrder.orderId`\n | `receipts.${number}.sourceReference.wixPaymentOrder.transactionId`\n | `receipts.${number}.sourceReference.wixEcomOrder.orderId`\n | `receipts.${number}.sourceReference.wixEcomOrder.transactionId`\n | `receipts.${number}.sourceReference.appId`\n | `receipts.${number}.sourceReference.externalReferenceId`\n | `receipts.${number}.sourceReference.receiptOrderType`\n | `receipts.${number}.shippingInfo.title`\n | `receipts.${number}.shippingInfo.priceBeforeTax`\n | `receipts.${number}.shippingInfo.priceAfterTax`\n | `receipts.${number}.payment.paymentMethod`\n | `receipts.${number}.payment.amount`\n | `receipts.${number}.document.status`,\n 6\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ query: query });\n\n const reqOpts = ambassadorWixReceiptsV1Receipt.queryReceipts(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(\n transformPaths(result.data, [\n {\n transformFn: transformRESTAddressToSDKAddress,\n paths: [\n { path: 'receipts.businessDetails.address' },\n { path: 'receipts.customer.billingAddress' },\n { path: 'receipts.customer.shippingAddress' },\n ],\n },\n {\n transformFn: transformRESTImageToSDKImage,\n paths: [{ path: 'receipts.businessDetails.logo' }],\n },\n ])\n )!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['query']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ReceiptQuerySpec extends QuerySpec {\n paging: 'cursor';\n wql: [\n {\n fields: [\n '_createdDate',\n '_id',\n '_updatedDate',\n 'numbering.number',\n 'numbering.prefix',\n 'numbering.suffix',\n 'sourceReference.appId',\n 'sourceReference.externalReferenceId',\n 'sourceReference.wixEcomOrder.transactionId',\n 'sourceReference.wixPaymentOrder.transactionId'\n ];\n operators: '*';\n sort: 'BOTH';\n },\n {\n fields: ['numbering.displayNumber'];\n operators: [];\n sort: 'BOTH';\n }\n ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<\n Receipt,\n ReceiptQuerySpec\n>;\nexport type ReceiptQuery = {\n /** \n Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. \n */\n cursorPaging?: {\n /** \n Maximum number of items to return in the results. \n @max: 100 \n */\n limit?:\n | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['limit']\n | null;\n /** \n Pointer to the next or previous page in the list of results.\n\n Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n Not relevant for the first request. \n @maxLength: 16000 \n */\n cursor?:\n | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['cursor']\n | null;\n };\n /** \n Filter object in the following format:\n `\"filter\" : {\n \"fieldName1\": \"value1\",\n \"fieldName2\":{\"$operator\":\"value2\"}\n }`\n Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` \n */\n filter?: CommonQueryWithEntityContext['filter'] | null;\n /** \n Sort object in the following format:\n `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]` \n @maxSize: 5 \n */\n sort?: {\n /** \n Name of the field to sort by. \n @maxLength: 512 \n */\n fieldName?: NonNullable<\n CommonQueryWithEntityContext['sort']\n >[number]['fieldName'];\n /** \n Sort order. \n */\n order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];\n }[];\n};\n\n/**\n * Retries generating a receipt document that has a `FAILED` or stuck in `PROCESSING` status.\n *\n * Note that you can access a receipt document with an `AVAILABLE` status with the URL provided in `document.downloadUrl` without regenerating.\n * @param receiptId - Receipt ID.\n * @public\n * @requiredField receiptId\n * @permissionId RECEIPTS.RECEIPT_UPDATE\n * @applicableIdentity APP\n * @fqn wix.receipts.v1.Receipts.RegenerateReceiptDocument\n */\nexport async function regenerateReceiptDocument(receiptId: string): Promise<\n void & {\n __applicationErrorsType?: RegenerateReceiptDocumentApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n receiptId: receiptId,\n });\n\n const reqOpts =\n ambassadorWixReceiptsV1Receipt.regenerateReceiptDocument(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { receiptId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['receiptId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Sends the receipt to the specified recipient in an email.\n *\n * Specifying a contact ID is required only when no contact ID was specified upon receipt creation.\n *\n * Note that if the specified contact ID doesn't have an associated email address, the call will fail.\n * @param receiptId - Receipt ID to send.\n * @public\n * @requiredField receiptId\n * @param options - Field options. The `contactId` object must be passed if one was not already specified upon receipt creation.\n * @permissionId RECEIPTS.RECEIPT_SEND\n * @applicableIdentity APP\n * @fqn wix.receipts.v1.Receipts.SendReceiptEmail\n */\nexport async function sendReceiptEmail(\n receiptId: string,\n options?: SendReceiptEmailOptions\n): Promise<\n void & {\n __applicationErrorsType?: SendReceiptEmailApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n receiptId: receiptId,\n contactId: options?.contactId,\n });\n\n const reqOpts = ambassadorWixReceiptsV1Receipt.sendReceiptEmail(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n receiptId: '$[0]',\n contactId: '$[1].contactId',\n },\n singleArgumentUnchanged: false,\n },\n ['receiptId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface SendReceiptEmailOptions {\n /**\n * Recipient contact ID.\n * @format GUID\n */\n contactId?: string | null;\n}\n\n/**\n * Retrieves the highest receipt number currently in use (the sequential identifier displayed between the prefix and suffix in receipt display numbers).\n * Can be filtered by prefix.\n *\n * Receipt numbering is managed in the Receipts Settings API.\n * @public\n * @param options - Field options.\n * @permissionId RECEIPTS.RECEIPT_READ\n * @applicableIdentity APP\n * @fqn wix.receipts.v1.Receipts.GetLatestReceiptNumber\n */\nexport async function getLatestReceiptNumber(\n options?: GetLatestReceiptNumberOptions\n): Promise<GetLatestReceiptNumberResponse> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n prefix: options?.prefix,\n });\n\n const reqOpts =\n ambassadorWixReceiptsV1Receipt.getLatestReceiptNumber(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { prefix: '$[0].prefix' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetLatestReceiptNumberOptions {\n /**\n * Receipt prefix to filter by.\n * @minLength 1\n * @maxLength 10\n */\n prefix?: string | null;\n}\n\n/**\n * Updates extended fields of a receipt, without incrementing revision.\n * @param _id - ID of the entity to update.\n * @param namespace - Identifier for the app whose extended fields are being updated.\n * @public\n * @requiredField _id\n * @requiredField namespace\n * @requiredField options\n * @requiredField options.namespaceData\n * @param options - Field options. The `namespaceData` object **must** be passed.\n * @permissionId RECEIPTS.RECEIPT_UPDATE\n * @applicableIdentity APP\n * @fqn wix.receipts.v1.Receipts.UpdateExtendedFields\n */\nexport async function updateExtendedFields(\n _id: string,\n namespace: string,\n options: NonNullablePaths<UpdateExtendedFieldsOptions, `namespaceData`, 2>\n): Promise<\n NonNullablePaths<\n UpdateExtendedFieldsResponse,\n | `receipt.numbering.displayNumber`\n | `receipt.regionalProperties.locale.languageCode`\n | `receipt.currency`\n | `receipt.sourceReference.wixPaymentOrder.orderId`\n | `receipt.sourceReference.wixPaymentOrder.transactionId`\n | `receipt.sourceReference.wixEcomOrder.orderId`\n | `receipt.sourceReference.wixEcomOrder.transactionId`\n | `receipt.sourceReference.appId`\n | `receipt.sourceReference.externalReferenceId`\n | `receipt.sourceReference.receiptOrderType`\n | `receipt.businessDetails.address.streetAddress.number`\n | `receipt.businessDetails.address.streetAddress.name`\n | `receipt.businessDetails.address.streetAddress.apt`\n | `receipt.customer.contactDetails.vatId._id`\n | `receipt.customer.contactDetails.vatId.type`\n | `receipt.lineItems`\n | `receipt.shippingInfo.title`\n | `receipt.shippingInfo.priceBeforeTax`\n | `receipt.shippingInfo.priceAfterTax`\n | `receipt.shippingInfo.taxBreakdown`\n | `receipt.shippingInfo.taxBreakdown.${number}.name`\n | `receipt.shippingInfo.taxBreakdown.${number}.rate`\n | `receipt.shippingInfo.taxBreakdown.${number}.amount`\n | `receipt.additionalFees`\n | `receipt.additionalFees.${number}.name`\n | `receipt.additionalFees.${number}.priceBeforeTax`\n | `receipt.additionalFees.${number}.priceAfterTax`\n | `receipt.discounts`\n | `receipt.discounts.${number}.name`\n | `receipt.discounts.${number}.amount`\n | `receipt.payment.paymentMethod`\n | `receipt.payment.amount`\n | `receipt.taxBreakdown`\n | `receipt.taxBreakdown.${number}.name`\n | `receipt.taxBreakdown.${number}.rate`\n | `receipt.taxBreakdown.${number}.taxAmount`\n | `receipt.taxBreakdown.${number}.taxableAmount`\n | `receipt.customFields.headerCustomFields`\n | `receipt.customFields.headerCustomFields.${number}.value`\n | `receipt.customFields.businessCustomFields`\n | `receipt.customFields.customerCustomFields`\n | `receipt.customFields.footerCustomFields`\n | `receipt.customFields.footerCustomFields.${number}.title`\n | `receipt.document.status`,\n 6\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[3] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n id: _id,\n namespace: namespace,\n namespaceData: options?.namespaceData,\n });\n\n const reqOpts = ambassadorWixReceiptsV1Receipt.updateExtendedFields(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(\n transformPaths(result.data, [\n {\n transformFn: transformRESTAddressToSDKAddress,\n paths: [\n { path: 'receipt.businessDetails.address' },\n { path: 'receipt.customer.billingAddress' },\n { path: 'receipt.customer.shippingAddress' },\n ],\n },\n {\n transformFn: transformRESTImageToSDKImage,\n paths: [{ path: 'receipt.businessDetails.logo' }],\n },\n ])\n )!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n id: '$[0]',\n namespace: '$[1]',\n namespaceData: '$[2].namespaceData',\n },\n singleArgumentUnchanged: false,\n },\n ['_id', 'namespace', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateExtendedFieldsOptions {\n /** Data to update. Structured according to the [schema](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields#json-schema-for-extended-fields) defined when the extended fields were configured. */\n namespaceData: Record<string, any> | null;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformRESTFloatToSDKFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixReceiptsV1ReceiptsUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/receipts',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/receipts/v1/receipts',\n destPath: '/v1/receipts',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/receipts/v1/receipts',\n destPath: '/v1/receipts',\n },\n ],\n _: [\n {\n srcPath: '/receipts/v1/receipts',\n destPath: '/v1/receipts',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_get-paid_receipts';\n\n/**\n * Creates a receipt.\n *\n * Receipt number is assigned later and will be provided in the Get Receipt response.\n */\nexport function createReceipt(payload: object): RequestOptionsFactory<any> {\n function __createReceipt({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'receipt.createdDate' },\n { path: 'receipt.updatedDate' },\n { path: 'receipt.businessDetails.logo.urlExpirationDate' },\n { path: 'receipt.payment.transactionDate' },\n { path: 'receipt.document.startGenerationTime' },\n ],\n },\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'receipt.businessDetails.address.geocode.latitude' },\n { path: 'receipt.businessDetails.address.geocode.longitude' },\n { path: 'receipt.customer.billingAddress.geocode.latitude' },\n { path: 'receipt.customer.billingAddress.geocode.longitude' },\n { path: 'receipt.customer.shippingAddress.geocode.latitude' },\n { path: 'receipt.customer.shippingAddress.geocode.longitude' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.receipts.v1.receipt',\n method: 'POST' as any,\n methodFqn: 'wix.receipts.v1.Receipts.CreateReceipt',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixReceiptsV1ReceiptsUrl({\n protoPath: '/v1/receipts',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'receipt.createdDate' },\n { path: 'receipt.updatedDate' },\n { path: 'receipt.businessDetails.logo.urlExpirationDate' },\n { path: 'receipt.payment.transactionDate' },\n { path: 'receipt.document.startGenerationTime' },\n ],\n },\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'receipt.businessDetails.address.geocode.latitude' },\n { path: 'receipt.businessDetails.address.geocode.longitude' },\n { path: 'receipt.customer.billingAddress.geocode.latitude' },\n { path: 'receipt.customer.billingAddress.geocode.longitude' },\n { path: 'receipt.customer.shippingAddress.geocode.latitude' },\n { path: 'receipt.customer.shippingAddress.geocode.longitude' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createReceipt;\n}\n\n/** Retrieves a receipt. */\nexport function getReceipt(payload: object): RequestOptionsFactory<any> {\n function __getReceipt({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.receipts.v1.receipt',\n method: 'GET' as any,\n methodFqn: 'wix.receipts.v1.Receipts.GetReceipt',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixReceiptsV1ReceiptsUrl({\n protoPath: '/v1/receipts/{receiptId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'receipt.createdDate' },\n { path: 'receipt.updatedDate' },\n { path: 'receipt.businessDetails.logo.urlExpirationDate' },\n { path: 'receipt.payment.transactionDate' },\n { path: 'receipt.document.startGenerationTime' },\n ],\n },\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'receipt.businessDetails.address.geocode.latitude' },\n { path: 'receipt.businessDetails.address.geocode.longitude' },\n { path: 'receipt.customer.billingAddress.geocode.latitude' },\n { path: 'receipt.customer.billingAddress.geocode.longitude' },\n { path: 'receipt.customer.shippingAddress.geocode.latitude' },\n { path: 'receipt.customer.shippingAddress.geocode.longitude' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getReceipt;\n}\n\n/** Retrieves a list of up to 100 receipts, given the specified filtering, paging, and sorting ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/api-query-language) | [REST](https://dev.wix.com/api/rest/getting-started/api-query-language)). */\nexport function queryReceipts(payload: object): RequestOptionsFactory<any> {\n function __queryReceipts({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.receipts.v1.receipt',\n method: 'POST' as any,\n methodFqn: 'wix.receipts.v1.Receipts.QueryReceipts',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixReceiptsV1ReceiptsUrl({\n protoPath: '/v1/receipts/query',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'receipts.createdDate' },\n { path: 'receipts.updatedDate' },\n { path: 'receipts.businessDetails.logo.urlExpirationDate' },\n { path: 'receipts.payment.transactionDate' },\n { path: 'receipts.document.startGenerationTime' },\n ],\n },\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'receipts.businessDetails.address.geocode.latitude' },\n { path: 'receipts.businessDetails.address.geocode.longitude' },\n { path: 'receipts.customer.billingAddress.geocode.latitude' },\n { path: 'receipts.customer.billingAddress.geocode.longitude' },\n { path: 'receipts.customer.shippingAddress.geocode.latitude' },\n { path: 'receipts.customer.shippingAddress.geocode.longitude' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __queryReceipts;\n}\n\n/**\n * Retries generating a receipt document that has a `FAILED` or stuck in `PROCESSING` status.\n *\n * Note that you can access a receipt document with an `AVAILABLE` status with the URL provided in `document.downloadUrl` without regenerating.\n */\nexport function regenerateReceiptDocument(\n payload: object\n): RequestOptionsFactory<any> {\n function __regenerateReceiptDocument({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.receipts.v1.receipt',\n method: 'POST' as any,\n methodFqn: 'wix.receipts.v1.Receipts.RegenerateReceiptDocument',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixReceiptsV1ReceiptsUrl({\n protoPath: '/v1/receipts/{receiptId}/regenerate-receipt-document',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __regenerateReceiptDocument;\n}\n\n/**\n * Sends the receipt to the specified recipient in an email.\n *\n * Specifying a contact ID is required only when no contact ID was specified upon receipt creation.\n *\n * Note that if the specified contact ID doesn't have an associated email address, the call will fail.\n */\nexport function sendReceiptEmail(payload: object): RequestOptionsFactory<any> {\n function __sendReceiptEmail({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.receipts.v1.receipt',\n method: 'POST' as any,\n methodFqn: 'wix.receipts.v1.Receipts.SendReceiptEmail',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixReceiptsV1ReceiptsUrl({\n protoPath: '/v1/receipts/{receiptId}/send-email',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __sendReceiptEmail;\n}\n\n/**\n * Retrieves the highest receipt number currently in use (the sequential identifier displayed between the prefix and suffix in receipt display numbers).\n * Can be filtered by prefix.\n *\n * Receipt numbering is managed in the Receipts Settings API.\n */\nexport function getLatestReceiptNumber(\n payload: object\n): RequestOptionsFactory<any> {\n function __getLatestReceiptNumber({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.receipts.v1.receipt',\n method: 'GET' as any,\n methodFqn: 'wix.receipts.v1.Receipts.GetLatestReceiptNumber',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixReceiptsV1ReceiptsUrl({\n protoPath: '/v1/receipts/get-latest-number',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getLatestReceiptNumber;\n}\n\n/** Updates extended fields of a receipt, without incrementing revision. */\nexport function updateExtendedFields(\n payload: object\n): RequestOptionsFactory<any> {\n function __updateExtendedFields({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.receipts.v1.receipt',\n method: 'POST' as any,\n methodFqn: 'wix.receipts.v1.Receipts.UpdateExtendedFields',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixReceiptsV1ReceiptsUrl({\n protoPath: '/v1/receipts/{id}/update-extended-fields',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'receipt.createdDate' },\n { path: 'receipt.updatedDate' },\n { path: 'receipt.businessDetails.logo.urlExpirationDate' },\n { path: 'receipt.payment.transactionDate' },\n { path: 'receipt.document.startGenerationTime' },\n ],\n },\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'receipt.businessDetails.address.geocode.latitude' },\n { path: 'receipt.businessDetails.address.geocode.longitude' },\n { path: 'receipt.customer.billingAddress.geocode.latitude' },\n { path: 'receipt.customer.billingAddress.geocode.longitude' },\n { path: 'receipt.customer.shippingAddress.geocode.latitude' },\n { path: 'receipt.customer.shippingAddress.geocode.longitude' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateExtendedFields;\n}\n","import {\n createReceipt as publicCreateReceipt,\n getReceipt as publicGetReceipt,\n queryReceipts as publicQueryReceipts,\n typedQueryReceipts as publicTypedQueryReceipts,\n regenerateReceiptDocument as publicRegenerateReceiptDocument,\n sendReceiptEmail as publicSendReceiptEmail,\n getLatestReceiptNumber as publicGetLatestReceiptNumber,\n updateExtendedFields as publicUpdateExtendedFields,\n} from './receipts-v1-receipt-receipts.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { createEventModule } from '@wix/sdk-runtime/event-definition-modules';\nimport {\n BuildRESTFunction,\n MaybeContext,\n BuildEventDefinition,\n} from '@wix/sdk-types';\nimport { HttpClient } from '@wix/sdk-types';\nimport { createQueryOverloadRouter } from '@wix/sdk-runtime/query-method-router';\nimport {\n ReceiptQuery,\n ReceiptsQueryBuilder,\n typedQueryReceipts as universalTypedQueryReceipts,\n} from './receipts-v1-receipt-receipts.universal.js';\nimport { onReceiptCreated as publicOnReceiptCreated } from './receipts-v1-receipt-receipts.public.js';\nimport { onReceiptSent as publicOnReceiptSent } from './receipts-v1-receipt-receipts.public.js';\nimport { onReceiptUpdated as publicOnReceiptUpdated } from './receipts-v1-receipt-receipts.public.js';\n\nfunction customQueryReceipts(httpClient: HttpClient) {\n const router = createQueryOverloadRouter({\n builderQueryFunction: () => publicQueryReceipts(httpClient)(),\n typedQueryFunction: (query: ReceiptQuery) =>\n publicTypedQueryReceipts(httpClient)(query),\n hasOptionsParameter: false,\n });\n\n function overloadedQuery(): ReceiptsQueryBuilder;\n function overloadedQuery(\n query: ReceiptQuery\n ): ReturnType<typeof universalTypedQueryReceipts>;\n function overloadedQuery(query?: ReceiptQuery): any {\n return router(...arguments);\n }\n\n return overloadedQuery;\n}\n\nexport const createReceipt: MaybeContext<\n BuildRESTFunction<typeof publicCreateReceipt> & typeof publicCreateReceipt\n> = /*#__PURE__*/ createRESTModule(publicCreateReceipt);\nexport const getReceipt: MaybeContext<\n BuildRESTFunction<typeof publicGetReceipt> & typeof publicGetReceipt\n> = /*#__PURE__*/ createRESTModule(publicGetReceipt);\nexport const regenerateReceiptDocument: MaybeContext<\n BuildRESTFunction<typeof publicRegenerateReceiptDocument> &\n typeof publicRegenerateReceiptDocument\n> = /*#__PURE__*/ createRESTModule(publicRegenerateReceiptDocument);\nexport const sendReceiptEmail: MaybeContext<\n BuildRESTFunction<typeof publicSendReceiptEmail> &\n typeof publicSendReceiptEmail\n> = /*#__PURE__*/ createRESTModule(publicSendReceiptEmail);\nexport const getLatestReceiptNumber: MaybeContext<\n BuildRESTFunction<typeof publicGetLatestReceiptNumber> &\n typeof publicGetLatestReceiptNumber\n> = /*#__PURE__*/ createRESTModule(publicGetLatestReceiptNumber);\nexport const updateExtendedFields: MaybeContext<\n BuildRESTFunction<typeof publicUpdateExtendedFields> &\n typeof publicUpdateExtendedFields\n> = /*#__PURE__*/ createRESTModule(publicUpdateExtendedFields);\nexport const queryReceipts: MaybeContext<\n BuildRESTFunction<typeof customQueryReceipts> & typeof customQueryReceipts\n> = /*#__PURE__*/ createRESTModule(customQueryReceipts);\n/**\n * Triggered when a receipt is created.\n */\nexport const onReceiptCreated: BuildEventDefinition<\n typeof publicOnReceiptCreated\n> &\n typeof publicOnReceiptCreated = createEventModule(publicOnReceiptCreated);\n/**\n * Triggered when a receipt is sent.\n */\nexport const onReceiptSent: BuildEventDefinition<typeof publicOnReceiptSent> &\n typeof publicOnReceiptSent = createEventModule(publicOnReceiptSent);\n/**\n * Triggered when a receipt's number allocation is updated or a receipt document is generated.\n */\nexport const onReceiptUpdated: BuildEventDefinition<\n typeof publicOnReceiptUpdated\n> &\n typeof publicOnReceiptUpdated = createEventModule(publicOnReceiptUpdated);\n\nexport {\n ReceiptOrderType,\n SubdivisionType,\n VatType,\n DocumentStatus,\n WebhookIdentityType,\n RequestOrigin,\n SortOrder,\n} from './receipts-v1-receipt-receipts.universal.js';\nexport {\n Receipt,\n Numbering,\n RegionalProperties,\n Locale,\n SourceReference,\n SourceReferenceOrderOneOf,\n WixPayment,\n WixEcom,\n BusinessDetails,\n Address,\n AddressStreetOneOf,\n StreetAddress,\n AddressLocation,\n Subdivision,\n StandardDetails,\n Customer,\n FullAddressContactDetails,\n VatId,\n ShippingAddressContactDetails,\n LineItem,\n LineItemTax,\n LineItemTotals,\n ShippingInfo,\n ShippingTax,\n AdditionalFee,\n AdditionalFeeTax,\n Discount,\n Payment,\n Totals,\n Tax,\n CustomFields,\n CustomField,\n FooterCustomField,\n Document,\n ExtendedFields,\n Sent,\n UpdateReceiptRequest,\n UpdateReceiptResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n ReceiptDocumentProcess,\n ReceiptNumberingProcess,\n ReceiptDocumentHandled,\n ReceiptDocumentHandledResultOneOf,\n Succeeded,\n Failed,\n GenerateReceiptDocument,\n CreateReceiptRequest,\n CreateReceiptResponse,\n GetReceiptRequest,\n GetReceiptResponse,\n QueryReceiptsRequest,\n CursorQuery,\n CursorQueryPagingMethodOneOf,\n Sorting,\n CursorPaging,\n QueryReceiptsResponse,\n CursorPagingMetadata,\n Cursors,\n RegenerateReceiptDocumentRequest,\n RegenerateReceiptDocumentResponse,\n SendReceiptEmailRequest,\n SendReceiptEmailResponse,\n GetLatestReceiptNumberRequest,\n GetLatestReceiptNumberResponse,\n UpdateExtendedFieldsRequest,\n UpdateExtendedFieldsResponse,\n Empty,\n BaseEventMetadata,\n EventMetadata,\n ReceiptCreatedEnvelope,\n ReceiptSentEnvelope,\n ReceiptUpdatedEnvelope,\n ReceiptsQueryResult,\n ReceiptsQueryBuilder,\n ReceiptQuerySpec,\n SendReceiptEmailOptions,\n GetLatestReceiptNumberOptions,\n UpdateExtendedFieldsOptions,\n} from './receipts-v1-receipt-receipts.universal.js';\nexport {\n ReceiptOrderTypeWithLiterals,\n SubdivisionTypeWithLiterals,\n VatTypeWithLiterals,\n DocumentStatusWithLiterals,\n WebhookIdentityTypeWithLiterals,\n RequestOriginWithLiterals,\n SortOrderWithLiterals,\n CreateReceiptApplicationErrors,\n RegenerateReceiptDocumentApplicationErrors,\n SendReceiptEmailApplicationErrors,\n CommonQueryWithEntityContext,\n ReceiptQuery,\n} from './receipts-v1-receipt-receipts.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAAA;AAAA,EAAA,8BAAAC;AAAA,EAAA,kBAAAC;AAAA,EAAA,wBAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA,wBAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA,iCAAAC;AAAA,EAAA,wBAAAC;AAAA,EAAA,4BAAAC;AAAA;AAAA;;;ACAA,IAAAC,iCAAwD;AACxD,IAAAC,kBAAiD;AACjD,IAAAC,gBAA6C;AAC7C,IAAAC,oBAAqD;AACrD,IAAAC,0BAA+B;AAC/B,uBAA8D;;;ACL9D,6BAAoD;AACpD,2BAA6B;AAC7B,oCAGO;;;ACLP,0BAAkC;AAClC,mBAA6C;AAC7C,IAAAC,gBAA6C;AAC7C,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,gCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;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iBA,0BAA+B;AAC3D,IAAMC,oBAGK,2DAAiBA,iBAAsB;AAClD,IAAMC,0BAGK,2DAAiBA,uBAA4B;AACxD,IAAMC,wBAGK,2DAAiBA,qBAA0B;AACtD,IAAMP,iBAEK,2DAAiB,mBAAmB;AAI/C,IAAMQ,wBAGqB,mDAAkB,gBAAsB;AAInE,IAAMC,qBACkB,mDAAkB,aAAmB;AAI7D,IAAMC,wBAGqB,mDAAkB,gBAAsB;","names":["createReceipt","getLatestReceiptNumber","getReceipt","onReceiptCreated","onReceiptSent","onReceiptUpdated","queryReceipts","regenerateReceiptDocument","sendReceiptEmail","updateExtendedFields","import_rename_all_nested_keys","import_address","import_image","import_timestamp","import_transform_paths","import_float","import_timestamp","import_rest_modules","payload","import_address","import_image","import_transform_paths","ReceiptOrderType","SubdivisionType","VatType","DocumentStatus","WebhookIdentityType","RequestOrigin","SortOrder","createReceipt","sdkTransformError","getReceipt","queryReceipts","regenerateReceiptDocument","sendReceiptEmail","getLatestReceiptNumber","updateExtendedFields","createReceipt","getReceipt","queryReceipts","typedQueryReceipts","regenerateReceiptDocument","sendReceiptEmail","getLatestReceiptNumber","updateExtendedFields","import_rest_modules","queryReceipts","typedQueryReceipts","createReceipt","getReceipt","regenerateReceiptDocument","sendReceiptEmail","getLatestReceiptNumber","updateExtendedFields","onReceiptCreated","onReceiptSent","onReceiptUpdated"]}
|
|
1
|
+
{"version":3,"sources":["../../../index.ts","../../../src/receipts-v1-receipt-receipts.public.ts","../../../src/receipts-v1-receipt-receipts.universal.ts","../../../src/receipts-v1-receipt-receipts.http.ts","../../../src/receipts-v1-receipt-receipts.context.ts"],"sourcesContent":["export * from './src/receipts-v1-receipt-receipts.context.js';\n","import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { transformRESTAddressToSDKAddress } from '@wix/sdk-runtime/transformations/address';\nimport { transformRESTImageToSDKImage } from '@wix/sdk-runtime/transformations/image';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { EventDefinition, HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n CreateReceiptApplicationErrors,\n GetLatestReceiptNumberOptions,\n GetLatestReceiptNumberResponse,\n QueryReceiptsResponse,\n Receipt,\n ReceiptCreatedEnvelope,\n ReceiptQuery,\n ReceiptSentEnvelope,\n ReceiptUpdatedEnvelope,\n ReceiptsQueryBuilder,\n RegenerateReceiptDocumentApplicationErrors,\n SendReceiptEmailApplicationErrors,\n SendReceiptEmailOptions,\n UpdateExtendedFieldsOptions,\n UpdateExtendedFieldsResponse,\n createReceipt as universalCreateReceipt,\n getLatestReceiptNumber as universalGetLatestReceiptNumber,\n getReceipt as universalGetReceipt,\n queryReceipts as universalQueryReceipts,\n regenerateReceiptDocument as universalRegenerateReceiptDocument,\n sendReceiptEmail as universalSendReceiptEmail,\n typedQueryReceipts as universalTypedQueryReceipts,\n updateExtendedFields as universalUpdateExtendedFields,\n} from './receipts-v1-receipt-receipts.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/get-paid' };\n\nexport function createReceipt(httpClient: HttpClient): CreateReceiptSignature {\n return (\n receipt: NonNullablePaths<\n Receipt,\n | `currency`\n | `lineItems`\n | `lineItems.${number}._id`\n | `lineItems.${number}.price`\n | `lineItems.${number}.quantity`\n | `lineItems.${number}.totals`\n | `lineItems.${number}.totals.totalPriceBeforeTax`\n | `payment`\n | `payment.amount`\n | `payment.paymentMethod`\n | `payment.transactionDate`\n | `sourceReference`\n | `sourceReference.appId`\n | `sourceReference.externalReferenceId`\n | `sourceReference.receiptOrderType`\n | `sourceReference.wixEcomOrder.orderId`\n | `sourceReference.wixEcomOrder.transactionId`\n | `sourceReference.wixPaymentOrder.orderId`\n | `sourceReference.wixPaymentOrder.transactionId`\n | `totals`\n | `totals.subtotal`\n | `totals.total`,\n 5\n >\n ) =>\n universalCreateReceipt(\n receipt,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateReceiptSignature {\n /**\n * Creates a receipt.\n *\n * Receipt number is assigned later and will be provided in the Get Receipt response.\n * @param - Receipt to create.\n * @returns Created receipt.\n */\n (\n receipt: NonNullablePaths<\n Receipt,\n | `currency`\n | `lineItems`\n | `lineItems.${number}._id`\n | `lineItems.${number}.price`\n | `lineItems.${number}.quantity`\n | `lineItems.${number}.totals`\n | `lineItems.${number}.totals.totalPriceBeforeTax`\n | `payment`\n | `payment.amount`\n | `payment.paymentMethod`\n | `payment.transactionDate`\n | `sourceReference`\n | `sourceReference.appId`\n | `sourceReference.externalReferenceId`\n | `sourceReference.receiptOrderType`\n | `sourceReference.wixEcomOrder.orderId`\n | `sourceReference.wixEcomOrder.transactionId`\n | `sourceReference.wixPaymentOrder.orderId`\n | `sourceReference.wixPaymentOrder.transactionId`\n | `totals`\n | `totals.subtotal`\n | `totals.total`,\n 5\n >\n ): Promise<\n NonNullablePaths<\n Receipt,\n | `numbering.displayNumber`\n | `regionalProperties.locale.languageCode`\n | `currency`\n | `sourceReference.wixPaymentOrder.orderId`\n | `sourceReference.wixPaymentOrder.transactionId`\n | `sourceReference.wixEcomOrder.orderId`\n | `sourceReference.wixEcomOrder.transactionId`\n | `sourceReference.appId`\n | `sourceReference.externalReferenceId`\n | `sourceReference.receiptOrderType`\n | `businessDetails.address.streetAddress.number`\n | `businessDetails.address.streetAddress.name`\n | `businessDetails.address.streetAddress.apt`\n | `customer.contactDetails.vatId._id`\n | `customer.contactDetails.vatId.type`\n | `lineItems`\n | `shippingInfo.title`\n | `shippingInfo.priceBeforeTax`\n | `shippingInfo.priceAfterTax`\n | `shippingInfo.taxBreakdown`\n | `shippingInfo.taxBreakdown.${number}.name`\n | `shippingInfo.taxBreakdown.${number}.rate`\n | `shippingInfo.taxBreakdown.${number}.amount`\n | `additionalFees`\n | `additionalFees.${number}.name`\n | `additionalFees.${number}.priceBeforeTax`\n | `additionalFees.${number}.priceAfterTax`\n | `discounts`\n | `discounts.${number}.name`\n | `discounts.${number}.amount`\n | `payment.paymentMethod`\n | `payment.amount`\n | `taxBreakdown`\n | `taxBreakdown.${number}.name`\n | `taxBreakdown.${number}.rate`\n | `taxBreakdown.${number}.taxAmount`\n | `taxBreakdown.${number}.taxableAmount`\n | `customFields.headerCustomFields`\n | `customFields.headerCustomFields.${number}.value`\n | `customFields.businessCustomFields`\n | `customFields.customerCustomFields`\n | `customFields.footerCustomFields`\n | `customFields.footerCustomFields.${number}.title`\n | `document.status`,\n 5\n > & {\n __applicationErrorsType?: CreateReceiptApplicationErrors;\n }\n >;\n}\n\nexport function getReceipt(httpClient: HttpClient): GetReceiptSignature {\n return (receiptId: string) =>\n universalGetReceipt(\n receiptId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetReceiptSignature {\n /**\n * Retrieves a receipt.\n * @param - Receipt ID.\n * @returns Requested receipt.\n */\n (receiptId: string): Promise<\n NonNullablePaths<\n Receipt,\n | `numbering.displayNumber`\n | `regionalProperties.locale.languageCode`\n | `currency`\n | `sourceReference.wixPaymentOrder.orderId`\n | `sourceReference.wixPaymentOrder.transactionId`\n | `sourceReference.wixEcomOrder.orderId`\n | `sourceReference.wixEcomOrder.transactionId`\n | `sourceReference.appId`\n | `sourceReference.externalReferenceId`\n | `sourceReference.receiptOrderType`\n | `businessDetails.address.streetAddress.number`\n | `businessDetails.address.streetAddress.name`\n | `businessDetails.address.streetAddress.apt`\n | `customer.contactDetails.vatId._id`\n | `customer.contactDetails.vatId.type`\n | `lineItems`\n | `shippingInfo.title`\n | `shippingInfo.priceBeforeTax`\n | `shippingInfo.priceAfterTax`\n | `shippingInfo.taxBreakdown`\n | `shippingInfo.taxBreakdown.${number}.name`\n | `shippingInfo.taxBreakdown.${number}.rate`\n | `shippingInfo.taxBreakdown.${number}.amount`\n | `additionalFees`\n | `additionalFees.${number}.name`\n | `additionalFees.${number}.priceBeforeTax`\n | `additionalFees.${number}.priceAfterTax`\n | `discounts`\n | `discounts.${number}.name`\n | `discounts.${number}.amount`\n | `payment.paymentMethod`\n | `payment.amount`\n | `taxBreakdown`\n | `taxBreakdown.${number}.name`\n | `taxBreakdown.${number}.rate`\n | `taxBreakdown.${number}.taxAmount`\n | `taxBreakdown.${number}.taxableAmount`\n | `customFields.headerCustomFields`\n | `customFields.headerCustomFields.${number}.value`\n | `customFields.businessCustomFields`\n | `customFields.customerCustomFields`\n | `customFields.footerCustomFields`\n | `customFields.footerCustomFields.${number}.title`\n | `document.status`,\n 5\n >\n >;\n}\n\nexport function queryReceipts(httpClient: HttpClient): QueryReceiptsSignature {\n return () =>\n universalQueryReceipts(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface QueryReceiptsSignature {\n /**\n * Retrieves a list of up to 100 receipts, given the specified filtering, paging, and sorting ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/api-query-language) | [REST](https://dev.wix.com/api/rest/getting-started/api-query-language)).\n */\n (): ReceiptsQueryBuilder;\n}\n\nexport function typedQueryReceipts(\n httpClient: HttpClient\n): TypedQueryReceiptsSignature {\n return (query: ReceiptQuery) =>\n universalTypedQueryReceipts(\n query,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface TypedQueryReceiptsSignature {\n /** */\n (query: ReceiptQuery): Promise<\n NonNullablePaths<\n QueryReceiptsResponse,\n | `receipts`\n | `receipts.${number}.numbering.displayNumber`\n | `receipts.${number}.regionalProperties.locale.languageCode`\n | `receipts.${number}.currency`\n | `receipts.${number}.sourceReference.wixPaymentOrder.orderId`\n | `receipts.${number}.sourceReference.wixPaymentOrder.transactionId`\n | `receipts.${number}.sourceReference.wixEcomOrder.orderId`\n | `receipts.${number}.sourceReference.wixEcomOrder.transactionId`\n | `receipts.${number}.sourceReference.appId`\n | `receipts.${number}.sourceReference.externalReferenceId`\n | `receipts.${number}.sourceReference.receiptOrderType`\n | `receipts.${number}.shippingInfo.title`\n | `receipts.${number}.shippingInfo.priceBeforeTax`\n | `receipts.${number}.shippingInfo.priceAfterTax`\n | `receipts.${number}.payment.paymentMethod`\n | `receipts.${number}.payment.amount`\n | `receipts.${number}.document.status`,\n 6\n >\n >;\n}\n\nexport function regenerateReceiptDocument(\n httpClient: HttpClient\n): RegenerateReceiptDocumentSignature {\n return (receiptId: string) =>\n universalRegenerateReceiptDocument(\n receiptId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface RegenerateReceiptDocumentSignature {\n /**\n * Retries generating a receipt document that has a `FAILED` or stuck in `PROCESSING` status.\n *\n * Note that you can access a receipt document with an `AVAILABLE` status with the URL provided in `document.downloadUrl` without regenerating.\n * @param - Receipt ID.\n */\n (receiptId: string): Promise<\n void & {\n __applicationErrorsType?: RegenerateReceiptDocumentApplicationErrors;\n }\n >;\n}\n\nexport function sendReceiptEmail(\n httpClient: HttpClient\n): SendReceiptEmailSignature {\n return (receiptId: string, options?: SendReceiptEmailOptions) =>\n universalSendReceiptEmail(\n receiptId,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface SendReceiptEmailSignature {\n /**\n * Sends the receipt to the specified recipient in an email.\n *\n * Specifying a contact ID is required only when no contact ID was specified upon receipt creation.\n *\n * Note that if the specified contact ID doesn't have an associated email address, the call will fail.\n * @param - Receipt ID to send.\n * @param - Field options. The `contactId` object must be passed if one was not already specified upon receipt creation.\n */\n (receiptId: string, options?: SendReceiptEmailOptions): Promise<\n void & {\n __applicationErrorsType?: SendReceiptEmailApplicationErrors;\n }\n >;\n}\n\nexport function getLatestReceiptNumber(\n httpClient: HttpClient\n): GetLatestReceiptNumberSignature {\n return (options?: GetLatestReceiptNumberOptions) =>\n universalGetLatestReceiptNumber(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetLatestReceiptNumberSignature {\n /**\n * Retrieves the highest receipt number currently in use (the sequential identifier displayed between the prefix and suffix in receipt display numbers).\n * Can be filtered by prefix.\n *\n * Receipt numbering is managed in the Receipts Settings API.\n * @param - Field options.\n */\n (\n options?: GetLatestReceiptNumberOptions\n ): Promise<GetLatestReceiptNumberResponse>;\n}\n\nexport function updateExtendedFields(\n httpClient: HttpClient\n): UpdateExtendedFieldsSignature {\n return (\n _id: string,\n namespace: string,\n options: NonNullablePaths<UpdateExtendedFieldsOptions, `namespaceData`, 2>\n ) =>\n universalUpdateExtendedFields(\n _id,\n namespace,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateExtendedFieldsSignature {\n /**\n * Updates extended fields of a receipt, without incrementing revision.\n * @param - ID of the entity to update.\n * @param - Identifier for the app whose extended fields are being updated.\n * @param - Field options. The `namespaceData` object **must** be passed.\n */\n (\n _id: string,\n namespace: string,\n options: NonNullablePaths<UpdateExtendedFieldsOptions, `namespaceData`, 2>\n ): Promise<\n NonNullablePaths<\n UpdateExtendedFieldsResponse,\n | `receipt.numbering.displayNumber`\n | `receipt.regionalProperties.locale.languageCode`\n | `receipt.currency`\n | `receipt.sourceReference.wixPaymentOrder.orderId`\n | `receipt.sourceReference.wixPaymentOrder.transactionId`\n | `receipt.sourceReference.wixEcomOrder.orderId`\n | `receipt.sourceReference.wixEcomOrder.transactionId`\n | `receipt.sourceReference.appId`\n | `receipt.sourceReference.externalReferenceId`\n | `receipt.sourceReference.receiptOrderType`\n | `receipt.businessDetails.address.streetAddress.number`\n | `receipt.businessDetails.address.streetAddress.name`\n | `receipt.businessDetails.address.streetAddress.apt`\n | `receipt.customer.contactDetails.vatId._id`\n | `receipt.customer.contactDetails.vatId.type`\n | `receipt.lineItems`\n | `receipt.shippingInfo.title`\n | `receipt.shippingInfo.priceBeforeTax`\n | `receipt.shippingInfo.priceAfterTax`\n | `receipt.shippingInfo.taxBreakdown`\n | `receipt.shippingInfo.taxBreakdown.${number}.name`\n | `receipt.shippingInfo.taxBreakdown.${number}.rate`\n | `receipt.shippingInfo.taxBreakdown.${number}.amount`\n | `receipt.additionalFees`\n | `receipt.additionalFees.${number}.name`\n | `receipt.additionalFees.${number}.priceBeforeTax`\n | `receipt.additionalFees.${number}.priceAfterTax`\n | `receipt.discounts`\n | `receipt.discounts.${number}.name`\n | `receipt.discounts.${number}.amount`\n | `receipt.payment.paymentMethod`\n | `receipt.payment.amount`\n | `receipt.taxBreakdown`\n | `receipt.taxBreakdown.${number}.name`\n | `receipt.taxBreakdown.${number}.rate`\n | `receipt.taxBreakdown.${number}.taxAmount`\n | `receipt.taxBreakdown.${number}.taxableAmount`\n | `receipt.customFields.headerCustomFields`\n | `receipt.customFields.headerCustomFields.${number}.value`\n | `receipt.customFields.businessCustomFields`\n | `receipt.customFields.customerCustomFields`\n | `receipt.customFields.footerCustomFields`\n | `receipt.customFields.footerCustomFields.${number}.title`\n | `receipt.document.status`,\n 6\n >\n >;\n}\n\nexport const onReceiptCreated = EventDefinition(\n 'wix.receipts.v1.receipt_created',\n true,\n (event: ReceiptCreatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'entity.createdDate' },\n { path: 'entity.updatedDate' },\n { path: 'entity.payment.transactionDate' },\n { path: 'entity.document.startGenerationTime' },\n { path: 'metadata.eventTime' },\n ],\n },\n {\n transformFn: transformRESTAddressToSDKAddress,\n paths: [\n { path: 'entity.businessDetails.address' },\n { path: 'entity.customer.billingAddress' },\n { path: 'entity.customer.shippingAddress' },\n ],\n },\n {\n transformFn: transformRESTImageToSDKImage,\n paths: [{ path: 'entity.businessDetails.logo' }],\n },\n ])\n )\n)<ReceiptCreatedEnvelope>();\nexport const onReceiptSent = EventDefinition(\n 'wix.receipts.v1.receipt_sent',\n true,\n (event: ReceiptSentEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'data.receipt.createdDate' },\n { path: 'data.receipt.updatedDate' },\n { path: 'data.receipt.payment.transactionDate' },\n { path: 'data.receipt.document.startGenerationTime' },\n { path: 'metadata.eventTime' },\n ],\n },\n {\n transformFn: transformRESTAddressToSDKAddress,\n paths: [\n { path: 'data.receipt.businessDetails.address' },\n { path: 'data.receipt.customer.billingAddress' },\n { path: 'data.receipt.customer.shippingAddress' },\n ],\n },\n {\n transformFn: transformRESTImageToSDKImage,\n paths: [{ path: 'data.receipt.businessDetails.logo' }],\n },\n ])\n )\n)<ReceiptSentEnvelope>();\nexport const onReceiptUpdated = EventDefinition(\n 'wix.receipts.v1.receipt_updated',\n true,\n (event: ReceiptUpdatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'entity.createdDate' },\n { path: 'entity.updatedDate' },\n { path: 'entity.payment.transactionDate' },\n { path: 'entity.document.startGenerationTime' },\n { path: 'metadata.eventTime' },\n { path: 'modifiedFields.createdDate' },\n { path: 'modifiedFields.updatedDate' },\n { path: 'modifiedFields.payment.transactionDate' },\n { path: 'modifiedFields.document.startGenerationTime' },\n ],\n },\n {\n transformFn: transformRESTAddressToSDKAddress,\n paths: [\n { path: 'entity.businessDetails.address' },\n { path: 'entity.customer.billingAddress' },\n { path: 'entity.customer.shippingAddress' },\n { path: 'modifiedFields.businessDetails.address' },\n { path: 'modifiedFields.customer.billingAddress' },\n { path: 'modifiedFields.customer.shippingAddress' },\n ],\n },\n {\n transformFn: transformRESTImageToSDKImage,\n paths: [\n { path: 'entity.businessDetails.logo' },\n { path: 'modifiedFields.businessDetails.logo' },\n ],\n },\n ])\n )\n)<ReceiptUpdatedEnvelope>();\n\nexport {\n ActionEvent,\n AdditionalFee,\n AdditionalFeeTax,\n Address,\n AddressLocation,\n AddressStreetOneOf,\n BaseEventMetadata,\n BusinessDetails,\n CreateReceiptRequest,\n CreateReceiptResponse,\n CursorPaging,\n CursorPagingMetadata,\n CursorQuery,\n CursorQueryPagingMethodOneOf,\n Cursors,\n CustomField,\n CustomFields,\n Customer,\n Discount,\n Document,\n DocumentStatus,\n DomainEvent,\n DomainEventBodyOneOf,\n Empty,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n ExtendedFields,\n Failed,\n FooterCustomField,\n FullAddressContactDetails,\n GenerateReceiptDocument,\n GetLatestReceiptNumberOptions,\n GetLatestReceiptNumberRequest,\n GetLatestReceiptNumberResponse,\n GetReceiptRequest,\n GetReceiptResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n LineItem,\n LineItemTax,\n LineItemTotals,\n Locale,\n MessageEnvelope,\n Numbering,\n Payment,\n QueryReceiptsRequest,\n QueryReceiptsResponse,\n Receipt,\n ReceiptCreatedEnvelope,\n ReceiptDocumentHandled,\n ReceiptDocumentHandledResultOneOf,\n ReceiptDocumentProcess,\n ReceiptNumberingProcess,\n ReceiptOrderType,\n ReceiptQuerySpec,\n ReceiptSentEnvelope,\n ReceiptUpdatedEnvelope,\n ReceiptsQueryBuilder,\n ReceiptsQueryResult,\n RegenerateReceiptDocumentRequest,\n RegenerateReceiptDocumentResponse,\n RegionalProperties,\n RequestOrigin,\n RestoreInfo,\n SendReceiptEmailOptions,\n SendReceiptEmailRequest,\n SendReceiptEmailResponse,\n Sent,\n ShippingAddressContactDetails,\n ShippingInfo,\n ShippingTax,\n SortOrder,\n Sorting,\n SourceReference,\n SourceReferenceOrderOneOf,\n StandardDetails,\n StreetAddress,\n Subdivision,\n SubdivisionType,\n Succeeded,\n Tax,\n Totals,\n UpdateExtendedFieldsOptions,\n UpdateExtendedFieldsRequest,\n UpdateExtendedFieldsResponse,\n UpdateReceiptRequest,\n UpdateReceiptResponse,\n VatId,\n VatType,\n WebhookIdentityType,\n WixEcom,\n WixPayment,\n} from './receipts-v1-receipt-receipts.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { queryBuilder } from '@wix/sdk-runtime/query-builder';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport {\n HttpClient,\n HttpResponse,\n NonNullablePaths,\n QuerySpec,\n Query as QuerySdkType,\n} from '@wix/sdk-types';\nimport * as ambassadorWixReceiptsV1Receipt from './receipts-v1-receipt-receipts.http.js';\n// @ts-ignore\nimport { transformSDKAddressToRESTAddress } from '@wix/sdk-runtime/transformations/address';\nimport { transformRESTAddressToSDKAddress } from '@wix/sdk-runtime/transformations/address';\nimport { transformSDKImageToRESTImage } from '@wix/sdk-runtime/transformations/image';\nimport { transformRESTImageToSDKImage } from '@wix/sdk-runtime/transformations/image';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\n\n/**\n * A receipt is a document that confirms a Wix user has received money or property as payment following a sale, transfer of goods, or provision of a service.\n * Read more about [receipts](https://support.wix.com/en/article/wix-receipts-adding-and-setting-up-your-receipts).\n */\nexport interface Receipt {\n /**\n * Receipt ID.\n * @format GUID\n * @readonly\n * @immutable\n */\n _id?: string | null;\n /**\n * Revision number, which increments by 1 each time the receipt is updated.\n * To prevent conflicting changes,\n * the current revision must be passed when updating the receipt.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the receipt was created.\n * @readonly\n * @immutable\n */\n _createdDate?: Date | null;\n /**\n * Date and time the receipt was last updated.\n * Relevant updates include receipt regeneratation and number allocation changes. Updates to financial information are not stored.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * Receipt numbering.\n * @readonly\n */\n numbering?: Numbering;\n /**\n * Regional properties pertaining to the receipt.\n * When regional properties are not provided, defaults are taken from the site's properties, available in the Site Properties API.\n * @immutable\n */\n regionalProperties?: RegionalProperties;\n /**\n * Currency code in [ISO-4217 alphabetic](https://www.iso.org/iso-4217-currency-codes.html) format.\n * @format CURRENCY\n */\n currency?: string;\n /**\n * Details about the associated Wix eCommerce or Wix Payments order.\n * @immutable\n */\n sourceReference?: SourceReference;\n /**\n * Business details.\n * When business properties are not provided, defaults are taken from the site's properties, available in the Site Properties API.\n */\n businessDetails?: BusinessDetails;\n /** Customer details. */\n customer?: Customer;\n /**\n * Line item details.\n * @minSize 1\n * @maxSize 300\n */\n lineItems?: LineItem[];\n /** Shipping info. */\n shippingInfo?: ShippingInfo;\n /**\n * Additional fees.\n * @maxSize 100\n */\n additionalFees?: AdditionalFee[];\n /**\n * Discounts.\n * @maxSize 320\n */\n discounts?: Discount[];\n /** Payment details. */\n payment?: Payment;\n /** Summaries of totals including tax, shipping, additional fees and discounts. */\n totals?: Totals;\n /**\n * Tax and taxable amounts breakdowns.\n * @maxSize 100\n */\n taxBreakdown?: Tax[];\n /** Indicates if there were exempt from tax. */\n taxExempt?: boolean | null;\n /**\n * Receipt preset ID.\n * Defaults to the default receipt preset ID, available with Get Default Receipt Preset ID.\n * @format GUID\n */\n presetId?: string | null;\n /**\n * Custom fields for this receipt.\n * Values appear on the receipt in the specified order.\n */\n customFields?: CustomFields;\n /**\n * Document details.\n * @readonly\n */\n document?: Document;\n /**\n * Custom field data for the receipt.\n * Extended fields must be configured in the app dashboard before they can be accessed with API calls.\n */\n extendedFields?: ExtendedFields;\n}\n\nexport interface Numbering {\n /** Receipt number. */\n number?: number | null;\n /**\n * Receipt prefix that will be displayed before the receipt number.\n * @minLength 1\n * @maxLength 10\n */\n prefix?: string | null;\n /**\n * Receipt suffix that will be displayed after the receipt number.\n * @minLength 1\n * @maxLength 10\n */\n suffix?: string | null;\n /**\n * Full receipt display number, in [prefix][number][suffix] format.\n * @readonly\n * @maxLength 30\n */\n displayNumber?: string;\n}\n\nexport interface RegionalProperties {\n /** Locale. Determines formating of numbers, dates and times. */\n locale?: Locale;\n /**\n * Time zone. Determines offset of dates and times.\n * @maxLength 32\n */\n timeZone?: string | null;\n /**\n * Receipt language. Determines the language of receipt static content (i.e. field and column titles). If not provided, defaults to locale's language.\n * Two-letter language code in [ISO-639-1 alpha-2](https://en.wikipedia.org/wiki/ISO_639-1) format.\n * @format LANGUAGE\n */\n language?: string | null;\n}\n\nexport interface Locale {\n /**\n * Two-letter language code in [ISO-639-1 alpha-2](https://en.wikipedia.org/wiki/ISO_639-1) format.\n * For example: `en`, `de`, `ja`.\n * @format LANGUAGE\n */\n languageCode?: string;\n /**\n * Two-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#officially_assigned_code_elements) format.\n * For example: `US`, `DE`, `JP`.\n * @format COUNTRY\n */\n country?: string | null;\n}\n\nexport interface SourceReference extends SourceReferenceOrderOneOf {\n /**\n * Wix Payments order.\n * @immutable\n */\n wixPaymentOrder?: WixPayment;\n /**\n * Wix eCommerce order.\n * @immutable\n */\n wixEcomOrder?: WixEcom;\n /**\n * ID of the app that generated the receipt.\n * @format GUID\n * @immutable\n */\n appId?: string;\n /**\n * External reference ID.\n * For example: Wix eCommerce `orderId`, Wix Events `eventId`.\n * @format GUID\n * @immutable\n */\n externalReferenceId?: string;\n /**\n * Order type.\n * @immutable\n */\n receiptOrderType?: ReceiptOrderTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface SourceReferenceOrderOneOf {\n /**\n * Wix Payments order.\n * @immutable\n */\n wixPaymentOrder?: WixPayment;\n /**\n * Wix eCommerce order.\n * @immutable\n */\n wixEcomOrder?: WixEcom;\n}\n\nexport enum ReceiptOrderType {\n UNKNOWN_ORDER_TYPE = 'UNKNOWN_ORDER_TYPE',\n WIX_PAYMENT = 'WIX_PAYMENT',\n WIX_ECOM = 'WIX_ECOM',\n}\n\n/** @enumType */\nexport type ReceiptOrderTypeWithLiterals =\n | ReceiptOrderType\n | 'UNKNOWN_ORDER_TYPE'\n | 'WIX_PAYMENT'\n | 'WIX_ECOM';\n\nexport interface WixPayment {\n /**\n * Wix Payments order ID.\n * @format GUID\n * @immutable\n */\n orderId?: string;\n /**\n * Wix Payments transaction ID.\n * @format GUID\n * @immutable\n */\n transactionId?: string;\n}\n\nexport interface WixEcom {\n /**\n * Wix eCommerce order ID.\n * @format GUID\n * @immutable\n */\n orderId?: string;\n /**\n * Wix eCommerce transaction ID.\n * @format GUID\n * @immutable\n */\n transactionId?: string;\n}\n\nexport interface BusinessDetails {\n /**\n * Business name.\n * @maxLength 60\n * @immutable\n */\n name?: string | null;\n /**\n * Business email.\n * @format EMAIL\n * @immutable\n */\n email?: string | null;\n /**\n * Business phone.\n * @format PHONE\n * @immutable\n */\n phone?: string | null;\n /**\n * Business address.\n * @immutable\n */\n address?: Address;\n /**\n * Business logo.\n * @immutable\n */\n logo?: string;\n}\n\n/** Physical address */\nexport interface Address extends AddressStreetOneOf {\n /** Street name and number. */\n streetAddress?: StreetAddress;\n /** Main address line, usually street and number as free text. */\n addressLine1?: string | null;\n /**\n * Country code.\n * @format COUNTRY\n */\n country?: string | null;\n /** Subdivision shorthand. Usually, a short code (2 or 3 letters) that represents a state, region, prefecture, or province. e.g. NY */\n subdivision?: string | null;\n /** City name. */\n city?: string | null;\n /** Zip/postal code. */\n postalCode?: string | null;\n /** Free text providing more detailed address info. Usually contains Apt, Suite, and Floor. */\n addressLine2?: string | null;\n}\n\n/** @oneof */\nexport interface AddressStreetOneOf {\n /** Street name and number. */\n streetAddress?: StreetAddress;\n /** Main address line, usually street and number as free text. */\n addressLine?: string | null;\n}\n\nexport interface StreetAddress {\n /** Street number. */\n number?: string;\n /** Street name. */\n name?: string;\n /** Apartment number. */\n apt?: string;\n}\n\nexport interface AddressLocation {\n /** Address latitude. */\n latitude?: number | null;\n /** Address longitude. */\n longitude?: number | null;\n}\n\nexport interface Subdivision {\n /** Short subdivision code. */\n code?: string;\n /** Subdivision full name. */\n name?: string;\n}\n\nexport enum SubdivisionType {\n UNKNOWN_SUBDIVISION_TYPE = 'UNKNOWN_SUBDIVISION_TYPE',\n /** State */\n ADMINISTRATIVE_AREA_LEVEL_1 = 'ADMINISTRATIVE_AREA_LEVEL_1',\n /** County */\n ADMINISTRATIVE_AREA_LEVEL_2 = 'ADMINISTRATIVE_AREA_LEVEL_2',\n /** City/town */\n ADMINISTRATIVE_AREA_LEVEL_3 = 'ADMINISTRATIVE_AREA_LEVEL_3',\n /** Neighborhood/quarter */\n ADMINISTRATIVE_AREA_LEVEL_4 = 'ADMINISTRATIVE_AREA_LEVEL_4',\n /** Street/block */\n ADMINISTRATIVE_AREA_LEVEL_5 = 'ADMINISTRATIVE_AREA_LEVEL_5',\n /** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */\n COUNTRY = 'COUNTRY',\n}\n\n/** @enumType */\nexport type SubdivisionTypeWithLiterals =\n | SubdivisionType\n | 'UNKNOWN_SUBDIVISION_TYPE'\n | 'ADMINISTRATIVE_AREA_LEVEL_1'\n | 'ADMINISTRATIVE_AREA_LEVEL_2'\n | 'ADMINISTRATIVE_AREA_LEVEL_3'\n | 'ADMINISTRATIVE_AREA_LEVEL_4'\n | 'ADMINISTRATIVE_AREA_LEVEL_5'\n | 'COUNTRY';\n\n/** Subdivision Concordance values */\nexport interface StandardDetails {\n /**\n * subdivision iso-3166-2 code according to [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2). e.g. US-NY, GB-SCT, NO-30\n * @maxLength 20\n */\n iso31662?: string | null;\n}\n\nexport interface Customer {\n /**\n * Customer's contact ID.\n * @format GUID\n */\n contactId?: string | null;\n /** Customer's contact details. */\n contactDetails?: FullAddressContactDetails;\n /** Customer's billing address. */\n billingAddress?: Address;\n /** Customer's shipping address. */\n shippingAddress?: Address;\n /** Shipping address contact details. Allows to have a separate contact details (name, email, etc.) for the shipping address. */\n shippingAddressContactDetails?: ShippingAddressContactDetails;\n}\n\n/** Full contact details for an address */\nexport interface FullAddressContactDetails {\n /** Contact's first name. */\n firstName?: string | null;\n /** Contact's last name. */\n lastName?: string | null;\n /** Contact's phone number. */\n phone?: string | null;\n /** Contact's company name. */\n company?: string | null;\n /** Email associated with the address. */\n email?: string | null;\n /** Tax info. Currently usable only in Brazil. */\n vatId?: VatId;\n}\n\nexport interface VatId {\n /** Customer's tax ID. */\n _id?: string;\n /**\n * Tax type.\n *\n * Supported values:\n * + `CPF`: for individual tax payers\n * + `CNPJ`: for corporations\n */\n type?: VatTypeWithLiterals;\n}\n\n/** tax info types */\nexport enum VatType {\n UNSPECIFIED = 'UNSPECIFIED',\n /** CPF - for individual tax payers. */\n CPF = 'CPF',\n /** CNPJ - for corporations */\n CNPJ = 'CNPJ',\n}\n\n/** @enumType */\nexport type VatTypeWithLiterals = VatType | 'UNSPECIFIED' | 'CPF' | 'CNPJ';\n\n/** Shipping contact details for an address */\nexport interface ShippingAddressContactDetails {\n /** Contact's first name. */\n firstName?: string | null;\n /** Contact's last name. */\n lastName?: string | null;\n /** Contact's phone number. */\n phone?: string | null;\n /** Contact's company name. */\n company?: string | null;\n /** Email associated with the address. */\n email?: string | null;\n}\n\nexport interface LineItem {\n /**\n * Line item ID.\n * @format GUID\n */\n _id?: string | null;\n /**\n * Line item name.\n * @maxLength 400\n */\n name?: string | null;\n /**\n * Line item description.\n * @maxLength 600\n */\n description?: string | null;\n /**\n * Line item quantity.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:100000, maxScale:15 }\n */\n quantity?: string | null;\n /**\n * Line item unit price per unit after discounts.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:-1000000000000000, lte:1000000000000000, maxScale:4 }\n */\n price?: string | null;\n /**\n * Line item price per unit before discounts.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:-1000000000000000, lte:1000000000000000, maxScale:4 }\n */\n priceBeforeDiscounts?: string | null;\n /**\n * Line item tax breakdown.\n * @maxSize 7\n */\n taxBreakdown?: LineItemTax[];\n /** Line item totals. */\n totals?: LineItemTotals;\n}\n\nexport interface LineItemTax {\n /**\n * Tax name.\n * @maxLength 200\n */\n taxName?: string;\n /**\n * Tax rate percentage.\n * For example: 0.1000 means 10% tax, and 2.1000 means 210% tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, maxScale:6 }\n */\n taxRate?: string;\n /**\n * Amount of the line item price that is taxable.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n taxableAmount?: string;\n /**\n * Amount of tax calculated for this line item.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n taxAmount?: string;\n /**\n * Exempt amount from tax calculated for this line item.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n exemptAmount?: string | null;\n}\n\nexport interface LineItemTotals {\n /**\n * Line item total discount.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n totalDiscount?: string | null;\n /**\n * Line item total price after discounts and before taxes.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:-1000000000000000, lte:1000000000000000, maxScale:4 }\n */\n totalPriceBeforeTax?: string | null;\n /**\n * Line item total applied tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n totalTax?: string | null;\n /**\n * Line item total price after taxes and discounts.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:-1000000000000000, lte:1000000000000000, maxScale:4 }\n */\n totalPriceAfterTax?: string | null;\n /**\n * Line item total price that was exempt from tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n totalExemptAmount?: string | null;\n}\n\nexport interface ShippingInfo {\n /**\n * Shipping title.\n * @maxLength 250\n */\n title?: string;\n /**\n * Shipping amount after discounts (when relevant), and before tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n priceBeforeTax?: string;\n /**\n * Shipping price after all discounts (if any exist), and after tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n priceAfterTax?: string;\n /**\n * Shipping tax breakdown.\n * @maxSize 10\n */\n taxBreakdown?: ShippingTax[];\n /**\n * Shipping price that was exempt from tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n exemptAmount?: string | null;\n}\n\nexport interface ShippingTax {\n /**\n * Tax name.\n * @maxLength 200\n */\n name?: string;\n /**\n * Tax rate percentage.\n * Example: 0.1000 signifies 10% tax and 2.1000 signifies 210% tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, maxScale:6 }\n */\n rate?: string;\n /**\n * Tax amount.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n amount?: string;\n /**\n * Exempt amount from tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n exemptAmount?: string | null;\n}\n\nexport interface AdditionalFee {\n /**\n * Additional fee name.\n * @minLength 1\n * @maxLength 50\n */\n name?: string;\n /**\n * Additional fee price before taxes.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n priceBeforeTax?: string;\n /**\n * Additional fee amount after taxes.\n * If no taxes apply to this fee, this will be the same as `priceBeforeTax`.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n priceAfterTax?: string;\n /**\n * Additional fee tax breakdown.\n * @maxSize 10\n */\n taxBreakdown?: AdditionalFeeTax[];\n /**\n * Additional fee price that was exempt from tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n exemptAmount?: string | null;\n}\n\nexport interface AdditionalFeeTax {\n /**\n * Tax name.\n * @maxLength 200\n */\n name?: string;\n /**\n * Tax rate.\n * Example: 0.1000 signifies 10% tax and 2.1000 signifies 210% tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, maxScale:6 }\n */\n rate?: string;\n /**\n * Tax amount.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n amount?: string;\n /**\n * Exempt amount from tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n exemptAmount?: string | null;\n}\n\nexport interface Discount {\n /**\n * Deprecated: Use `display_name` instead.\n * @maxLength 400\n * @deprecated Deprecated: Use `display_name` instead.\n * @replacedBy display_name\n * @targetRemovalDate 2025-06-01\n */\n name?: string;\n /**\n * Discount amount.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n amount?: string;\n /**\n * Discount name.\n * @minLength 1\n * @maxLength 400\n */\n displayName?: string | null;\n}\n\nexport interface Payment {\n /**\n * Payment method.\n * @maxLength 200\n */\n paymentMethod?: string;\n /**\n * Payment details.\n * @maxLength 200\n */\n paymentMethodDetails?: string | null;\n /**\n * Payment amount.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n amount?: string;\n /** Payment transaction date. */\n transactionDate?: Date | null;\n}\n\nexport interface Totals {\n /**\n * Subtotal of all line items, before discounts and before taxes.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n subtotal?: string | null;\n /**\n * Shipping price, before discounts and tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n shipping?: string | null;\n /**\n * Discount amount.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n discount?: string | null;\n /**\n * Additional fee amount, before discounts and tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n additionalFees?: string | null;\n /**\n * Tax amount.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n tax?: string | null;\n /**\n * Total amount after all calculations. Equates to: subtotal - discounts + taxes + shipping + additional_fees.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n total?: string | null;\n /**\n * Total amount that was exempt from tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n exempt?: string | null;\n}\n\nexport interface Tax {\n /**\n * Tax name.\n * @maxLength 200\n */\n name?: string;\n /**\n * Tax rate percentage, as a positive decimal numeral. For example, \"0.13\".\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, maxScale:6 }\n */\n rate?: string;\n /**\n * Tax amount.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n taxAmount?: string;\n /**\n * Taxable amount this tax applies to.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n taxableAmount?: string;\n /**\n * Exempt amount from tax.\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n exemptAmount?: string | null;\n}\n\nexport interface CustomFields {\n /**\n * Header custom fields.\n * @maxSize 4\n */\n headerCustomFields?: CustomField[];\n /**\n * Business custom fields.\n * @maxSize 4\n */\n businessCustomFields?: CustomField[];\n /**\n * Customer custom fields.\n * @maxSize 4\n */\n customerCustomFields?: CustomField[];\n /**\n * Footer custom fields.\n * @maxSize 4\n */\n footerCustomFields?: FooterCustomField[];\n}\n\nexport interface CustomField {\n /**\n * Title.\n * @minLength 1\n * @maxLength 100\n */\n title?: string | null;\n /**\n * Value.\n * @maxLength 100\n */\n value?: string;\n}\n\nexport interface FooterCustomField {\n /**\n * Title.\n * @minLength 1\n * @maxLength 200\n */\n title?: string;\n /**\n * Value.\n * @maxLength 5000\n */\n value?: string | null;\n}\n\nexport interface Document {\n /** Document status. */\n status?: DocumentStatusWithLiterals;\n /**\n * Document download URL.\n * @format WEB_URL\n */\n downloadUrl?: string | null;\n /** Document start generation time. */\n startGenerationTime?: Date | null;\n}\n\nexport enum DocumentStatus {\n /** Generation status is unknown. */\n UNKNOWN_DOCUMENT_STATUS = 'UNKNOWN_DOCUMENT_STATUS',\n /** Generation is in progress. Call Get Receipt after 6-10 seconds to check the updated status. */\n PROCESSING = 'PROCESSING',\n /** Generation was successful. You can downloaded the document using the `downloadUrl`. */\n AVAILABLE = 'AVAILABLE',\n /** Generation has failed. You can retrigger document generation by calling Regenerate Receipt Document. */\n FAILED = 'FAILED',\n}\n\n/** @enumType */\nexport type DocumentStatusWithLiterals =\n | DocumentStatus\n | 'UNKNOWN_DOCUMENT_STATUS'\n | 'PROCESSING'\n | 'AVAILABLE'\n | 'FAILED';\n\nexport interface ExtendedFields {\n /**\n * Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\n * The value of each key is structured according to the schema defined when the extended fields were configured.\n *\n * You can only access fields for which you have the appropriate permissions.\n *\n * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).\n */\n namespaces?: Record<string, Record<string, any>>;\n}\n\nexport interface Sent {\n /** Receipt that was sent. */\n receipt?: Receipt;\n /** Receipt was sent in automatic or manual flow. */\n automatic?: boolean;\n}\n\nexport interface UpdateReceiptRequest {\n /** Receipt. */\n receipt?: Receipt;\n}\n\nexport interface UpdateReceiptResponse {\n /** Receipt. */\n receipt?: Receipt;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface ReceiptDocumentProcess {\n /**\n * Receipt Id.\n * @format GUID\n */\n receiptId?: string;\n /**\n * Media Document Id.\n * @format GUID\n */\n documentId?: string;\n /**\n * Existing File Id that will be deleted after the document is generated.\n * @maxLength 100\n */\n existingFileId?: string | null;\n}\n\nexport interface ReceiptNumberingProcess {\n /**\n * Receipt Id.\n * @format GUID\n */\n receiptId?: string;\n}\n\nexport interface ReceiptDocumentHandled\n extends ReceiptDocumentHandledResultOneOf {\n /** Populated only if receipt document handling has succeeded. */\n succeeded?: Succeeded;\n /** Populated only if receipt document handling has failed. */\n failed?: Failed;\n}\n\n/** @oneof */\nexport interface ReceiptDocumentHandledResultOneOf {\n /** Populated only if receipt document handling has succeeded. */\n succeeded?: Succeeded;\n /** Populated only if receipt document handling has failed. */\n failed?: Failed;\n}\n\nexport interface Succeeded {\n /**\n * Receipt Id.\n * @format GUID\n */\n receiptId?: string;\n /**\n * Media file Id.\n * @maxLength 100\n */\n mediaFileId?: string;\n /**\n * Download URL.\n * @maxLength 200\n */\n downloadUrl?: string;\n}\n\nexport interface Failed {\n /**\n * Receipt Id.\n * @format GUID\n */\n receiptId?: string;\n}\n\nexport interface GenerateReceiptDocument {\n /**\n * Receipt Id.\n * @format GUID\n */\n receiptId?: string;\n /** Shows how request for document generation was made. */\n requestOrigin?: RequestOriginWithLiterals;\n}\n\nexport enum RequestOrigin {\n INITIAL = 'INITIAL',\n MANUAL = 'MANUAL',\n}\n\n/** @enumType */\nexport type RequestOriginWithLiterals = RequestOrigin | 'INITIAL' | 'MANUAL';\n\nexport interface CreateReceiptRequest {\n /** Receipt to create. */\n receipt: Receipt;\n}\n\nexport interface CreateReceiptResponse {\n /** Created receipt. */\n receipt?: Receipt;\n}\n\nexport interface GetReceiptRequest {\n /**\n * Receipt ID.\n * @format GUID\n */\n receiptId: string;\n}\n\nexport interface GetReceiptResponse {\n /** Requested receipt. */\n receipt?: Receipt;\n}\n\nexport interface QueryReceiptsRequest {\n /** Query options. */\n query?: CursorQuery;\n}\n\nexport interface CursorQuery extends CursorQueryPagingMethodOneOf {\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging;\n /**\n * Filter object in the following format:\n * `\"filter\" : {\n * \"fieldName1\": \"value1\",\n * \"fieldName2\":{\"$operator\":\"value2\"}\n * }`\n * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`\n */\n filter?: Record<string, any> | null;\n /**\n * Sort object in the following format:\n * `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]`\n * @maxSize 5\n */\n sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface CursorQueryPagingMethodOneOf {\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n /**\n * Name of the field to sort by.\n * @maxLength 512\n */\n fieldName?: string;\n /** Sort order. */\n order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return in the results.\n * @max 100\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface QueryReceiptsResponse {\n /** Requested receipts. */\n receipts?: Receipt[];\n /** Paging metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in the response. */\n count?: number | null;\n /** Cursor strings that point to the next page, previous page, or both. */\n cursors?: Cursors;\n /**\n * Whether there are more pages to retrieve following the current page.\n *\n * + `true`: Another page of results can be retrieved.\n * + `false`: This is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\n}\n\nexport interface RegenerateReceiptDocumentRequest {\n /**\n * Receipt ID.\n * @format GUID\n */\n receiptId: string;\n}\n\nexport interface RegenerateReceiptDocumentResponse {}\n\nexport interface SendReceiptEmailRequest {\n /**\n * Receipt ID to send.\n * @format GUID\n */\n receiptId: string;\n /**\n * Recipient contact ID.\n * @format GUID\n */\n contactId?: string | null;\n}\n\nexport interface SendReceiptEmailResponse {}\n\nexport interface GetLatestReceiptNumberRequest {\n /**\n * Receipt prefix to filter by.\n * @minLength 1\n * @maxLength 10\n */\n prefix?: string | null;\n}\n\nexport interface GetLatestReceiptNumberResponse {\n /** Receipt number. */\n number?: number | null;\n}\n\nexport interface UpdateExtendedFieldsRequest {\n /** ID of the entity to update. */\n _id: string;\n /** Identifier for the app whose extended fields are being updated. */\n namespace: string;\n /** Data to update. Structured according to the [schema](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields#json-schema-for-extended-fields) defined when the extended fields were configured. */\n namespaceData: Record<string, any> | null;\n}\n\nexport interface UpdateExtendedFieldsResponse {\n /** Updated receipt. */\n receipt?: Receipt;\n}\n\nexport interface Empty {}\n\n/** @docsIgnore */\nexport type CreateReceiptApplicationErrors =\n | {\n code?: 'APP_INSTALLATION_FAILED';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'NO_META_SITE';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'RECEIPT_PRESET_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n/** @docsIgnore */\nexport type RegenerateReceiptDocumentApplicationErrors = {\n code?: 'NOT_APPLICABLE_TO_REGENERATE';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type SendReceiptEmailApplicationErrors =\n | {\n code?: 'MISSING_CONTACT';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SEND_LIMIT_REACHED';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'NO_META_SITE';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'MISSING_DOCUMENT';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'MISSING_NUMBERING';\n description?: string;\n data?: Record<string, any>;\n };\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\nexport interface ReceiptCreatedEnvelope {\n entity: Receipt;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a receipt is created.\n * @permissionScope Manage Receipts\n * @permissionScopeId SCOPE.RECEIPTS.MANAGE\n * @permissionId RECEIPTS.RECEIPT_READ\n * @webhook\n * @eventType wix.receipts.v1.receipt_created\n * @slug created\n */\nexport declare function onReceiptCreated(\n handler: (event: ReceiptCreatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface ReceiptSentEnvelope {\n data: Sent;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a receipt is sent.\n * @permissionScope Manage Receipts\n * @permissionScopeId SCOPE.RECEIPTS.MANAGE\n * @permissionId RECEIPTS.RECEIPT_READ\n * @webhook\n * @eventType wix.receipts.v1.receipt_sent\n * @slug sent\n */\nexport declare function onReceiptSent(\n handler: (event: ReceiptSentEnvelope) => void | Promise<void>\n): void;\n\nexport interface ReceiptUpdatedEnvelope {\n entity: Receipt;\n metadata: EventMetadata;\n /** @hidden */\n modifiedFields: Record<string, any>;\n}\n\n/**\n * Triggered when a receipt's number allocation is updated or a receipt document is generated.\n * @permissionScope Manage Receipts\n * @permissionScopeId SCOPE.RECEIPTS.MANAGE\n * @permissionId RECEIPTS.RECEIPT_READ\n * @webhook\n * @eventType wix.receipts.v1.receipt_updated\n * @slug updated\n */\nexport declare function onReceiptUpdated(\n handler: (event: ReceiptUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Creates a receipt.\n *\n * Receipt number is assigned later and will be provided in the Get Receipt response.\n * @param receipt - Receipt to create.\n * @public\n * @requiredField receipt\n * @requiredField receipt.currency\n * @requiredField receipt.lineItems\n * @requiredField receipt.lineItems._id\n * @requiredField receipt.lineItems.price\n * @requiredField receipt.lineItems.quantity\n * @requiredField receipt.lineItems.totals\n * @requiredField receipt.lineItems.totals.totalPriceBeforeTax\n * @requiredField receipt.payment\n * @requiredField receipt.payment.amount\n * @requiredField receipt.payment.paymentMethod\n * @requiredField receipt.payment.transactionDate\n * @requiredField receipt.sourceReference\n * @requiredField receipt.sourceReference.appId\n * @requiredField receipt.sourceReference.externalReferenceId\n * @requiredField receipt.sourceReference.order.wixEcomOrder.orderId\n * @requiredField receipt.sourceReference.order.wixEcomOrder.transactionId\n * @requiredField receipt.sourceReference.order.wixPaymentOrder.orderId\n * @requiredField receipt.sourceReference.order.wixPaymentOrder.transactionId\n * @requiredField receipt.sourceReference.receiptOrderType\n * @requiredField receipt.totals\n * @requiredField receipt.totals.subtotal\n * @requiredField receipt.totals.total\n * @permissionId RECEIPTS.RECEIPT_CREATE\n * @applicableIdentity APP\n * @returns Created receipt.\n * @fqn wix.receipts.v1.Receipts.CreateReceipt\n */\nexport async function createReceipt(\n receipt: NonNullablePaths<\n Receipt,\n | `currency`\n | `lineItems`\n | `lineItems.${number}._id`\n | `lineItems.${number}.price`\n | `lineItems.${number}.quantity`\n | `lineItems.${number}.totals`\n | `lineItems.${number}.totals.totalPriceBeforeTax`\n | `payment`\n | `payment.amount`\n | `payment.paymentMethod`\n | `payment.transactionDate`\n | `sourceReference`\n | `sourceReference.appId`\n | `sourceReference.externalReferenceId`\n | `sourceReference.receiptOrderType`\n | `sourceReference.wixEcomOrder.orderId`\n | `sourceReference.wixEcomOrder.transactionId`\n | `sourceReference.wixPaymentOrder.orderId`\n | `sourceReference.wixPaymentOrder.transactionId`\n | `totals`\n | `totals.subtotal`\n | `totals.total`,\n 5\n >\n): Promise<\n NonNullablePaths<\n Receipt,\n | `numbering.displayNumber`\n | `regionalProperties.locale.languageCode`\n | `currency`\n | `sourceReference.wixPaymentOrder.orderId`\n | `sourceReference.wixPaymentOrder.transactionId`\n | `sourceReference.wixEcomOrder.orderId`\n | `sourceReference.wixEcomOrder.transactionId`\n | `sourceReference.appId`\n | `sourceReference.externalReferenceId`\n | `sourceReference.receiptOrderType`\n | `businessDetails.address.streetAddress.number`\n | `businessDetails.address.streetAddress.name`\n | `businessDetails.address.streetAddress.apt`\n | `customer.contactDetails.vatId._id`\n | `customer.contactDetails.vatId.type`\n | `lineItems`\n | `shippingInfo.title`\n | `shippingInfo.priceBeforeTax`\n | `shippingInfo.priceAfterTax`\n | `shippingInfo.taxBreakdown`\n | `shippingInfo.taxBreakdown.${number}.name`\n | `shippingInfo.taxBreakdown.${number}.rate`\n | `shippingInfo.taxBreakdown.${number}.amount`\n | `additionalFees`\n | `additionalFees.${number}.name`\n | `additionalFees.${number}.priceBeforeTax`\n | `additionalFees.${number}.priceAfterTax`\n | `discounts`\n | `discounts.${number}.name`\n | `discounts.${number}.amount`\n | `payment.paymentMethod`\n | `payment.amount`\n | `taxBreakdown`\n | `taxBreakdown.${number}.name`\n | `taxBreakdown.${number}.rate`\n | `taxBreakdown.${number}.taxAmount`\n | `taxBreakdown.${number}.taxableAmount`\n | `customFields.headerCustomFields`\n | `customFields.headerCustomFields.${number}.value`\n | `customFields.businessCustomFields`\n | `customFields.customerCustomFields`\n | `customFields.footerCustomFields`\n | `customFields.footerCustomFields.${number}.title`\n | `document.status`,\n 5\n > & {\n __applicationErrorsType?: CreateReceiptApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = transformPaths(\n renameKeysFromSDKRequestToRESTRequest({ receipt: receipt }),\n [\n {\n transformFn: transformSDKAddressToRESTAddress,\n paths: [\n { path: 'receipt.businessDetails.address' },\n { path: 'receipt.customer.billingAddress' },\n { path: 'receipt.customer.shippingAddress' },\n ],\n },\n {\n transformFn: transformSDKImageToRESTImage,\n paths: [{ path: 'receipt.businessDetails.logo' }],\n },\n ]\n );\n\n const reqOpts = ambassadorWixReceiptsV1Receipt.createReceipt(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(\n transformPaths(result.data, [\n {\n transformFn: transformRESTAddressToSDKAddress,\n paths: [\n { path: 'receipt.businessDetails.address' },\n { path: 'receipt.customer.billingAddress' },\n { path: 'receipt.customer.shippingAddress' },\n ],\n },\n {\n transformFn: transformRESTImageToSDKImage,\n paths: [{ path: 'receipt.businessDetails.logo' }],\n },\n ])\n )?.receipt!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { receipt: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['receipt']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a receipt.\n * @param receiptId - Receipt ID.\n * @public\n * @requiredField receiptId\n * @permissionId RECEIPTS.RECEIPT_READ\n * @applicableIdentity APP\n * @returns Requested receipt.\n * @fqn wix.receipts.v1.Receipts.GetReceipt\n */\nexport async function getReceipt(\n receiptId: string\n): Promise<\n NonNullablePaths<\n Receipt,\n | `numbering.displayNumber`\n | `regionalProperties.locale.languageCode`\n | `currency`\n | `sourceReference.wixPaymentOrder.orderId`\n | `sourceReference.wixPaymentOrder.transactionId`\n | `sourceReference.wixEcomOrder.orderId`\n | `sourceReference.wixEcomOrder.transactionId`\n | `sourceReference.appId`\n | `sourceReference.externalReferenceId`\n | `sourceReference.receiptOrderType`\n | `businessDetails.address.streetAddress.number`\n | `businessDetails.address.streetAddress.name`\n | `businessDetails.address.streetAddress.apt`\n | `customer.contactDetails.vatId._id`\n | `customer.contactDetails.vatId.type`\n | `lineItems`\n | `shippingInfo.title`\n | `shippingInfo.priceBeforeTax`\n | `shippingInfo.priceAfterTax`\n | `shippingInfo.taxBreakdown`\n | `shippingInfo.taxBreakdown.${number}.name`\n | `shippingInfo.taxBreakdown.${number}.rate`\n | `shippingInfo.taxBreakdown.${number}.amount`\n | `additionalFees`\n | `additionalFees.${number}.name`\n | `additionalFees.${number}.priceBeforeTax`\n | `additionalFees.${number}.priceAfterTax`\n | `discounts`\n | `discounts.${number}.name`\n | `discounts.${number}.amount`\n | `payment.paymentMethod`\n | `payment.amount`\n | `taxBreakdown`\n | `taxBreakdown.${number}.name`\n | `taxBreakdown.${number}.rate`\n | `taxBreakdown.${number}.taxAmount`\n | `taxBreakdown.${number}.taxableAmount`\n | `customFields.headerCustomFields`\n | `customFields.headerCustomFields.${number}.value`\n | `customFields.businessCustomFields`\n | `customFields.customerCustomFields`\n | `customFields.footerCustomFields`\n | `customFields.footerCustomFields.${number}.title`\n | `document.status`,\n 5\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n receiptId: receiptId,\n });\n\n const reqOpts = ambassadorWixReceiptsV1Receipt.getReceipt(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(\n transformPaths(result.data, [\n {\n transformFn: transformRESTAddressToSDKAddress,\n paths: [\n { path: 'receipt.businessDetails.address' },\n { path: 'receipt.customer.billingAddress' },\n { path: 'receipt.customer.shippingAddress' },\n ],\n },\n {\n transformFn: transformRESTImageToSDKImage,\n paths: [{ path: 'receipt.businessDetails.logo' }],\n },\n ])\n )?.receipt!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { receiptId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['receiptId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a list of up to 100 receipts, given the specified filtering, paging, and sorting ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/api-query-language) | [REST](https://dev.wix.com/api/rest/getting-started/api-query-language)).\n * @public\n * @permissionId RECEIPTS.RECEIPT_READ\n * @applicableIdentity APP\n * @fqn wix.receipts.v1.Receipts.QueryReceipts\n */\nexport function queryReceipts(): ReceiptsQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<\n Receipt,\n 'CURSOR',\n QueryReceiptsRequest,\n QueryReceiptsResponse\n >({\n func: async (payload: QueryReceiptsRequest) => {\n const reqOpts = ambassadorWixReceiptsV1Receipt.queryReceipts(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n return result;\n } catch (err) {\n sideEffects?.onError?.(err);\n throw err;\n }\n },\n requestTransformer: (query: QueryReceiptsRequest['query']) => {\n const args = [query, {}] as [QueryReceiptsRequest['query'], {}];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryReceiptsResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [\n {\n transformFn: transformRESTAddressToSDKAddress,\n paths: [\n { path: 'receipts.businessDetails.address' },\n { path: 'receipts.customer.billingAddress' },\n { path: 'receipts.customer.shippingAddress' },\n ],\n },\n {\n transformFn: transformRESTImageToSDKImage,\n paths: [{ path: 'receipts.businessDetails.logo' }],\n },\n ])\n );\n\n return {\n items: transformedData?.receipts,\n pagingMetadata: transformedData?.pagingMetadata,\n };\n },\n errorTransformer: (err: unknown) => {\n const transformedError = sdkTransformError(err, {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n });\n\n throw transformedError;\n },\n pagingMethod: 'CURSOR',\n transformationPaths: {},\n });\n}\n\ninterface QueryCursorResult {\n cursors: Cursors;\n hasNext: () => boolean;\n hasPrev: () => boolean;\n length: number;\n pageSize: number;\n}\n\nexport interface ReceiptsQueryResult extends QueryCursorResult {\n items: Receipt[];\n query: ReceiptsQueryBuilder;\n next: () => Promise<ReceiptsQueryResult>;\n prev: () => Promise<ReceiptsQueryResult>;\n}\n\nexport interface ReceiptsQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n eq: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'numbering.number'\n | 'numbering.prefix'\n | 'numbering.suffix'\n | 'sourceReference.wixPaymentOrder.transactionId'\n | 'sourceReference.wixEcomOrder.transactionId'\n | 'sourceReference.appId'\n | 'sourceReference.externalReferenceId',\n value: any\n ) => ReceiptsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ne: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'numbering.number'\n | 'numbering.prefix'\n | 'numbering.suffix'\n | 'sourceReference.wixPaymentOrder.transactionId'\n | 'sourceReference.wixEcomOrder.transactionId'\n | 'sourceReference.appId'\n | 'sourceReference.externalReferenceId',\n value: any\n ) => ReceiptsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ge: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'numbering.number'\n | 'numbering.prefix'\n | 'numbering.suffix'\n | 'sourceReference.wixPaymentOrder.transactionId'\n | 'sourceReference.wixEcomOrder.transactionId'\n | 'sourceReference.appId'\n | 'sourceReference.externalReferenceId',\n value: any\n ) => ReceiptsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n gt: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'numbering.number'\n | 'numbering.prefix'\n | 'numbering.suffix'\n | 'sourceReference.wixPaymentOrder.transactionId'\n | 'sourceReference.wixEcomOrder.transactionId'\n | 'sourceReference.appId'\n | 'sourceReference.externalReferenceId',\n value: any\n ) => ReceiptsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n le: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'numbering.number'\n | 'numbering.prefix'\n | 'numbering.suffix'\n | 'sourceReference.wixPaymentOrder.transactionId'\n | 'sourceReference.wixEcomOrder.transactionId'\n | 'sourceReference.appId'\n | 'sourceReference.externalReferenceId',\n value: any\n ) => ReceiptsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n lt: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'numbering.number'\n | 'numbering.prefix'\n | 'numbering.suffix'\n | 'sourceReference.wixPaymentOrder.transactionId'\n | 'sourceReference.wixEcomOrder.transactionId'\n | 'sourceReference.appId'\n | 'sourceReference.externalReferenceId',\n value: any\n ) => ReceiptsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `string`.\n * @param string - String to compare against. Case-insensitive.\n */\n startsWith: (\n propertyName:\n | '_id'\n | 'numbering.prefix'\n | 'numbering.suffix'\n | 'sourceReference.wixPaymentOrder.transactionId'\n | 'sourceReference.wixEcomOrder.transactionId'\n | 'sourceReference.appId'\n | 'sourceReference.externalReferenceId',\n value: string\n ) => ReceiptsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `values`.\n * @param values - List of values to compare against.\n */\n hasSome: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'numbering.number'\n | 'numbering.prefix'\n | 'numbering.suffix'\n | 'sourceReference.wixPaymentOrder.transactionId'\n | 'sourceReference.wixEcomOrder.transactionId'\n | 'sourceReference.appId'\n | 'sourceReference.externalReferenceId',\n value: any[]\n ) => ReceiptsQueryBuilder;\n in: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'numbering.number'\n | 'numbering.prefix'\n | 'numbering.suffix'\n | 'sourceReference.wixPaymentOrder.transactionId'\n | 'sourceReference.wixEcomOrder.transactionId'\n | 'sourceReference.appId'\n | 'sourceReference.externalReferenceId',\n value: any\n ) => ReceiptsQueryBuilder;\n exists: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'numbering.number'\n | 'numbering.prefix'\n | 'numbering.suffix'\n | 'sourceReference.wixPaymentOrder.transactionId'\n | 'sourceReference.wixEcomOrder.transactionId'\n | 'sourceReference.appId'\n | 'sourceReference.externalReferenceId',\n value: boolean\n ) => ReceiptsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n ascending: (\n ...propertyNames: Array<\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'numbering.number'\n | 'numbering.prefix'\n | 'numbering.suffix'\n | 'numbering.displayNumber'\n | 'sourceReference.wixPaymentOrder.transactionId'\n | 'sourceReference.wixEcomOrder.transactionId'\n | 'sourceReference.appId'\n | 'sourceReference.externalReferenceId'\n >\n ) => ReceiptsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n descending: (\n ...propertyNames: Array<\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'numbering.number'\n | 'numbering.prefix'\n | 'numbering.suffix'\n | 'numbering.displayNumber'\n | 'sourceReference.wixPaymentOrder.transactionId'\n | 'sourceReference.wixEcomOrder.transactionId'\n | 'sourceReference.appId'\n | 'sourceReference.externalReferenceId'\n >\n ) => ReceiptsQueryBuilder;\n /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */\n limit: (limit: number) => ReceiptsQueryBuilder;\n /** @param cursor - A pointer to specific record */\n skipTo: (cursor: string) => ReceiptsQueryBuilder;\n find: () => Promise<ReceiptsQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn wix.receipts.v1.Receipts.QueryReceipts\n * @requiredField query\n */\nexport async function typedQueryReceipts(\n query: ReceiptQuery\n): Promise<\n NonNullablePaths<\n QueryReceiptsResponse,\n | `receipts`\n | `receipts.${number}.numbering.displayNumber`\n | `receipts.${number}.regionalProperties.locale.languageCode`\n | `receipts.${number}.currency`\n | `receipts.${number}.sourceReference.wixPaymentOrder.orderId`\n | `receipts.${number}.sourceReference.wixPaymentOrder.transactionId`\n | `receipts.${number}.sourceReference.wixEcomOrder.orderId`\n | `receipts.${number}.sourceReference.wixEcomOrder.transactionId`\n | `receipts.${number}.sourceReference.appId`\n | `receipts.${number}.sourceReference.externalReferenceId`\n | `receipts.${number}.sourceReference.receiptOrderType`\n | `receipts.${number}.shippingInfo.title`\n | `receipts.${number}.shippingInfo.priceBeforeTax`\n | `receipts.${number}.shippingInfo.priceAfterTax`\n | `receipts.${number}.payment.paymentMethod`\n | `receipts.${number}.payment.amount`\n | `receipts.${number}.document.status`,\n 6\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ query: query });\n\n const reqOpts = ambassadorWixReceiptsV1Receipt.queryReceipts(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(\n transformPaths(result.data, [\n {\n transformFn: transformRESTAddressToSDKAddress,\n paths: [\n { path: 'receipts.businessDetails.address' },\n { path: 'receipts.customer.billingAddress' },\n { path: 'receipts.customer.shippingAddress' },\n ],\n },\n {\n transformFn: transformRESTImageToSDKImage,\n paths: [{ path: 'receipts.businessDetails.logo' }],\n },\n ])\n )!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['query']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ReceiptQuerySpec extends QuerySpec {\n paging: 'cursor';\n wql: [\n {\n fields: [\n '_createdDate',\n '_id',\n '_updatedDate',\n 'numbering.number',\n 'numbering.prefix',\n 'numbering.suffix',\n 'sourceReference.appId',\n 'sourceReference.externalReferenceId',\n 'sourceReference.wixEcomOrder.transactionId',\n 'sourceReference.wixPaymentOrder.transactionId'\n ];\n operators: '*';\n sort: 'BOTH';\n },\n {\n fields: ['numbering.displayNumber'];\n operators: [];\n sort: 'BOTH';\n }\n ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<\n Receipt,\n ReceiptQuerySpec\n>;\nexport type ReceiptQuery = {\n /** \n Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. \n */\n cursorPaging?: {\n /** \n Maximum number of items to return in the results. \n @max: 100 \n */\n limit?:\n | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['limit']\n | null;\n /** \n Pointer to the next or previous page in the list of results.\n\n Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n Not relevant for the first request. \n @maxLength: 16000 \n */\n cursor?:\n | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['cursor']\n | null;\n };\n /** \n Filter object in the following format:\n `\"filter\" : {\n \"fieldName1\": \"value1\",\n \"fieldName2\":{\"$operator\":\"value2\"}\n }`\n Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` \n */\n filter?: CommonQueryWithEntityContext['filter'] | null;\n /** \n Sort object in the following format:\n `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]` \n @maxSize: 5 \n */\n sort?: {\n /** \n Name of the field to sort by. \n @maxLength: 512 \n */\n fieldName?: NonNullable<\n CommonQueryWithEntityContext['sort']\n >[number]['fieldName'];\n /** \n Sort order. \n */\n order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];\n }[];\n};\n\n/**\n * Retries generating a receipt document that has a `FAILED` or stuck in `PROCESSING` status.\n *\n * Note that you can access a receipt document with an `AVAILABLE` status with the URL provided in `document.downloadUrl` without regenerating.\n * @param receiptId - Receipt ID.\n * @public\n * @requiredField receiptId\n * @permissionId RECEIPTS.RECEIPT_UPDATE\n * @applicableIdentity APP\n * @fqn wix.receipts.v1.Receipts.RegenerateReceiptDocument\n */\nexport async function regenerateReceiptDocument(receiptId: string): Promise<\n void & {\n __applicationErrorsType?: RegenerateReceiptDocumentApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n receiptId: receiptId,\n });\n\n const reqOpts =\n ambassadorWixReceiptsV1Receipt.regenerateReceiptDocument(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { receiptId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['receiptId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Sends the receipt to the specified recipient in an email.\n *\n * Specifying a contact ID is required only when no contact ID was specified upon receipt creation.\n *\n * Note that if the specified contact ID doesn't have an associated email address, the call will fail.\n * @param receiptId - Receipt ID to send.\n * @public\n * @requiredField receiptId\n * @param options - Field options. The `contactId` object must be passed if one was not already specified upon receipt creation.\n * @permissionId RECEIPTS.RECEIPT_SEND\n * @applicableIdentity APP\n * @fqn wix.receipts.v1.Receipts.SendReceiptEmail\n */\nexport async function sendReceiptEmail(\n receiptId: string,\n options?: SendReceiptEmailOptions\n): Promise<\n void & {\n __applicationErrorsType?: SendReceiptEmailApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n receiptId: receiptId,\n contactId: options?.contactId,\n });\n\n const reqOpts = ambassadorWixReceiptsV1Receipt.sendReceiptEmail(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n receiptId: '$[0]',\n contactId: '$[1].contactId',\n },\n singleArgumentUnchanged: false,\n },\n ['receiptId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface SendReceiptEmailOptions {\n /**\n * Recipient contact ID.\n * @format GUID\n */\n contactId?: string | null;\n}\n\n/**\n * Retrieves the highest receipt number currently in use (the sequential identifier displayed between the prefix and suffix in receipt display numbers).\n * Can be filtered by prefix.\n *\n * Receipt numbering is managed in the Receipts Settings API.\n * @public\n * @param options - Field options.\n * @permissionId RECEIPTS.RECEIPT_READ\n * @applicableIdentity APP\n * @fqn wix.receipts.v1.Receipts.GetLatestReceiptNumber\n */\nexport async function getLatestReceiptNumber(\n options?: GetLatestReceiptNumberOptions\n): Promise<GetLatestReceiptNumberResponse> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n prefix: options?.prefix,\n });\n\n const reqOpts =\n ambassadorWixReceiptsV1Receipt.getLatestReceiptNumber(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { prefix: '$[0].prefix' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetLatestReceiptNumberOptions {\n /**\n * Receipt prefix to filter by.\n * @minLength 1\n * @maxLength 10\n */\n prefix?: string | null;\n}\n\n/**\n * Updates extended fields of a receipt, without incrementing revision.\n * @param _id - ID of the entity to update.\n * @param namespace - Identifier for the app whose extended fields are being updated.\n * @public\n * @requiredField _id\n * @requiredField namespace\n * @requiredField options\n * @requiredField options.namespaceData\n * @param options - Field options. The `namespaceData` object **must** be passed.\n * @permissionId RECEIPTS.RECEIPT_UPDATE\n * @applicableIdentity APP\n * @fqn wix.receipts.v1.Receipts.UpdateExtendedFields\n */\nexport async function updateExtendedFields(\n _id: string,\n namespace: string,\n options: NonNullablePaths<UpdateExtendedFieldsOptions, `namespaceData`, 2>\n): Promise<\n NonNullablePaths<\n UpdateExtendedFieldsResponse,\n | `receipt.numbering.displayNumber`\n | `receipt.regionalProperties.locale.languageCode`\n | `receipt.currency`\n | `receipt.sourceReference.wixPaymentOrder.orderId`\n | `receipt.sourceReference.wixPaymentOrder.transactionId`\n | `receipt.sourceReference.wixEcomOrder.orderId`\n | `receipt.sourceReference.wixEcomOrder.transactionId`\n | `receipt.sourceReference.appId`\n | `receipt.sourceReference.externalReferenceId`\n | `receipt.sourceReference.receiptOrderType`\n | `receipt.businessDetails.address.streetAddress.number`\n | `receipt.businessDetails.address.streetAddress.name`\n | `receipt.businessDetails.address.streetAddress.apt`\n | `receipt.customer.contactDetails.vatId._id`\n | `receipt.customer.contactDetails.vatId.type`\n | `receipt.lineItems`\n | `receipt.shippingInfo.title`\n | `receipt.shippingInfo.priceBeforeTax`\n | `receipt.shippingInfo.priceAfterTax`\n | `receipt.shippingInfo.taxBreakdown`\n | `receipt.shippingInfo.taxBreakdown.${number}.name`\n | `receipt.shippingInfo.taxBreakdown.${number}.rate`\n | `receipt.shippingInfo.taxBreakdown.${number}.amount`\n | `receipt.additionalFees`\n | `receipt.additionalFees.${number}.name`\n | `receipt.additionalFees.${number}.priceBeforeTax`\n | `receipt.additionalFees.${number}.priceAfterTax`\n | `receipt.discounts`\n | `receipt.discounts.${number}.name`\n | `receipt.discounts.${number}.amount`\n | `receipt.payment.paymentMethod`\n | `receipt.payment.amount`\n | `receipt.taxBreakdown`\n | `receipt.taxBreakdown.${number}.name`\n | `receipt.taxBreakdown.${number}.rate`\n | `receipt.taxBreakdown.${number}.taxAmount`\n | `receipt.taxBreakdown.${number}.taxableAmount`\n | `receipt.customFields.headerCustomFields`\n | `receipt.customFields.headerCustomFields.${number}.value`\n | `receipt.customFields.businessCustomFields`\n | `receipt.customFields.customerCustomFields`\n | `receipt.customFields.footerCustomFields`\n | `receipt.customFields.footerCustomFields.${number}.title`\n | `receipt.document.status`,\n 6\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[3] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n id: _id,\n namespace: namespace,\n namespaceData: options?.namespaceData,\n });\n\n const reqOpts = ambassadorWixReceiptsV1Receipt.updateExtendedFields(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(\n transformPaths(result.data, [\n {\n transformFn: transformRESTAddressToSDKAddress,\n paths: [\n { path: 'receipt.businessDetails.address' },\n { path: 'receipt.customer.billingAddress' },\n { path: 'receipt.customer.shippingAddress' },\n ],\n },\n {\n transformFn: transformRESTImageToSDKImage,\n paths: [{ path: 'receipt.businessDetails.logo' }],\n },\n ])\n )!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n id: '$[0]',\n namespace: '$[1]',\n namespaceData: '$[2].namespaceData',\n },\n singleArgumentUnchanged: false,\n },\n ['_id', 'namespace', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateExtendedFieldsOptions {\n /** Data to update. Structured according to the [schema](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields#json-schema-for-extended-fields) defined when the extended fields were configured. */\n namespaceData: Record<string, any> | null;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformRESTFloatToSDKFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixReceiptsV1ReceiptsUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/receipts',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/receipts/v1/receipts',\n destPath: '/v1/receipts',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/receipts/v1/receipts',\n destPath: '/v1/receipts',\n },\n ],\n _: [\n {\n srcPath: '/receipts/v1/receipts',\n destPath: '/v1/receipts',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_get-paid_receipts';\n\n/**\n * Creates a receipt.\n *\n * Receipt number is assigned later and will be provided in the Get Receipt response.\n */\nexport function createReceipt(payload: object): RequestOptionsFactory<any> {\n function __createReceipt({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'receipt.createdDate' },\n { path: 'receipt.updatedDate' },\n { path: 'receipt.businessDetails.logo.urlExpirationDate' },\n { path: 'receipt.payment.transactionDate' },\n { path: 'receipt.document.startGenerationTime' },\n ],\n },\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'receipt.businessDetails.address.geocode.latitude' },\n { path: 'receipt.businessDetails.address.geocode.longitude' },\n { path: 'receipt.customer.billingAddress.geocode.latitude' },\n { path: 'receipt.customer.billingAddress.geocode.longitude' },\n { path: 'receipt.customer.shippingAddress.geocode.latitude' },\n { path: 'receipt.customer.shippingAddress.geocode.longitude' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.receipts.v1.receipt',\n method: 'POST' as any,\n methodFqn: 'wix.receipts.v1.Receipts.CreateReceipt',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixReceiptsV1ReceiptsUrl({\n protoPath: '/v1/receipts',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'receipt.createdDate' },\n { path: 'receipt.updatedDate' },\n { path: 'receipt.businessDetails.logo.urlExpirationDate' },\n { path: 'receipt.payment.transactionDate' },\n { path: 'receipt.document.startGenerationTime' },\n ],\n },\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'receipt.businessDetails.address.geocode.latitude' },\n { path: 'receipt.businessDetails.address.geocode.longitude' },\n { path: 'receipt.customer.billingAddress.geocode.latitude' },\n { path: 'receipt.customer.billingAddress.geocode.longitude' },\n { path: 'receipt.customer.shippingAddress.geocode.latitude' },\n { path: 'receipt.customer.shippingAddress.geocode.longitude' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createReceipt;\n}\n\n/** Retrieves a receipt. */\nexport function getReceipt(payload: object): RequestOptionsFactory<any> {\n function __getReceipt({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.receipts.v1.receipt',\n method: 'GET' as any,\n methodFqn: 'wix.receipts.v1.Receipts.GetReceipt',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixReceiptsV1ReceiptsUrl({\n protoPath: '/v1/receipts/{receiptId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'receipt.createdDate' },\n { path: 'receipt.updatedDate' },\n { path: 'receipt.businessDetails.logo.urlExpirationDate' },\n { path: 'receipt.payment.transactionDate' },\n { path: 'receipt.document.startGenerationTime' },\n ],\n },\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'receipt.businessDetails.address.geocode.latitude' },\n { path: 'receipt.businessDetails.address.geocode.longitude' },\n { path: 'receipt.customer.billingAddress.geocode.latitude' },\n { path: 'receipt.customer.billingAddress.geocode.longitude' },\n { path: 'receipt.customer.shippingAddress.geocode.latitude' },\n { path: 'receipt.customer.shippingAddress.geocode.longitude' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getReceipt;\n}\n\n/** Retrieves a list of up to 100 receipts, given the specified filtering, paging, and sorting ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/api-query-language) | [REST](https://dev.wix.com/api/rest/getting-started/api-query-language)). */\nexport function queryReceipts(payload: object): RequestOptionsFactory<any> {\n function __queryReceipts({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.receipts.v1.receipt',\n method: 'POST' as any,\n methodFqn: 'wix.receipts.v1.Receipts.QueryReceipts',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixReceiptsV1ReceiptsUrl({\n protoPath: '/v1/receipts/query',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'receipts.createdDate' },\n { path: 'receipts.updatedDate' },\n { path: 'receipts.businessDetails.logo.urlExpirationDate' },\n { path: 'receipts.payment.transactionDate' },\n { path: 'receipts.document.startGenerationTime' },\n ],\n },\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'receipts.businessDetails.address.geocode.latitude' },\n { path: 'receipts.businessDetails.address.geocode.longitude' },\n { path: 'receipts.customer.billingAddress.geocode.latitude' },\n { path: 'receipts.customer.billingAddress.geocode.longitude' },\n { path: 'receipts.customer.shippingAddress.geocode.latitude' },\n { path: 'receipts.customer.shippingAddress.geocode.longitude' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __queryReceipts;\n}\n\n/**\n * Retries generating a receipt document that has a `FAILED` or stuck in `PROCESSING` status.\n *\n * Note that you can access a receipt document with an `AVAILABLE` status with the URL provided in `document.downloadUrl` without regenerating.\n */\nexport function regenerateReceiptDocument(\n payload: object\n): RequestOptionsFactory<any> {\n function __regenerateReceiptDocument({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.receipts.v1.receipt',\n method: 'POST' as any,\n methodFqn: 'wix.receipts.v1.Receipts.RegenerateReceiptDocument',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixReceiptsV1ReceiptsUrl({\n protoPath: '/v1/receipts/{receiptId}/regenerate-receipt-document',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __regenerateReceiptDocument;\n}\n\n/**\n * Sends the receipt to the specified recipient in an email.\n *\n * Specifying a contact ID is required only when no contact ID was specified upon receipt creation.\n *\n * Note that if the specified contact ID doesn't have an associated email address, the call will fail.\n */\nexport function sendReceiptEmail(payload: object): RequestOptionsFactory<any> {\n function __sendReceiptEmail({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.receipts.v1.receipt',\n method: 'POST' as any,\n methodFqn: 'wix.receipts.v1.Receipts.SendReceiptEmail',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixReceiptsV1ReceiptsUrl({\n protoPath: '/v1/receipts/{receiptId}/send-email',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __sendReceiptEmail;\n}\n\n/**\n * Retrieves the highest receipt number currently in use (the sequential identifier displayed between the prefix and suffix in receipt display numbers).\n * Can be filtered by prefix.\n *\n * Receipt numbering is managed in the Receipts Settings API.\n */\nexport function getLatestReceiptNumber(\n payload: object\n): RequestOptionsFactory<any> {\n function __getLatestReceiptNumber({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.receipts.v1.receipt',\n method: 'GET' as any,\n methodFqn: 'wix.receipts.v1.Receipts.GetLatestReceiptNumber',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixReceiptsV1ReceiptsUrl({\n protoPath: '/v1/receipts/get-latest-number',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getLatestReceiptNumber;\n}\n\n/** Updates extended fields of a receipt, without incrementing revision. */\nexport function updateExtendedFields(\n payload: object\n): RequestOptionsFactory<any> {\n function __updateExtendedFields({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.receipts.v1.receipt',\n method: 'POST' as any,\n methodFqn: 'wix.receipts.v1.Receipts.UpdateExtendedFields',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixReceiptsV1ReceiptsUrl({\n protoPath: '/v1/receipts/{id}/update-extended-fields',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'receipt.createdDate' },\n { path: 'receipt.updatedDate' },\n { path: 'receipt.businessDetails.logo.urlExpirationDate' },\n { path: 'receipt.payment.transactionDate' },\n { path: 'receipt.document.startGenerationTime' },\n ],\n },\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'receipt.businessDetails.address.geocode.latitude' },\n { path: 'receipt.businessDetails.address.geocode.longitude' },\n { path: 'receipt.customer.billingAddress.geocode.latitude' },\n { path: 'receipt.customer.billingAddress.geocode.longitude' },\n { path: 'receipt.customer.shippingAddress.geocode.latitude' },\n { path: 'receipt.customer.shippingAddress.geocode.longitude' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateExtendedFields;\n}\n","import {\n createReceipt as publicCreateReceipt,\n getReceipt as publicGetReceipt,\n queryReceipts as publicQueryReceipts,\n typedQueryReceipts as publicTypedQueryReceipts,\n regenerateReceiptDocument as publicRegenerateReceiptDocument,\n sendReceiptEmail as publicSendReceiptEmail,\n getLatestReceiptNumber as publicGetLatestReceiptNumber,\n updateExtendedFields as publicUpdateExtendedFields,\n} from './receipts-v1-receipt-receipts.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { createEventModule } from '@wix/sdk-runtime/event-definition-modules';\nimport {\n BuildRESTFunction,\n MaybeContext,\n BuildEventDefinition,\n} from '@wix/sdk-types';\nimport { HttpClient } from '@wix/sdk-types';\nimport { createQueryOverloadRouter } from '@wix/sdk-runtime/query-method-router';\nimport {\n ReceiptQuery,\n ReceiptsQueryBuilder,\n typedQueryReceipts as universalTypedQueryReceipts,\n} from './receipts-v1-receipt-receipts.universal.js';\nimport { onReceiptCreated as publicOnReceiptCreated } from './receipts-v1-receipt-receipts.public.js';\nimport { onReceiptSent as publicOnReceiptSent } from './receipts-v1-receipt-receipts.public.js';\nimport { onReceiptUpdated as publicOnReceiptUpdated } from './receipts-v1-receipt-receipts.public.js';\n\nfunction customQueryReceipts(httpClient: HttpClient) {\n const router = createQueryOverloadRouter({\n builderQueryFunction: () => publicQueryReceipts(httpClient)(),\n typedQueryFunction: (query: ReceiptQuery) =>\n publicTypedQueryReceipts(httpClient)(query),\n hasOptionsParameter: false,\n });\n\n function overloadedQuery(): ReceiptsQueryBuilder;\n function overloadedQuery(\n query: ReceiptQuery\n ): ReturnType<typeof universalTypedQueryReceipts>;\n function overloadedQuery(query?: ReceiptQuery): any {\n return router(...arguments);\n }\n\n return overloadedQuery;\n}\n\nexport const createReceipt: MaybeContext<\n BuildRESTFunction<typeof publicCreateReceipt> & typeof publicCreateReceipt\n> = /*#__PURE__*/ createRESTModule(publicCreateReceipt);\nexport const getReceipt: MaybeContext<\n BuildRESTFunction<typeof publicGetReceipt> & typeof publicGetReceipt\n> = /*#__PURE__*/ createRESTModule(publicGetReceipt);\nexport const regenerateReceiptDocument: MaybeContext<\n BuildRESTFunction<typeof publicRegenerateReceiptDocument> &\n typeof publicRegenerateReceiptDocument\n> = /*#__PURE__*/ createRESTModule(publicRegenerateReceiptDocument);\nexport const sendReceiptEmail: MaybeContext<\n BuildRESTFunction<typeof publicSendReceiptEmail> &\n typeof publicSendReceiptEmail\n> = /*#__PURE__*/ createRESTModule(publicSendReceiptEmail);\nexport const getLatestReceiptNumber: MaybeContext<\n BuildRESTFunction<typeof publicGetLatestReceiptNumber> &\n typeof publicGetLatestReceiptNumber\n> = /*#__PURE__*/ createRESTModule(publicGetLatestReceiptNumber);\nexport const updateExtendedFields: MaybeContext<\n BuildRESTFunction<typeof publicUpdateExtendedFields> &\n typeof publicUpdateExtendedFields\n> = /*#__PURE__*/ createRESTModule(publicUpdateExtendedFields);\nexport const queryReceipts: MaybeContext<\n BuildRESTFunction<typeof customQueryReceipts> & typeof customQueryReceipts\n> = /*#__PURE__*/ createRESTModule(customQueryReceipts);\n/**\n * Triggered when a receipt is created.\n */\nexport const onReceiptCreated: BuildEventDefinition<\n typeof publicOnReceiptCreated\n> &\n typeof publicOnReceiptCreated = createEventModule(publicOnReceiptCreated);\n/**\n * Triggered when a receipt is sent.\n */\nexport const onReceiptSent: BuildEventDefinition<typeof publicOnReceiptSent> &\n typeof publicOnReceiptSent = createEventModule(publicOnReceiptSent);\n/**\n * Triggered when a receipt's number allocation is updated or a receipt document is generated.\n */\nexport const onReceiptUpdated: BuildEventDefinition<\n typeof publicOnReceiptUpdated\n> &\n typeof publicOnReceiptUpdated = createEventModule(publicOnReceiptUpdated);\n\nexport {\n ReceiptOrderType,\n SubdivisionType,\n VatType,\n DocumentStatus,\n WebhookIdentityType,\n RequestOrigin,\n SortOrder,\n} from './receipts-v1-receipt-receipts.universal.js';\nexport {\n Receipt,\n Numbering,\n RegionalProperties,\n Locale,\n SourceReference,\n SourceReferenceOrderOneOf,\n WixPayment,\n WixEcom,\n BusinessDetails,\n Address,\n AddressStreetOneOf,\n StreetAddress,\n AddressLocation,\n Subdivision,\n StandardDetails,\n Customer,\n FullAddressContactDetails,\n VatId,\n ShippingAddressContactDetails,\n LineItem,\n LineItemTax,\n LineItemTotals,\n ShippingInfo,\n ShippingTax,\n AdditionalFee,\n AdditionalFeeTax,\n Discount,\n Payment,\n Totals,\n Tax,\n CustomFields,\n CustomField,\n FooterCustomField,\n Document,\n ExtendedFields,\n Sent,\n UpdateReceiptRequest,\n UpdateReceiptResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n ReceiptDocumentProcess,\n ReceiptNumberingProcess,\n ReceiptDocumentHandled,\n ReceiptDocumentHandledResultOneOf,\n Succeeded,\n Failed,\n GenerateReceiptDocument,\n CreateReceiptRequest,\n CreateReceiptResponse,\n GetReceiptRequest,\n GetReceiptResponse,\n QueryReceiptsRequest,\n CursorQuery,\n CursorQueryPagingMethodOneOf,\n Sorting,\n CursorPaging,\n QueryReceiptsResponse,\n CursorPagingMetadata,\n Cursors,\n RegenerateReceiptDocumentRequest,\n RegenerateReceiptDocumentResponse,\n SendReceiptEmailRequest,\n SendReceiptEmailResponse,\n GetLatestReceiptNumberRequest,\n GetLatestReceiptNumberResponse,\n UpdateExtendedFieldsRequest,\n UpdateExtendedFieldsResponse,\n Empty,\n BaseEventMetadata,\n EventMetadata,\n ReceiptCreatedEnvelope,\n ReceiptSentEnvelope,\n ReceiptUpdatedEnvelope,\n ReceiptsQueryResult,\n ReceiptsQueryBuilder,\n ReceiptQuerySpec,\n SendReceiptEmailOptions,\n GetLatestReceiptNumberOptions,\n UpdateExtendedFieldsOptions,\n} from './receipts-v1-receipt-receipts.universal.js';\nexport {\n ReceiptOrderTypeWithLiterals,\n SubdivisionTypeWithLiterals,\n VatTypeWithLiterals,\n DocumentStatusWithLiterals,\n WebhookIdentityTypeWithLiterals,\n RequestOriginWithLiterals,\n SortOrderWithLiterals,\n CreateReceiptApplicationErrors,\n RegenerateReceiptDocumentApplicationErrors,\n SendReceiptEmailApplicationErrors,\n CommonQueryWithEntityContext,\n ReceiptQuery,\n} from './receipts-v1-receipt-receipts.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAAA;AAAA,EAAA,8BAAAC;AAAA,EAAA,kBAAAC;AAAA,EAAA,wBAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA,wBAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA,iCAAAC;AAAA,EAAA,wBAAAC;AAAA,EAAA,4BAAAC;AAAA;AAAA;;;ACAA,IAAAC,iCAAwD;AACxD,IAAAC,kBAAiD;AACjD,IAAAC,gBAA6C;AAC7C,IAAAC,oBAAqD;AACrD,IAAAC,0BAA+B;AAC/B,uBAA8D;;;ACL9D,6BAAoD;AACpD,2BAA6B;AAC7B,oCAGO;;;ACLP,0BAAkC;AAClC,mBAA6C;AAC7C,IAAAC,gBAA6C;AAC7C,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI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AAC;AAMD,WAAS,gBAAgB,OAA2B;AAClD,WAAO,OAAO,GAAG,SAAS;AAAA,EAC5B;AAEA,SAAO;AACT;AAEO,IAAMC,iBAEK,2DAAiBA,cAAmB;AAC/C,IAAMC,cAEK,2DAAiBA,WAAgB;AAC5C,IAAMC,6BAGK,2DAAiBA,0BAA+B;AAC3D,IAAMC,oBAGK,2DAAiBA,iBAAsB;AAClD,IAAMC,0BAGK,2DAAiBA,uBAA4B;AACxD,IAAMC,wBAGK,2DAAiBA,qBAA0B;AACtD,IAAMP,iBAEK,2DAAiB,mBAAmB;AAI/C,IAAMQ,wBAGqB,mDAAkB,gBAAsB;AAInE,IAAMC,qBACkB,mDAAkB,aAAmB;AAI7D,IAAMC,wBAGqB,mDAAkB,gBAAsB;","names":["createReceipt","getLatestReceiptNumber","getReceipt","onReceiptCreated","onReceiptSent","onReceiptUpdated","queryReceipts","regenerateReceiptDocument","sendReceiptEmail","updateExtendedFields","import_rename_all_nested_keys","import_address","import_image","import_timestamp","import_transform_paths","import_float","import_timestamp","import_rest_modules","payload","import_address","import_image","import_transform_paths","ReceiptOrderType","SubdivisionType","VatType","DocumentStatus","WebhookIdentityType","RequestOrigin","SortOrder","createReceipt","sdkTransformError","getReceipt","queryReceipts","regenerateReceiptDocument","sendReceiptEmail","getLatestReceiptNumber","updateExtendedFields","createReceipt","getReceipt","queryReceipts","typedQueryReceipts","regenerateReceiptDocument","sendReceiptEmail","getLatestReceiptNumber","updateExtendedFields","import_rest_modules","queryReceipts","typedQueryReceipts","createReceipt","getReceipt","regenerateReceiptDocument","sendReceiptEmail","getLatestReceiptNumber","updateExtendedFields","onReceiptCreated","onReceiptSent","onReceiptUpdated"]}
|