POST Get Price

https://jerrytest.ewe.com.au/eweApi/ewe/api/getPrice

You can use get price API to get order/shipment pricing of last mile.

Request

Attribute Type Required Description
productId string Required Service product type, maximum length 20
username string Required Jerry username, maximum length 30
digest string Required Digest algorithm, maximum length 50
msgType string Required Default: getPrice, maximum length 30
length BigDecimal Optional Length
width BigDecimal Optional Width
height BigDecimal Optional Height
weight BigDecimal Required Weight
pickupAddress string Optional Address should be valid.
senderState string Optional The state will be validated
receiverCountry string Optional The country will be validated
receiverState string Optional The state will be validated
receiverSuburb string Optional Suburb needs to match with postcode
receiverPostcode string Required Suburb needs to match with postcode
merchandiseCount integer Optional The count of merchandise, it is related to warehouse operation fees

Digest Algorithm

The digest algorithm is MD5 + base64 algorithm.

Example: content = username + weight + msgType
public static String MD5EncodeForCainiao(String content, String keys) {
        String sign = "";
        String charset = "UTF-8";
        content = content + keys;
        try {
            MessageDigest md = MessageDigest.getInstance("MD5");
            md.update(content.getBytes(charset));
            sign = new String(Base64.encodeBase64(md.digest()), charset);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return sign;
    }
Request Example

Content-Type application/json

{
    "productId":"3D35",
    "username":"dl-syd",
    "digest":"pBERfWh1jMt21HgPQn/B2A==",
    "msgType":"getPrice",
    "length":"3",
    "width":"3",
    "height":"3",
    "weight":"2",
    "pickupAddress":"",
    "senderState":"",
    "receiverCountry":"",
    "receiverState":"",
    "receiverSuburb":"",
    "receiverPostcode":"2190",
    "merchandiseCount":"0"

}

Response

Attribute Type Description
status integer Valid data load. The payload type varies according to the request
Message string Text messages. If a complex error occurs, make a brief explanation
priceDtos - -

Price Dtos

Attribute Type Description
status BigDecimal Valid data load. The payload type varies according to the request
productId BigDecimal Service Product Type
totalPrice BigDecimal Total price of all products
priceDetails BigDecimal Specification

Price Details

Attribute Type Description
name string The name of detailed fee or charge.
amount BigDecimal The price of detailed fee or charge.

Status Codes

Status Code Type Description
1 SUCCESS Successful
0 FAILURE Failed
Response Example
{
    "status": 1,
    "message": "success",
    "priceDtos": [
        {
            "status": 1,
            "productId": "3D35",
            "totalPrice": 5.34,
            "priceDetails": [
                {
                    "name": "freight",
                    "amount": 4.69
                },
                {
                    "name": "fuelSurcharge",
                    "amount": 0.16
                },
                {
                    "name": "gst",
                    "amount": 0.49
                }
            ]
        }
    ]
}
Copyright © EWE Group Pty Ltd 2022 all right reserved,powered by GitbookLast Modified 19-05-2023

results matching ""

    No results matching ""