POST Create AusPost Return Label

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

You can use create AusPost Return Label API to create the return label for a shipment (Outbound Order).


Request

Attribute Type Required Description
username string Required Jerry username
digest string Required Digest algorithm
shipments array Required Shipments
msgType string Required pushUnCreatedShipments
version string Optional Could be 3.1

Shipments

Attribute Type Required Description
sender_reference string Required Order reference number (unique)
email_tracking_enabled boolean Optional Enable AUS POST to notify receiver by sending email. Yes: "True"
from from Optional Sender information; This field will be filled out with preset sender information if it is left blank
to to Required Receiver information
items array Required The item size must be 1

From

Attribute Type Required Description
state string Required The state will be validated
suburb string Required Suburb needs to match with postcode
postcode string Required Suburb needs to match with postcode
phone string Required The phone number must be between 9 and 20 characters and the allowable characters are "() - 0-9" (digits, space, hyphen and parentheses). Examples are 0491-570-156, (02) 5550 1234, +61 (3) 7010 4321
lines array Required The lines of the address.
Minimum one line, up to three lines.
Maximum 40 characters for each line
name string Required Maximum 40 characters
email string Optional Should be a vaild email address

To

Attribute Type Required Description
country string Optional Please fill in "AU" for eParcel service; The country code must comply with ISO 3166-1 alpha-2 standard
state string Required The state will be validated
suburb string Required Suburb needs to match with postcode
postcode string Required Suburb needs to match with postcode
lines array Required The lines of the address.
Minimum one line, up to three lines.
Maximum 40 characters for each line
name string Required Maximum 40 characters
business_name string Optional Business name
phone string Optional The phone number must be between 9 and 20 characters and the allowable characters are "() - 0-9" (digits, space, hyphen and parentheses). Examples are 0491-570-156, (02) 5550 1234, +61 (3) 7010 4321
email string Optional Should be a vaild email address
delivery_instructions string Optional Required when "authority_to_leave" is True

Items

Attribute Type Required Description
item_description string Optional Item description. It will appear on the label. Maximum 35 characters for DHL shipment
product_id array Required See Service Product Type
length double Optional Length, width and height in centimeters. Each should not be over 105cm, every two should not be less than 5cm, the volume should not be over 0.25m³
width double Optional Width
height double Optional Height
weight double Required The declared weight. See Service Product Type for limited weight requirement.
allow_partial_delivery boolean Optional It will be set as user default setting if the API does not provide the field
authority_to_leave boolean Optional Whether the parcel can be left in a safe place on delivery without receiving a signature. This is optional for domestic shipments (and defaults to "true"), but must not be specified for international shipments. This field works with the "safe_drop_enabled".
It will be set as user default setting if the API does not provide the field
safe_drop_enabled boolean Optional Whether your customer can request that the item be left in a safe place at the delivery address if they are not home to sign for their delivery.
Your customer can request this while the item is on its way. This field is optional for domestic shipments (and defaults to "true"), but must not be specified for international deliveries.
This field works with "authority_to_leave". If ‘authority_to_leave’ is set to true, the "‘safe_drop_enabled" can be ignored.
It will be set as user default setting if the API does not provide the field
useStock integer Optional Fill out with "1" if this order uses stock. Please ignore this area or fill out with "0" if this order doesn't use stock
merchandise array Optional Required for using stock and ECI. Optional for not using stock. See Merchandise
insurance boolean Optional Insurance

Merchandise

Attribute Type Required Description
sku string Optional It is used to manage merchandise. Required if the order uses stock
goodsName string Optional The name of product
goodsNameCn string Optional The name of product in Chinese
barcode string Optional UPC. Each item corresponds to a barcode
description string Optional Required for ECI. Eg: milk, red wine etc
country_of_origin string Optional Country of origin
quantity integer Optional Quantity. Required for ECI or when using stock
value decimal Optional Single item price. Required for ECI or when insurance applies
length decimal Optional Single item length(cm). Required when using Freight Service
width decimal Optional Single item width(cm). Required when using Freight Service
height decimal Optional Single item height(cm). Required when using Freight Service
weight decimal Optional Single item weight(kg). Required when using Freight Service

Service Product Type

product_id Product Type Return Order Number Label Size
PR EPARCEL POST RETURNS Yes 210mm×297mm
XPR EXPRESS EPARCEL POST RETURNS Yes 210mm×297mm

Digest Algorithm

The digest algorithm is MD5 + base64 algorithm.

Example: digest = username + 1 + pushUnCreatedShipments + API password
String content = username + auPostShipmentsToJerryDto.getShipments().size() +
auPostShipmentsToJerryDto.getMsgType();
String digest = MD5Util.MD5Encode(content, auCustomer.getPassword());
//content = test1pushUnCreatedShipments
//keys = 123456
public static String MD5Encode(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/javascript

{
    "username": "DUMMY DUCK",
    "digest": "xxxxxxxxxxxxxxxxx",
    "msgType": "pushUnCreatedShipments",
    "version": "1.0",
    "shipments": [
        {
            "sender_reference": "TEST000001",
            "from": {
                "name": "The Department of Dummy",
                "phone": "61407000000",
                "suburb": "Greenacre",
                "state": "NSW",
                "lines": [
                    "457 Waterloo Road"
                ],
                "postcode": "2190"
            },
            "to": {
                "name": "MELBOURNE DC",
                "phone": "0404280016",
                "suburb": "Moorabbin Airport",
                "state": "VIC",
                "lines": [
                    "6 Chifley Drive"
                ],
                "postcode": "3194",
                "country": "AU"
            },
            "items": [
                {
                    "item_description": "TEST PARCEL",
                    "product_id": "PR",
                    "useStock": 0,
                    "merchandise": [
                        {
                            "sku": "NG0000X1",
                            "goodsName": "T-shirt",
                            "barcode": "12345601",
                            "description": "T-shirt",
                            "country_of_origin": "AU",
                            "quantity": "2",
                            "value": "2",
                            "length": "6",
                            "width": "6",
                            "height": "6",
                            "weight": "6"
                        }
                    ]
                }
            ]
        }
    ]
}

Response

Attribute Type Required Description
shipments array Optional The shipment information will return if the order is created successfully
errors array Required The error message will return when the error occurs
code string Required See Return Codes

Shipments

Attribute Type Required Description
sender_references array Required Order reference number
items array Required Items
msg string Required Prompt message

Items

Attribute Type Required Description
article_id string Optional Tracking number
consignment_id string Optional Consignment number
item_description array Required Item description
pdf_url string Optional Label URL

Errors

Attribute Type Required Description
message string Required Wrong order number
sender_reference string Required The order reference number

Return Codes

Return Codes Description
0 Successful
1 Unknown error
2 Service is temporarily unavailable
3 Unsupported open API method
10 Invalid parameter
101 Invalid API key
104 Incorrect signature
Response Example
{
    "shipments": [
        {
            "sender_references": "TEST000001",
            "isSuccess": true,
            "items": [
                {
                    "article_id": "ABC200000001000931503",
                    "consignment_id": "ABC2000000",
                    "item_description": "TEST PARCEL",
                    "pdf_url": 
"https://jerrytest.ewe.com.au/eweApi/ewe/aupost/printSingleLabel? 
articleId=ABC200000001000931503"
                }
            ],
            "msg": "shipment sealed successfully"
        }
    ],
    "errors": [],
    "code": 1
}
Copyright © EWE Group Pty Ltd 2022 all right reserved,powered by GitbookLast Modified 19-05-2023

results matching ""

    No results matching ""