import { NonNullablePaths } from '@wix/sdk-types'; /** A Receipt preset is a set of customizable receipt configurations that control the information, design, and branding of receipts to align with a site's business needs. */ interface ReceiptPreset { /** * Receipt preset ID. * @format GUID * @readonly * @immutable */ _id?: string | null; /** * Revision number, which increments by 1 each time the receipt preset is updated. * To prevent conflicting changes, the current revision must be passed when updating the receipt preset. * @readonly */ revision?: string | null; /** * Date and time the receipt preset was created. * @readonly * @immutable */ _createdDate?: Date | null; /** * Date and time the receipt preset was last updated. * @readonly */ _updatedDate?: Date | null; /** * Receipt preset name. * @maxLength 100 */ name?: string; /** Display settings. */ displaySettings?: DisplaySettings; /** * Custom fields. * Values appear on the receipt in the specified order. */ customFields?: CustomFields; /** * Whether this is the default receipt preset. * The default preset is used during receipt creation when a preset isn't specified or doesn't exist. * @readonly */ default?: boolean; /** Display values. */ displayValues?: DisplayValues; /** * Custom field data for the receipt preset. * * Extended fields must be configured in the app dashboard before they can be accessed with API calls. */ extendedFields?: ExtendedFields; } interface DisplaySettings { /** Business display options. */ businessDisplayOptions?: BusinessDisplayOptions; /** Customer display options. */ customerDisplayOptions?: CustomerDisplayOptions; /** Item display options. */ itemsDisplayOptions?: ItemsDisplayOption; /** Totals display options. */ totalsDisplayOptions?: TotalsDisplayOption; } interface BusinessDisplayOptions { /** Whether to display the business email in the receipt. */ showBusinessEmail?: boolean; /** Whether to display the business phone number in the receipt. */ showBusinessPhoneNumber?: boolean; /** Whether to display the business address in the receipt. */ showBusinessAddress?: boolean; } interface CustomerDisplayOptions { /** Whether to display the customer's email in the receipt. */ showCustomerEmail?: boolean; /** Whether to display the customer's phone number in the receipt. */ showCustomerPhoneNumber?: boolean; /** Whether to display the customer's shipping address in the receipt. */ showCustomerShippingAddress?: boolean; /** Whether to display the customer's billing address in the receipt. */ showCustomerBillingAddress?: boolean; /** Whether to display the customer's VAT ID in the receipt. */ showCustomerVatId?: boolean; /** Whether to display the customer's company's name. */ showCustomerCompanyName?: boolean; } interface ItemsDisplayOption { /** Whether to display item descriptions in the receipt. */ showItemsDescription?: boolean; /** Whether to display item taxes in the receipt. */ showTax?: boolean; } interface TotalsDisplayOption { /** Whether to display the tax breakdown in the receipt. */ showTaxBreakdown?: boolean; /** Whether to display the item subtotal per tax breakdown in the receipt. */ showItemSubtotalPerTaxBreakdown?: boolean; } interface CustomFields { /** * Header custom fields. * @maxSize 4 */ headerCustomFields?: CustomField[]; /** * Business custom fields. * @maxSize 4 */ businessCustomFields?: CustomField[]; /** * Customer custom fields. * @maxSize 4 */ customerCustomFields?: CustomField[]; /** * Footer custom fields. * @maxSize 4 */ footerCustomFields?: FooterCustomField[]; } interface CustomField { /** * Title. * @minLength 1 * @maxLength 100 */ title?: string | null; /** * Value. * @maxLength 100 */ value?: string; } interface FooterCustomField { /** * Title. * @minLength 1 * @maxLength 200 */ title?: string; /** * Value. * @maxLength 5000 */ value?: string | null; } interface DisplayValues { /** * Text override for receipt title. * @minLength 1 * @maxLength 20 */ titleOverride?: string | null; } interface ExtendedFields { /** * Extended field data. Each key corresponds to the namespace of the app that created the extended fields. * The value of each key is structured according to the schema defined when the extended fields were configured. * * You can only access fields for which you have the appropriate permissions. * * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields). */ namespaces?: Record>; } interface CreateReceiptPresetRequest { /** Receipt preset to create. */ receiptPreset: ReceiptPreset; } interface CreateReceiptPresetResponse { /** Created receipt preset. */ receiptPreset?: ReceiptPreset; } interface GetReceiptPresetRequest { /** * Receipt preset ID to retrieve. * @format GUID */ receiptPresetId: string; } interface GetReceiptPresetResponse { /** Requested receipt preset. */ receiptPreset?: ReceiptPreset; } interface GetDefaultReceiptPresetRequest { } interface GetDefaultReceiptPresetResponse { /** Default receipt preset. */ receiptPreset?: ReceiptPreset; } interface UpdateReceiptPresetRequest { /** Receipt preset to update. May be partial. */ receiptPreset: ReceiptPreset; } interface UpdateReceiptPresetResponse { /** Updated receipt preset. */ receiptPreset?: ReceiptPreset; } interface SetDefaultReceiptPresetRequest { /** * Receipt preset ID to set as default. * @format GUID */ receiptPresetId: string; } interface SetDefaultReceiptPresetResponse { /** Default receipt preset. */ receiptPreset?: ReceiptPreset; } interface DeleteReceiptPresetRequest { /** * Receipt preset ID to delete. * @format GUID */ receiptPresetId: string; } interface DeleteReceiptPresetResponse { } interface ListReceiptPresetsRequest { } interface ListReceiptPresetsResponse { /** List of receipt presets. */ receiptPresets?: ReceiptPreset[]; } interface UpdateExtendedFieldsRequest { /** ID of the entity to update. */ _id: string; /** Identifier for the app whose extended fields are being updated. */ namespace: string; /** 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. */ namespaceData: Record | null; } interface UpdateExtendedFieldsResponse { /** Updated receipt preset. */ receiptPreset?: ReceiptPreset; } interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** Event ID. With this ID you can easily spot duplicated events and ignore them. */ _id?: string; /** * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`. */ entityFqdn?: string; /** * Event action name, placed at the top level to make it easier for users to dispatch messages. * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`. */ slug?: string; /** ID of the entity associated with the event. */ entityId?: string; /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */ eventTime?: Date | null; /** * Whether the event was triggered as a result of a privacy regulation application * (for example, GDPR). */ triggeredByAnonymizeRequest?: boolean | null; /** If present, indicates the action that triggered the event. */ originatedFrom?: string | null; /** * 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. * 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. */ entityEventSequence?: string | null; } /** @oneof */ interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } interface EntityCreatedEvent { entity?: string; } interface RestoreInfo { deletedDate?: Date | null; } interface EntityUpdatedEvent { /** * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff. * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects. * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it. */ currentEntity?: string; } interface EntityDeletedEvent { /** Entity that was deleted. */ deletedEntity?: string | null; } interface ActionEvent { body?: string; } interface MessageEnvelope { /** * App instance ID. * @format GUID */ instanceId?: string | null; /** * Event type. * @maxLength 150 */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; /** Details related to the account */ accountInfo?: AccountInfo; } interface IdentificationData extends IdentificationDataIdOneOf { /** * ID of a site visitor that has not logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site visitor that has logged in to the site. * @format GUID */ memberId?: string; /** * ID of a Wix user (site owner, contributor, etc.). * @format GUID */ wixUserId?: string; /** * ID of an app. * @format GUID */ appId?: string; /** @readonly */ identityType?: WebhookIdentityTypeWithLiterals; } /** @oneof */ interface IdentificationDataIdOneOf { /** * ID of a site visitor that has not logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site visitor that has logged in to the site. * @format GUID */ memberId?: string; /** * ID of a Wix user (site owner, contributor, etc.). * @format GUID */ wixUserId?: string; /** * ID of an app. * @format GUID */ appId?: string; } declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } /** @enumType */ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP'; interface AccountInfo { /** * ID of the Wix account associated with the event. * @format GUID */ accountId?: string | null; /** * ID of the parent Wix account. Only included when accountId belongs to a child account. * @format GUID */ parentAccountId?: string | null; /** * ID of the Wix site associated with the event. Only included when the event is tied to a specific site. * @format GUID */ siteId?: string | null; } /** @docsIgnore */ type CreateReceiptPresetApplicationErrors = { code?: 'NO_META_SITE'; description?: string; data?: Record; } | { code?: 'APP_INSTALLATION_FAILED'; description?: string; data?: Record; }; /** @docsIgnore */ type GetDefaultReceiptPresetApplicationErrors = { code?: 'NO_META_SITE'; description?: string; data?: Record; }; /** @docsIgnore */ type UpdateReceiptPresetApplicationErrors = { code?: 'NO_META_SITE'; description?: string; data?: Record; }; /** @docsIgnore */ type DeleteReceiptPresetApplicationErrors = { code?: 'NO_META_SITE'; description?: string; data?: Record; } | { code?: 'DEFAULT_RECEIPT_PRESET'; description?: string; data?: Record; }; /** @docsIgnore */ type ListReceiptPresetsApplicationErrors = { code?: 'NO_META_SITE'; description?: string; data?: Record; }; interface BaseEventMetadata { /** * App instance ID. * @format GUID */ instanceId?: string | null; /** * Event type. * @maxLength 150 */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Details related to the account */ accountInfo?: AccountInfo; } interface EventMetadata extends BaseEventMetadata { /** Event ID. With this ID you can easily spot duplicated events and ignore them. */ _id?: string; /** * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`. */ entityFqdn?: string; /** * Event action name, placed at the top level to make it easier for users to dispatch messages. * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`. */ slug?: string; /** ID of the entity associated with the event. */ entityId?: string; /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */ eventTime?: Date | null; /** * Whether the event was triggered as a result of a privacy regulation application * (for example, GDPR). */ triggeredByAnonymizeRequest?: boolean | null; /** If present, indicates the action that triggered the event. */ originatedFrom?: string | null; /** * 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. * 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. */ entityEventSequence?: string | null; accountInfo?: AccountInfoMetadata; } interface AccountInfoMetadata { /** ID of the Wix account associated with the event */ accountId: string; /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */ siteId?: string; /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */ parentAccountId?: string; } interface ReceiptPresetCreatedEnvelope { entity: ReceiptPreset; metadata: EventMetadata; } /** * Triggered when a receipt preset is created. * @permissionScope Manage Receipts * @permissionScopeId SCOPE.RECEIPTS.MANAGE * @permissionId RECEIPTS.RECEIPT_PRESET_DOMAIN_EVENTS_READ * @webhook * @eventType wix.receipts.presets.v1.receipt_preset_created * @slug created */ declare function onReceiptPresetCreated(handler: (event: ReceiptPresetCreatedEnvelope) => void | Promise): void; interface ReceiptPresetDeletedEnvelope { entity: ReceiptPreset; metadata: EventMetadata; } /** * Triggered when a receipt preset is deleted. * @permissionScope Manage Receipts * @permissionScopeId SCOPE.RECEIPTS.MANAGE * @permissionId RECEIPTS.RECEIPT_PRESET_DOMAIN_EVENTS_READ * @webhook * @eventType wix.receipts.presets.v1.receipt_preset_deleted * @slug deleted */ declare function onReceiptPresetDeleted(handler: (event: ReceiptPresetDeletedEnvelope) => void | Promise): void; interface ReceiptPresetUpdatedEnvelope { entity: ReceiptPreset; metadata: EventMetadata; /** @hidden */ modifiedFields: Record; } /** * Triggered when a receipt preset is updated. * @permissionScope Manage Receipts * @permissionScopeId SCOPE.RECEIPTS.MANAGE * @permissionId RECEIPTS.RECEIPT_PRESET_DOMAIN_EVENTS_READ * @webhook * @eventType wix.receipts.presets.v1.receipt_preset_updated * @slug updated */ declare function onReceiptPresetUpdated(handler: (event: ReceiptPresetUpdatedEnvelope) => void | Promise): void; /** * Creates a receipt preset. * @param receiptPreset - Receipt preset to create. * @public * @requiredField receiptPreset * @permissionId RECEIPTS.RECEIPT_PRESET_CREATE * @applicableIdentity APP * @returns Created receipt preset. * @fqn wix.receipts.presets.v1.ReceiptPresets.CreateReceiptPreset */ declare function createReceiptPreset(receiptPreset: ReceiptPreset): Promise & { __applicationErrorsType?: CreateReceiptPresetApplicationErrors; }>; /** * Retrieves a receipt preset. * @param receiptPresetId - Receipt preset ID to retrieve. * @public * @requiredField receiptPresetId * @permissionId RECEIPTS.RECEIPT_PRESET_READ * @applicableIdentity APP * @returns Requested receipt preset. * @fqn wix.receipts.presets.v1.ReceiptPresets.GetReceiptPreset */ declare function getReceiptPreset(receiptPresetId: string): Promise>; /** * Retrieves the default receipt preset. * * The default preset is used during receipt creation when a preset isn't specified or doesn't exist. * @public * @permissionId RECEIPTS.RECEIPT_PRESET_READ * @applicableIdentity APP * @fqn wix.receipts.presets.v1.ReceiptPresets.GetDefaultReceiptPreset */ declare function getDefaultReceiptPreset(): Promise & { __applicationErrorsType?: GetDefaultReceiptPresetApplicationErrors; }>; /** * Updates a receipt preset. * * * Each time the receipt preset is updated, * `revision` increments by 1. * The current `revision` must be passed when updating the receipt preset. * This ensures you're working with the latest receipt preset * and prevents unintended overwrites. * @param _id - Receipt preset ID. * @public * @requiredField _id * @requiredField receiptPreset * @requiredField receiptPreset.revision * @permissionId RECEIPTS.RECEIPT_PRESET_UPDATE * @applicableIdentity APP * @returns Updated receipt preset. * @fqn wix.receipts.presets.v1.ReceiptPresets.UpdateReceiptPreset */ declare function updateReceiptPreset(_id: string, receiptPreset: NonNullablePaths): Promise & { __applicationErrorsType?: UpdateReceiptPresetApplicationErrors; }>; interface UpdateReceiptPreset { /** * Receipt preset ID. * @format GUID * @readonly * @immutable */ _id?: string | null; /** * Revision number, which increments by 1 each time the receipt preset is updated. * To prevent conflicting changes, the current revision must be passed when updating the receipt preset. * @readonly */ revision?: string | null; /** * Date and time the receipt preset was created. * @readonly * @immutable */ _createdDate?: Date | null; /** * Date and time the receipt preset was last updated. * @readonly */ _updatedDate?: Date | null; /** * Receipt preset name. * @maxLength 100 */ name?: string; /** Display settings. */ displaySettings?: DisplaySettings; /** * Custom fields. * Values appear on the receipt in the specified order. */ customFields?: CustomFields; /** * Whether this is the default receipt preset. * The default preset is used during receipt creation when a preset isn't specified or doesn't exist. * @readonly */ default?: boolean; /** Display values. */ displayValues?: DisplayValues; /** * Custom field data for the receipt preset. * * Extended fields must be configured in the app dashboard before they can be accessed with API calls. */ extendedFields?: ExtendedFields; } /** * Sets a receipt preset as default. * * The default preset is used during receipt creation when a preset isn't specified or doesn't exist. * @param receiptPresetId - Receipt preset ID to set as default. * @public * @requiredField receiptPresetId * @permissionId RECEIPTS.RECEIPT_PRESET_SET_DEFAULT * @applicableIdentity APP * @fqn wix.receipts.presets.v1.ReceiptPresets.SetDefaultReceiptPreset */ declare function setDefaultReceiptPreset(receiptPresetId: string): Promise>; /** * Permanently deletes a receipt preset. * @param receiptPresetId - Receipt preset ID to delete. * @public * @requiredField receiptPresetId * @permissionId RECEIPTS.RECEIPT_PRESET_DELETE * @applicableIdentity APP * @fqn wix.receipts.presets.v1.ReceiptPresets.DeleteReceiptPreset */ declare function deleteReceiptPreset(receiptPresetId: string): Promise; /** * Lists all available receipt presets. * * By default the returned receipt presets are sorted by `default` and `updatedDate` in descending order. * @public * @permissionId RECEIPTS.RECEIPT_PRESET_READ * @applicableIdentity APP * @fqn wix.receipts.presets.v1.ReceiptPresets.ListReceiptPresets */ declare function listReceiptPresets(): Promise & { __applicationErrorsType?: ListReceiptPresetsApplicationErrors; }>; /** * Updates the extended fields of a receipt preset, without incrementing revision. * @param _id - ID of the entity to update. * @param namespace - Identifier for the app whose extended fields are being updated. * @public * @requiredField _id * @requiredField namespace * @requiredField options * @requiredField options.namespaceData * @param options - Field options. The `namespaceData` object **must** be passed. * @permissionId RECEIPTS.RECEIPT_PRESET_UPDATE * @applicableIdentity APP * @fqn wix.receipts.presets.v1.ReceiptPresets.UpdateExtendedFields */ declare function updateExtendedFields(_id: string, namespace: string, options: NonNullablePaths): Promise>; interface UpdateExtendedFieldsOptions { /** 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. */ namespaceData: Record | null; } export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type BaseEventMetadata, type BusinessDisplayOptions, type CreateReceiptPresetApplicationErrors, type CreateReceiptPresetRequest, type CreateReceiptPresetResponse, type CustomField, type CustomFields, type CustomerDisplayOptions, type DeleteReceiptPresetApplicationErrors, type DeleteReceiptPresetRequest, type DeleteReceiptPresetResponse, type DisplaySettings, type DisplayValues, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type ExtendedFields, type FooterCustomField, type GetDefaultReceiptPresetApplicationErrors, type GetDefaultReceiptPresetRequest, type GetDefaultReceiptPresetResponse, type GetReceiptPresetRequest, type GetReceiptPresetResponse, type IdentificationData, type IdentificationDataIdOneOf, type ItemsDisplayOption, type ListReceiptPresetsApplicationErrors, type ListReceiptPresetsRequest, type ListReceiptPresetsResponse, type MessageEnvelope, type ReceiptPreset, type ReceiptPresetCreatedEnvelope, type ReceiptPresetDeletedEnvelope, type ReceiptPresetUpdatedEnvelope, type RestoreInfo, type SetDefaultReceiptPresetRequest, type SetDefaultReceiptPresetResponse, type TotalsDisplayOption, type UpdateExtendedFieldsOptions, type UpdateExtendedFieldsRequest, type UpdateExtendedFieldsResponse, type UpdateReceiptPreset, type UpdateReceiptPresetApplicationErrors, type UpdateReceiptPresetRequest, type UpdateReceiptPresetResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, createReceiptPreset, deleteReceiptPreset, getDefaultReceiptPreset, getReceiptPreset, listReceiptPresets, onReceiptPresetCreated, onReceiptPresetDeleted, onReceiptPresetUpdated, setDefaultReceiptPreset, updateExtendedFields, updateReceiptPreset };