interface Invoice { /** Invoice ID. */ _id?: string; /** ID of the app that set the invoice. */ appId?: string; } interface ListInvoicesForSingleOrderRequest { /** Order ID. */ orderId?: string; } interface ListInvoicesForSingleOrderResponse { /** List of invoices. */ invoices?: Invoice[]; } interface ListInvoicesForMultipleOrdersRequest { /** Order IDs for which to retrieve invoices. */ orderIds: string[]; } interface ListInvoicesForMultipleOrdersResponse { /** List of order IDs and their associated invoices. */ invoicesForOrder?: InvoicesForOrder[]; } interface InvoicesForOrder { /** Order ID. */ orderId?: string; /** Invoices info. */ invoicesInfo?: Invoice[]; } interface GenerateInvoiceRequest { /** Order ID. */ orderId: string; } interface GenerateInvoiceResponse { /** Invoice ID. */ invoiceId?: string; } interface BulkGenerateInvoicesRequest { /** Order IDs. */ orderIds: string[]; } interface BulkGenerateInvoicesResponse { results?: BulkInvoiceResult[]; bulkActionMetadata?: BulkActionMetadata; } interface BulkInvoiceResult { itemMetadata?: ItemMetadata; item?: InvoiceForOrder; } interface ItemMetadata { /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */ _id?: string | null; /** Index of the item within the request array. Allows for correlation between request and response items. */ originalIndex?: number; /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */ success?: boolean; /** Details about the error in case of failure. */ error?: ApplicationError; } interface ApplicationError { /** Error code. */ code?: string; /** Description of the error. */ description?: string; /** Data related to the error. */ data?: Record | null; } interface InvoiceForOrder { /** Order ID. */ orderId?: string; /** Invoice ID. */ invoiceId?: string; } interface BulkActionMetadata { /** Number of items that were successfully processed. */ totalSuccesses?: number; /** Number of items that couldn't be processed. */ totalFailures?: number; /** Number of failures without details because detailed failure threshold was exceeded. */ undetailedFailures?: number; } interface AddInvoiceToOrderRequest { /** Order ID. */ orderId: string; /** Invoice info. */ invoiceInfo: Invoice; } interface AddInvoiceToOrderResponse { /** List of order invoices. */ orderInvoices?: Invoice[]; } interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** * Unique event ID. * Allows clients to ignore duplicate webhooks. */ _id?: string; /** * Assumes actions are also always typed to an entity_type * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction */ entityFqdn?: string; /** * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug) * This is although the created/updated/deleted notion is duplication of the oneof types * 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 defining the order of updates to the underlying entity. * For example, given that some entity was updated at 16:00 and than again at 16:01, * it is guaranteed that the sequence number of the second update is strictly higher than the first. * As the consumer, you can use this value to ensure that you handle messages in the correct order. * To do so, you will need to persist this number on your end, and compare the sequence number from the * message against the one you have stored. Given that the stored number is higher, you should ignore the message. */ 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 Empty { } interface GetOrderInvoiceRequest { /** Invoice ID. */ invoiceId?: string; } interface GetOrderInvoiceResponse { /** Order ID. */ orderId?: string; /** Invoice info. */ invoiceInfo?: Invoice; } interface GenerateInvoiceWithNumberRequest { /** Order ID. */ orderId?: string; invoiceNumber?: string; /** Date and time the payment was created in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) format. Defaults to current time when not provided. */ issueDate?: Date | null; } interface GenerateInvoiceWithNumberResponse { /** Invoice ID. */ invoiceId?: string; } interface MessageEnvelope { /** App instance ID. */ instanceId?: string | null; /** Event type. */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; } interface IdentificationData extends IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; /** @readonly */ identityType?: WebhookIdentityType; } /** @oneof */ interface IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; } declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } interface InvoiceNonNullableFields { _id: string; appId: string; } interface InvoicesForOrderNonNullableFields { orderId: string; invoices: InvoiceNonNullableFields[]; invoicesInfo: InvoiceNonNullableFields[]; } interface ListInvoicesForMultipleOrdersResponseNonNullableFields { invoicesForOrder: InvoicesForOrderNonNullableFields[]; } interface GenerateInvoiceResponseNonNullableFields { invoiceId: string; } interface ApplicationErrorNonNullableFields { code: string; description: string; } interface ItemMetadataNonNullableFields { originalIndex: number; success: boolean; error?: ApplicationErrorNonNullableFields; } interface InvoiceForOrderNonNullableFields { orderId: string; invoiceId: string; } interface BulkInvoiceResultNonNullableFields { itemMetadata?: ItemMetadataNonNullableFields; item?: InvoiceForOrderNonNullableFields; } interface BulkActionMetadataNonNullableFields { totalSuccesses: number; totalFailures: number; undetailedFailures: number; } interface BulkGenerateInvoicesResponseNonNullableFields { results: BulkInvoiceResultNonNullableFields[]; bulkActionMetadata?: BulkActionMetadataNonNullableFields; } interface AddInvoiceToOrderResponseNonNullableFields { orderInvoices: InvoiceNonNullableFields[]; } export { type AddInvoiceToOrderResponse as A, type BulkGenerateInvoicesResponse as B, type IdentificationDataIdOneOf as C, type DomainEvent as D, type EntityCreatedEvent as E, type GenerateInvoiceResponse as G, type Invoice as I, type ListInvoicesForMultipleOrdersResponse as L, type MessageEnvelope as M, type RestoreInfo as R, WebhookIdentityType as W, type ListInvoicesForMultipleOrdersResponseNonNullableFields as a, type GenerateInvoiceResponseNonNullableFields as b, type BulkGenerateInvoicesResponseNonNullableFields as c, type AddInvoiceToOrderResponseNonNullableFields as d, type ListInvoicesForSingleOrderRequest as e, type ListInvoicesForSingleOrderResponse as f, type ListInvoicesForMultipleOrdersRequest as g, type InvoicesForOrder as h, type GenerateInvoiceRequest as i, type BulkGenerateInvoicesRequest as j, type BulkInvoiceResult as k, type ItemMetadata as l, type ApplicationError as m, type InvoiceForOrder as n, type BulkActionMetadata as o, type AddInvoiceToOrderRequest as p, type DomainEventBodyOneOf as q, type EntityUpdatedEvent as r, type EntityDeletedEvent as s, type ActionEvent as t, type Empty as u, type GetOrderInvoiceRequest as v, type GetOrderInvoiceResponse as w, type GenerateInvoiceWithNumberRequest as x, type GenerateInvoiceWithNumberResponse as y, type IdentificationData as z };