1

Create Order in Java

Тема: Create Order in Java

Hi guys,
I try to create a order, but I get an error of type 4 (Invalid input).
Here is the data that I pass in parameter of the request.

{
  "n": "Test",
  "p": {
    "n": "Alves",
    "p": "+22525353633",
    "p2": "",
    "e": "test@gmail.com",
    "a": "régaler.gauche.chaque",
    "v": 12,
    "w": 12,
    "c": 123.334,
    "ut": 600000,
    "t": "default car",
    "d": "Simple Description",
    "pr": 1,
    "r": {
      "ndt": 300
    }
  },
  "rp": "",
  "f": 2,
  "tf": 1484318291523,
  "tt": 1484404691524,
  "trt": 600000,
  "r": 12,
  "y": 5.3662,
  "x": -3.9216,
  "u": 0,
  "itemId": 14047455,
  "callMode": "create"
}

If possible, give an example of a parameter.

2

Create Order in Java

Re: Create Order in Java

Hi there

Here's order create documentation with explained parameters
https://sdk.wialon.com/wiki/en/sidebar/ … der/update

Also you can check Logistics API documentation http://apps.wialon.com/files/logistics/ … ces_en.pdf

I recommend you to start with empty p parameter (p:{}), make your request working and then move forward to it

3

Create Order in Java

Re: Create Order in Java

thanks for the help.
I'll give you a return if everything goes well.

4

Create Order in Java

Re: Create Order in Java

I still get the same error after changing parameters.

{
  "n": "Test",
  "p": {},
  "rp": "",
  "f": 2,
  "tf": 1484572753369,
  "tt": 1484659153369,
  "trt": 300,
  "r": 12,
  "y": 5.3662,
  "x": -3.9216,
  "u": 0,
  "itemId": 14047455,
  "callMode": "create"
}

I've even tried with several different parameter values, but I still get the same error.

5

Create Order in Java

Re: Create Order in Java

Try to fix some parameters in your request:
-you need to set uid(unique id (is used as unique key in order history)) and id(order id).
-tt and tf are too big - 1484572753369 is 03/29/49014 @ 12:22am (UTC)

This request and it works:
https://hst-api.wialon.com/wialon/ajax.html?svc=order/update&params={"uid":0,"id":0,"n":"Test","p":{},"f":2,"tf":1484572753,"tt":1484659153,"trt":300,"r":12,"y":5.3662,"x":-3.9216,"u":0,"itemId":14047455,"callMode":"create"}&sid=

Wialon Local Expert
6

Create Order in Java

Re: Create Order in Java

Thanks for the help. The problem was resolved. Indeed as regards the times, I made a conversion in milliseconds and not in second.
Thanks again.