> 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: forms
# Namespace: formSubmissions
# Webhook link: https://dev.wix.com/docs/api-reference/crm/forms/form-submissions/submission-deleted.md
## Introduction
> **Note:** The Form Submission API only works with the Wix Forms app. Call [GetAppInstance](https://dev.wix.com/docs/rest/api-reference/app-management/apps/app-instance/get-app-instance.md) to confirm that the app named `wix_forms` is installed on the site.
Triggered when a submission is deleted.
---
## REST API
### Schema
```
Webhook: Submission Deleted
Description: > **Note:** The Form Submission API only works with the Wix Forms app. Call [GetAppInstance](https://dev.wix.com/docs/rest/api-reference/app-management/apps/app-instance/get-app-instance.md) to confirm that the app named `wix_forms` is installed on the site.
Triggered when a submission is deleted.
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.
```
### Examples
```curl
{
"id": "d89ac711-727f-4884-ab09-5ce4e334df02",
"entityFqdn": "wix.forms.v4.submission",
"slug": "deleted",
"entityId": "3342df1b-6064-4dbe-83be-3aa196d78214",
"deletedEvent": {
"movedToTrash": true
},
"eventTime": "2023-06-15T08:02:59.371918Z",
"triggeredByAnonymizeRequest": false,
"originatedFrom": "{\"namespace\":\"wix.form_example.form\"}"
}
```
---
## JavaScript SDK
### Schema
```
Webhook: onSubmissionDeleted
Description: > **Note:** The Form Submission API only works with the Wix Forms app. Call [GetAppInstance](https://dev.wix.com/docs/rest/api-reference/app-management/apps/app-instance/get-app-instance.md) to confirm that the app named `wix_forms` is installed on the site.
Triggered when a submission is deleted.
Payload: SubmissionDeletedEnvelope
- name: entity | type: FormSubmission | description: none
- name: _id | type: string | description: Submission GUID.
- name: formId | type: string | description: GUID of the form which the submission belongs to.
- name: namespace | type: string | description: The app which the form submissions belong to. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace.
- name: status | type: SubmissionStatus | description: Status of the submission.
- enum:
- PENDING: A submission is created, but has not yet been recorded in the Wix Forms collection.
- CONFIRMED: A submission is recorded in the Wix Forms collection.
- PAYMENT_WAITING: A form submission requiring payment is created.
- PAYMENT_CANCELED: An order of a form submission is canceled.
- name: submissions | type: Map | description: Submission values where `key` is the form field and `value` is the data submitted for the given field.
- ONE-OF:
- name: nullValue | type: | description:
- name: numberValue | type: number | description:
- name: stringValue | type: string | description:
- name: boolValue | type: boolean | description:
- name: structValue | type: object | description:
- name: listValue | type: ListValue | description:
- name: values | type: array | description:
- name: _createdDate | type: Date | description: Date and time the form submission was created.
- name: _updatedDate | type: Date | description: Date and time the form submission was updated.
- name: revision | type: string | description: Revision number, which increments by 1 each time the form submission is updated. To prevent conflicting changes, the existing revision must be used when updating a form submission.
- name: submitter | type: Submitter | description: GUID of the visitor that submitted the form.
- ONE-OF:
- name: memberId | type: string | description: Member GUID.
- name: visitorId | type: string | description: Visitor GUID.
- name: applicationId | type: string | description: Application GUID.
- name: userId | type: string | description: User GUID.
- name: seen | type: boolean | description: Whether a site owner marked a submission as "seen".
- name: extendedFields | type: ExtendedFields | description: Data extension object that holds users' and apps' fields.
- name: namespaces | type: object | description: 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.md).
- name: orderDetails | type: OrderDetails | description: Order details.
Note: This object is only applicable when submitting a form in the Wix Payments app.
- name: orderId | type: string | description: GUID of the order related to submission (only applicable if a form has payments).
- name: number | type: string | description: Order number.
- name: currency | type: string | description: Currency.
- name: itemSubtotal | type: string | description: Item subtotal.
- name: checkoutId | type: string | description: GUID of the checkout related to submission (only applicable if a form has payments).
- name: contactId | type: string | description: Contact GUID of a site visitor who created the submission.
- name: accessRestriction | type: string | description: Authorized viewer GUID.
- name: tags | type: PublicTags | description: Tag GUIDs collections associated with the current entity.
- name: tags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors.
- name: tagIds | type: array | description: List of tag GUIDs
- name: appointmentDetails | type: AppointmentDetails | description: Appointment details. This object is only applicable when submitting a form that creates a booking appointment.
- name: staffMemberId | type: string | description: GUID of the staff member assigned to the appointment.
- name: staffMemberName | type: string | description: Name of the staff member assigned to the appointment.
- 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 { submissions } from '@wix/forms';
submissions.onSubmissionDeleted((event) => {
// handle your event here
});
```
```javascript
import { createClient, AppStrategy } from '@wix/sdk';
import { submissions } from '@wix/forms';
const wixClient = createClient({
auth: AppStrategy({
appId: 'MY-APP-ID',
publicKey: 'YOUR_APP_PUBLIC_KEY',
}),
modules: {
submissions,
},
});
wixClient.submissions.onSubmissionDeleted((event) => {
// handle your event here
});
```
---