Resources in Dispatch API
A resource represents any entity that can be picked up or dropped off. In terms of ridehail, it can refer to passengers and in terms of delivery it can refer to things like packages, boxes, food parcels etc. Using the Dispatch API, we can create and complete tasks to move a resource from one location to another.
There are two types of resources:
Unique resource: a resource that is unique and not interchangeable with any other resource. For example, a passenger in vehicle 1 is not the same as passenger in vehicle 2. The vehicle assigned to the task must first pick up the unique resource from a location and then drop it off. The information of these resources are provided while creating a task. Some examples of unique resources are passengers, made-to-order meal deliveries, shipped packages from Amazon and UPS etc. To get started with unique resources, refer to this guide on how to build a simple ridehail service.
Generic resource: a resource that is interchangeable with other identical resources. Such resources have to be added to a vehicle's inventory beforehand. Thus, it is possible for multiple vehicles to have all the requested items in its inventory and any of them is capable of completing the delivery. Some examples of generic resources are lunch delivery with identical food items, fruits and vegetables delivery, test kits delivery etc. The guide on mobile warehouse style delivery will help you get started with generic resources.