updateFulfillment( )


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.

Authentication
  • When developing websites or building an app with Blocks, this method may require elevated permissions, depending on the identity of the user calling it and the calling user’s permissions.
  • When building apps without Blocks or for headless projects, you can only call this method directly when authenticated as a Wix app or Wix user identity. When authenticated as a different identity, you can call this method using elevation.
  • Elevation permits users to call methods they typically cannot access. Therefore, you should only use it intentionally and securely.
Permissions
Manage eCommerce - all permissions
Manage Stores - all permissions
Manage Orders
Manage Restaurants - all permissions
Learn more about app permissions.
Method Declaration
Copy
function updateFulfillment(
  identifiers: UpdateFulfillmentIdentifiers,
  options: UpdateFulfillmentOptions,
): Promise<OrderWithFulfillments>;
Method Parameters
identifiersUpdateFulfillmentIdentifiersRequired

Order and fulfillment IDs to be updated.


optionsUpdateFulfillmentOptions

Available options to use when updating a fulfillment.

Returns
Return Type:Promise<OrderWithFulfillments>

Updates the fulfillment's trackingNumber

JavaScript
import { orderFulfillments } from "@wix/ecom"; /* 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.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" * } * } * ] * } * } * */
Errors
409Already Exists

There is 1 error with this status code.

This method may also return standard errors. Learn more about standard Wix errors.

Did this help?