Going the Extra Mile In Customer Service: How Does JD.com Make Order Cancellation So Easy?

JD Smart Supply Chain
JD Technology Blog
Published in
7 min readOct 30, 2018

There is no doubt that e-commerce makes life in the modern world much more convenient. Instead of going to a store to buy products, purchases are increasingly made sitting at home or at the office, on mobile phones.

When consumers order something by accident, or change their minds before their orders arrive, the process suddenly becomes less convenient. In the era of e-commerce, cancellations have become a common problem facing users and retailers alike. Because most retailers used third-party logistics providers, they can’t allow cancellations once orders leave the warehouse. Customers who want to cancel orders can only do so by returning goods after they’ve arrived and by mailing the package back. Some retailers even charge a return fee. When this happens, a trip to the store doesn’t sound like such a bad option anymore.

At JD.com, we don’t want to accept this level of inconvenience to our customers so we allow them to cancel orders up to the minute their package is delivered, through our mobile app, at no extra cost. JD.com is able to do this because we operate our own in-house logistics network, which enables more control and flexibility.

Figure 1: JD.com Allows Customers To Cancel Orders Up To The Delivery Of The Package

We also deliver at incredibly fast speeds — over 90% of orders are delivered the same or next day after they’re placed. When a customer confirms a cancellation, their package must be singled out as soon as possible, while it is en route to its destination which, if handled improperly, can be very costly and lead delays in the delivery of other packages.

In this post, we discuss one of the algorithms JD.com uses to minimize order cancellation costs, while providing easy cancellation and fast delivery to our users.

Figure 2: Order Fulfillment Process

Before going into the details of the algorithm, let’s take an overview of the order fulfillment process at JD.com (Figure 2). The highly efficient fulfillment process starts with Order Approval. This is done immediately after the payment is verified. The order is then dispatched to the warehouses for processing. This Dispatchingprocess takes a short time and ensures that the selected warehouses contain the items purchased and is in a good condition to complete the order beforethe cut-off time. The next key process is Picking, Assembling, and Packingat the warehouses. At JD.com, a significant portion of the orders are pickedand packed around one hour from when the orders are assigned to the warehouses. If an order has already been packed before it gets cancelled, we need to spend extra time to unpack and re-stock the items into the storage field. Finally, the fulfillment process completes with Shipping and Deliverywhere the packed order is loaded onto the truck and delivered to the customers through JD.com’s delivery network.

For many e-commerce platforms, the cut-off time for free cancellation is before an order gets dispatched to the warehouse. However, JD.com is able to extend the free cancellation window until the delivery of a package, because of the fact JD.com’s order fulfillment is empowered by a self-operated supply chain network consisting of 500+ warehouses and a dedicated delivery fleet.

The Cool-Down Period

The “Cool-Down” period is a unique way for handling order cancellations, and is patent pending. By analyzing the order cancellation rate, we find that the majority of the cancellations made are within the first 30 minutes (see Figure 3). In order to reduce the cancellation rate, we put the orders on hold for a given period before dispatching orders to the warehouses for picking. We call this the cool-down period, as this allows customers to reconsider their purchase decisions.

Figure 3. Order Cancellation Rate By Time Once The Orders Being Placed (y-axis hidden)

However, to determining the length of an appropriate cool-down period is not that straightforward. A longer cooling period increases the probability of ‘catching’ a cancelled order before its fulfillment process starts; however, it also reduces the time left for picking and packing. This would result in a lower picking efficiency and potentially higher fulfillment costs. We discuss how we use a Smart Cool-Down Period algorithm (SCDP) to determine the appropriate cool-down period and reduce costs.

Figure 4: Trade-offs of Extending and Reducing Cool-Down Period

Smart Cool-Down Period Algorithm

The key of the SCDP algorithm is to i) predict the probability of order cancellation for each given order and ii) set the cool-down period accordingly. This is another great example showing how optimization and machine learning techniques work together in real world.

The optimal cool-down period can be calculated using the following mathematical model:

where

· P is the cancellation probability to be estimated for the order.

· Y(t) is the conditional probability that an order will be cancelled after time t given that the order is cancelled.

· F(t) is the additional operational cost associated with delaying the order dispatching by time. The form of function F(t) depends on the operational structure of the fulfillment process. One instance of such function is a linear cost model. F(t)= βt where β is a constant.

· α is a constant representing extra cost per cancelled order.

· T is the maximum cool-down period allowed based on business constraint and user delivery promise.

Given an order will be cancelled, we assume the conditional probability that the order will be cancelled after time t, Y(t) follows an exponential distribution, i.e. Y(t)=exp(-λt). The parameter λ is estimated by data from the previous 4 weeks and updated daily.

In order to predict the cancellation probability for an order, a Logistic Regression model is built. The model is trained onorder data and we list the key features used in the model in Figure 5.

Figure 5: Some Features Used For The Estimation Of The Cancellation Rates

The optimal solution of the minimization problem can be solved analytically or numerically. With a linear cost function F(t)= βt, the optimization function has an analytical solution. The optimization model can be written as

This optimization model has an optimal solution:

With the above calculation, we determine the required cool-down period for each order. During the cool-down period, the order is sidelined in the order process pipeline. If cancellation occurs during the cool-down period, the order will be automatically cancelled and removed from the order fulfillment process. Otherwise, the order will be dispatched to the warehouses for fulfillment after the cool-down period is passed.

By adjusting the values of α and β, the proposed algorithm can efficiently balance between order holding time and expected fulfillment waste spent on cancelled orders. Compared to a naïve implementation of a static holding time, the proposed algorithm can reduce about 35% of the holding time while catching the same number of cancelled orders. Or putting it in the other way, it can reduce the cancellation-after-dispatch rate by 12% with the same total order holding time.

Figure 6 shows the comparison between the SCDP algorithm and a baseline algorithm (where every order is set to apply the same cool-down period) based on real order information. The x-axis is the total number of orders that get cancelled after the cool-down period. The y-axis indicates the total waiting time for all the orders processed by the cool-down algorithm. We plot multiple points on the figure for each algorithm using different parameters. A better algorithm would yield a result closer to the lower left corner of the graph. As it can be seen from the figure, the proposed SCDP algorithm dominates the baseline algorithm.

Figure 6. Comparison Between SCDP and Baseline Algorithm (values are hidden)

When used in practice, the parameters and are normally not easy to estimate as there are many different factors affecting the final cost calculation. We normally choose the appropriate parameters by working with the operations team. The parameters are also adjusted over time as the fulfillment process changes.

Summary

This algorithm is a small piece of our fulfillment process that keeps improving for higher efficiency and lower costs. We hope you get the idea of how we combine techniques from optimization and machine learning to improve our business.

We are open to all kinds of academic research collaborations. Please contact jd_tech_blog@jd.com if you are interested.

--

--

JD Smart Supply Chain
JD Technology Blog

Focuses on technological innovation and real-world application that connects big data and supply chain technologies to build next generation smart supply chain.