Integrating Edit API for Loadshare (hyperlocal version)
- 1 Problem Statement
- 2 Bullet Point Summary Scope
- 3 Requirements
- 3.1 Use Case 1 : <COD Amount Update Post-Booking>
- 3.2 Use Case 2 : <Consignment Data Update Post-Booking>
- 3.3 Use Case 3 : <Generic Edit API for hyperlocal>
- 3.4 Current request body for order edit API (Loadshare)
- 3.5 Order Update API request body to be integrated in the hyperlocal version.
- 3.6 Acceptance and Rejection Criteria [Extremely Critical]
- 3.7 Test Case 1: <COD Amount Update after Booking>
- 3.8 Test Case 2: <Other Consignment Details Update after Booking>
- 3.9 Test Case 3: <Consistency Between Versions>
- 4 Design Links/Images
- 5 Success metrics
- 6 Settings/Configurations in the Product
- 7 API Playground
- 8 Assumptions
- 9 Permission Management
- 10 Analytics & Reports
- 11 Automated Alerts & Monitoring
- 12 Scalability and Release Planning
- 13 Impacted Modules of the Product
- 14 Risks Involved
- 15 Future Scopes
Jira Link | |
---|---|
Document owner | @KhushiVerma |
Problem Statement
For Spencers, during the picking and packing process, items can be missing, and thus the final COD amount is updated through softdata calls. However, Loadshare bookings are made before these softdata updates are applied, which leads to discrepancies in COD reconciliation. The Edit API, which is already integrated into the default Loadshare version, allows updates after the initial booking and needs to be implemented in the hyperlocal version as well to resolve this issue.
Currently, the integrated edit API that we have is customised according to meesho’s requirements and hence is not generic. We need a generic edit API for hyperlocal version in Loadshare.
Bullet Point Summary Scope
Integrate the order update API for the hyperlocal version in Loadshare.
Requirements
Use Case 1 : <COD Amount Update Post-Booking>
When items are missing during picking/packing, the COD amount needs to be updated. If the booking was done before these updates, the Edit API should be used to modify the COD amount for the booking.
Ensure the Edit API can handle updates to the COD field even after the booking has been made in the hyperlocal version.
Use Case 2 : <Consignment Data Update Post-Booking>
Other consignment details (such as weight, dimensions) may also change post-booking. The Edit API should allow updates to these details as required.
Extend the Edit API to handle any relevant consignment data changes.
Use Case 3 : <Generic Edit API for hyperlocal>
Integrate the order update API for hyperlocal version in Loadshare.
Sanity check : To make sure to not affect meesho’s already integrated edit API.
URL : https://api.loadshare.net/hyperlocal/v2/order/edit
<Edit API uses PUT method>
HEADERS | |
Checksum | SHA256(`${token}|${customer-code}|${orderId}`) |
Customer-Code | {customer-code} |
Content-Type | ‘application/json' |
Current request body for order edit API (Loadshare)
{
"serviceabilityRequestId": "60994d19-41e4-4d5d-b0c3-07d5f9e2a618",
"orderId": "YELLOWSUB1281",
"displayCode": "PMA:D",
"shipmentDetails": {
"deliveryMode": "EXPRESS",
"isHubOrder": true,
"shipmentValue": {
"value": 150,
"unit": "INR"
},
"shipmentType": "FOOD",
"metadata": {
"promiseSlaInEpoch": {
"assignment": 0,
"total": 0
}
},
"tasks": [
{
"type": "PICK_UP",
"address": {
"outletName": "abc",
"city": "Bangalore",
"contact": 9899980845,
"location": {
"latitude": 28.9609526,
"longitude": 77.7372383
},
"landmark": "ESI",
"address": "12th Main, HAL 2nd Stage, ESI To Domlur, Service Road, Indiranagar, Bangalore - 560075",
"directionsToReach": "Test Pickup direction for loadshare. Next to AVS school. "
},
"pay": {
"value": 100,
"unit": "INR"
},
"collect": {
"value": 100,
"unit": "INR"
},
"items": [
{
"id": "Qwerty123",
"name": "milkshake",
"quantity": 0,
"price": {
"value": 0,
"unit": "INR"
}
}
],
"isContactless": false,
"instructions": [
"pickupInstruction",
"Near the church"
],
"metadata": {
"predictedShipmentReadyTimeInEpoch": 1699421748000,
"shipmentReadyTimeInEpoch": 1699420957000,
"passcode": 1231,
"rto_passcode": 3241
}
},
{
"type": "DROP",
"address": {
"city": "Bangalore",
"outletName": "abc",
"contact": 9711496894,
"location": {
"latitude": 28.9609526,
"longitude": 77.7372383
},
"landmark": "ESI",
"address": "12th Main, HAL 2nd Stage, ESI To Domlur, Service Road, Indiranagar, Bangalore - 560075",
"directionsToReach": "Test Drop direction for loadshare. Next to AVS school"
},
"pay": {
"value": 0,
"unit": "INR"
},
"collect": {
"value": 0,
"unit": "INR"
},
"items": [
{
"id": "string",
"name": "string",
"quantity": 0,
"price": {
"value": 0,
"unit": "INR"
}
}
],
"isContactless": true,
"dropLocationTxt": "area in which shipment is to be delivered",
"instructions": [
"dropInstruction",
[
"Leave at the Door",
"Don't ring bell"
]
],
"metadata": {
"predictedDistanceInMetre": 4000,
"noOfShipments": 6,
"predictedShipmentReadyTimeInEpoch": "1616069490000",
"shipmentReadyTimeInEpoch": 0,
"passcode": 1231,
"noOfDeliveredShipments": 5,
"noOfUndeliveredShipments": 1
}
}
]
}
}
Order Update API request body to be integrated in the hyperlocal version.
{
"order_number": "OD2367",
"order_date": "2022-03-31",
"store_id": "STR7443",
"instruction": "TOTAL BAGS: 1. \n Please collect 1 insulated bag.",
"tip": 50,
"eligible_payout": 50,
"order_source": "zomato",
"order_type_code": "TEST",
"tag": "time",
"delivery_time_slot_start": "2022-09-19 10:00:00",
"delivery_time_slot_end": "2022-09-19 12:00:00",
"order_type": "Order Type",
"pickup_service_time": 300,
"delivery_service_time": 300,
"skip_pickup_validation": true,
"invoice_number": "#ABC1",
"invoice_url": "abc",
"time_restricted_constraint_tags": [
{
"tag_id": "string",
"expiry": "string"
}
],
"hu_details": [
{
"label": "1",
"hu_number": "1"
}
],
"final_amount": 200,
"payment": {
"mode": "gpay",
"value": 198
},
"storage_location": "abcd",
"pieces_detail": [
{
"menu_code": "Menu Code",
"menu_description": "Box",
"quantity": 3,
"order_line_total": 145.95,
"size": 5,
"unit_price": 20,
"shipping_fees": 10,
"discount": 20
}
],
"origin_details": {
"latitude": 23.215762,
"longitude": 77.402045,
"name": "Prasann",
"street_number": "549/11",
"street_name": "Bada barha",
"city_name": "string",
"address_line_2": "string",
"address_line_3": "string",
"address_line_4": "string",
"postal_code": "122003"
},
"destination_details": {
"latitude": 23.215762,
"longitude": 77.402045,
"customer_name": "Prasann",
"street_number": "549/11",
"street_name": "Bada barha",
"city_name": "string",
"address_line_2": "string",
"address_line_3": "string",
"address_line_4": "string",
"phone_number": "9999999999",
"postal_code": "122003"
}
}
Acceptance and Rejection Criteria [Extremely Critical]
Test Case 1: <COD Amount Update after Booking>
Description: Ensure that the COD amount is updated correctly after the booking is made using the Edit API in the hyperlocal version.
Expected Outcome: The updated COD amount reflects accurately in all reconciliation processes.
Test Case 2: <Other Consignment Details Update after Booking>
Description: Validate that changes to consignment details, such as weight or dimensions (including piece details), are successfully updated post-booking.
Expected Outcome: All consignment updates are reflected in the booking without causing errors or discrepancies.
Test Case 3: <Consistency Between Versions>
Description: Compare the behavior of the Edit API in both the default and hyperlocal versions to ensure identical functionality.
Expected Outcome: No discrepancies in functionality across the versions.
Design Links/Images
Figma link to be attached here
Success metrics
Project goals and success metrics - The first set of KPIs you will be targetting
Goal | Metric |
---|---|
e.g. Label creation made easier | e.g. 0 engineering involvement to configure labels |
|
|
Settings/Configurations in the Product
How do we enable this feature from setup etc. Where will all the configurations will be in the ops dashboard or customer dashboard. No new configurations will be added in the internal dashboard.
API Playground
Changes required in the API Playground. Addition of a new API/ updates or custom for clients
Assumptions
Any assumptions we made during the scoping of this
Permission Management
New Permissions or any Existing Permission which will enable this for customers
Analytics & Reports
Changes to any analytics or reporting dashboards. E.g addition of a new column will need to be shown in reports as well
Automated Alerts & Monitoring
List of automated alerts that should be triggered during this development
Alert Type | When to Trigger |
---|---|
e.g. Booking Failure | e.g. 5 failures in the last 60 min beacause of serviceability |
|
|
Scalability and Release Planning
Load the system should handle. Things to keep in mind for releases like migration etc
Impacted Modules of the Product
Modules of the product this will impact. Say Customer Allocation Rules, Allocation Logs etc
Risks Involved
Other use cases that should be checked before making this live
Future Scopes
Things which are not a part of the current scope but can be a part of the future scope
Version | Date | Comment |
---|---|---|
Current Version (v. 3) | Oct 02, 2024 11:21 | Khushi Verma |
v. 2 | Oct 02, 2024 11:10 | Khushi Verma |
v. 1 | Oct 02, 2024 08:40 | Khushi Verma |