{"openapi":"3.0.0","info":{"description":"This is the Swoove API, used by both businesses and agencies to manage deliveries, vehicles, and tracking.\n\n- **Business Portal:** [https://business.swoove.delivery/](https://business.swoove.delivery/) – Sign up and manage business deliveries.  \n- **Agency Portal:** [https://panel.swoovedelivery.com/](https://panel.swoovedelivery.com/) – Manage agency operations, fleet, and riders.\n","version":"1.0.0","title":"Swoove","contact":{"email":"developer@swoove360.com","name":"Swoove360 developer"}},"servers":[{"description":"Sandbox","url":"https://test.swooveapi.com"},{"description":"Production","url":"https://live.swooveapi.com"}],"paths":{"/estimates/create-estimate":{"post":{"tags":["Business Estimates"],"summary":"Check Delivery Estimate","parameters":[{"name":"app_key","in":"query","required":true,"schema":{"type":"string"}}],"requestBody":{"$ref":"#/components/requestBodies/Estimates"},"responses":{"200":{"description":"Delivery Estimates Found","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"responses":{"allOf":[{"$ref":"#/components/schemas/Estimate"},{"type":"object","properties":{"distance":{"type":"number","deprecated":true},"distance_units":{"type":"string","default":"km","deprecated":true},"timestamp":{"type":"number"},"optimal_estimate":{"$ref":"#/components/schemas/EstimateOption"},"estimates":{"type":"array","items":{"$ref":"#/components/schemas/EstimateOption"}}}}]}}}]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiError400"},{"type":"object"}]}}}},"500":{"description":"Getting Estimates Failed"}},"security":[{"ApiKeyAuth":[]}]}},"/bulk-estimate/create-bulk-estimate":{"post":{"tags":["Business Estimates"],"summary":"Check Estimate for a bulk delivery that is multiple pick up and drop offs","parameters":[{"name":"app_key","in":"query","required":true,"schema":{"type":"string"}}],"requestBody":{"$ref":"#/components/requestBodies/BulkEstimates"},"responses":{"200":{"description":"Delivery Estimates Found","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"responses":{"allOf":[{"$ref":"#/components/schemas/BulkEstimateResponses"}]}}}]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiError400"},{"type":"object"}]}}}},"500":{"description":"Getting Estimates Failed"}},"security":[{"ApiKeyAuth":[]}]}},"/delivery/create-delivery":{"post":{"tags":["Business - Delivery"],"summary":"Create a delivery request","description":"Create a new delivery. If a callback URL was provided, delivery status updates will be sent to that URL.\nSee [CallbackDeliveryPayload](#components-schemas-CallbackDeliveryPayload) for the structure of the data sent.\n","parameters":[{"name":"app_key","in":"query","required":true,"schema":{"type":"string"}}],"requestBody":{"$ref":"#/components/requestBodies/Deliveries"},"responses":{"200":{"description":"Success Responses On Delivery Creation Request","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"responses":{"allOf":[{"$ref":"#/components/schemas/Delivery"},{"type":"object","properties":{"time":{"type":"number","deprecated":true},"distance":{"type":"number","deprecated":true},"estimate_id":{"type":"string","deprecated":true},"delivery_type":{"type":"string","deprecated":true,"default":"SHARED"},"status":{"type":"string","default":"AGENCY_ASSIGNED","description":"- PENDING - The initial state of a delivery after creation   \n- GROUPED - The delivery has been added to a group/trip    \n- AGENCY_ASSIGNED - The delivery has been assigned to an agency \n- ASSIGNED - The delivery has been assigned to a rider \n- ONHOLD - The delivery is on hold due to low funds or some other reason \n- PICKUP - The rider is on the way to pick up the items \n- PICKEDUP - The rider has picked up the items \n- DROPOFF - The rider is on the way to drop off the items \n- DROPEDOFF - The rider has dropped off the items \n- ENDED - The delivery is commpleted \n- CANCELLED - The delivery has been cancelled \n- DELIVERY_PAID_FOR - The delivery has been paid for\n- RETURN - The delivery is being returned to the pickup location\n- RETURNED - The delivery has been returned to the pickup location\n","enum":["PENDING","CANCELLED","GROUPED","AGENCY_ASSIGNED","ASSIGNED","ONHOLD","PICKUP","PICKEDUP","DROPOFF","DROPEDOFF","ENDED","DELIVERY_PAID_FOR","RETURN","RETURNED"]},"delivery_code":{"type":"string"},"secret_code":{"type":"string","description":"The secret code that will allow a delivery to be ended. This must be shared with the drop off content as it will be required to recieve the package from the rirder"},"timestamp":{"type":"number"},"full_price":{"$ref":"#/components/schemas/Price"}},"required":["secret_code","delivery_code","full_price","status"]}]}}}]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiError400"},{"type":"object"}]}}}},"500":{"description":"Requesting Delivery Failed"}},"security":[{"ApiKeyAuth":[]}]}},"/bulk-delivery/create-bulk-delivery":{"post":{"tags":["Business - Delivery"],"summary":"Create Bulk Delivery Request","parameters":[{"name":"app_key","in":"query","required":true,"schema":{"type":"string"}}],"requestBody":{"$ref":"#/components/requestBodies/BulkDeliveries"},"responses":{"200":{"description":"Bulk Delivery Created","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"responses":{"$ref":"#/components/schemas/BulkDeliveryResponses"}}}]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiError400"},{"type":"object"}]}}}},"500":{"description":"Getting Estimates Failed"}},"security":[{"ApiKeyAuth":[]}]}},"/delivery/get-delivery/{delivery-code}":{"get":{"tags":["Business - Delivery Information"],"summary":"Get Delivery By Delivery Code","parameters":[{"name":"delivery-code","in":"path","description":"Delivery Code","required":true,"schema":{"type":"string"}},{"name":"app_key","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Delivery Found","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"message":{"type":"string","default":"Delivery Found"},"responses":{"allOf":[{"$ref":"#/components/schemas/Delivery"},{"type":"object","properties":{"time":{"type":"number","deprecated":true},"distance":{"type":"number","deprecated":true},"delivery_type":{"type":"string","deprecated":true,"default":"SHARED"},"agent_details":{"$ref":"#/components/schemas/Agent"},"agency_details":{"$ref":"#/components/schemas/AgencyDetails"},"vehicle_details":{"$ref":"#/components/schemas/Vehicle"},"status":{"type":"string","default":"AGENCY_ASSIGNED","description":"- PENDING - The initial state of a delivery after creation - GROUPED - The delivery has been added to a group/trip  - AGENCY_ASSIGNED - The delivery has been assigned to an agency - ASSIGNED - The delivery has been assigned to a rider - ONHOLD - The delivery is on hold due to low funds or some other reason - PICKUP - The rider is on the way to pick up the items - PICKEDUP - The rider has picked up the items - DROPOFF - The rider is on the way to drop off the items - DROPEDOFF - The rider has dropped off the items - ENDED - The delivery is commpleted - CANCELLED - The delivery has been cancelled\n","enum":["PENDING","CANCELLED","GROUPED","AGENCY_ASSIGNED","ASSIGNED","ONHOLD","PICKUP","PICKEDUP","DROPOFF","DROPEDOFF","ENDED"]},"delivery_code":{"type":"string"},"secret_code":{"type":"string","description":"Delivery Secret Code. This is shared with the customer and given to the rider to comfirm dropoff"},"timestamp":{"type":"number"},"full_price":{"$ref":"#/components/schemas/Price"},"time_completed":{"type":"number","description":"Delivery End Time"}},"required":["secret_code","delivery_code","status","full_price"]}]}}}]}}}},"404":{"description":"Delivery not found"},"500":{"description":"Get Delivery Failed"}},"security":[{"ApiKeyAuth":[]}]}},"/delivery/single/get-by-reference/{reference}":{"get":{"tags":["Business - Delivery Information"],"summary":"Get Delivery By reference","parameters":[{"name":"reference","in":"path","description":"Reference submitted during delivery creation","required":true,"schema":{"type":"string"}},{"name":"app_key","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Delivery Found","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"message":{"type":"string","default":"Delivery Found"},"responses":{"$ref":"#/components/schemas/DeliveryResponses"}}}]}}}},"400":{"description":"Delivery not found"},"500":{"description":"Get Delivery Failed"}},"security":[{"ApiKeyAuth":[]}]}},"/delivery/get-delivery-timeline/{delivery-code}":{"get":{"tags":["Business - Delivery Information"],"summary":"Get Delivery Timeline By Delivery Code","parameters":[{"name":"delivery-code","in":"path","description":"Delivery Code","required":true,"schema":{"type":"string"}},{"name":"app_key","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Delivery Timeline Found","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"message":{"type":"string","default":"Delivery Found"},"responses":{"allOf":[{"$ref":"#/components/schemas/DeliveryTimeline"}]}}}]}}}},"404":{"description":"Delivery Timeline not found"},"500":{"description":"Get Delivery Timeline Failed"}},"security":[{"ApiKeyAuth":[]}]}},"/delivery/bulk/get-by-reference/{reference}":{"get":{"tags":["Business - Delivery Information"],"summary":"Get Bulk Delivery By reference","parameters":[{"name":"reference","in":"path","description":"Reference submitted during delivery creation","required":true,"schema":{"type":"string"}},{"name":"app_key","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Delivery Found","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"message":{"type":"string","default":"Delivery Found"},"responses":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryResponses"}}}}]}}}},"404":{"description":"Delivery not found"},"500":{"description":"Get Delivery Failed"}},"security":[{"ApiKeyAuth":[]}]}},"/delivery/get-deliveries":{"get":{"tags":["Business - Delivery Information"],"summary":"Get deliveries","description":"This api allows you to fetch deliveries created by your api key. This route is paginated and defaults to 10 per page startiong from 0. It also allows a from and to date filter","parameters":[{"name":"app_key","in":"query","required":true,"schema":{"type":"string"}},{"name":"pagenumber","in":"query","required":false,"description":"This is the page number for the deliveries returned. It starts and defaults to 0","schema":{"type":"number","default":0,"minimum":0}},{"name":"limits","in":"query","required":false,"description":"This is the number of deliveries to return. It defaults to 10","schema":{"type":"number","default":10,"minimum":1}},{"name":"from_date","in":"query","required":false,"description":"This is used to add the start date when fetching the delivery data. The from_date value should be the date and time in milliseconds.","schema":{"type":"number","default":0,"minimum":0}},{"name":"to_date","in":"query","required":false,"description":"This is used to add the end date when fetching the delivery data. The to_date value should be the date and time in milliseconds.","schema":{"type":"number","default":0,"minimum":0}},{"name":"status","in":"query","required":false,"description":"This is used to filter the deliveries returned by status. By default all deliveries are returned","schema":{"type":"string","enum":["PENDING","CANCELLED","GROUPED","AGENCY_ASSIGNED","ASSIGNED","ONHOLD","PICKUP","PICKEDUP","DROPOFF","DROPEDOFF","ENDED"]}}],"responses":{"200":{"description":"Delivery Found","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"message":{"type":"string","default":"Delivery Found"},"responses":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryResponses"}}}}]}}}},"404":{"description":"Delivery not found"},"500":{"description":"Get Delivery Failed"}},"security":[{"ApiKeyAuth":[]}]}},"/delivery/cancel-delivery":{"put":{"tags":["Business - Update Delivery"],"summary":"Cancel a delivery","description":"NB: Only deliveries that are not running can be canncelled. That is deliveries with status PENDING,AGENCY_ASSIGNED,REASSIGNED and PICKUP","parameters":[{"name":"app_key","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Delivery Cancelled","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"message":{"type":"string","default":"Delivery Cancelled"},"responses":{"$ref":"#/components/schemas/DeliveryResponses"}}}]}}}},"400":{"description":"Delivery not found"},"500":{"description":"Get Delivery Failed"}},"security":[{"ApiKeyAuth":[]}]}},"/delivery/rate-delivery":{"post":{"tags":["Business - Update Delivery"],"summary":"Rate a delivery","parameters":[{"name":"app_key","in":"query","required":true,"schema":{"type":"string"}}],"requestBody":{"$ref":"#/components/requestBodies/RateDelivery"},"responses":{"200":{"description":"Delivery Rated","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"responses":{"nullable":true,"default":null}}}]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiError400"},{"type":"object"}]}}}},"500":{"description":"Rating Delivery Failed"}},"security":[{"ApiKeyAuth":[]}]}},"/delivery/simulate-action":{"post":{"tags":["Extras"],"summary":"Simulate a delivery action in test enviroment only. ","description":"Note that the actions need to be triggered in this order \n1. ASSIGNED\n2. PICKUP\n3. PICKEDUP\n4. DROPOFF\n5. DROPEDOFF\n6. ENDED\n7. CANCELLED\n","parameters":[{"name":"app_key","in":"query","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Simulate Action For Deliveries","content":{"application/json":{"schema":{"type":"object","properties":{"delivery_code":{"type":"string","default":"The delivery code from the delivery that you want to simulate the action for. The delivery should already be created for this to happen"},"simulate_status":{"type":"string","description":"- PENDING - The initial state of a delivery after creation - GROUPED - The delivery has been added to a group/trip  - AGENCY_ASSIGNED - The delivery has been assigned to an agency - ASSIGNED - The delivery has been assigned to a rider - ONHOLD - The delivery is on hold due to low funds or some other reason - PICKUP - The rider is on the way to pick up the items - PICKEDUP - The rider has picked up the items - DROPOFF - The rider is on the way to drop off the items - DROPEDOFF - The rider has dropped off the items - ENDED - The delivery is commpleted - CANCELLED - The delivery has been cancelled\n","enum":["ASSIGNED","PICKUP","PICKEDUP","DROPOFF","DROPEDOFF","ENDED","CANCELLED"]},"secret_code":{"type":"string","description":"delivery secret code to be used in triggering ENDED status"}},"required":["delivery_code","simulate_status","secret_code"]}}}},"responses":{"200":{"description":"Success Responses On Delivery Simulation","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"message":{"type":"string","description":"Deliveries assigned to agent, trip created"},"responses":{"type":"string","default":null}}}]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiError400"},{"type":"object"}]}}}},"500":{"description":"Simulate acction failed"}}}},"/service-zone/":{"get":{"tags":["Business - Service Zones"],"summary":"Get available service zones","parameters":[{"name":"app_key","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Service Zones Found","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","default":true},"code":{"type":"number","default":200},"message":{"type":"string","default":"Service Zones"},"responses":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/ServiceZone"}}}}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiError400"},{"type":"object"}]}}}}}}},"/service-zone/check-zone/":{"post":{"tags":["Business - Service Zones"],"summary":"Check if a latitude and a longitude is in our service zone","description":"We allow requests from\n* Layer 3 to Layer 3\n* Layer 2 to Layer 3\n* Layer 3 to Layer 2\n","parameters":[{"name":"app_key","in":"query","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"description":"request body to be sent when checking if a location is in our servce zone","content":{"applicaltion/json":{"schema":{"type":"object","properties":{"longitude":{"type":"number","default":0},"latitude":{"type":"number","default":0}},"required":["latitude","longitude"]}}}},"responses":{"200":{"description":"Service Zones Found","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","default":true},"code":{"type":"number","default":200},"message":{"type":"string","default":"Service Zones"},"responses":{"$ref":"#/components/schemas/ServiceZone"}}}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiError400"},{"type":"object"}]}}}}}}},"/wallet/fund-wallet":{"post":{"tags":["Business - Wallet"],"summary":"Check Fund Wallet","deprecated":true,"parameters":[{"name":"app_key","in":"query","required":true,"schema":{"type":"string"}}],"requestBody":{"$ref":"#/components/requestBodies/Wallets"},"responses":{"200":{"description":"Fund Wallet Found","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","default":true},"code":{"type":"number","default":200},"message":{"type":"string","default":"Wallet Funded"},"responses":{"type":"object","properties":{"redirect_url":{"type":"string"}}}}}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError400"}}}},"500":{"description":"Funding Wallet Failed"}},"security":[{"ApiKeyAuth":[]}]}},"/agency/delivery/create-multiple-dropoffs":{"post":{"tags":["Agency - Delivery"],"summary":"Create Bulk Delivery Request from one location to multiple drop off locations","description":"This endpoint is used by the agency to create a bulk delivery request internally from one locaton, mostly the agency/warehouse location to multiple drop off locations. It is not meant for external use.","requestBody":{"$ref":"#/components/requestBodies/AgencyBulkDeliveries"},"responses":{"200":{"description":"Bulk Delivery Created","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"responses":{"$ref":"#/components/schemas/BulkDeliveryResponses"}}}]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiError400"},{"type":"object"}]}}}},"401":{"description":"Unauthorized"},"500":{"description":"Getting Estimates Failed"}},"security":[{"BearerAuth":[]}]}},"/agency/delivery/create-multi-route":{"post":{"tags":["Agency - Delivery"],"summary":"Create Multiple Bulk Delivery Request from different pick up and dropoff","description":"Create multiple deliveries with both pickup and dropoff info (used by agency)","requestBody":{"$ref":"#/components/requestBodies/AgencyBulkCreateMulti"},"responses":{"200":{"description":"Bulk deliveries created successfully","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"responses":{"$ref":"#/components/schemas/BulkDeliveryResponses"}}}]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiError400"}]}}}},"401":{"description":"Unauthorized"},"500":{"description":"Something went wrong"}},"security":[{"BearerAuth":[]}]}},"/agency/get-orders/":{"get":{"tags":["Agency - Delivery Information"],"summary":"Get Orders By Status","description":"Returns a paginated list of deliveries filtered by date and status.\n","parameters":[{"name":"from_date","in":"query","required":false,"schema":{"type":"integer","format":"int64"},"description":"Start of delivery range in timestamp format (ms)"},{"name":"to_date","in":"query","required":false,"schema":{"type":"integer","format":"int64"},"description":"End of delivery range in timestamp format (ms)"},{"name":"page_number","in":"query","required":false,"schema":{"type":"integer","default":1},"description":"Page number"},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["UNASSIGNED","ACTIVE","ALL","OUTSOURCED","PENDING","CANCELLED","GROUPED","AGENCY_ASSIGNED","ASSIGNED","ONHOLD","PICKUP","PICKEDUP","DROPOFF","DROPEDOFF","ENDED","RETURN","RETURNED","AUCTION"]},"description":"Filter orders by delivery status.   `UNASSIGNED`, `ACTIVE`, `ALL`, `OUTSOURCED`, or specific statuses like `PICKUP`, `ENDED`, `RETURNED`, etc.\n"},{"name":"limits","in":"query","required":false,"schema":{"type":"integer","default":10},"description":"Number of deliveries to return per page"}],"responses":{"200":{"description":"List of Deliveries","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryPaginatedResponse"}}}},"401":{"description":"Unauthorized – missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError401"}}}}},"security":[{"BearerAuth":[]}]}},"/agency/capabilities/":{"get":{"tags":["Agency - Extensions"],"summary":"Get Agency Capabilities","description":"Returns all capabilities related to the agency including item sizes, item weights, and vehicle types available.\n","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"responses":{"$ref":"#/components/schemas/Capabilities"}}}]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiError400"}]}}}},"500":{"description":"Something went wrong"}},"security":[{"BearerAuth":[]}]}},"/agency/get-riders/":{"get":{"tags":["Agency - Extensions"],"summary":"Get Riders","description":"Returns a paginated list of riders (agents) created by the agency.","parameters":[{"name":"page_number","in":"query","required":false,"schema":{"type":"integer","default":1},"description":"The current page number"},{"name":"limits","in":"query","required":false,"schema":{"type":"integer","default":10},"description":"Number of riders to return per page"},{"name":"active_deliveries","in":"query","required":false,"schema":{"type":"boolean","default":false},"description":"Filter for agents with active deliveries"},{"name":"location","in":"query","required":false,"schema":{"type":"string","example":"5.6456,-0.1124"},"description":"Comma-separated latitude and longitude to sort agents by proximity"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"responses":{"$ref":"#/components/schemas/AgentPaginatedResponse"}}}]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiError400"}]}}}},"401":{"description":"Unauthorized"},"500":{"description":"Something went wrong"}},"security":[{"BearerAuth":[]}]}},"/agency/finance/invoices/":{"get":{"tags":["Agency - Finance"],"summary":"Get invoices","description":"Returns a paginated list of invoices associated with the agency.","parameters":[{"in":"query","name":"from_date","schema":{"type":"integer","format":"int64"},"description":"Start of date range in epoch milliseconds"},{"in":"query","name":"to_date","schema":{"type":"integer","format":"int64"},"description":"End of date range in epoch milliseconds"},{"in":"query","name":"page_number","schema":{"type":"integer","default":1},"description":"Page number"},{"in":"query","name":"limit","schema":{"type":"integer","default":10},"description":"Number of invoices per page"}],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Successfully retrieved invoices","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"responses":{"$ref":"#/components/schemas/InvoicePaginatedResponse"}}}]}}}},"401":{"description":"Unauthorized"},"500":{"description":"Something went wrong"}}}},"/agency/tracking/vehicles":{"get":{"tags":["Agency - Tracking"],"summary":"Get tracked vehicles","description":"Retrieve a paginated list of vehicles with their latest location, specifications, and devices.","parameters":[{"name":"page_number","in":"query","required":false,"schema":{"type":"integer","example":1,"default":1},"description":"Page number for pagination."},{"name":"limits","in":"query","required":false,"schema":{"type":"integer","example":10,"default":10},"description":"Number of items per page."},{"name":"search","in":"query","required":false,"schema":{"type":"string","example":"chevy","default":null},"description":"Search string to filter vehicles."}],"responses":{"200":{"description":"Successfully retrieved invoices","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"message":{"type":"string","example":"Vehicles found"},"responses":{"$ref":"#/components/schemas/VehicleTrackingPaginatedResponse"}}}]}}}},"401":{"description":"Unauthorized"},"500":{"description":"Something went wrong"}}}},"/webhook/callback-example":{"post":{"tags":["Webhook Reference"],"summary":"Example of delivery callback payload","description":"This endpoint describes the structure of the payload sent to your configured webhook when a delivery status update occurs. It is not an actual callback trigger.\nThe format of the data is defined in the  [CallbackDeliveryPayload](#components-schemas-CallbackDeliveryPayload) schema.\nYour webhook must be capable of accepting POST requests with this structure.\n","responses":{"200":{"description":"Example payload structure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallbackDeliveryPayload"}}}}}}}},"components":{"schemas":{"Estimate":{"type":"object","description":"Delivery Estimate Request Structure","properties":{"pickup":{"$ref":"#/components/schemas/Location"},"dropoff":{"$ref":"#/components/schemas/Location"},"items":{"description":"Item(s) to be delivered","type":"array","default":[],"items":{"$ref":"#/components/schemas/Item"}},"vehicle_type":{"type":"string","deprecated":true,"description":"Type of vehicle wanted for the delivery\n\n  * `MOTORCYCLE` - Normal last-mile bikes\n","default":"MOTORCYCLE"}},"required":["pickup","dropoff","contact","reference"]},"BulkEstimate":{"type":"object","description":"Bulk Delivery Estimate Structure","properties":{"delivery_list":{"type":"array","description":"Array of deliveries to create an estimate for","minItems":1,"items":{"$ref":"#/components/schemas/Estimate"}}},"required":["delivery_list"]},"BulkEstimateResponses":{"type":"object","properties":{"optimal_estimate":{"$ref":"#/components/schemas/BulkEstimateDetails"},"estimates":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/BulkEstimateDetails"}}}},"Delivery":{"allOf":[{"$ref":"#/components/schemas/Estimate"},{"type":"object","description":"Delivery Request Structure","properties":{"contact":{"$ref":"#/components/schemas/Contact"},"instructions":{"type":"string","default":null,"description":"Any extra notes rider should be mindful of for the delivery."},"reference":{"type":"string","description":"Can be set to the id of some data in your system that needs to know about this delivery."},"estimate_id":{"type":"string","description":"The estimate id of the selected estimate that was returned during the create delivery estimate request"}},"required":["estimate_id","contact","reference"]}]},"DeliveryResponses":{"allOf":[{"$ref":"#/components/schemas/Estimate"},{"type":"object","description":"Delivery Request Structure","properties":{"instructions":{"type":"string","default":null,"description":"Any extra notes rider should be mindful of for the delivery."},"reference":{"type":"string","description":"Can be set to the id of some data in your system that needs to know about this delivery."},"status":{"type":"string","description":"- PENDING - The initial state of a delivery after creation  \n- GROUPED - The delivery has been added to a group/trip  \n- AGENCY_ASSIGNED - The delivery has been assigned to an agency  \n- ASSIGNED - The delivery has been assigned to a rider  \n- ONHOLD - The delivery is on hold due to low funds or some other reason  \n- PICKUP - The rider is on the way to pick up the items  \n- PICKEDUP - The rider has picked up the items  \n- DROPOFF - The rider is on the way to drop off the items  \n- DROPEDOFF - The rider has dropped off the items  \n- ENDED - The delivery is completed  \n- CANCELLED - The delivery has been cancelled  \n- DELIVERY_PAID_FOR - Payment has been successfully made for the delivery (applies only on webhook updates)\n- RETURN - The delivery is being returned to the pickup location\n- RETURNED - The delivery has been returned to the pickup location\n","enum":["PENDING","CANCELLED","GROUPED","AGENCY_ASSIGNED","ASSIGNED","ONHOLD","PICKUP","PICKEDUP","DROPOFF","DROPEDOFF","ENDED","DELIVERY_PAID_FOR","RETURN","RETURNED"]},"delivery_code":{"type":"string","description":"This is the delivery's unique code"},"secret_code":{"type":"string","description":"Delivery Secret Code. This is shared with the customer and given to the rider to comfirm dropoff"},"time":{"type":"number","deprecated":true},"end_time":{"type":"number","description":"Delivery End Time"},"distance":{"type":"number","deprecated":true},"delivery_type":{"type":"string","deprecated":true,"default":"SHARED"},"full_price":{"$ref":"#/components/schemas/Price"},"items":{"type":"array","default":null,"items":{"$ref":"#/components/schemas/Item"}},"time_completed":{"type":"number","description":"The time a delivery was completed in milliseconds"}},"required":["reference","status","delivery_code","secret_code","full_price"]}]},"BulkDelivery":{"description":"Bulk Delivery Request Structure","type":"object","properties":{"delivery_list":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/Estimate"},{"type":"object","properties":{"contacts":{"$ref":"#/components/schemas/Contact"},"instructions":{"type":"string","default":null,"description":"Any extra notes rider should be mindful of for the delivery."},"reference":{"type":"string","description":"Can be set to the id of some data in your system that needs to know about this delivery."}}}]}},"estimate_id":{"type":"string","description":"The estimate id of the selected estimate that was returned during the create delivery estimate request"},"individual_pricing_id":{"type":"string","description":"This is an optional paramater to create a delviery for only one individual pricing that is returned in a bulk estimate. Note that creating one will require all others to be created individually"}},"required":["delivery_list","estimate_id"]},"RateDelivery":{"type":"object","description":"Rate Delivery Request Structure","properties":{"rating":{"type":"number","minimum":0,"maximum":5,"description":"Numeric rating score for the completed delivery.","example":4.5},"delivery_code":{"type":"string","description":"Unique delivery code of the delivery being rated.","example":"UT74"},"review":{"type":"string","nullable":true,"default":"","description":"Optional text feedback about the delivery experience.","example":"Rider was professional and delivery was on time."},"user_type":{"type":"string","enum":["pickup","dropoff","contact"],"default":"dropoff","description":"Indicates which contact perspective is submitting the rating.","example":"dropoff"}},"required":["rating","delivery_code"]},"DeliveryTimeline":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryTimelineEvent"}},"DeliveryTimelineEvent":{"type":"object","properties":{"_id":{"type":"string","description":"MongoDB ObjectId"},"delivery_id":{"type":"string","description":"Related delivery ID"},"trip_id":{"type":"string","nullable":true},"agent_id":{"type":"string","nullable":true},"agency_id":{"type":"string"},"status":{"type":"string","description":"- PENDING - The initial state of a delivery after creation  \n- GROUPED - The delivery has been added to a group/trip  \n- AGENCY_ASSIGNED - The delivery has been assigned to an agency  \n- ASSIGNED - The delivery has been assigned to a rider  \n- ONHOLD - The delivery is on hold due to low funds or some other reason  \n- PICKUP - The rider is on the way to pick up the items  \n- PICKEDUP - The rider has picked up the items  \n- DROPOFF - The rider is on the way to drop off the items  \n- DROPEDOFF - The rider has dropped off the items  \n- ENDED - The delivery is completed  \n- CANCELLED - The delivery has been cancelled  \n- DELIVERY_PAID_FOR - Payment has been successfully made for the delivery (applies only on webhook updates)\n- RETURN - The delivery is being returned to the pickup location\n- RETURNED - The delivery has been returned to the pickup location\n- AUCTION - Delivery was automatically dispatched to a rider\n- DELIVERY_ACCEPTED -  Delivery was accepted my rider\n- AGENT_ARRIVED_PICKUP - Agnt has arrived at pickup location\n- AGENT_ARRIVED_DROPOFF - Agenct has arrived at drop off location\n","enum":["PENDING","CANCELLED","GROUPED","AGENCY_ASSIGNED","ASSIGNED","ONHOLD","PICKUP","PICKEDUP","DROPOFF","DROPEDOFF","ENDED","DELIVERY_PAID_FOR","RETURN","RETURNED","AUCTION","DELIVERY ACCEPTED","AGENT_ARRIVED_PICKUP","AGENT_ARRIVED_DROPOFF"]},"action":{"type":"string","description":"Human-readable action text"},"type":{"type":"string","enum":["PRIMARY","SECONDARY","TERTIARY"]},"timestamp":{"type":"integer","format":"int64","description":"Epoch timestamp in milliseconds"},"trip_details":{"type":"object","properties":{"_id":{"type":"string"},"type":{"type":"string","enum":["SHARED","PRIVATE"]},"trip_code":{"type":"string"},"name":{"type":"string"}},"required":["_id","type"]},"agency_details":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"}},"required":["_id","name"]},"agent_details":{"type":"object","properties":{"_id":{"type":"string"},"agent_first_name":{"type":"string"},"agent_last_name":{"type":"string"},"agent_mobile":{"type":"string"}},"required":["_id","agent_first_name","agent_last_name"]}},"required":["_id","delivery_id","agency_id","status","action","type","timestamp"]},"AgencyBulkCreate":{"type":"object","description":"Request body schema for agencies to bulk create deliveries","required":["sender_name","sender_number","sender_email","delivery_date","sender_location","deliveries"],"properties":{"sender_name":{"type":"string"},"sender_number":{"type":"string"},"sender_email":{"type":"string"},"delivery_date":{"type":"number"},"sender_location":{"type":"object","required":["lat","lng","location","country_code"],"properties":{"lat":{"type":"number"},"lng":{"type":"number"},"location":{"type":"string"},"country_code":{"type":"string"}}},"deliveries":{"type":"array","items":{"type":"object","required":["delivery_name","delivery_number","delivery_date","package_size","package_value","order_number","delivery_location","items"],"properties":{"delivery_name":{"type":"string"},"delivery_number":{"type":"string"},"delivery_email":{"type":"string"},"delivery_date":{"type":"number"},"delivery_fee":{"type":"string"},"discount":{"type":"string"},"payment_method":{"type":"string"},"order_number":{"type":"string"},"package_size":{"type":"string"},"package_value":{"type":"string"},"instructions":{"type":"string"},"is_paid":{"type":"boolean"},"assigned_agent_id":{"type":"string"},"mark_as_paid":{"type":"boolean"},"delivery_location":{"type":"object","required":["lat","lng","location","country_code"],"properties":{"lat":{"type":"number"},"lng":{"type":"number"},"location":{"type":"string"},"country_code":{"type":"string"}}},"items":{"type":"array","items":{"type":"object","required":["item_name","item_quantity","item_weight"],"properties":{"item_name":{"type":"string"},"item_quantity":{"type":"string"},"item_weight":{"type":"string"}}}}}}}}},"AgencyBulkCreateMulti":{"type":"object","required":["delivery_date","deliveries"],"properties":{"delivery_date":{"type":"integer","format":"int64"},"deliveries":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/Estimate"},{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["item_name","item_quantity","item_weight"],"properties":{"item_name":{"type":"string"},"item_quantity":{"type":"integer"},"item_weight":{"type":"string"}}}},"order_number":{"type":"string"},"delivery_fee":{"type":"number"},"discount":{"type":"number"},"payment_method":{"type":"string"},"package_value":{"type":"number"},"package_size":{"type":"string"},"assigned_agent_id":{"type":"string"},"mark_as_paid":{"type":"boolean"},"instructions":{"type":"string"},"delivery_date":{"type":"integer","format":"int64"}}}]}}}},"BulkDeliveryResponses":{"type":"array","description":"Bulk Delivery(s) Details","minItems":1,"items":{"allOf":[{"$ref":"#/components/schemas/Estimate"},{"type":"object","properties":{"contacts":{"$ref":"#/components/schemas/Contact"},"time":{"type":"number","deprecated":true},"distance":{"type":"number","deprecated":true},"delivery_type":{"type":"string","deprecated":true,"default":"SHARED"},"status":{"type":"string","description":"- PENDING - The initial state of a delivery after creation  \n- GROUPED - The delivery has been added to a group/trip  \n- AGENCY_ASSIGNED - The delivery has been assigned to an agency  \n- ASSIGNED - The delivery has been assigned to a rider  \n- ONHOLD - The delivery is on hold due to low funds or some other reason  \n- PICKUP - The rider is on the way to pick up the items  \n- PICKEDUP - The rider has picked up the items  \n- DROPOFF - The rider is on the way to drop off the items  \n- DROPEDOFF - The rider has dropped off the items  \n- ENDED - The delivery is completed  \n- CANCELLED - The delivery has been cancelled  \n- DELIVERY_PAID_FOR - Payment has been successfully made for the delivery (applies only on webhook updates)\n- RETURN - The delivery is being returned to the pickup location\n- RETURNED - The delivery has been returned to the pickup location\n","enum":["PENDING","CANCELLED","GROUPED","AGENCY_ASSIGNED","ASSIGNED","ONHOLD","PICKUP","PICKEDUP","DROPOFF","DROPEDOFF","ENDED","DELIVERY_PAID_FOR","RETURN","RETURNED"]},"delivery_code":{"type":"string"},"secret_code":{"type":"string","description":"Delivery Secret Code. This is shared with the customer and given to the rider to comfirm dropoff"},"instructions":{"type":"string"},"reference":{"type":"string"},"full_price":{"$ref":"#/components/schemas/Price"},"bulk_id":{"type":"string","description":"Unique id for all deliveries in a bulk delivery request","deprecated":true},"waybill_link":{"type":"string","description":"A waybill url added on the delivery object sent to your callback url"},"tracking_link":{"type":"string","description":"Delivery tracking url added to the delivery object sent to your callback url"},"time_completed":{"type":"number","description":"The time a delivery was completed in milliseconds"}},"required":["contacts","status","delivery_code","secret_code","reference","full_price","bulk_id"]}]}},"Location":{"description":"Location object for pickup or dropoff in a delivery or estimate request","type":"object","properties":{"type":{"type":"string","description":"Values:\n  * `LATLNG` - Longitude and latitude values. Submitted as lat and lng in DeliveryLocation object\n  * `GHPOST` - Ghana Post GPS value. Submitted in value key in DeliveryLocation object\n  * `WHATTW` - What3Words value, Submitted in value key in DeliveryLocation object"},"value":{"type":"string","description":"Holds the value for either GHPOST or WHATTW"},"contact":{"$ref":"#/components/schemas/Contact"},"country_code":{"type":"string","description":"Iso Alpha-2 code for the delivery location country. Visit [country code ](https://www.iban.com/country-codes) for more reference","default":"GH"},"lat":{"type":"number","description":"Latitude value for delviery location if type is LATLNG","default":null},"lng":{"type":"number","description":"Longitude value for delviery location if type is LATLNG","default":null},"location":{"type":"string","description":"Human readable location of a delivery (address)","default":null}},"required":["type","contact","country_code"]},"LatestLocation":{"description":"Latest Location of a rider or a vehicle","type":"object","properties":{"latitude":{"type":"number","format":"float"},"longitude":{"type":"number","format":"float"},"coordinates":{"type":"array","items":{"type":"number"},"example":[-0.342392,5.549658]},"time":{"type":"integer","description":"Epoch timestamp in milliseconds"},"location":{"type":"string","example":"WEIJA GBAWE MUNICIPAL, GREATER ACCRA"},"state":{"type":"string","example":"STOPPED"},"direction":{"type":"integer","example":204},"speed":{"type":"number","example":0}}},"FundWallet":{"type":"object","description":"Fund Wallet Request Structure","properties":{"amount":{"type":"number","description":"amount"},"payment_number":{"type":"string","description":"The payment_number"},"payment_type":{"type":"string","description":"The payment_type"}},"required":["amount","payment_number"]},"Contact":{"description":"Contact person for the delivery location","type":"object","properties":{"name":{"type":"string","description":"Contact Person's Name","default":null},"mobile":{"type":"string","description":"Contact Person's Mobile Number"},"email":{"type":"string","description":"Contact Person's Email","default":null}},"required":["mobile"]},"Item":{"type":"object","description":"Object Structure for item in items array","properties":{"itemName":{"type":"string","description":"Name of item being shipped"},"itemQuantity":{"type":"number","description":"Quantity of the item being shipped"},"itemCost":{"type":"number","description":"Cost of the item being shipped"},"description":{"type":"string","default":null,"description":"A short description of the item"},"itemImages":{"type":"array","items":{"type":"string","description":"valid image url"}},"itemWeight":{"type":"number","description":"Package Weight","default":null},"is_fragile":{"type":"boolean","default":false},"dimensions":{"type":"object","description":"Dimensions of the item. Default to null","default":null,"properties":{"x":{"type":"number","description":"Length of the item"},"y":{"type":"number","description":"Width of the item"},"z":{"type":"number","description":"Height of the item"}},"required":["x","y","z"]}},"required":["itemName","itemCost","itemQuantity","itemWeight"]},"Price":{"type":"object","properties":{"discount":{"type":"number","default":0},"value":{"type":"number","default":0},"currency_code":{"type":"string","default":"GHS","description":"Country Currency Code"},"currency_symbol":{"type":"string","default":"₵","description":"Country Currency Symbol"},"currency_name":{"type":"string","default":"Ghanaian cedi","description":"Country Currency Name"}},"required":["discount","value","currency_code","currency_name","currency_symbol"]},"EstimateOption":{"description":"Estimate Option Object Structure","type":"object","properties":{"estimate_id":{"type":"string","description":"Estimate Id. To be sent when making a delivery request"},"selected_estimate_link":{"type":"string","description":"Link to open estimate on the [Swoove website](https://swoove.delivery)"},"agency_details":{"allOf":[{"$ref":"#/components/schemas/AgencyDetails"},{"deprecated":true}]},"estimate_type_details":{"type":"object","properties":{"name":{"type":"string","description":"Day of Delivery","default":"Today"},"icon":{"type":"string","description":"image icon of estimate type"}},"required":["name","icon"]},"pickup_distance":{"type":"number","deprecated":true},"delivery_distance":{"type":"number","deprecated":true},"discount":{"type":"number","default":0,"description":"Discount Value Applied On Delivery"},"currency_code":{"type":"string","default":"GHS","description":"Country Currency Code"},"currency_symbol":{"type":"string","default":"₵","description":"Country Currency Symbol"},"currency_name":{"type":"string","default":"Ghanaian cedi","description":"Country Currency Name"},"full_price":{"type":"number","description":"Estimated price for this agency option."},"time_string":{"type":"string","description":"The day and time for when the delivery will be done"},"end_time":{"type":"number","description":"The UNIX day and time for when the delivery wil be done"}}},"BulkEstimateDetails":{"type":"object","description":"Bulk Estimate Object Structure","properties":{"estimate_type_details":{"type":"object","properties":{"name":{"type":"string","description":"Day of Delivery","default":"Today"},"icon":{"type":"string","description":"image icon of estimate type"}},"required":["name","icon"]},"total_pricing":{"$ref":"#/components/schemas/Price"},"time_string":{"type":"string","description":"Time Description For Estimate","default":"Pickup and Delivery Tomorrow (8:00am - 04:00pm)"},"estimate_id":{"type":"string","description":"Estimate Id. To be sent when making a delivery request"},"selected_estimate_link":{"type":"string","description":"Link to open estimate on the [Swoove website](https://swoove.delivery)"},"individual_pricing":{"type":"array","description":"Array of Delivery Estimates In Bulk Requested","minItems":1,"items":{"allOf":[{"$ref":"#/components/schemas/Estimate"},{"type":"object","description":"Single Individual Delivery","properties":{"price_details":{"$ref":"#/components/schemas/Price"},"delivery_type":{"type":"string","deprecated":true,"enum":["SHARED","EXPRESS"]},"_id":{"type":"string","description":"This is the individual delivery pricing id, use this during delivery creation to only create one delivery in a bulk request at a time"}},"required":["price_details","delivery_type"]}]}}},"required":["estimate_type_details","total_pricing","time_string","estimate_id","selected_estimate_link","individual_pricing"]},"AgencyDetails":{"type":"object","properties":{"name":{"type":"string","default":"Agency Name","description":"Agency Name"},"mobile_number":{"type":"string","default":23350484565,"description":"Agency Mobile Number"},"logo":{"type":"string","description":"Agency Logo Url"},"rating":{"type":"number","description":"Agency Rating"},"location":{"type":"object","properties":{"country_code":{"type":"string","default":"GH"},"latitude":{"type":"number","default":0},"longitude":{"type":"number","default":0},"city":{"type":"string"},"country":{"type":"string"}}}},"required":["name","mobile","logo","rating"]},"Agent":{"type":"object","properties":{"agent_first_name":{"type":"string"},"agent_last_name":{"type":"string"},"agent_mobile":{"type":"string"},"agent_picture":{"type":"string","description":"Image url"},"license_type":{"type":"string"},"license_number":{"type":"string"},"license_expiry":{"type":"number","description":"timestamp date of expiry date of license."}}},"Vehicle":{"type":"object","properties":{"_id":{"type":"string","example":"67c849c22096cfb0aae13cdf"},"assigned_agent_id":{"type":"string","nullable":true},"brand":{"type":"string","example":"FORD"},"model":{"type":"string","example":"FOCUS gps"},"color":{"type":"string","example":"#edb6b6"},"picture":{"type":"string","format":"uri"},"vehicle_type":{"type":"string","example":"CAR"},"license_plate_number":{"type":"string","example":"GT-1234-2025"},"latest_location":{"$ref":"#/components/schemas/LatestLocation"}}},"ServiceZone":{"type":"object","description":"Service zone object","properties":{"_id":{"type":"string","description":"Servive Zone Id"},"properties":{"$ref":"#/components/schemas/ServiceZoneProperty"},"geometry":{"$ref":"#/components/schemas/ServiceZoneGeometry"}}},"Invoice":{"type":"object","properties":{"_id":{"type":"string"},"source":{"type":"string","enum":["DELIVERY"]},"status":{"type":"string","enum":["PAID","UNPAID"]},"is_requested":{"type":"boolean"},"discount":{"nullable":true},"currency_code":{"type":"string","example":"GHS"},"currency_symbol":{"type":"string","example":"₵"},"currency_name":{"type":"string","example":"Ghanaian Cedis"},"payer_id":{"type":"string","nullable":true},"receiver_id":{"type":"string","nullable":true},"agency_id":{"type":"string"},"trip_id":{"type":"string","nullable":true},"description":{"type":"string"},"redirect_url":{"type":"string","nullable":true},"estimate_id":{"type":"string"},"individual_delivery_id":{"type":"string"},"payment_type":{"type":"string","enum":["CASH"]},"option_id":{"type":"string","nullable":true},"subscription_id":{"type":"string","nullable":true},"category":{"type":"string","example":"DELIVERY FEES"},"payment_link":{"type":"string","nullable":true},"customer_name":{"type":"string"},"customer_email":{"type":"string"},"customer_mobile":{"type":"string"},"referrence_id":{"type":"string","nullable":true},"channel":{"type":"string"},"is_deleted":{"type":"boolean"},"date_created":{"type":"number","format":"int64"},"date_changed":{"type":"number","format":"int64"},"price":{"type":"number"},"balance":{"type":"number"},"delivery":{"$ref":"#/components/schemas/Delivery"}}},"ServiceZoneProperty":{"type":"object","description":"Properties for a service zone","properties":{"country_code":{"type":"string","description":"The ISO country code for the service zone","default":"GH"},"country":{"type":"string","description":"The country name for the service zone","default":"GHANA"},"city_code":{"type":"string","description":"The city code for the service zone","default":"OUT-ACCRA"},"city_name":{"type":"string","description":"The city name for the service zone","default":"OUTSIDE ACCRA"},"layer":{"type":"number","description":"The layer number for the service zone","default":2},"stroke":{"type":"string","description":"The hex color of the border for the boundary of the service zone","default":"#ff0000"},"stroke-width":{"type":"number","description":"the width of  the border for the boundary of the service zone","default":2},"stroke-opacity":{"type":"number","description":"the opacity level for the border of the boundary of the service zone","default":1,"minimum":0,"maximum":1},"fill":{"type":"string","description":"The hex color of the area within the boundary of the service zone","default":"#f00a0a"},"fill-opacity":{"type":"number","description":"the opacity level for the border of the boundary of the service zone","default":1,"minimum":0,"maximum":1}},"required":["country_code","country","city_code","city_name","layer","stroke","stroke-width","stroke-opacity","fill","fill-opacity"]},"ServiceZoneGeometry":{"type":"object","description":"Geo Boundary area for a service zone","properties":{"coordinates":{"type":"array","items":{"type":"array","description":"An array of coordinates [Longitude,Latitude]","items":{"type":"number"},"minItems":2,"maxItems":2},"minItems":2,"default":[[0,0],[0,0]]},"type":{"type":"string","default":"Polygon","description":"The type of figure for the coordinates returned"}},"required":["coordinates","type"]},"CallbackDeliveryPayload":{"type":"object","description":"Payload sent to user's callback URL when delivery status changes","properties":{"success":{"type":"boolean","example":true},"code":{"type":"integer","example":200},"message":{"type":"string","example":"Delivery Update Callback"},"responses":{"type":"array","minItems":1,"items":{"type":"object","properties":{"pickup":{"$ref":"#/components/schemas/Location"},"dropoff":{"$ref":"#/components/schemas/Location"},"return_contact":{"type":"object","properties":{"coordinates":{"type":"array","items":{"type":"number"}}}},"full_price":{"$ref":"#/components/schemas/Price"},"contact":{"$ref":"#/components/schemas/Contact"},"return_delivery":{"type":"boolean"},"return_reason":{"type":"string","nullable":true},"distance":{"type":"number"},"individual_pricing_id":{"type":"string"},"status":{"type":"string","enum":["PENDING","CANCELLED","GROUPED","AGENCY_ASSIGNED","ASSIGNED","ONHOLD","PICKUP","PICKEDUP","DROPOFF","DROPEDOFF","ENDED","DELIVERY_PAID_FOR","RETURN","RETURNED"]},"instructions":{"type":"string"},"reference":{"type":"string"},"start_time":{"type":"number"},"end_time":{"type":"number"},"time_completed":{"type":"number","nullable":true},"items":{"type":"array","items":{"$ref":"#/components/schemas/Item"}},"tracking_code":{"type":"string"},"delivery_code":{"type":"string"},"secret_code":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"tracking_link":{"type":"string"},"proof_of_delivery":{"type":"object","description":"Included only when status is `ENDED`","properties":{"location":{"type":"object","properties":{"latitude":{"type":"number"},"longitude":{"type":"number"},"address":{"type":"string"}}},"_id":{"type":"string"},"delivery_id":{"type":"string"},"image_url":{"type":"string","format":"uri"},"mobile":{"type":"string"},"name":{"type":"string"}}},"agent_details":{"allOf":[{"$ref":"#/components/schemas/Agent"},{"description":"Present when status is AGENCY_ASSIGNED, ASSIGNED, PICKUP, PICKEDUP, DROPOFF, or DROPEDOFF"}]},"agency_details":{"allOf":[{"$ref":"#/components/schemas/AgencyDetails"},{"description":"Present when status is AGENCY_ASSIGNED, ASSIGNED, PICKUP, PICKEDUP, DROPOFF, or DROPEDOFF"}]},"vehicle_details":{"allOf":[{"$ref":"#/components/schemas/Vehicle"},{"description":"Present when status is AGENCY_ASSIGNED, ASSIGNED, PICKUP, PICKEDUP, DROPOFF, or DROPEDOFF"}]}}}}},"required":["success","code","message","responses"]},"Capabilities":{"type":"object","properties":{"itemSizes":{"type":"array","items":{"$ref":"#/components/schemas/ItemSize"}},"itemWeights":{"type":"array","items":{"$ref":"#/components/schemas/ItemWeight"}},"vehicleTypes":{"type":"array","items":{"$ref":"#/components/schemas/VehicleType"}}}},"ItemSize":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"code":{"type":"string"},"description":{"type":"string"},"unit":{"type":"string"},"dimensions":{"type":"object","properties":{"length":{"type":"number"},"width":{"type":"number"},"height":{"type":"number"}}},"logo":{"type":"string","format":"uri"},"is_enabled":{"type":"boolean"},"agency_id":{"type":"string"},"country_id":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"ItemWeight":{"type":"object","properties":{"_id":{"type":"string"},"label":{"type":"string"},"min_weight":{"type":"number"},"max_weight":{"type":"number"},"description":{"type":"string"},"unit":{"type":"string"},"is_enabled":{"type":"boolean"},"is_active":{"type":"boolean"},"agency_id":{"type":"string"},"country_id":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"VehicleType":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["MOTORCYCLE","BICYCLE","VAN","CAR","PICKUP","SHORT_TRUCK","SUV","LONG_TRUCK"]},"is_enabled":{"type":"boolean"},"agency_id":{"type":"string"},"country_id":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"AgentPaginatedResponse":{"allOf":[{"$ref":"#/components/schemas/PaginatedResponse"},{"type":"object","properties":{"docs":{"type":"array","items":{"$ref":"#/components/schemas/Agent"}}}}]},"DeliveryPaginatedResponse":{"allOf":[{"$ref":"#/components/schemas/PaginatedResponse"},{"type":"object","properties":{"docs":{"type":"array","items":{"$ref":"#/components/schemas/Delivery"}}}}]},"InvoicePaginatedResponse":{"allOf":[{"$ref":"#/components/schemas/PaginatedResponse"},{"type":"object","properties":{"docs":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}}}}]},"VehicleTrackingPaginatedResponse":{"allOf":[{"$ref":"#/components/schemas/PaginatedResponse"},{"type":"object","properties":{"docs":{"type":"array","items":{"$ref":"#/components/schemas/Vehicle"}}}}]},"PaginatedResponse":{"type":"object","properties":{"total":{"type":"number"},"limit":{"type":"number"},"page":{"type":"number"},"pages":{"type":"number"}}},"ApiResponse":{"type":"object","properties":{"success":{"type":"boolean","default":true,"description":"status of request true for success and false for failed request"},"code":{"type":"integer","format":"int32","default":200,"description":"code for reason for failure"},"message":{"type":"string","default":"Estimate completed"}}},"ApiError400":{"type":"object","properties":{"success":{"type":"boolean","default":false,"description":"status of request true for success and false for failed request"},"code":{"type":"integer","format":"int32","default":400,"description":"Data validation error code"},"message":{"type":"string","default":"A certain field was expected but was null or invalid"},"responses":{"type":"string","nullable":true,"default":null}}},"ApiError401":{"type":"object","properties":{"success":{"type":"boolean","default":false,"description":"status of request true for success and false for failed request"},"code":{"type":"integer","format":"int32","default":401,"description":"Authentication Error Code"},"message":{"type":"string","default":"A certain field was expected but was null or invalid"},"responses":{"type":"string","nullable":true,"default":null}}}},"requestBodies":{"Estimates":{"required":true,"description":"Delivery Estimate Body Sample And Schema","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Estimate"}}}},"BulkEstimates":{"required":true,"description":"Bulk Delivery Estimate Body Sample And Schema","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkEstimate"}}}},"Deliveries":{"required":true,"description":"Delivery Request Body Sample And Schema","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Delivery"}}}},"BulkDeliveries":{"required":true,"description":"Bulk Delivery Request Body Sample and Schema","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDelivery"}}}},"RateDelivery":{"required":true,"description":"Rate Delivery Body Sample And Schema","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateDelivery"}}}},"AgencyBulkDeliveries":{"required":true,"description":"Bulk Internal Delivery Request Body Sample and Schema","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgencyBulkCreate"}}}},"AgencyBulkCreateMulti":{"required":true,"description":"Bulk delivery request for agency with pickup and dropoff","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgencyBulkCreateMulti"}}}},"Wallets":{"required":true,"description":"Fund Wallet Body Sample And Schema","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundWallet"}}}}},"examples":{"estimates-latlnt":{"summary":"An estimate request with latitude and longitude as location type","value":{"pickup":{"ref":null,"type":"LATLNG","value":"LATLNG","contact":{"name":"Person Name","mobile":"12254848","email":null},"country_code":"GH","lng":-0.1488948,"lat":5.650558,"location":"Accra Mall,Accra"},"dropoff":{"ref":null,"type":"LATLNG","value":"LATLNG","contact":{"name":"Person Name","mobile":"12254848","email":null},"country_code":"GH","lng":-0.1488948,"lat":5.650558,"location":"Accra Mall,Accra"},"items":[{"itemName":"item,","itemCost":"1,","itemQuantity":"1,","description":"random item","itemWeight":1,"is_fragile":false,"dimensions":{"x":1,"y":1,"z":1}}]}}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"query","name":"app_key"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}}}