import { NonNullablePaths } from '@wix/sdk-types'; interface ReceiptsSettings { /** * Revision number, which increments by 1 each time the receipt settings are updated. To prevent conflicting changes, the current revision must be passed when updating the receipt settings. * @readonly */ revision?: string | null; /** * Date and time the receipt settings were created. * @readonly * @immutable */ _createdDate?: Date | null; /** * Date and time the receipt settings were last updated. * @readonly */ _updatedDate?: Date | null; /** Receipt numbering settings. */ numbering?: Numbering; /** * Custom field data for the receipt settings. * * Extended fields must be configured in the app dashboard before they can be accessed with API calls. */ extendedFields?: ExtendedFields; } interface Numbering { /** * Receipt prefix that will be displayed before the receipt number. * @minLength 1 * @maxLength 10 */ prefix?: string | null; /** * Next receipt number. Used during receipt creation to ensure unique and consecutive numbering. * @min 1 * @max 1000000000 */ nextNumber?: number | null; /** * Receipt suffix that will be displayed after the receipt number. * @minLength 1 * @maxLength 10 */ suffix?: 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 GetReceiptsSettingsRequest { } interface GetReceiptsSettingsResponse { /** Receipts settings. */ receiptsSettings?: ReceiptsSettings; } interface UpdateReceiptsSettingsRequest { /** Receipt settings to update. Partial update is supported, but if no receipt settings entity exists, the full entity must be specified. */ receiptsSettings: ReceiptsSettings; } interface UpdateReceiptsSettingsResponse { /** Updated receipt settings. */ receiptsSettings?: ReceiptsSettings; } interface NextNumberDescendingErrorDetails { /** Next available number for prefix. */ nextAvailableNumber?: number | null; } 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 GetReceiptsSettingsApplicationErrors = { code?: 'NO_META_SITE'; description?: string; data?: Record; }; /** @docsIgnore */ type UpdateReceiptsSettingsApplicationErrors = { code?: 'NO_META_SITE'; description?: string; data?: Record; } | { code?: 'NEXT_NUMBER_MISSING'; description?: string; data?: Record; } | { code?: 'PREFIX_CONTAINS_ILLEGAL_CHARACTERS'; description?: string; data?: Record; } | { code?: 'SUFFIX_CONTAINS_ILLEGAL_CHARACTERS'; description?: string; data?: Record; } | { code?: 'NEXT_NUMBER_DESCENDING'; description?: string; data?: NextNumberDescendingErrorDetails; }; 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 ReceiptsSettingsUpdatedEnvelope { entity: ReceiptsSettings; metadata: EventMetadata; /** @hidden */ modifiedFields: Record; } /** * Triggered when a site's receipt settings are updated. [TEST] * @permissionScope Manage Receipts * @permissionScopeId SCOPE.RECEIPTS.MANAGE * @permissionId RECEIPTS.RECEIPTS_SETTINGS_DOMAIN_EVENTS_READ * @webhook * @eventType wix.receipts.v1.receipts_settings_updated * @slug updated */ declare function onReceiptsSettingsUpdated(handler: (event: ReceiptsSettingsUpdatedEnvelope) => void | Promise): void; /** * Retrieves a site's receipt settings. * @public * @permissionId RECEIPTS.RECEIPTS_SETTINGS_READ * @applicableIdentity APP * @fqn wix.receipts.settings.v1.ReceiptsSettingsService.GetReceiptsSettings */ declare function getReceiptsSettings(): Promise; /** * Updates a site's receipt settings, or creates them if none exist. * @param receiptsSettings - Receipt settings to update. Partial update is supported, but if no receipt settings entity exists, the full entity must be specified. * @public * @requiredField receiptsSettings * @requiredField receiptsSettings.numbering * @requiredField receiptsSettings.revision * @permissionId RECEIPTS.RECEIPTS_SETTINGS_UPDATE * @applicableIdentity APP * @returns Updated receipt settings. * @fqn wix.receipts.settings.v1.ReceiptsSettingsService.UpdateReceiptsSettings */ declare function updateReceiptsSettings(receiptsSettings: NonNullablePaths): Promise; export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type BaseEventMetadata, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type ExtendedFields, type GetReceiptsSettingsApplicationErrors, type GetReceiptsSettingsRequest, type GetReceiptsSettingsResponse, type IdentificationData, type IdentificationDataIdOneOf, type MessageEnvelope, type NextNumberDescendingErrorDetails, type Numbering, type ReceiptsSettings, type ReceiptsSettingsUpdatedEnvelope, type RestoreInfo, type UpdateReceiptsSettingsApplicationErrors, type UpdateReceiptsSettingsRequest, type UpdateReceiptsSettingsResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, getReceiptsSettings, onReceiptsSettingsUpdated, updateReceiptsSettings };