Search.../

listFulfillmentsForSingleOrder( )

Retrieves fulfillments associated with a specified order.

Description

The listFulfillmentsForSingleOrder() function returns a Promise that resolves when the fulfillments are retrieved.

Syntax

function listFulfillmentsForSingleOrder(orderId: string): Promise<ListFulfillmentsForSingleOrderResponse>

listFulfillmentsForSingleOrder Parameters

NAME
TYPE
DESCRIPTION
orderId
string

Order ID for which to retrieve fulfillments.

Returns

Return Type:

Promise<
ListFulfillmentsForSingleOrderResponse
>
NAME
TYPE
DESCRIPTION
orderWithFulfillments
OrderWithFulfillments

List of fulfillments associated with the order.

Was this helpful?

Retrieve an order's fulfillments

Copy Code
1import { orderFulfillments } from 'wix-ecom-backend';
2
3// Sample orderId value: '7001d34b-11a6-4a34-8746-dc8ababeca42';
4
5export async function myListFulfillmentsForSingleOrderFunction(orderId) {
6 try {
7 const retrievedOrderFulfillments = await orderFulfillments.listFulfillmentsForSingleOrder(orderId);
8
9 const fulfillmentsArray = retrievedOrderFulfillments.orderWithFulfillments.fulfillments;
10 console.log('Success! Retrieved order fulfillments:', retrievedOrderFulfillments);
11
12 return retrievedOrderFulfillments;
13 } catch (error) {
14 console.error(error);
15 // Handle the error
16 }
17
18}
19
20/* Promise resolves to:
21 *
22 * {
23 * "orderWithFulfillments": {
24 * "orderId": "7001d34b-11a6-4a34-8746-dc8ababeca42",
25 * "fulfillments": [
26 * {
27 * "_id": "00a7eba6-059e-430c-9f8e-9d3d31dd5e9d",
28 * "_createdDate": "2023-03-07T11:51:48.233Z",
29 * "lineItems": [
30 * {
31 * "_id": "00000000-0000-0000-0000-000000000003",
32 * "quantity": 1
33 * }
34 * ],
35 * "trackingInfo": {
36 * "trackingNumber": "28674",
37 * "shippingProvider": "dhl",
38 * "trackingLink": "https://www.logistics.dhl/global-en/home/tracking.html?tracking-id=28674"
39 * }
40 * },
41 * {
42 * "_id": "47451ae1-7325-4ef6-a0d8-fb91ffa88e2e",
43 * "_createdDate": "2023-03-07T10:24:56.406Z",
44 * "lineItems": [
45 * {
46 * "_id": "00000000-0000-0000-0000-000000000001",
47 * "quantity": 1
48 * },
49 * {
50 * "_id": "00000000-0000-0000-0000-000000000002",
51 * "quantity": 1
52 * }
53 * ],
54 * "trackingInfo": {
55 * "trackingNumber": "43255",
56 * "shippingProvider": "fedex",
57 * "trackingLink": "https://www.fedex.com/apps/fedextrack/?action=track&trackingnumber=43255"
58 * }
59 * }
60 * ]
61 * }
62 * }
63 *
64 */