Skip to main content

Data Model

JSON example:

{
# Status, Service, Request
"_id" : "QMB0HO",
"status" : "CANCELLED",
"service_id" : "SGN-TRICYCLE", # Service ID
"city_id" : "SGN", # City ID

# List of special requests
"requests" : [
{
"_id":"SGN-TRUCK-500-CART",
"num":2,
"price": 100000 # Final request price = 50000 x 2
},
{
"_id":"SGN-TRUCK-500-BOCXEP",
"price": 50000,
},
{
"_id":"SGN-TRUCK-500-COD",
"price": 0,
"value": 300000
},
{
"_id":"SGN-COFFEEHOUSE-COMBO-1",
"num": 2,
"price": 0, # Request fee
"item_price": 980000 # Final item price = 49000 x 2
}
],

# User ID & Supplier ID
"user_id" : "84972709963", # User who created this order
"user_name" : "Thao Vy", # User name
"supplier_id" : "84909561477", # Supplier who accepted this order
"supplier_name" : "Hieu Nguyen", # Supplier name

# Partner
"partner": "foodbook", # If this order is created by 3rd-party partners

# Time
"order_time" : 1426297774, # Pick-up time
"create_time" : 1426297174.649361, # Order create time
"accept_time" : 1426298634.189912, # Order accept time
"accept_lat": 10.7890462,
"accept_lng": 106.7763078,
"accept_distance": 1.2, # Distance from accepted location to pick up point
"accept_duration": 150, # Time from accepted location to pick up point

"cancel_time" : 1426671164.374609, # Order cancel time
"cancel_comment" : "Lich chuyen nha bi hoan", # Cancelled reason by user or supplier
"cancel_by_user" : False, # True if this order is cancelled by user, otherwise False
# Others: complete_time, complete_lat, complete_lng, accept_lat, accept_lng, fail_time, fail_lat, fail_lng, fail_comment

# Payment
"currency" : "VND",
"stop_fee" : 0,
"request_fee" : 0,
"distance" : 5.597,
"distance_fee" : 142358,
"promo_code" : "AHAMOVE",
"discount" : 0,
"total_fee" : 142358, # Total fee = Distance Fee + Request Fee + Stop Fee - Discount
"payment_method": "BALANCE" # User pay by Ahamove balance (Available methods: CASH | BALANCE)

# Use credit from user account if available
"user_bonus_account" : 0,
"user_main_account" : 0,
"total_pay" : 142358, # Total pay = Total fee - User Main account - User Bonus account

# Supplier commission = Service commission = Supplier Main account + Supplier Bonus account
"supplier_main_account" : 0,
"supplier_bonus_account" : 14235.8,

# These fields applied for food orders
"partner_fee" : 20000, # Partner total fee = Partner Distance Fee + Request Fee + Stop Fee - Discount
"partner_distance_fee" : 10000,
"partner_subsidy": 20000, # partner_subsidy = total_fee - partner_fee
"partner_discount": 10000, # discount = partner_discount + partner_subsidy
"partner_pay": 90000, # Total partner pay in cash, partner_pay = total_pay + item_fee - item_discount + item_vat_fee
"online_pay": 0, # Total pay via online channels

# Rating
"rating_by_user": 4,
"comment_by_user": "Good",
"rating_by_supplier": 5,
"comment_by_supplier": "Great customer",
"rating_by_receiver": 4,
"comment_by_receiver": "Good driver",
"store_rating_by_user": 4, # For food orders
"store_comment_by_user": "Delicious food", # For food orders

# Path, at least 2 locations, 1 From and >= 1 To
"path" : [
{
"lat" : 10.7890462,
"lng" : 106.7763078,
"address" : "Số 47, Bình Trưng Đông, Quận 2, Hồ Chí Minh, Vietnam",
},
{
"lat" : 10.76403580333166,
"lng" : 106.7558794096112,
"address" : "Vũ Phương Đề, Thạnh Mỹ Lợi, Quận 2, Hồ Chí Minh, Vietnam",

"mobile": "0908842285",
"name": "Ngon",
"cod": 500000,
"remarks": "Call me when arrive",
"require_pod": True, # If true, supplier will be required proof of delivery before complete the transaction
"require_verification": True, # If true, a verification code will be sent to the receiver, then the supplier will need to enter this code to complete the transaction

"rating_by_receiver": 4,
"comment_by_receiver": "Good",

"complete_time": 1426671164,
"complete_lat": 10.7890462,
"complete_lng": 106.7763078,
"complete_comment": "Nice receiver",
"image_url": "https://i.imgur.com/lchC2xz.jpg", # Image to show that the supplier has already completed the order, uploaded by the supplier
"pod_info" : "024792155", # Proof of delivery information that supplier has collected, can be recipient's ID number or image URL
"status": "COMPLETED"
},
{
"lat" : 10.7640412,
"lng" : 106.755910,
"address" : "Nha tho Duc Ba",

"mobile": "0908842285",
"name": "Ngon",
"cod": 500000,
"remarks": "Call me when arrive",

"fail_time": 1426671164,
"fail_comment": "User does not show",
"fail_lat": 10.7890462,
"fail_lng": 106.7763078,
"status": "FAILED",

# Note from supplier, to reschedule time and address for failed delivery
"redelivery_note":
{
"from_time" : NumberInt(1532109600), # Redeliver after this time
"to_time" : NumberInt(1532111400), # Redeliver before this time
"address" : "21 Nguyễn Trung Ngạn, Bến Nghé, Quận 1, Hồ Chí Minh, Vietnam", # Redelivery address
"lat" : 10.782938,
"lng" : 106.704899
}
}
],

# Others
"remarks": "Den noi goi dien cho toi", # Note to supplier
"remind": True, # If this is advance booking and the system already reminds users
"assigned_by": "84908842285", # If this order is assigned by a user or "auto" if by the system
"index": 1, # 0 if first order request from the user, 1 for second...

# For internal Geo index only
"from_location" : {
"type" : "Point",
"coordinates" : [
106.7763078,
10.7890462
]
}
}
ParameterTypeDescription
idStringOrder ID.
statusStringOrder status more detail.
service_idStringService ID.
city_idStringCity ID.
user_idStringUser ID who created this order.
user_nameStringUser name who created this order.
partnerStringPartner ID.
supplier_idStringSupplier who accepted this order.
supplier_nameStringSupplier name.
pathObjectPickup and drop-offs information
create_timeNumberTime when order was created, in epoch timestamp format.
order_timeNumberTime user want supplier to pick up his package, in epoch timestamp format.
accept_timeNumberTime when a supplier accept an order, in epoch timestamp format
board_timeNumberTime when a supplier come to user place, in epoch timestamp format.
pickup_timeNumberTime when a supplier pick up user package successfully, in epoch timestamp format.
cancel_timeNumberTime when an order was cancelled, in epoch timestamp format.
complete_timeNumberTime when an order was completed, in epoch timestamp format.
currencyStringCurrency (ISO 4217 currency code)
promo_codeStringPromotion code to be applied
payment_methodStringMethod which user chooses to pay for this order (Available methods: CASH, CASH_BY_RECIPIENT, BALANCE)
user_bonus_accountNumberThe amount of credit which is deducted fron user bonus account if bonus account have enough credit
user_main_accountNumberThe amount of credit which is deducted fron user main account if main account have enough credit
total_payNumberThe amount of CASH that user has to pay for this order (Total pay = Total fee - User Main account - User Bonus account)
distance_priceNumberService fee calculated based on distance
special_request_priceNumberExtra fee for adding special request to the order
stoppoint_priceNumberStop fee for multiple drop-offs
voucher_discountNumberDiscount
subtotal_priceNumberSum of distance price, special_request_price,stoppoint_price
total_priceNumberFinal price, total_price = distance_price + stoppoint_price + special_request_price + cod_commission_price - voucher_discount

Path

Representing From path[0] and multiple Tos path[x], x > 0

ParameterTypeDescription
addressStringAddress of the location.
latNumberLatitude of the location.
lngNumberLongitude of the location.
nameStringRecipient's name. Optional if is path[0].
mobileStringRecipient's mobile number. Optional if is path[0].
tracking_numberStringTracking number for the package (Partner's order id).
remarksStringNote to supplier, for multiple delivery points.
codNumberCOD amount (Cash on delivery), for multiple delivery points.
statusStringDelivery Status (detail)
buildingStringBuilding name for delivery to door
apt_numberStringApartment, Suite or Floor number for delivery to door