It seems very few businesses, large or small, have escaped the rollercoaster that 2020 has been. Some segments, like bars and restaurants, have seen massive downturns. For these businesses, local delivery services have been a saving grace.
But what about retailers that don’t offer burritos and pizza? Large companies, like Walmart, have begun to offer local delivery for a much wider range of products than just takeout. By integrating a delivery service into their own site and apps, they can provide customers with access to a wide variety of items, safely delivered to the customer’s doorstep.
This isn’t a feature that only mega-retailers, like Walmart, can offer. Postmates, a courier service that does real-time pickup and delivery services, is the service behind Walmart’s offerings and is available to any sized business.
Plus, Postmates isn’t just for food deliveries. It can be used to have just about anything delivered to customers in real-time – from cold medicine to auto parts to office supplies.
Connecting with Postmates
Postmates offers two ways for merchants to connect with their delivery services – via a web dashboard or by integrating with the Postmate API.
The Postmates web dashboard gives merchants the ability to use Postmates delivery through their online portal without the need for additional programming or integration. It requires direct deposit for payments and is used for tablet or phone ordering. If you need a quick and easy way for your customers to start ordering your products for delivery, without the need for a developer, the web portal is for you. It’s more hands-on work for the merchant, however, and doesn’t allow you to use Postmates within your own app or site.
The Postmate API, on the other hand, is flexible, provides more opportunity for automation, and can be integrated with your app or site. The API allows your own properties to query Postmates for availability, pricing, and to set up a delivery, all behind your own brand.
What the Postmates API Offers
As mentioned, the Postmate Delivery API gives you greater flexibility, visibility, and control over real-time, local deliveries. It does that through a number of functions and the use of webhooks. The API is REST-based and uses standard HTTP requests like GET, POST, and DELETE, with standard HTTP status codes. Authentication for the API occurs over HTTP Basic Auth, using an API key.
Delivery Quotes and Rating
When a customer would like a delivery, the first thing your application will need to do is get a delivery quote. Providing the pickup and dropoff address to the API, you’ll get a JSON response with the fee and the duration, or the estimated amount of time it will take for the delivery to reach the dropoff, based on Postmates delivery capacity at the time of the request.
Create a Delivery
Once the customer has placed the order and payment has been processed, you can use the Postmates API to schedule delivery. The delivery request will include the manifest (the item(s) to be picked up), where the order is being picked up from, and where it will be delivered to.
A successful request will send back a delivery object, confirming the fee and delivery information. It will also include a status of the delivery, the pickup ETA and the dropoff ETA. These values will initially be null, but as the order progresses, they will be updated. Most importantly, though, the response includes the id, which will allow you to view and track the delivery as it progresses.
Track a Delivery
Using the id assigned to the delivery, additional requests can be sent to retrieve the status of the order. Responses include pending, pickup, dropoff, and delivered.
There are additional values that provide useful information while a delivery is active.
Complete will be false as long as the delivery is still in progress.
Courier provides information about the delivery driver – their name, a picture, and their location while executing the delivery.
Pickup_eta and dropoff_eta give the estimated time at with the courier will be picking the order up from you, and when it’s expected they will deliver the purchase to the customer. This gives you important information like how long you have to prepare the order before the driver arrives. You can also provide information back to the customer on when to expect delivery and if the driver is pulling up with their delivery.
As mentioned, the API uses a key to authenticate the request. But beyond that, the webhooks created through the API can be verified with a digital signature, calculated from a shared secret and the payload of the request. Postmates uses a SHA-256 hashing algorithm, so merchants can be reasonably confident that a request is coming from Postmates and not a hacker or other bad actor.
The Postmates API has some pretty robust error codes, making error handling very useful. While there are too many codes to list here, suffice it to say you’ll know with a good deal of clarity what went wrong if there is a problem, from couriers_busy to max_tip_exceeded.
Using the Postmates API within your site or app creates a better user experience for the customer. Local delivery orders can happen quickly, through self-service, and the API gives customers all the information they need without needing to call or visit your location. For your store, integrating the API means automated delivery orders with minimal action needed by your staff, other than to prep the order for pickup. Best of all, Postmates will deliver nearly anything. With online shopping and ordering skyrocketing in the last few months – and no anticipated decline in sight – now is the right time to add local delivery for your customers.
If you’re looking to integrate the Postmates API with your business, let us know. Curotec can help you with that, as well as setting up or improving your e-commerce storefront, adding a 3PL to your online business and much, much more.