Hello Jeff!
to create an order, you can use this API:
https://sdk.wialon.com/wiki/en/sidebar/ … der/update
Create an order with callMode:“create”
Example:
svc=order/update¶ms={"uid":0,"id":0,"n":"2 копия","p": {"uid":0,"id":0,"n":"Delivery","p":{"n":"Tony","p":"","p2":"","e":"","a":"vulica Matusieviča 7, Minsk, Belarus","v":10,"w":45.3592,"c":100,"d":"Hi!","ut":600,"t":"","r":null,"cid":"","ntf":0,"pr":0,"tags":[]},"f":1,"tf":1610391600,"tt":1610395140,"r":100,"y":53.915258958120475,"x":27.486151214976196,"u":"","s":0,"trt":120,"cf":{"Номер накладной":"","Поставщик":"","Тип груза":""},"itemId":21126416,"callMode":"create"}
I will describe the logic of creating a route:
- first, we optimize the route ( we get the track and arrival time for orders)
- we record the received data into orders
- save the route
callMode:«assign» - this is an outdated way of creating, better not to use it
Optimization:
In order to use optimization while executing orders use order/optimize:
https://sdk.wialon.com/wiki/en/sidebar/ … r/optimize
Example
svc=order/optimize¶ms={"itemId":21126416,"orders":[{"y":53.8986740112,"x":27.5098991394,"tf":1610348400,"n":"8","tt":1610391600,"f":0,"r":100,"p":{"ut":300,"rep":true,"w":0.0447,"v":10}},{"y":53.9037322998,"x":27.5195178986,"tf":1610348400,"n":"9","tt":1610391600,"f":0,"r":100,"p":{"ut":300,"rep":true,"w":0.0447,"v":10}},{"y":53.9091911316,"x":27.5244064331,"tf":1610348400,"n":"44","tt":1610391600,"f":0,"r":100,"p":{"ut":300,"rep":true,"w":0.0447,"v":10}}],"warehouses":[],"flags":131,"units":[21131933],"gis":{"addPoints":1,"provider":2,"speed":360,"cityJams":0.7,"countryJams":1,"mode":"driving","departure_time":1}}
Example of creating a route:
https://sdk.wialon.com/wiki/en/sidebar/ … ute_update
Example:
https://hst-api.wialon.com/wialon/ajax.html?svc=order/route_update&sid=<SID>¶ms={{"itemId":21126416,"orders":[{"uid":0,"id":0,"n":"8","p":{"n":"","p":"","p2":"","e":"","a":"ул. Харьковская 61, Минск, Беларусь","v":10,"w":0.0447,"c":0,"ut":300,"t":"","d":"","uic":"","cid":"","r":{"vt":1610360809,"ndt":1200,"id":1610359357951,"i":0,"m":0,"t":0},"aff":"","z":"","ntf":0,"cm":"","pr":0,"tags":[],"rep":true},"f":64,"tf":1610348400,"tt":1610391600,"r":100,"y":53.8986740112,"x":27.5098991394,"u":21131933,"s":0,"sf":0,"trt":120,"st":1606825424,"cnm":0,"rp":"","ej":{},"cf":{"Factura":"","Proveedor":"","Tipo de carga":"","frgrtgrt":"","fvfv":"","ppppoooo":"","tgtttt":"","Номер накладной":"","Поставщик":"","Тип груза":"","Тип груза ":"","авмвамавм":"","куикуикуик":"","№ паллета":""},"callMode":"create"},{"uid":0,"id":0,"n":"9","p":{"n":"","p":"","p2":"","e":"","a":"ул. 3-го сентября 1а, Минск, Беларусь","v":10,"w":0.0447,"c":0,"ut":300,"t":"","d":"","uic":"","cid":"","r":{"vt":1610361643,"ndt":1200,"id":1610359357951,"i":1,"m":1132,"t":834},"aff":"","z":"","ntf":0,"cm":"","pr":0,"tags":[],"rep":true},"f":64,"tf":1610348400,"tt":1610391600,"r":100,"y":53.9037322998,"x":27.5195178986,"u":21131933,"s":0,"sf":0,"trt":120,"st":1606825427,"cnm":0,"rp":"oa~gIi_|fDYZGSq@x@_@}AQkAY_Co@mF_A_H}AuLk@uCyBcIwF~CmBbA}AdAQqAiBgL","ej":{},"cf":{"Factura":"","Proveedor":"","Tipo de carga":"","frgrtgrt":"","fvfv":"","ppppoooo":"","tgtttt":"","Номер накладной":"","Поставщик":"","Тип груза":"","Тип груза ":"","авмвамавм":"","куикуикуик":"","№ паллета":""},"callMode":"create"},{"uid":0,"id":0,"n":"44","p":{"n":"","p":"","p2":"","e":"","a":"просп. Машерова 10, Минск, Беларусь","v":10,"w":0.0447,"c":0,"ut":300,"t":"","d":"","uic":"","cid":"","r":{"vt":1610362423,"ndt":1200,"id":1610359357951,"i":2,"m":864,"t":780},"aff":"","z":"","ntf":0,"cm":"","pr":0,"tags":[],"rep":true},"f":0,"tf":1610348400,"tt":1610391600,"r":100,"y":53.9091911316,"x":27.5244064331,"u":21131933,"s":0,"sf":0,"trt":1200,"st":1604557324,"cnm":0,"rp":"od_hIs{}fDi@gDGe@OsAUOIGgBi@iASoAUq@OBiAA[?i@ZuGBcACu@Kq@kAr@eAf@UJWJ[HQD_@H]Be@Dm@?YAgAIc@IYGo@YWM","ej":{},"cf":{"Provider name":"","Поставщик":"","Тип груза":"","№ паллета":""},"callMode":"create"}],"uid":1610359357951,"callMode":"create","exp":76277,"f":0,"n":"Сourier "}}],"flags":0}
here is an example, it has:
- optimization
- filling in the arrival time, track
- saving the route
you need to set SID, RES_ID, UNITS_ID
https://codesandbox.io/embed/relaxed-sunset-glf8d
I hope you will find this information useful.
Best regards,
Anton Voitenko
Anton Voitenko,
Wialon Product Manager, Gurtam