> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Package: getPaid # Namespace: bulkDownloads # Webhook link: https://dev.wix.com/docs/api-reference/business-management/get-paid/bulk-downloads/bulk-download-created.md ## Introduction Triggered when a bulk download is created. --- ## REST API ### Schema ``` Webhook: Bulk Download Created Description: Triggered when a bulk download is created. Event body: - name: id | type: string | description: Unique event ID. Allows clients to ignore duplicate events. - name: entityFqdn | type: string | description: Fully qualified domain name of the entity associated with the event. - name: slug | type: string | description: Event name. - name: entityId | type: string | description: ID of the entity associated with the event. - name: eventTime | type: string (date-time) | description: Event timestamp. - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application such as GDPR. - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event. - name: createdEvent | type: object | description: Created event details. - name: entity | type: BulkDownload | description: The created entity. - name: id | type: string | description: Bulk download GUID. - name: revision | type: string | description: Revision number, which increments by 1 each time the bulk download is updated. To prevent conflicting changes, the current `revision` must be passed when updating the bulk download. - name: createdDate | type: string | description: Date and time the bulk download was created. - name: updatedDate | type: string | description: Date and time the bulk download was last updated. - name: expirationDate | type: string | description: Date and time the bulk download expires. The .zip file is available for download with the `downloadUrl` until this time. Default expiration date is 24 hours after creation. - name: downloadGenerationStatus | type: DownloadGenerationStatus | description: Status of the bulk download generation. - enum: - UNKNOWN_DOWNLOAD_STATUS: Unknown download status. - PROCESSING: Generation is in progress. - PARTIAL_SUCCESS: Generation was successful for some, but not all, entities. Check `skippedEntityIds` for entities not included. The `downloadUrl` is available to download the .zip file containing the successfully generated entities. - SUCCESS: Generation was successful. The .zip file is ready for download using the `downloadUrl`. - FAILED: Generation has failed. - name: downloadUrl | type: string | description: URL to download the generated .zip file. Open this URL in a browser to download the file. Only available when the `downloadGenerationStatus` is `"PARTIAL_SUCCESS"` or `"SUCCESS"`. - name: namespace | type: Namespace | description: App namespace. Currently only supports `"RECEIPTS"`. - enum: - UNKNOWN_NAMESPACE: Unknown namespace. - RECEIPTS: Receipts ([SDK](https://dev.wix.com/docs/sdk/backend-modules/get-paid/receipts/about-the-receipts-apis.md) | [REST](https://dev.wix.com/docs/rest/business-management/get-paid/receipts/about-the-receipts-apis.md)). - name: entityIds | type: array | description: List of GUIDs of the entities to include in the bulk download. - name: skippedEntityIds | type: array | description: IDs of the entities that aren't included in the .zip file. If `downloadGenerationStatus` is `"PARTIAL_SUCCESS"` then these entities may still be included once the initiated download is complete. If the value of `downloadGenerationDetails.processed` matches `downloadGenerationDetails.total` then all of the entities have been processed and the skipped entities aren't included in the bulk download. - name: downloadGenerationDetails | type: DownloadGenerationDetails | description: Details about the number of files processed. - name: processed | type: integer | description: Number of files that have been processed. - name: total | type: integer | description: Total number of files to process. ``` ### Examples ```curl { "id": "52269077-05f2-4b59-ba4f-36ef8c4c1e11", "entityFqdn": "wix.get_paid.downloader.v1.bulk_download", "slug": "created", "entityId": "8046df3c-7575-4098-a5ab-c91ad8f33c47", "createdEvent": { "entity": { "id": "8046df3c-7575-4098-a5ab-c91ad8f33c47", "revision": 1, "createdDate": "2023-04-15T14:22:30.299Z", "updatedDate": "2023-04-15T14:22:30.299Z", "expirationDate": "2023-04-22T14:22:30.299Z", "namespace": "RECEIPTS", "downloadGenerationStatus": "PROCESSING", "entityIds": [ "a1b2c3d4-e5f6-4a5b-9c8d-7e6f5a4b3c2d", "f1e2d3c4-b5a6-4c5d-8e7f-9a8b7c6d5e4f" ], "downloadGenerationDetails": { "processed": 0, "total": 2 } } }, "eventTime": "2023-04-15T14:22:30.304800Z", "triggeredByAnonymizeRequest": false } ``` --- ## JavaScript SDK ### Schema ``` Webhook: onBulkDownloadCreated Description: Triggered when a bulk download is created. Payload: BulkDownloadCreatedEnvelope - name: entity | type: BulkDownload | description: none - name: _id | type: string | description: Bulk download GUID. - name: revision | type: string | description: Revision number, which increments by 1 each time the bulk download is updated. To prevent conflicting changes, the current `revision` must be passed when updating the bulk download. - name: _createdDate | type: Date | description: Date and time the bulk download was created. - name: _updatedDate | type: Date | description: Date and time the bulk download was last updated. - name: expirationDate | type: Date | description: Date and time the bulk download expires. The .zip file is available for download with the `downloadUrl` until this time. Default expiration date is 24 hours after creation. - name: downloadGenerationStatus | type: DownloadGenerationStatus | description: Status of the bulk download generation. - enum: - UNKNOWN_DOWNLOAD_STATUS: Unknown download status. - PROCESSING: Generation is in progress. - PARTIAL_SUCCESS: Generation was successful for some, but not all, entities. Check `skippedEntityIds` for entities not included. The `downloadUrl` is available to download the .zip file containing the successfully generated entities. - SUCCESS: Generation was successful. The .zip file is ready for download using the `downloadUrl`. - FAILED: Generation has failed. - name: downloadUrl | type: string | description: URL to download the generated .zip file. Open this URL in a browser to download the file. Only available when the `downloadGenerationStatus` is `"PARTIAL_SUCCESS"` or `"SUCCESS"`. - name: namespace | type: Namespace | description: App namespace. Currently only supports `"RECEIPTS"`. - enum: - UNKNOWN_NAMESPACE: Unknown namespace. - RECEIPTS: Receipts ([SDK](https://dev.wix.com/docs/sdk/backend-modules/get-paid/receipts/about-the-receipts-apis.md) | [REST](https://dev.wix.com/docs/rest/business-management/get-paid/receipts/about-the-receipts-apis.md)). - name: entityIds | type: array | description: List of GUIDs of the entities to include in the bulk download. - name: skippedEntityIds | type: array | description: IDs of the entities that aren't included in the .zip file. If `downloadGenerationStatus` is `"PARTIAL_SUCCESS"` then these entities may still be included once the initiated download is complete. If the value of `downloadGenerationDetails.processed` matches `downloadGenerationDetails.total` then all of the entities have been processed and the skipped entities aren't included in the bulk download. - name: downloadGenerationDetails | type: DownloadGenerationDetails | description: Details about the number of files processed. - name: processed | type: integer | description: Number of files that have been processed. - name: total | type: integer | description: Total number of files to process. - name: metadata | type: EventMetadata | description: none - name: instanceId | type: string | description: App instance GUID. - name: eventType | type: string | description: Event type. - name: identity | type: IdentificationData | description: The identification type and identity data. - ONE-OF: - name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site. - name: memberId | type: string | description: GUID of a site visitor that has logged in to the site. - name: wixUserId | type: string | description: GUID of a Wix user (site owner, contributor, etc.). - name: appId | type: string | description: GUID of an app. - name: identityType | type: WebhookIdentityType | description: - enum: UNKNOWN, ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP - name: accountInfo | type: AccountInfo | description: Details related to the account - name: accountId | type: string | description: GUID of the Wix account associated with the event. - name: parentAccountId | type: string | description: GUID of the parent Wix account. Only included when accountId belongs to a child account. - name: siteId | type: string | description: GUID of the Wix site associated with the event. Only included when the event is tied to a specific site. - name: _id | type: string | description: Event GUID. With this GUID you can easily spot duplicated events and ignore them. - name: entityFqdn | type: string | description: 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`. - name: slug | type: string | description: 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`. - name: entityId | type: string | description: GUID of the entity associated with the event. - name: eventTime | type: Date | description: Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application (for example, GDPR). - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event. - name: entityEventSequence | type: string | description: 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. ``` ### Examples ```javascript import { bulkDownloads } from '@wix/get-paid'; bulkDownloads.onBulkDownloadCreated((event) => { // handle your event here }); ``` ```javascript import { createClient, AppStrategy } from '@wix/sdk'; import { bulkDownloads } from '@wix/get-paid'; const wixClient = createClient({ auth: AppStrategy({ appId: 'MY-APP-ID', publicKey: 'YOUR_APP_PUBLIC_KEY', }), modules: { bulkDownloads, }, }); wixClient.bulkDownloads.onBulkDownloadCreated((event) => { // handle your event here }); ``` ---