deleteFulfillment( )


Deletes an existing order fulfillment.

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

Authentication

This function requires elevated permissions and runs only on the backend and on dashboard pages.

Permissions
Manage Stores - all permissions
Manage Restaurants - all permissions
Manage eCommerce - all permissions
Manage Orders
Learn more about app permissions.
Method Declaration
Copy
function deleteFulfillment(
  identifiers: DeleteFulfillmentIdentifiers,
): Promise<DeleteFulfillmentResponse>;
Method Parameters
identifiersDeleteFulfillmentIdentifiersRequired

Order and fulfillment IDs.

Returns
Return Type:Promise<DeleteFulfillmentResponse>
JavaScript
import { orderFulfillments } from "wix-ecom-backend"; /* Sample identifiers value: * { * orderId: 'e613320a-8e8f-4f8f-9d87-b5edc9f99788', * fulfillmentId: '91357295-a95c-4973-b210-281640f3e795' * }; */ export async function myDeleteFulfillmentFunction(identifiers) { try { const { orderWithFulfillments } = await orderFulfillments.deleteFulfillment(identifiers); const fulfillmentsArray = orderWithFulfillments.fulfillments; console.log("Success! Deleted fulfillment", orderWithFulfillments); return orderWithFulfillments; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to: * * { * "orderWithFulfillments": { * "orderId": "e613320a-8e8f-4f8f-9d87-b5edc9f99788", * "fulfillments": [] * } * } * */
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?