Your browser does not support Java Script or javascript is disabled. Please ensure that your browser supports it for full compatibility with our services.

Create order

Create order

The 'Create order' service initializes the booking process. In order to do this, you need to provide information concerning the package, its collection and destination addresses, dimensions. etc.  As a response from this service, you are provided with the exact cost. The order at this point is stored in the S2A database. It is stored as 'pending' and the booking process waits for acceptance of the pending order.

Request
Orders
URI /orders/
Method POST
Authorization
required

Parameters

Name
Required
Type
Description
order.shipments[]
required shipment object Shipment information, at least one shipment required.
order.shipments[].transient_id
optional string Id returned with response, it allows distinguishing shipments. 35 characters max.
order.shipments[].service.code
required string Chosen service. Code obtained from here: "Get Quote".
order.shipments[].service.options
optional list of strings Additional options as list of strings.
order.shipments[].service.options.insurance
optional boolean true/false Additional insurance for package.
order.shipments[].collection_type
required string Collection type can be "pickup" or "dropoff". However "dropoff" is only permitted for shipments leaving Australia.
order.shipments[].collection
required/optional collection object Collection address data, required for "pickup" collection type.
order.shipments[].collection.first_name
required string First name, 35 characters max. 
order.shipments[].collection.last_name
required string Last name, 35 characters max.  
order.shipments[].collection.company
optional string Company, 35 characters max. 
order.shipments[].collection.email
required string Email address
order.shipments[].collection.phone
required string Phone number
order.shipments[].collection.country
required string - two letter country code Country code.
order.shipments[].collection.postcode
required  string Post code
order.shipments[].collection.city
required string City
order.shipments[].collection.address_lines
required  list of strings List containing collection address lines, first line is required and should always be present, 3 lines maximum, in each 35 characters max. 
order.shipments[].collection.pickup
required/optional  pickup object Pick up information. Optional for "dropoff".
order.shipments[].collection.pickup.date
required  string - date in iso8601 format Pick up date
order.shipments[].collection.pickup.time_earliest
required  string - time in iso8601 format Pick up earliest time
order.shipments[].collection.pickup.time_latest
required  string - time in iso8601 format Pick up latest time
order.shipments[].delivery
required delivery object Delivery address data
order.shipments[].delivery.first_name
required string First name, 35 characters max.  
order.shipments[].delivery.last_name
required string Last name, 35 characters max.  
order.shipments[].delivery.company
optional string Company, 35 characters max. 
order.shipments[].delivery.email
required string Email address
order.shipments[].delivery.phone
required string Phone number
order.shipments[].delivery.country
required string - two letter country code Country code.
order.shipments[].delivery.postcode
required  string Post code 
order.shipments[].delivery.city
required string City 
order.shipments[].delivery.address_lines
required  list of strings List containing delivery address lines, first line is required and should always be present, 3 lines max, in each 35 characters max. 
order.shipments[].packages
required list of packages

List containing information concerning each package. Minimum 1 package.

order.shipments[].packages[].height
required decimal number Package height
order.shipmtens[].packages[].width
required decimal number Package width
order.shipments[].packages[].length
required decimal number Package length
order.shipments[].packages[].weight
required decimal number Package weight
order.shipments[].packages[].unit
required string - 'cm' or 'in' Measure/Weight unit, either 'cm' for centimetres and kilograms or 'in' for inches and pounds.
order.shipments[].customs_information
required customs information object

Customs information.

order.shipments[].customs_information.description
optional string Additional comments about shipment, 512 characters max. 
order.shipments[].customs_information.reason
required enum "Gift", "Purchase", "Sale", "Sample", "Return", "Repair", "Personal Effects" Reason for shipping: Gift, Purchase, Sale, Sample, Return, Repair or Personal Effects.
order.shipments[].customs_information.tax_status
required string Tax status: Private or Company.
order.shipments[].customs_information.lithium
required boolean -true or false

Describes whether or not the shipment contains lithium products (mobile phones etc.).

order.shipments[].customs_information.items
required list of items

List containing descriptions of items inside package. Minimum 1 item.

order.shipments[].customs_information.items[].description
required string Item Description, 35 characters max.
order.shipments[].customs_information.items[].quantity
required integer number Quantity of particular item type.
order.shipments[].customs_information.items[].value
required decimal number

Value of a single item. Total value of all items can not exceed 7500 AUD.

order.shipments[].customs_information.items[].currency
required string - three letter currency code Currency for value. For now we support only AUD.
order.shipments[].customs_information.items[].madein
required string - two letter country code Country of manufacture
order.shipments[].description
required string

Brief description of goods, 35 characters max.

Request body

 
    {
    "request": {
        "order": {
            "shipments": [
                {
                    "transient_id""123",
                    "service": {
                        "code""1002",
                        "options": {
                            "insurance": "true"
                        }
                    },
                    "collection_type""pickup",
                    "collection": {
                        "first_name""Fred",
                        "last_name""Flintstone",
                        "company""Bedrock",
                        "email""fread@bedrock.com",
                        "phone""123123123",
                        "country""AU",
                        "postcode""3000",
                        "city""Melbourne",
                        "address_lines": [
                            "address line 1",
                            "address line 2",
                            "address line 3"
                        ],
                        "pickup": {
                            "date""2014-04-20",
                            "time_earliest""09:00",
                            "time_latest""14:00"
                        }
                    },
                    "delivery": {
                        "first_name""Foo",
                        "last_name""Bar",
                        "company""baz",
                        "email""foo.bar@baz.com",
                        "phone""123123123",
                        "country""AU",
                        "postcode""2000",
                        "city""Sydney",
                        "address_lines": [
                            "address line 1",
                            "address line 2",
                            "address line 3"
                        ]
                    },
                    "packages": [
                        {
                            "height"10,
                            "width"15,
                            "length"20,
                            "weight"3,
                            "unit""cm"
                        }
                    ],
                    "customs_information": {
                        "description""Additional comments about shipment.",
                        "reason""purchase",
                        "tax_status""company",
                        "lithium": false,
                        "items": [
                            {
                                "description""shoes",
                                "quantity"1,
                                "value"20,
                                "currency""AUD",
                                "madein""US"
                            }
                        ]
                    },
                    "description""Brief description"
                }
            ]
        }
    }
}


Note

You can use the same JSON carrier service object as the one returned in the API response from the quote service. However, there are two things the order service will take into account: service code and options.

Response

{
    "code"200,
    "message""OK",
    "result": {
        "order": {
            "id""S2AO000001",
            "status""new",
            "price": {
                "amount"120.5,
                "insurance"10.5,
                "gst"13.1,
                "total"144.1,
                "currency""AUD"
            },
            "shipments": [
                {
                    "transient_id""123",
                    "status""TODO",
                    "service": {
                        "code""service_code",
                        "name""DHL",
                        "price": {
                            "amount"120.5,
                            "insurance"10.5,
                            "gst"13.1,
                            "total"144.1,
                            "currency""AUD"
                        },
                        "options": []
                    },
                    "collection_type""pickup",
                    "collection": {
                        "first_name""Fred",
                        "last_name""Flintstone",
                        "company""Bedrock",
                        "email""fread@bedrock.com",
                        "phone""123123123",
                        "country""AU",
                        "postcode""3000",
                        "city""Melbourne",
                        "address_lines": [
                            "address line 1",
                            "address line 2",
                            "address line 3"
                        ],
                        "pickup": {
                            "date""2012-09-03",
                            "time_earliest""09:00",
                            "time_latest""14:00"
                        }
                    },
                    "delivery": {
                        "first_name""Foo",
                        "last_name""Bar",
                        "company""baz",
                        "email""foo.bar@baz.com",
                        "phone""123123123",
                        "country""AU",
                        "postcode""2000",
                        "city""Sydney",
                        "address_lines": [
                            "address line 1",
                            "address line 2",
                            "address line 3"
                        ]
                    },
                    "packages": [
                        {
                            "height"10,
                            "width"15,
                            "length"20,
                            "weight"3,
                            "unit_weight""cm"
                        }
                    ],
                    "customs_information": {
                        "description""Additional comments about shipment.",
                        "reason""purchase",
                        "tax_status""company",
                        "lithium": false,
                        "items": [
                            {
                                "description""shoes",
                                "quantity"1,
                                "value"20,
                                "currency""AUD",
                                "madein""US"
                            }
                        ]
                    },
                    "description""Brief description"
                }
            ]
        }
    }
}

Response from a 'create order' contains the order id and the exact price for this order.

When order is created you can either accept it using this function: "Accept Order" or cancel it using this function: "Cancel Order".