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';23/* Sample identifiers value:4 * {5 * orderId: 'e613320a-8e8f-4f8f-9d87-b5edc9f99788',6 * fulfillmentId: '91357295-a95c-4973-b210-281640f3e795'7 * };8 */910export async function myDeleteFulfillmentFunction(identifiers) {11 try {12 const { orderWithFulfillments } = await orderFulfillments.deleteFulfillment(identifiers);1314 const fulfillmentsArray = orderWithFulfillments.fulfillments;15 console.log('Success! Deleted fulfillment', orderWithFulfillments);1617 return orderWithFulfillments;18 } catch (error) {19 console.error(error);20 // Handle the error21 }2223}2425/* 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';34/* Sample identifiers value:5 * {6 * orderId: 'e613320a-8e8f-4f8f-9d87-b5edc9f99788',7 * fulfillmentId: '91357295-a95c-4973-b210-281640f3e795'8 * };9 */1011export const myDeleteFulfillmentFunction = webMethod(Permissions.Anyone, async (identifiers) => {12 try {13 const { orderWithFulfillments } = await orderFulfillments.deleteFulfillment(identifiers);1415 const fulfillmentsArray = orderWithFulfillments.fulfillments;16 console.log('Success! Deleted fulfillment', orderWithFulfillments);1718 return orderWithFulfillments;19 } catch (error) {20 console.error(error);21 // Handle the error22 }23});2425/* Promise resolves to:26 *27 * {28 * "orderWithFulfillments": {29 * "orderId": "e613320a-8e8f-4f8f-9d87-b5edc9f99788",30 * "fulfillments": []31 * }32 * }33 *34 */