How to start shipping for millions of users
Hello! My name is Denis. I am the head of the SafeDeal area in Avito. We develop the “Delivery” and “Short-term lease” services and make their use convenient, understandable and secure. In March of this year, we launched a service for the delivery of goods between private users. It would seem that there is such a thing and why devote an entire article to it? Delivery is available at all online stores, many customers use it and there are no great difficulties with this service.
Yes it is. There are no problems if the seller is a legal entity, a company representative. But when private buyers and sellers are connected to this process from both sides, a number of interesting tasks and problems appear that need to be addressed. Taking into account the fact that Avito is visited by more than 34 million users every month, we understood that the transfer of goods from the seller to the buyer with the help of our service should be made as simple as possible. In the article I will talk about the prerequisites for launching delivery between private users on Avito, about the problems we encountered, and how we solved them thanks to agreements with our partners and attention to detail. And I will show some insides of the service: its mechanics and architecture.
Why there was a delivery on Avito: prerequisites
To expand the range of products for each
Avito is tens of thousands of small communities of buyers and sellers in each locality. But if, for example, you live in Voronezh and tomorrow you want to buy ski boots size 44 on Avito, in your city (at the time of writing this article) there are only four ads you need. Not a great choice. When searching across Russia you will see 377 ads. Selection increases 94 times.
Sometimes, due to lack of choice or unwillingness to engage in logistics of delivery of goods from another region, buyers left Avito and searched for the goods they needed on the Internet and in local stores. Often it turned out to be more expensive. A purchased new product was not always better. That is, although Avito was what the buyer liked, he did not dare to buy it. We wanted to rectify the situation.
Solve the problems of interregional sellers and buyers
We have an analytical model, which with high accuracy considers how many transactions are made on Avito. She tells us that private users annually conclude 63 million transactions among themselves. A quarter of them are interregional. Of course, distance introduces certain difficulties in this process.
Before the launch of the delivery, the interregional transaction was partly a kind of “leap of faith”. Buying goods from another region, people often made an advance payment for it. And nervous, relying on the integrity of the seller. And if users agreed that the buyer would pay after receiving the goods, then the seller was in danger. Sometimes cash on delivery was used. The seller sent the parcel by mail indicating its value, and the buyer took the goods and paid for them. Then the money went to the sender. But cash on delivery did not resolve all issues: the recipient had to pay upon delivery, without the ability to check the contents and make sure that there lies (for example) the iPhone, the purchase of which was agreed with the seller, and not a brick.
In addition, there were often contradictions about who exactly was to pay for the delivery service itself, and because of this there were no transactions. We have always tried to help users, but first of all we acted as an “infrastructure bridge” between people, not taking part in the transaction. Avito connected the seller and the buyer, and further arrangements and their faithful execution remained on the conscience of users. This situation did not suit us. Buying goods at a profit is not the main criterion for the success of a transaction on ad sites. Trust and security issues are just as important. We wanted to create a reliable service that will make the process of making transactions easier, more convenient and safer.
Attract new customers
It is difficult to find in Russia a person who would not have heard about Avito. But not everyone uses the service. Someone simply does not like to meet personally with the seller, to understand the features of parcel shipments, to transfer money to unknown accounts and cards. Therefore, we defended the delivery transactions so that people who previously did not dare to buy and sell products on Avito, tried our service using convenient mechanics.
How it works: mechanics and architecture
Mechanics
We tried to make the mechanics of using Avito delivery simple and straightforward. The buyer selects the product, clicks "Buy with delivery" and pays for the product and delivery by credit card. Until the goods are received, the money is reserved in the bank escrow account. The seller receives a confirmation of payment, and he has two days to take the goods to the receiving point. When the goods arrive at the point of issue, the buyer must pick up the package within three days. At the point of issue the buyer calls the code from the SMS and receives the goods. It can be checked within 15 minutes, after which the purchase is confirmed. After the buyer receives the goods, the seller receives a message on Avito. He binds his bank card - the money will be transferred to her from the escrow account. The transaction is completed.
Architecture
In this section, I will talk about the product internals and services that are responsible for the work at the stage of purchase, delivery, and upon receipt of the goods.
Purchase
When a user selects a product through the site or the Avito mobile app, he sends a request to the Avito-Site service. The Avito site backend “communicates” with two systems:
1. Avito Delivery Core - contacts the delivery service.
2. Billing - forwards the request to QIWI, Tinkoff.
After the buyer has chosen the product, he gets to the page where he can find out the cost and delivery time.
Services that are involved here
Avito-Site. Sends requests.
Calculation. Stores tariffs and knows how much shipping will cost based on the selected product category.
Terminal Keeper. Finds pickup points in the city of the recipient.
Delivery-Geo. Stores information about the possibility of delivery to a specific city and the timing of delivery.
Scheme of work of services
From payment to delivery
At this stage, an order is actually created.
Services that are involved at this stage
Avito-Site. Sends requests to other services.
Order-Controller. It proxies calls to our other internal services and conducts the initial validation of data received from the Avito-Site backend.
Order-Expiration. Tracks the life of the order. If the payment deadlines have passed, the buyer’s order must be invalidated.
Calculation. Calculates shipping costs.
Callback Processor. Notifies Avito-Site about changes to the order.
Order keeper Service, as a kind of wrapper over the base with the API. Some business validations still occur in it, and after that it gives the order number to Order-Controller.
Scheme of work of services
When Order-Controller sent everything it owed and received the order number, it sends the information to Avito-Site: “Everything went well”. The Avito-Site backend knocks on Billing, which works with QIWI or Tinkoff, and the order is paid.
After successful payment, the Avito-Site backend knocks on our Order-Controller service, saying: "The confirmation was successful."
The next step - Order-Controller again knocks on Order-Keeper, saying: "We confirm the order." Order-Keeper checks for correct status. (Suddenly, such a product has already been delivered, canceled, or something else happened to it). If the check is successful, the service transfers the status to the confirmation to the delivery service.
Further, Order-Controller knocks on the Order-Expiration service, and says that the buyer’s payment phase of the order is over. Now the seller has from two to four days to carry the goods to the pick-up point. Order-Expiration follows these deadlines. If the seller does not have time, the service will cancel the order, and the money will be returned to the buyer.
Delivery
The first part of the transaction was completed: the buyer paid the order and the money was deducted from his account. Now the seller must bring his goods to the delivery service within two days.
What services are working here
Avito-Site. Still sending requests.
Order-Controller. Proxy calls to other internal services and validates data received from the Avito-Site backend.
Order keeper Stores order number and order payment information.
Delivery Registrator. Responsible for registering an order directly to the delivery service.
Delivery-Submitter. Registers and cancels the order, gives the number assigned by the delivery service to our services.
Status-Manager. It stores all statuses in our version, validates incoming information and notifies the necessary services about it.
Callback Processor. Notifies Avito-Site that the order is paid.
Messenger. Sends messages to the user.
How does this happen
We explain the work of services on the example of the Boxberry delivery service. But since recent times we have also been working with DPD.
Getting
The transaction is nearing completion - the order is on the way, or has already been delivered to the buyer. We should inform the user about this in the messenger.
Services involved in the last stage
Delivery-History-Converter. Receives and stores status according to the delivery service version: “on the way”, “ready for issue”, “returned”.
Order keeper Stores information received from the delivery service about the dimensions, weight of the goods and the receiving terminal.
Status-Manager. Updates the latest status received and sends a request to Order-Expiration.
Order-Expiration. Monitors the timing of dispatch of goods by the seller.
Callback Processor. Alerts Avito-Site.
Avito-Site. Sends information to the messenger.
Scheme of work of services
What problems do buyers and sellers solve?
I'll tell you what other problems private users encounter, and how we solved them with the launch of the delivery.
Fixed Shipping Price
Usually the cost of delivery of a professional service depends on the size and weight of the goods. Indicating them correctly is not a problem for a professional. But the private seller may be mistaken in the parameters of length, width or weight, and then he will be charged an additional bill. Because of this, use the delivery services do not want.
We have large volumes of service - daily sellers place over 400,000 ads. We didn’t want each of them to be dissatisfied with our product only because it could not accurately indicate the size of its goods. No one would connect to the delivery, and customers would be inconvenient to use Avito. Therefore, we compared our category tree with Boxberry and DPD dimensions and tariffs and converted them into conditional dimensions. For the tariffs we use in delivery, the goods of the same category are always the same size and weight. It doesn’t matter if you sell iPad mini or iPad Pro - you don’t need to pay additional fees for errors in size. Although there are services that require you to pay a commission, if the seller incorrectly indicated the size and weight of the goods.
Packaging
In a classic delivery, the seller always packs the goods. He has opportunities for that. But if you, for example, simply sell an old TV, you may encounter a problem: the delivery service will not accept the goods without packaging, and you hardly have a factory box of it, and there is hardly any packing paper storage around the corner. We agreed with the delivery service that they undertake this task, and therefore sellers do not waste time on unnecessary action.
Easy process for sending and receiving goods
Each order has its own unique number, which only the seller and the recipient know. In order to deliver and receive an order, you need to call this number. You don’t need to do anything else - for example, fill in invoices. In many delivery services without this action, you will not send or receive anything.
Security and transaction control
The advantage of delivery to Avito is also in the fact that it is not just the shipment of goods from the seller to the buyer, but also money management. If the buyer did not like the product, he can refuse it, and the money will be returned to him. And you do not have to pay for the return delivery of goods, as happens in other services. We not only help physically deliver the goods, but also participate in the transaction, protecting sellers and buyers. If problems arise, we will solve them.
You can not buy one product twice
If the goods are paid, we hang a tag with information about it. This helps us avoid confusion with double payment of a single product. But if the seller has several copies of the same product, soon he can also indicate this. Then we just change their number in the issue.
What is the result
We have launched a convenient service for private sellers and buyers, which provides them with new opportunities and helps them better achieve their goals. After three months of work, we summed up the interim results.
Now with delivery, you can buy 5 million products - this is 36% of all ads for sale. Most of them, of course, in Moscow - the number of ads exceeded one million, and in St. Petersburg - more than 500 thousand ads. These same cities and the most "sending". Since the beginning of April, users have sent almost 67 thousand products across Russia. One day record - 2,115 shipments.
Most often, users made intracity departures in Moscow - this route accounted for 5% of all parcels. The next three most popular delivery routes are in the two largest cities: Moscow - St. Petersburg (1.6%); St. Petersburg - St. Petersburg (1.5%); St. Petersburg - Moscow (1.1%). Then - departures from Moscow to Rostov-on-Don, Nizhny Novgorod, Krasnodar, Yekaterinburg, Novosibirsk and Voronezh. With delivery to Avito, you can send the goods to any region of Russia. The longest route was the route Moscow - Yuzhno-Sakhalinsk: a highchair for feeding from the capital flew more than 6.6 thousand kilometers.
This is the first post in the series about shipping to Avito. If you are interested in this topic, in the following posts we will tell you a little more about the technology of our service: with code and other internals. Ask your questions in the comments, we will try to answer.
Stay tuned!