updateFulfillment( )
Updates an existing fulfillment in an order.
Description
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.
Syntax
function updateFulfillment(orderId: string, fulfillmentId: string, trackingInfo: TrackingInfo): Promise<Order>
updateFulfillment Parameters
NAME
TYPE
DESCRIPTION
ID of the order to update the fulfillment in.
ID of the fulfillment to update.
Tracking information to update in the fulfillment.
Returns
Fulfilled - The order with the updated fulfillment.
Return Type:
NAME
TYPE
DESCRIPTION
Unique order ID.
Date and time the order was updated.
The site's displayed language.
Shopping cart ID.
Channel information.
Identity of the order's initiator.
Billing information.
Buyer information.
A note added by the buyer.
Date and time the order was created.
Order currency.
The order's current fulfillment status (whether the order received a tracking number or was delivered/picked up). One of:
"NOT_FULFILLED"
: Order is not yet fulfilled."FULFILLED"
: Order was fulfilled successfully."CANCELED"
: Order was canceled."PARTIALLY_FULFILLED"
: Order was partially fulfilled. For example, when only some of the order's items were fulfilled.
Whether or not the order was archived.
Log of updates related to the order.
Running order number.
Current status of the payment. One of:
"NOT_PAID"
: Payment was not made."PAID"
: Order was successfully paid for."PARTIALLY_REFUNDED"
: Order was partially refunded."FULLY_REFUNDED"
: Order was refunded in full.
Shipping information.
Order items.
Order totals.
The unit in which the order's weight is measured. Either "KG"
or "LB"
. If not provided, the site's default weight unit is used.
Custom field information.
Order fulfillment information.
Discount information.
Refund information.
Subscription information. Omitted unless the order is a subscription. Learn more about selling product subscriptions.
Was this helpful?
Update a fulfillment
1import wixStoresBackend from 'wix-stores-backend';23const trackingInfo = {4 "shippingProvider": "fedex",5 "trackingLink": "https://www.fedex.com/apps/fedextrack/?action=track&trackingnumber=6789",6 "trackingNumber": "6789",7}89export function updateFulfillment(orderId, fulfillmentId) {10 return wixStoresBackend.updateFulfillment(11 orderId,12 fulfillmentId,13 trackingInfo14 )15 .then((updatedOrder) => {16 // Fulfillment updated17 const orderFulfillmentStatus = updatedOrder.fulfillmentStatus18 })19 .catch(error => {20 // Fulfillment not updated21 console.error(error)22 })23}2425/* Returns promise that resolves to:26 *27 * {28 * "order": {29 * "_id": "d5d43d01-d9a4-4cc2-b257-61184b881447",30 * "_updatedDate": "2020-06-12T10:24:22.938Z",31 * "buyerLanguage": "en",32 * "channelInfo": {33 * "type": "WEB"34 * },35 * "enteredBy": {36 * "id": "f6c2c0f9-4e9f-a58d-a02d-9af2497294d9",37 * "identityType": "MEMBER"38 * },39 * "billingInfo": {40 * "address": {41 * "formatted": "My company name\n235 W 23rd St\nNew York, New York 10011\nUnited States\n+15555555555",42 * "city": "New York",43 * "country": "USA",44 * "addressLine": "235 W 23rd St",45 * "postalCode": "10011",46 * "subdivision": "NY"47 * },48 * "firstName": "John",49 * "lastName": "Doe",50 * "email": "john.doe@somedomain.com",51 * "phone": "+15555555555",52 * "company": "My company name",53 * "externalTransactionId": "7c03ca74-eaf5-4541-8678-9b857634fdcb",54 * "paidDate": "2020-05-27T12:20:37.994Z",55 * "paymentMethod": "VISA",56 * "paymentGatewayTransactionId": "29A06193U6234935D",57 * "paymentProviderTransactionId": "7c03ca74-eaf5-4541-8678-9b857634fdcb"58 * },59 * "buyerInfo": {60 * "id": "f6c2c0f9-4e9f-a58d-a02d-9af2497294d9",61 * "identityType": "MEMBER",62 * "firstName": "John",63 * "lastName": "Doe",64 * "phone": "+15555555555",65 * "email": "john.doe@somedomain.com"66 * },67 * "_dateCreated": "2020-05-27T12:20:37.966Z",68 * "currency": "ILS",69 * "fulfillmentStatus": "FULFILLED",70 * "archived": false,71 * "activities": [72 * {73 * "type": "ORDER_PLACED",74 * "timestamp": "2020-05-27T12:20:37.966Z"75 * },76 * {77 * "type": "ORDER_PAID",78 * "timestamp": "2020-05-27T12:20:37.994Z"79 * }80 * ],81 * "number": 10019,82 * "paymentStatus": "PAID",83 * "shippingInfo": {84 * "deliveryOption": "Free Shipping",85 * "estimatedDeliveryTime": "4:30pm",86 * "shippingRegion": "Domestic",87 * "shipmentDetails": {88 * "address": {89 * "formatted": "company name\n235 W 23rd St\nNew York, New York 10011\nUnited States\n5555555555",90 * "city": "New York",91 * "country": "USA",92 * "addressLine": "235 W 23rd St",93 * "postalCode": "10011",94 * "subdivision": "NY"95 * },96 * "firstName": "John",97 * "lastName": "Doe",98 * "email": "john.doe@somedomain.com",99 * "phone": "5555555555",100 * "company": "company name",101 * "tax": 0,102 * "discount": 0,103 * "priceData": null104 * },105 * "pickupDetails": null106 * },107 * "lineItems": [108 * {109 * "index": 1,110 * "quantity": 1,111 * "price": 5,112 * "name": "my product's name",113 * "translatedName": "Nombre traducido",114 * "productId": "3fb6a3c8-988b-8755-04bd-5c59ae0b18ea",115 * "totalPrice": 5,116 * "lineItemType": "PHYSICAL",117 * "options": [118 * {119 * "option": "Size",120 * "selection": "Medium"121 * }122 * ],123 * "customTextFields": [124 * {125 * "title": "Notes for delivery",126 * "value": "Please leave at front door"127 * }128 * ],129 * "weight": 1.42,130 * "sku": "36523641234523",131 * "discount": 0,132 * "tax": 5,133 * "taxIncludedInPrice": true,134 * "priceData": {135 * "price": "5",136 * "totalPrice": 5,137 * "taxIncludedInPrice": true138 * },139 * "mediaItem": null140 * }141 * ],142 * "totals": {143 * "discount": 0,144 * "quantity": 1,145 * "shipping": 0,146 * "subtotal": 5,147 * "tax": 0,148 * "total": 5,149 * "weight": 1.42150 * },151 * "weightUnit": "KG",152 * "customField": {153 * "value": "Please call when outside",154 * "title": "Notes for delivery",155 * "translatedTitle": "Notas de entrega"156 * },157 * "fulfillments": [158 * {159 * "id": "cfbc5122-8766-4209-8bf4-611a10f9c546",160 * "dateCreated": "2020-06-10T15:38:10.938Z",161 * "lineItems": [162 * {163 * "index": 1,164 * "quantity": 1165 * }166 * ],167 * "trackingInfo": {168 * "trackingNumber": "6789",169 * "shippingProvider": "fedex",170 * "trackingLink": "https://www.fedex.com/apps/fedextrack/?action=track&trackingnumber=6789"171 * },172 * }173 * ],174 * "discount": null175 * }176 * }177 *178 */