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

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 */