Search.../

deleteFulfillment( )

Deletes an existing order fulfillment.

Description

The deleteFulfillment() function returns a Promise that resolves when the fulfillment is deleted.

Admin Method

This function requires elevated permissions to run. This function is not universal and runs only on the backend.

Syntax

function deleteFulfillment(identifiers: DeleteFulfillmentIdentifiers): Promise<DeleteFulfillmentResponse>

deleteFulfillment Parameters

NAME
TYPE
DESCRIPTION
identifiers
DeleteFulfillmentIdentifiers

Order and fulfillment IDs.

Returns

Return Type:

Promise<
DeleteFulfillmentResponse
>
NAME
TYPE
DESCRIPTION
orderWithFulfillments
OrderWithFulfillments

Order ID and the order's associated fulfillments after deletion.

Was this helpful?

Delete a fulfillment (dashboard page code)

Copy Code
1import { orderFulfillments } from 'wix-ecom-backend';
2
3/* Sample identifiers value:
4 * {
5 * orderId: 'e613320a-8e8f-4f8f-9d87-b5edc9f99788',
6 * fulfillmentId: '91357295-a95c-4973-b210-281640f3e795'
7 * };
8 */
9
10export async function myDeleteFulfillmentFunction(identifiers) {
11 try {
12 const { orderWithFulfillments } = await orderFulfillments.deleteFulfillment(identifiers);
13
14 const fulfillmentsArray = orderWithFulfillments.fulfillments;
15 console.log('Success! Deleted fulfillment', orderWithFulfillments);
16
17 return orderWithFulfillments;
18 } catch (error) {
19 console.error(error);
20 // Handle the error
21 }
22
23}
24
25/* Promise resolves to:
26 *
27 * {
28 * "orderWithFulfillments": {
29 * "orderId": "e613320a-8e8f-4f8f-9d87-b5edc9f99788",
30 * "fulfillments": []
31 * }
32 * }
33 *
34 */
Delete a fulfillment (export from backend code)

Copy Code
1import { Permissions, webMethod } from 'wix-web-module';
2import { orderFulfillments } from 'wix-ecom-backend';
3
4/* Sample identifiers value:
5 * {
6 * orderId: 'e613320a-8e8f-4f8f-9d87-b5edc9f99788',
7 * fulfillmentId: '91357295-a95c-4973-b210-281640f3e795'
8 * };
9 */
10
11export const myDeleteFulfillmentFunction = webMethod(Permissions.Anyone, async (identifiers) => {
12 try {
13 const { orderWithFulfillments } = await orderFulfillments.deleteFulfillment(identifiers);
14
15 const fulfillmentsArray = orderWithFulfillments.fulfillments;
16 console.log('Success! Deleted fulfillment', orderWithFulfillments);
17
18 return orderWithFulfillments;
19 } catch (error) {
20 console.error(error);
21 // Handle the error
22 }
23});
24
25/* Promise resolves to:
26 *
27 * {
28 * "orderWithFulfillments": {
29 * "orderId": "e613320a-8e8f-4f8f-9d87-b5edc9f99788",
30 * "fulfillments": []
31 * }
32 * }
33 *
34 */