> 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: updateFulfillment(identifiers: UpdateFulfillmentIdentifiers, options: UpdateFulfillmentOptions) # Method package: wixEcomBackend # Method menu location: wixEcomBackend --> orderFulfillments --> updateFulfillment # Method Link: https://dev.wix.com/docs/velo/apis/wix-ecom-backend/order-fulfillments/update-fulfillment.md # Method Description: Updates a fulfillment's properties. To update a field's value, include the new value in the `fulfillment` field in the body params. To remove a field's value, pass `null`. The `updateFulfillment()` function returns a Promise that resolves when the fulfillment is updated. > **Note:** Updating line item IDs or fulfilled quantities is not allowed. To update line item IDs or quantities, delete the fulfillment and create it again. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Update a fulfillment (dashboard page code) ```javascript import { orderFulfillments } from 'wix-ecom-backend'; /* Sample identifiers value: * { * orderId: 'a6c3a817-579d-4cb5-8521-2fe53b2c4bf1', * fulfillmentId: 'a838877d-3f13-49f3-ab29-1cde478e0949' * }; * * Sample options value: * { * fulfillment: { * trackingInfo: { * trackingNumber: '45677' * } * } * }; */ export async function myUpdateFulfillmentFunction(identifiers, options) { try { const updatedOrderFulfillments = await orderFulfillments.updateFulfillment(identifiers, options); const fulfillmentsArray = updatedOrderFulfillments.orderWithFulfillments.fulfillments; console.log('Success! Updated fulfillment', updatedOrderFulfillments); return updatedOrderFulfillments; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to: * * { * "orderWithFulfillments": { * "orderId": "a6c3a817-579d-4cb5-8521-2fe53b2c4bf1", * "fulfillments": [ * { * "_id": "a838877d-3f13-49f3-ab29-1cde478e0949", * "_createdDate": "2023-03-07T14:30:21.535Z", * "lineItems": [ * { * "_id": "00000000-0000-0000-0000-000000000001", * "quantity": 1 * } * ], * "trackingInfo": { * "trackingNumber": "45677", * "shippingProvider": "usps", * "trackingLink": "https://tools.usps.com/go/TrackConfirmAction.action?tLabels=45677" * } * } * ] * } * } * */ ``` ## Update a fulfillment (export from backend code) ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { orderFulfillments } from 'wix-ecom-backend'; /* Sample identifiers value: * { * orderId: 'a6c3a817-579d-4cb5-8521-2fe53b2c4bf1', * fulfillmentId: 'a838877d-3f13-49f3-ab29-1cde478e0949' * }; * * Sample options value: * { * fulfillment: { * trackingInfo: { * trackingNumber: '45677' * } * } * }; */ export const myUpdateFulfillmentFunction = webMethod(Permissions.Anyone, async (identifiers, options) => { try { const updatedOrderFulfillments = await orderFulfillments.updateFulfillment(identifiers, options); const fulfillmentsArray = updatedOrderFulfillments.orderWithFulfillments.fulfillments; console.log('Success! Updated fulfillment', updatedOrderFulfillments); return updatedOrderFulfillments; } catch (error) { console.error(error); // Handle the error } }); /* Promise resolves to: * * { * "orderWithFulfillments": { * "orderId": "a6c3a817-579d-4cb5-8521-2fe53b2c4bf1", * "fulfillments": [ * { * "_id": "a838877d-3f13-49f3-ab29-1cde478e0949", * "_createdDate": "2023-03-07T14:30:21.535Z", * "lineItems": [ * { * "_id": "00000000-0000-0000-0000-000000000001", * "quantity": 1 * } * ], * "trackingInfo": { * "trackingNumber": "45677", * "shippingProvider": "usps", * "trackingLink": "https://tools.usps.com/go/TrackConfirmAction.action?tLabels=45677" * } * } * ] * } * } * */ ``` ---