API Reference
API Reference

To retrieve multiple orders, call the find_all method on the Order resource class with a ShippingEasy order ID specified.

Example

ShippingEasy::Resources::Order.find_all

Example Response

{"orders": [
    {
        "id": 73150,
        "external_order_identifier": "45640",
        "ordered_at": "2014-03-05T08:00:00Z",
        "order_status": "ready_for_shipment",
        "total_including_tax": "94.90",
        "total_excluding_tax": "0.00",
        "discount_amount": "0.00",
        "coupon_discount": "0.00",
        "subtotal_including_tax": "89.95",
        "subtotal_excluding_tax": "0.00",
        "subtotal_tax": "0.00",
        "total_tax": "0.00",
        "base_shipping_cost": "4.95",
        "shipping_cost_including_tax": "4.95",
        "shipping_cost_excluding_tax": "0.00",
        "shipping_cost_tax": "0.00",
        "base_handling_cost": "0.00",
        "handling_cost_excluding_tax": "0.00",
        "handling_cost_including_tax": "0.00",
        "handling_cost_tax": "0.00",
        "base_wrapping_cost": "0.00",
        "wrapping_cost_excluding_tax": "0.00",
        "wrapping_cost_including_tax": "0.00",
        "wrapping_cost_tax": "0.00",
        "billing_company": "",
        "billing_first_name": "Tom",
        "billing_last_name": "Smith",
        "billing_address": "600 California St",
        "billing_address2": "",
        "billing_city": "San Francisco",
        "billing_state": "California",
        "billing_country": "United States",
        "billing_postal_code": "94108",
        "billing_phone_number": null,
        "billing_email": "[email protected]",
        "recipients": [
            {
                "company": "",
                "first_name": "Tom",
                "last_name": "Smith",
                "address": "600 California St",
                "address2": "",
                "address3": null,
                "city": "San Francisco",
                "residential": false,
                "state": "CA",
                "province": null,
                "country": "United States",
                "postal_code": "94108",
                "postal_code_plus_4": "2704",
                "phone_number": "3453332222",
                "email": "[email protected]",
                "base_cost": "0.00",
                "cost_excluding_tax": "0.00",
                "cost_including_tax": "0.00",
                "cost_tax": "0.00",
                "base_handling_cost": "0.00",
                "handling_cost_excluding_tax": "0.00",
                "handling_cost_including_tax": "0.00",
                "handling_cost_tax": "0.00",
                "shipping_zone_id": null,
                "shipping_zone_name": null,
                "items_total": 0,
                "shipping_method": null,
                "items_shipped": 0,
                "ext_shipping_detail_id": 44370,
                "line_items": [
                    {
                        "item_name": "Crumpler Bag",
                        "sku": "90907",
                        "bin_picking_number": null,
                        "weight_in_ounces": "46.08",
                        "quantity": 1,
                        "total_excluding_tax": "0.00",
                        "price_excluding_tax": "89.95",
                        "unit_price": "89.95",
                        "ext_line_item_id": "90908",
                        "ext_product_id": "1018",
                        "product_options": null
                    },
                    {
                        "item_name": "Downloadable - Office for PC",
                        "sku": "90909",
                        "bin_picking_number": null,
                        "weight_in_ounces": "36.8",
                        "quantity": 1,
                        "total_excluding_tax": "0.00",
                        "price_excluding_tax": "0.00",
                        "unit_price": "0.00",
                        "ext_line_item_id": "90910",
                        "ext_product_id": "1037",
                        "product_options": null
                    }
                ]
            }
        ],
        "store_api_key": null
    }
], "meta": {
    "current_page": 1,
    "next_page": 2,
    "prev_page": null,
    "total_pages": 17,
    "total_count": 17,
    "last_updated_at": "2014-02-21T14:54:07Z",
    "status": ["ready_for_shipment", "shipped"]
}}

Filtering Results

Results may be filtered on a number of parameters.

Example

filters = {page: 1, per_page: 1, status: ["ready_for_shipment", "shipped"], last_updated_at: "2014-05-07 14:42:18 UTC"}

ShippingEasy::Resources::Order.find_all(filters)

Filtering options

NameDescription
pageInteger

The page to return in the paginated result set.

Default to 1.
per_pageInteger

The number of result to include per pagein the paginated result set.

Defaults to 50 if not specified and the maximum number of results returned per page is 200.
last_updated_atDatetime

Filters the results by the orders' last updated at timestamp and only returns results with a timestamp newer than or equal to the specified value.

Defaults to 1 week ago if not specified. The maxiumum time this value can be set to is 3 months ago.
statusString or Array

Filters the results by the orders' ShippingEasy order status.

Defaults to "shipped".

Possible values:
shipped
ready_for_shipment
pending
cleared
drop_shipped
split
combined
pending_external_fulfillment

It is possible to pass an array of statuses, e.g. ["shipped", "ready_for_shipment"].

Note: There are a few additional states that are used internally as orders are processed, but they are not meant for API consumption.
includesAdds information to the response. Specifying includes=products will deliver additional information (if available) about each product in the order.
order_numberThe external_order_identifier to search for
tagsString or Array

Filters the results by tags that have been applied to the order. Specifying one or more tags limits the results to only orders that have at least one of the specified tags.

Exceptions

ExceptionDescription
ShippingEasy::AccessDeniedErrorYour credentials could not be authenticated or the store api_key could not be found.
ShippingEasy::InvalidRequestErrorThe orders could not retrieved for one or more of the following reasons:

* The API timestamp could not be parsed.

The exception will contain a message that indicates which of these conditions failed.