import { NonNullablePaths } from '@wix/sdk-types'; /** Site-level settings that control order behavior, such as when inventory is decremented and whether invoices are automatically generated. */ interface OrdersSettings { /** * Defines when to update the store inventory. * * - `ON_ORDER_PAID`: Stock quantities will update only after the payment is approved. * - `ON_ORDER_PLACED`: Stock quantities will update while the payment is being processed. If the payment did not go through, items will restock. * * Default: `ON_ORDER_PLACED` */ inventoryUpdateTrigger?: InventoryUpdateTriggerWithLiterals; /** * Whether to automatically create invoices for every new order paid online. * Default: `false` */ createInvoice?: boolean | null; /** * Date and time the orders settings were created. * @readonly */ _createdDate?: Date | null; /** * Date and time the orders settings were updated. * @readonly */ _updatedDate?: Date | null; /** * Whether to automatically generate invoices for every new paid order. * * > **Notes**: * > + Default: `false` * > + An invoice issued for an order is not a tax invoice and does not reflect refunds. It is your responsibility to ensure that the invoices you issue conform to any relevant legal requirements. * @internal */ autoGenerateInvoiceOnPaidOrder?: boolean | null; } declare enum InventoryUpdateTrigger { /** Stock quantities will update only after the payment is approved. */ ON_ORDER_PAID = "ON_ORDER_PAID", /** Stock quantities will update while the payment is being processed. If the payment did not go through, items will restock. */ ON_ORDER_PLACED = "ON_ORDER_PLACED" } /** @enumType */ type InventoryUpdateTriggerWithLiterals = InventoryUpdateTrigger | 'ON_ORDER_PAID' | 'ON_ORDER_PLACED'; interface GetOrdersSettingsRequest { } interface GetOrdersSettingsResponse { /** Orders settings. */ ordersSettings?: OrdersSettings; } interface UpdateOrdersSettingsRequest { /** Orders settings to update. */ ordersSettings: OrdersSettings; } interface UpdateOrdersSettingsResponse { /** The updated orders settings. */ ordersSettings?: OrdersSettings; } interface DeleteOrdersSettingsRequest { } interface DeleteOrdersSettingsResponse { } interface ListOrdersSettingsRequest { } interface ListOrdersSettingsResponse { /** List of retrieved orders settings. */ ordersSettings?: OrdersSettings[]; } 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; } 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 OrdersSettingsUpdatedEnvelope { entity: OrdersSettings; metadata: EventMetadata; /** @hidden */ modifiedFields: Record; } /** * Triggered when orders settings are updated. * @permissionScope Manage Stores - all permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES * @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope Read eCommerce - all read permissions * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM * @permissionScope Read Orders * @permissionScopeId SCOPE.DC-STORES.READ-ORDERS * @permissionScope Read Stores - all read permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES * @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @permissionScope Manage eCommerce - all permissions * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM * @permissionScope Manage Orders * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS * @permissionId ECOM.READ_ORDERS_SETTINGS * @webhook * @eventType wix.ecom.v1.orders_settings_updated * @serviceIdentifier wix.ecom.orders_settings.api.v1.OrdersSettingsService * @slug updated * @documentationMaturity preview */ declare function onOrdersSettingsUpdated(handler: (event: OrdersSettingsUpdatedEnvelope) => void | Promise): void; /** * Retrieves the sites' order settings. * * * The `getOrdersSettings()` function returns a Promise that resolves to orders settings. * @public * @documentationMaturity preview * @permissionId ECOM.READ_ORDERS_SETTINGS * @applicableIdentity APP * @returns The requested orders settings. * @fqn wix.ecom.orders_settings.api.v1.OrdersSettingsService.GetOrdersSettings */ declare function getOrdersSettings(): Promise>; /** * Updates the sites' orders settings. * * * The `updateOrdersSettings()` function returns a Promise that resolves to the newly updated orders settings. * @public * @documentationMaturity preview * @requiredField ordersSettings * @param ordersSettings - Orders settings to update. * @permissionId ECOM.UPDATE_ORDERS_SETTINGS * @applicableIdentity APP * @returns The updated orders settings. * @fqn wix.ecom.orders_settings.api.v1.OrdersSettingsService.UpdateOrdersSettings */ declare function updateOrdersSettings(ordersSettings: OrdersSettings): Promise>; export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type BaseEventMetadata, type DeleteOrdersSettingsRequest, type DeleteOrdersSettingsResponse, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type GetOrdersSettingsRequest, type GetOrdersSettingsResponse, type IdentificationData, type IdentificationDataIdOneOf, InventoryUpdateTrigger, type InventoryUpdateTriggerWithLiterals, type ListOrdersSettingsRequest, type ListOrdersSettingsResponse, type MessageEnvelope, type OrdersSettings, type OrdersSettingsUpdatedEnvelope, type RestoreInfo, type UpdateOrdersSettingsRequest, type UpdateOrdersSettingsResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, getOrdersSettings, onOrdersSettingsUpdated, updateOrdersSettings };