> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - 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(orderId: string, fulfillmentId: string, trackingInfo: TrackingInfo)

# Method package: wixStoresBackend

# Method menu location: wixStoresBackend --> updateFulfillment

# Method Link: https://dev.wix.com/docs/velo/apis/wix-stores-backend/update-fulfillment.md

# Method Description:

**Deprecated.**
This function will continue to work until September 4, 2024, but a newer version is available at
[`wix-ecom-backend.OrderFulfillments.updateFulfillment()`](/wix-ecom-backend/order-fulfillments/update-fulfillment).

We recommend you migrate to the new [Wix eCommerce APIs](https://www.wix.com/velo/reference/wix-ecom-backend/introduction) as soon as possible.

> #### Migration Instructions
>
> If this function is already in your code, it will continue to work.
> To stay compatible with future changes, migrate to
> [`wix-ecom-backend.OrderFulfillments.updateFulfillment()`](/wix-ecom-backend/order-fulfillments/update-fulfillment).
>
> To migrate to the new function:
>
> 1. Add the new import statement:
>
>    ```javascript
>    import { orderFulfillments } from 'wix-ecom-backend';
>    ```
>
> 2. Look for any code that uses `wixStoresBackend.updateFulfillment()`,
>    and replace it with `orderFulfillments.updateFulfillment()`.
>    Update your code to work with the new `updateFulfillment()`
>    response properties.
>
> 3. Test your changes to make sure your code behaves as expected.

 Updates an existing fulfillment in an order.

 The `updateFulfillment()` function returns a Promise that is resolved
 to an updated `Order` object when the specified fulfillment in the order
 is updated.

 Currently, you can only update a fulfillment's tracking information.



# Method Code Examples:

*** Note: do not assume any prop names or enum values other than the ones in the example.

## Update a fulfillment

```javascript
import wixStoresBackend from 'wix-stores-backend';

const trackingInfo = {
  "shippingProvider": "fedex",
  "trackingLink": "https://www.fedex.com/apps/fedextrack/?action=track&trackingnumber=6789",
  "trackingNumber": "6789",
}

export function updateFulfillment(orderId, fulfillmentId) {
  return wixStoresBackend.updateFulfillment(
    orderId,
    fulfillmentId,
    trackingInfo
    )
    .then((updatedOrder) => {
      // Fulfillment updated
      const orderFulfillmentStatus = updatedOrder.fulfillmentStatus
    })
    .catch(error => {
      // Fulfillment not updated
      console.error(error)
    })
}

/* Returns promise that resolves to:
 *
 *  {
 *    "order": {
 *      "_id": "d5d43d01-d9a4-4cc2-b257-61184b881447",
 *      "_updatedDate": "2020-06-12T10:24:22.938Z",
 *      "buyerLanguage": "en",
 *      "channelInfo": {
 *        "type": "WEB"
 *      },
 *      "enteredBy": {
 *        "id": "f6c2c0f9-4e9f-a58d-a02d-9af2497294d9",
 *        "identityType": "MEMBER"
 *      },
 *      "billingInfo": {
 *        "address": {
 *          "formatted": "My company name\n235 W 23rd St\nNew York, New York 10011\nUnited States\n+15555555555",
 *          "city": "New York",
 *          "country": "USA",
 *          "addressLine": "235 W 23rd St",
 *          "postalCode": "10011",
 *          "subdivision": "NY"
 *        },
 *        "firstName": "John",
 *        "lastName": "Doe",
 *        "email": "john.doe@somedomain.com",
 *        "phone": "+15555555555",
 *        "company": "My company name",
 *        "externalTransactionId": "7c03ca74-eaf5-4541-8678-9b857634fdcb",
 *        "paidDate": "2020-05-27T12:20:37.994Z",
 *        "paymentMethod": "VISA",
 *        "paymentGatewayTransactionId": "29A06193U6234935D",
 *        "paymentProviderTransactionId": "7c03ca74-eaf5-4541-8678-9b857634fdcb"
 *      },
 *      "buyerInfo": {
 *        "id": "f6c2c0f9-4e9f-a58d-a02d-9af2497294d9",
 *        "identityType": "MEMBER",
 *        "firstName": "John",
 *        "lastName": "Doe",
 *        "phone": "+15555555555",
 *        "email": "john.doe@somedomain.com"
 *      },
 *      "_dateCreated": "2020-05-27T12:20:37.966Z",
 *      "currency": "ILS",
 *      "fulfillmentStatus": "FULFILLED",
 *      "archived": false,
 *      "activities": [
 *        {
 *          "type": "ORDER_PLACED",
 *          "timestamp": "2020-05-27T12:20:37.966Z"
 *        },
 *        {
 *          "type": "ORDER_PAID",
 *          "timestamp": "2020-05-27T12:20:37.994Z"
 *        }
 *      ],
 *      "number": 10019,
 *      "paymentStatus": "PAID",
 *      "shippingInfo": {
 *        "deliveryOption": "Free Shipping",
 *        "estimatedDeliveryTime": "4:30pm",
 *        "shippingRegion": "Domestic",
 *        "shipmentDetails": {
 *          "address": {
 *            "formatted": "company name\n235 W 23rd St\nNew York, New York 10011\nUnited States\n5555555555",
 *            "city": "New York",
 *            "country": "USA",
 *            "addressLine": "235 W 23rd St",
 *            "postalCode": "10011",
 *            "subdivision": "NY"
 *          },
 *          "firstName": "John",
 *          "lastName": "Doe",
 *          "email": "john.doe@somedomain.com",
 *          "phone": "5555555555",
 *          "company": "company name",
 *          "tax": 0,
 *          "discount": 0,
 *          "priceData": null
 *        },
 *        "pickupDetails": null
 *      },
 *      "lineItems": [
 *        {
 *          "index": 1,
 *          "quantity": 1,
 *          "price": 5,
 *          "name": "my product's name",
 *          "translatedName": "Nombre traducido",
 *          "productId": "3fb6a3c8-988b-8755-04bd-5c59ae0b18ea",
 *          "totalPrice": 5,
 *          "lineItemType": "PHYSICAL",
 *          "options": [
 *            {
 *              "option": "Size",
 *              "selection": "Medium"
 *            }
 *          ],
 *          "customTextFields": [
 *            {
 *              "title": "Notes for delivery",
 *              "value": "Please leave at front door"
 *            }
 *          ],
 *          "weight": 1.42,
 *          "sku": "36523641234523",
 *          "discount": 0,
 *          "tax": 5,
 *          "taxIncludedInPrice": true,
 *          "priceData": {
 *            "price": "5",
 *            "totalPrice": 5,
 *            "taxIncludedInPrice": true
 *          },
 *          "mediaItem": null
 *        }
 *      ],
 *      "totals": {
 *        "discount": 0,
 *        "quantity": 1,
 *        "shipping": 0,
 *        "subtotal": 5,
 *        "tax": 0,
 *        "total": 5,
 *        "weight": 1.42
 *      },
 *      "weightUnit": "KG",
 *      "customField": {
 *        "value": "Please call when outside",
 *        "title": "Notes for delivery",
 *        "translatedTitle": "Notas de entrega"
 *      },
 *      "fulfillments": [
 *        {
 *          "id": "cfbc5122-8766-4209-8bf4-611a10f9c546",
 *          "dateCreated": "2020-06-10T15:38:10.938Z",
 *          "lineItems": [
 *            {
 *              "index": 1,
 *              "quantity": 1
 *            }
 *          ],
 *          "trackingInfo": {
 *            "trackingNumber": "6789",
 *            "shippingProvider": "fedex",
 *            "trackingLink": "https://www.fedex.com/apps/fedextrack/?action=track&trackingnumber=6789"
 *          },
 *        }
 *      ],
 *      "discount": null
 *    }
 *  }
 *
 */
```

---