Search.../

deleteFulfillment( )

Deprecated. This function will continue to work until September 4, 2024, but a newer version is available at wix-ecom-backend.OrderFulfillments.deleteFulfillment().

We recommend you migrate to the new Wix eCommerce APIs as soon as possible.

Description

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.deleteFulfillment().

To migrate to the new function:

  1. Add the new import statement:

    import { orderFulfillments } from 'wix-ecom-backend';
    javascript | Copy Code
  2. Look for any code that uses wixStoresBackend.deleteFulfillment(), and replace it with orderFulfillments.deleteFulfillment(). Update your code to work with the new deleteFulfillment() response properties.

  3. Test your changes to make sure your code behaves as expected.

Deletes a fulfillment from an order.

The deleteFulfillment() function returns a Promise that is resolved to an updated Order object when the specified fulfillment is deleted from the order.

Syntax

function deleteFulfillment(orderId: string, fulfillmentId: string): Promise<Order>

deleteFulfillment Parameters

NAME
TYPE
DESCRIPTION
orderId
string

ID of the order to delete the fulfillment from.

fulfillmentId
string

ID of the fulfillment to delete.

Returns

Fulfilled - The updated order without the specified fulfillment details.

Return Type:

Promise<Order>
NAME
TYPE
DESCRIPTION
_id
string

Unique order ID.

_updatedDate
string

Date and time the order was updated.

buyerLanguage
string

The site's displayed language.

cartId
string

Shopping cart ID.

channelInfo
ChannelInfo

Channel information.

enteredBy
EnteredBy

Identity of the order's initiator.

billingInfo
BillingInfo

Billing information.

buyerInfo
BuyerInfo

Buyer information.

buyerNote
string

A note added by the buyer.

_dateCreated
string

Date and time the order was created.

currency
string

Order currency.

fulfillmentStatus
string

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.
archived
boolean

Whether or not the order was archived.

activities
Array<Activities>

Log of updates related to the order.

number
number

Running order number.

paymentStatus
string

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.
shippingInfo
OrderShippingInfo

Shipping information.

lineItems
Array<OrderLineItem>

Order items.

totals
Totals

Order totals.

weightUnit
string

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.

customField
CustomField

Custom field information.

fulfillments
Array<Fulfillment>

Order fulfillment information.

discount
Discount

Discount information.

refunds
Array<Refund>

Refund information.

subscriptionInfo
SubscriptionInfo

Subscription information. Omitted unless the order is a subscription. Learn more about selling product subscriptions.

Was this helpful?

Delete a fulfillment

Copy Code
1import wixStoresBackend from 'wix-stores-backend'
2
3export function deleteFulfillment(orderId, fulfillmentId) {
4 return wixStoresBackend.deleteFulfillment(orderId, fulfillmentId)
5 .then((updatedOrderObject) => {
6 // Fulfillment deleted
7 const orderFulfillmentStatus = updatedOrderObject.fulfillmentStatus
8 })
9 .catch((error) => {
10 // Fulfillment not deleted
11 })
12}
13
14/* Returns a promise that resolves to:
15 *
16 * {
17 * "order": {
18 * "_id": "d5d43d01-d9a4-4cc2-b257-61184b881447",
19 * "_updatedDate": "2020-06-16T12:39:10.399Z",
20 * "buyerLanguage": "en",
21 * "channelInfo": {
22 * "type": "WEB"
23 * },
24 * "enteredBy": {
25 * "id": "f6c2c0f9-4e9f-a58d-a02d-9af2497294d9",
26 * "identityType": "MEMBER"
27 * },
28 * "billingInfo": {
29 * "address": {
30 * "formatted": "My company name\n235 W 23rd St\nNew York, New York 10011\nUnited States\n+15555555555",
31 * "city": "New York",
32 * "country": "USA",
33 * "addressLine": "235 W 23rd St",
34 * "postalCode": "10011",
35 * "subdivision": "NY"
36 * },
37 * "firstName": "John",
38 * "lastName": "Doe",
39 * "email": "john.doe@somedomain.com",
40 * "phone": "+15555555555",
41 * "company": "My company name",
42 * "externalTransactionId": "7c03ca74-eaf5-4541-8678-9b857634fdcb",
43 * "paidDate": "2020-05-27T12:20:37.994Z",
44 * "paymentMethod": "VISA",
45 * "paymentGatewayTransactionId": "29A06193U6234935D",
46 * "paymentProviderTransactionId": "7c03ca74-eaf5-4541-8678-9b857634fdcb"
47 * },
48 * "buyerInfo": {
49 * "id": "f6c2c0f9-4e9f-a58d-a02d-9af2497294d9",
50 * "identityType": "MEMBER",
51 * "firstName": "John",
52 * "lastName": "Doe",
53 * "phone": "+15555555555",
54 * "email": "john.doe@somedomain.com"
55 * },
56 * "_dateCreated": "2020-05-27T12:20:37.966Z",
57 * "currency": "ILS",
58 * "fulfillmentStatus": "NOT_FULFILLED",
59 * "archived": false,
60 * "activities": [
61 * {
62 * "type": "ORDER_PLACED",
63 * "timestamp": "2020-05-27T12:20:37.966Z"
64 * },
65 * {
66 * "type": "ORDER_PAID",
67 * "timestamp": "2020-05-27T12:20:37.994Z"
68 * }
69 * ],
70 * "number": 10019,
71 * "paymentStatus": "PAID",
72 * "shippingInfo": {
73 * "deliveryOption": "Free Shipping",
74 * "estimatedDeliveryTime": "4:30pm",
75 * "shippingRegion": "Domestic",
76 * "shipmentDetails": {
77 * "address": {
78 * "formatted": "company name\n235 W 23rd St\nNew York, New York 10011\nUnited States\n5555555555",
79 * "city": "New York",
80 * "country": "USA",
81 * "addressLine": "235 W 23rd St",
82 * "postalCode": "10011",
83 * "subdivision": "NY"
84 * },
85 * "firstName": "John",
86 * "lastName": "Doe",
87 * "email": "john.doe@somedomain.com",
88 * "phone": "5555555555",
89 * "company": "company name",
90 * "tax": 0,
91 * "discount": 0,
92 * "priceData": null
93 * },
94 * "pickupDetails": null
95 * },
96 * "lineItems": [
97 * {
98 * "index": 1,
99 * "quantity": 1,
100 * "price": 5,
101 * "name": "my product's name",
102 * "translatedName": "Nombre traducido",
103 * "productId": "3fb6a3c8-988b-8755-04bd-5c59ae0b18ea",
104 * "totalPrice": 5,
105 * "lineItemType": "PHYSICAL",
106 * "options": [
107 * {
108 * "option": "Size",
109 * "selection": "Medium"
110 * }
111 * ],
112 * "customTextFields": [
113 * {
114 * "title": "Notes for delivery",
115 * "value": "Please leave at front door"
116 * }
117 * ],
118 * "weight": 1.42,
119 * "sku": "36523641234523",
120 * "discount": 0,
121 * "tax": 5,
122 * "taxIncludedInPrice": true,
123 * "priceData": {
124 * "price": "5",
125 * "totalPrice": 5,
126 * "taxIncludedInPrice": true
127 * },
128 * "mediaItem": null
129 * }
130 * ],
131 * "totals": {
132 * "discount": 0,
133 * "quantity": 1,
134 * "shipping": 0,
135 * "subtotal": 5,
136 * "tax": 0,
137 * "total": 5,
138 * "weight": 1.42
139 * },
140 * "weightUnit": "KG",
141 * "customField": {
142 * "value": "Please call when outside",
143 * "title": "Notes for delivery",
144 * "translatedTitle": "Notas de entrega"
145 * },
146 * "fulfillments": [],
147 * "discount": null
148 * }
149 * }
150 *
151 */