> 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 # Method name: listFulfillmentsForMultipleOrders(orderIds: Array) # Method package: wixEcomBackend # Method menu location: wixEcomBackend --> orderFulfillments --> listFulfillmentsForMultipleOrders # Method Link: https://dev.wix.com/docs/velo/apis/wix-ecom-backend/order-fulfillments/list-fulfillments-for-multiple-orders.md # Method Description: Retrieves fulfillments associated with multiple specified orders. The `listFulfillmentsForMultipleOrders()` function returns a Promise that resolves when the fulfillments are retrieved. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Retrieve fulfillments for 2 orders ```javascript import { orderFulfillments } from 'wix-ecom-backend'; /* Sample orderIds value: * [ * 'ed4595fc-4e3d-4ba6-8583-e9e92b97ec8a', '7001d34b-11a6-4a34-8746-dc8ababeca42' * ]; */ export async function myListFulfillmentsForMultipleOrdersFunction(orderIds) { try { const retrievedOrdersFulfillments = await orderFulfillments.listFulfillmentsForMultipleOrders(orderIds); const firstOrderFulfillments = retrievedOrdersFulfillments[0].fulfillments; const secondOrderFulfillments = retrievedOrdersFulfillments[1].fulfillments; console.log("Success! Retrieved orders' fulfillments:", retrievedOrdersFulfillments); return retrievedOrdersFulfillments; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to: * * { * "ordersWithFulfillments": [ * { * "orderId": "ed4595fc-4e3d-4ba6-8583-e9e92b97ec8a", * "fulfillments": [ * { * "_id": "3247615d-dbbe-4cc8-a410-6ca809f1283f", * "_createdDate": "2023-02-27T12:02:57.364Z", * "lineItems": [ * { * "_id": "00000000-0000-0000-0000-000000000001", * "quantity": 1 * } * ], * "trackingInfo": { * "trackingNumber": "87236", * "shippingProvider": "fedex", * "trackingLink": "https://www.fedex.com/apps/fedextrack/?action=track&trackingnumber=87236" * } * } * ] * }, * { * "orderId": "7001d34b-11a6-4a34-8746-dc8ababeca42", * "fulfillments": [ * { * "_id": "00a7eba6-059e-430c-9f8e-9d3d31dd5e9d", * "_createdDate": "2023-03-07T11:51:48.233Z", * "lineItems": [ * { * "_id": "00000000-0000-0000-0000-000000000003", * "quantity": 1 * } * ], * "trackingInfo": { * "trackingNumber": "28674", * "shippingProvider": "dhl", * "trackingLink": "https://www.logistics.dhl/global-en/home/tracking.html?tracking-id=28674" * } * }, * { * "_id": "47451ae1-7325-4ef6-a0d8-fb91ffa88e2e", * "_createdDate": "2023-03-07T10:24:56.406Z", * "lineItems": [ * { * "_id": "00000000-0000-0000-0000-000000000001", * "quantity": 1 * }, * { * "_id": "00000000-0000-0000-0000-000000000002", * "quantity": 1 * } * ], * "trackingInfo": { * "trackingNumber": "43255", * "shippingProvider": "fedex", * "trackingLink": "https://www.fedex.com/apps/fedextrack/?action=track&trackingnumber=43255" * } * } * ] * } * ] * } * */ ``` ## Retrieve fulfillments for 2 orders (export from backend code) ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { orderFulfillments } from 'wix-ecom-backend'; /* Sample orderIds value: * [ * 'ed4595fc-4e3d-4ba6-8583-e9e92b97ec8a', '7001d34b-11a6-4a34-8746-dc8ababeca42' * ]; */ export const myListFulfillmentsForMultipleOrdersFunction = webMethod(Permissions.Anyone, async (orderIds) => { try { const retrievedOrdersFulfillments = await orderFulfillments.listFulfillmentsForMultipleOrders(orderIds); const firstOrderFulfillments = retrievedOrdersFulfillments[0].fulfillments; const secondOrderFulfillments = retrievedOrdersFulfillments[1].fulfillments; console.log("Success! Retrieved orders' fulfillments:", retrievedOrdersFulfillments); return retrievedOrdersFulfillments; } catch (error) { console.error(error); // Handle the error } }); /* Promise resolves to: * * { * "ordersWithFulfillments": [ * { * "orderId": "ed4595fc-4e3d-4ba6-8583-e9e92b97ec8a", * "fulfillments": [ * { * "_id": "3247615d-dbbe-4cc8-a410-6ca809f1283f", * "_createdDate": "2023-02-27T12:02:57.364Z", * "lineItems": [ * { * "_id": "00000000-0000-0000-0000-000000000001", * "quantity": 1 * } * ], * "trackingInfo": { * "trackingNumber": "87236", * "shippingProvider": "fedex", * "trackingLink": "https://www.fedex.com/apps/fedextrack/?action=track&trackingnumber=87236" * } * } * ] * }, * { * "orderId": "7001d34b-11a6-4a34-8746-dc8ababeca42", * "fulfillments": [ * { * "_id": "00a7eba6-059e-430c-9f8e-9d3d31dd5e9d", * "_createdDate": "2023-03-07T11:51:48.233Z", * "lineItems": [ * { * "_id": "00000000-0000-0000-0000-000000000003", * "quantity": 1 * } * ], * "trackingInfo": { * "trackingNumber": "28674", * "shippingProvider": "dhl", * "trackingLink": "https://www.logistics.dhl/global-en/home/tracking.html?tracking-id=28674" * } * }, * { * "_id": "47451ae1-7325-4ef6-a0d8-fb91ffa88e2e", * "_createdDate": "2023-03-07T10:24:56.406Z", * "lineItems": [ * { * "_id": "00000000-0000-0000-0000-000000000001", * "quantity": 1 * }, * { * "_id": "00000000-0000-0000-0000-000000000002", * "quantity": 1 * } * ], * "trackingInfo": { * "trackingNumber": "43255", * "shippingProvider": "fedex", * "trackingLink": "https://www.fedex.com/apps/fedextrack/?action=track&trackingnumber=43255" * } * } * ] * } * ] * } * */ ``` ---