Skip to main content

Multi-point delivery order creation feature on RO SDK

Sample Index

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Ahamove RO SDK</title>
<script>
function init() {
const path = [
{
address: "84 Đường An Dương Vương, Phường 09, Quận 05, Hồ Chí Minh, Việt Nam",
name: "CHỊ LOAN",
mobile: "0909634751",
remarks: "LÔ H "
},
{
address: "351 Đường Phan Xích Long, Phường 01, Quận Phú Nhuận",
name: "CHỊ TÂM ĐAN ",
mobile: "0987235325",
cod: 420000,
tracking_number: "SO_0001",
},
{
address: "83 Đường Số 5, Phường 17, Gò Vấp",
name: "FB PHUC HOANG",
mobile: "0907935292",
cod: 245000,
tracking_number: "SO_0002",
},
{
address: "26 Út Tịch, Phường 04, Quận Tân Bình",
name: "CHỊ XUÂN",
mobile: "0908158017",
tracking_number: "SO_0003",
},
{
address: "290 Nguyễn Thị Nhỏ, Phường 06, Quận 11",
name: "CHỊ TÂM ĐAN ",
mobile: "0987235325",
cod: 420000,
tracking_number: "SO_0004",
},
{
address: "16 Tân Khai, Phường 4, Tân Bình, Ho Chi Minh City",
short_address: "16 Tân Khai",
name: "FB QUANG",
mobile: "0907935292",
cod: 245000,
tracking_number: "SO_0005",
}
];
const token = "<TOKEN>"; //user token
const src = "https://rostg.ahamove.com"; //domain staging

const container_id = "kiotvietId"; //custom container
let ahamove = WebRoSdk;
ahamove.initIframe({
container_id,
close_button: true, //toggle close button, default is false
token,
src,
path,
service_ids: ["BIKE", "TRUCK"],
request_ids: ["TIP", "COD", "BULKY"],
promo_code: "AHAKM",
payment_method: [
{
payment: "cash",
},
{
payment: "cash_by_recipient",
},
{
payment: "balance",
},
],
default_payment_method: {
service_id: "SGN-BIKE",
service_method: "BALANCE",
public_method: "BALANCE",
},
});

ahamove.addEventListener("SUBMIT_ORDER_LIST", ({ data }) => {
console.log("on SUBMIT_ORDER_LIST", data);
setTimeout(() => {
// ahamove.destroy()
// Passing container_id value if use container_id
ahamove.destroy(container_id);
}, 3000);
});
}
</script>
</head>

<body style="background-color: grey">
<button onclick="init()">Init RO SDK</button>
<div class="kiotviet-screen" style="max-width: 80%; margin: auto">
<div id="kiotvietId"></div>
</div>

<script src="https://vncdn.ahamove.com/public/web-ro-sdk/index.0.1.2.js"></script>
</body>
</html>

Request Payload

Request payload
export interface SDKProps {
token: string;
path: Array<IPoint>;
service_ids: Array<string>;
request_ids: Array<string>;
promo_code: string;
payment_method: Array<PaymentMethod>;
default_payment_method: DefaultPaymentMethod;
close_button?: boolean;
src?: string;
container_id?: string;
}

export interface IPoint {
address: string;
name: string;
mobile: string;
remarks?: string;
cod?: number;
tracking_number?: string;
}

export interface PaymentMethod {
payment: string;
}

export interface DefaultPaymentMethod {
service_id: string | null;
service_method: string | null;
public_method: string | null;
}

function addEventListener, initIframe

SDKProps

ParameterTypeRequiredDescription
tokenstringYesUser's token
pathArrayYesList of pickup point information (path[0]) and delivery points (path[x], x>0)
service_idsArrayYesList of services displayed on RO
request_idsArrayYesList of types of special requests displayed per service_id
promo_codestringYesAvailable promo code
payment_methodArrayYesList of payment methods
default_payment_methodArrayYesList of default payment methods, configurable per service_id
close_buttonbooleanYesToggle close button
srcstringYesRO data source
- Staging Domain: https://rostg.ahamove.com
- Production Domain: https://ro.ahamove.com
container_idstringYesCustomer ID on the integrated platform

IPoint

ParameterTypeRequiredDescription
addressstringYesPickup and drop-off address
namestringYesSender or receiver name
mobilestringYesSender or receiver phone number
remarksstringNoRemarks for delivery points
codnumberNoCash on delivery amount, applicable for drop-off points
tracking_numberstringNoPackage tracking number (internal order number of the Partner, not required but Ahamove recommends having this in path[x])

PaymentMethod

ParameterTypeRequiredDescription
paymentstringYesDelivery fee payment methods

DefaultPaymentMethod

ParameterTypeRequiredDescription
service_idstringYesService to be configured with default payment method
service_methodstringYesCorresponding service payment method
public_methodstringYesPublic payment method

Important Information

  • Pickup point information is the information of the first path (path[0])
  • Delivery point information is the information from the second path onwards (path[x], x>0)
  • The user's token when optimizing and creating orders on the RO SDK is get from the Account Registration API
  • List of service_id can be obtained from the Get List of Services API and filter the service ID that support multi-stop order creation ( max_stop_points > 1 )
  • List of request_id types can be obtained from List of Special Requests
  • Promo code promo_code allows customers to input codes provided by Ahamove when using RO SDK on the Partner's system
  • The result returned by Ahamove when the Partner confirms the order creation in RO SDK is a list of information fields and data of each order to connect these data to Ahamove's order creation API

Main Features

Route Optimization

  • Allows customers to upload delivery points via an Excel file or manual input

    rosdk_upload_file
  • Allows customers to filter and search for delivery point information

    rosdk_ro_grid
  • Uses Optimization Algorithms to optimize routes based on distance, volume, etc., to minimize costs and shorten delivery distances.

    rosdk_vrp
  • Allows customers to select the number of delivery points and the maximum distance for a multi-stop delivery order when optimized

Multi-Stop Delivery Order Creation

  • Customers can visually see the optimized routes on the map

    rosdk_routing rosdk_map
  • Customers can edit the information of delivery points before confirming the order

    rosdk_edit_info
  • Customers can change the service type, special requests, and payment methods of the order

    rosdk_requests
  • Customers can create scheduled orders

    rosdk_schedule

Partners can refer to the use of RO SDK in the Order Optimization feature to guide customers when using multi-point delivery on the Partner's system.