API - Shipments

The Shipments resource contains several methods that return shipment specific information.

Method Name: listShipments, listPreviousShipments, listNextShipments

Retrieve a list of the Shipments on your account. The list will contain 25 Shipments at a time with links to the next and previous pages.

The methods listPreviousShipments and listNextShipments are pagination methods.

  • Method: GET

  • Parameters:

    • Limit — Min Value: 0, Max Value: 25.
    • Offset — Min Value: 0
  • Request Headers: Accept, Authorization, Host

  • Request Message Body: None

  • Response Headers: Content-Length, Content-Type, Content-Location

  • Response Message Body: List of Shipments

  • Response Status: 200, 204, 400, 401, 403, 404

  • Media Types:

    • application/vnd.koleimports.ds.shipment+xml
    • application/vnd.koleimports.ds.shipment+json

Request Parameters:

GET /shipments
Host: example.com 
Authorization: Basic {id}:{api_key} 
Accept: application/vnd.koleimports.ds.shipment+xml

Example CURL Request:

curl -H "Accept: application/vnd.koleimports.ds.shipment+xml" "https://{id}:{api_key}@api.koleimports.com/shipments?limit=1&offset=0"

Example Response:

HTTP/1.1 200 OK 
Content-Type: application/vnd.koleimports.ds.shipment+xml
Content-Length: 1804
Content-Location: https://api.koleimports.com/shipments?limit=25&offset=0

<?xml version="1.0" encoding="utf-8"?>
<shipments>
    <shipment>
        <order_id></order_id>
        <ship_account_id></ship_account_id>
        <po_number></po_number>
        <carrier></carrier>
        <service></service>
        <master_tracking></master_tracking>
        <zipcode></zipcode>
        <packages>
            <package>
                <weight></weight>
                <tracking></tracking>
            </package>
        </packages>
        <links>
            <link>
                <method></method>
                <media_type></media_type>
                <url></url>
            </link>
        </links>
    </shipment>
</shipments>

Response Body Field Definitions

The listShipments, listPreviousShipments and listNextShipments methods are collection methods. See getShipment for field definitions.

Method Name: getShipment

Retrieve information about an Shipment by the Order ID.

  • Method: GET

  • Parameters: None

  • Request Headers: Accept, Authorization, Host

  • Request Message Body: None

  • Response Headers: Content-Length, Content-Type, Content-Location

  • Response Message Body: Shipment Information

  • Response Status: 200, 400, 401, 403, 404

  • Media Types:

    • application/vnd.koleimports.ds.shipment+xml
    • application/vnd.koleimports.ds.shipment+json

Request Parameters:

GET /shipments/{order_id}
Host: example.com 
Authorization: Basic {id}:{api_key} 
Accept: application/vnd.koleimports.ds.shipment+xml

Example CURL Request:

curl -H "Accept: application/vnd.koleimports.ds.shipment+xml" "https://{id}:{api_key}@api.koleimports.com/shipments/{order_id}"

Example Response:

HTTP/1.1 200 OK 
Content-Type: application/vnd.koleimports.ds.shipment+xml
Content-Length: 1804
Content-Location: https://api.koleimports.com/shipments/{order_id}

<?xml version="1.0" encoding="utf-8"?>
<shipment>
    <order_id></order_id>
    <ship_account_id></ship_account_id>
    <po_number></po_number>
    <carrier></carrier>
    <service></service>
    <master_tracking></master_tracking>
    <zipcode></zipcode>
    <packages>
        <package>
            <weight></weight>
            <tracking></tracking>
        </package>
    </packages>
    <links>
        <link>
            <method></method>
            <media_type></media_type>
            <url></url>
        </link>
    </links>
</shipment>

Response Body Field Definitions

Field Name Description Type Length
Field Name Description Type Length
shipment

Children:

  • order_id
  • ship_account_id
  • po_number
  • carrier
  • service
  • master_tracking
  • zipcode
  • packages
  • links
n/a n/a
order_id

A unique order number.

integer 10
ship_account_id

The account number associated with the shipment.

String 20
po_number

The purchase order number.

String 20
carrier

A constant that specifies which shipping carrier was used.
Options: FEDEX or UPS.

String n/a
service

A description of the shipping service for this order.

String 60
master_tracking

The master tracking number for the shipment.

String 30
zipcode

Customer Zipcode

String 5
packages

Children:

  • package
n/a n/a
package

Children:

  • weight
  • tracking
n/a n/a
weight

Weight of the package

Integer 6
tracking

Tracking number of individual package

String 30
links

Children:

  • link
n/a n/a
link

Children:

  • method
  • media_type
  • url
n/a n/a
method

The name of the API method.

String 100
media_type

The media type for the method. Use this in the Accept Header.

String 250
url

The URL used to access the resource.

String 250