{"_id":"54cc2149380ecd0d00ca18cd","category":{"_id":"54cc2149380ecd0d00ca18b0","pages":["54cc2149380ecd0d00ca18ca","54cc2149380ecd0d00ca18cb","54cc2149380ecd0d00ca18cc","54cc2149380ecd0d00ca18cd","54cc2149380ecd0d00ca18ce","54cc2149380ecd0d00ca18cf","54cc2149380ecd0d00ca18d0","54cc2149380ecd0d00ca18d1"],"project":"5436a1e1d0ffee0e00f18f8c","__v":1,"version":"54cc2148380ecd0d00ca18aa","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-23T19:03:27.816Z","from_sync":false,"order":6,"slug":"ruby-client","title":"Ruby client"},"project":"5436a1e1d0ffee0e00f18f8c","__v":0,"parentDoc":null,"version":{"_id":"54cc2148380ecd0d00ca18aa","__v":2,"forked_from":"5436a1e1d0ffee0e00f18f8f","project":"5436a1e1d0ffee0e00f18f8c","createdAt":"2015-01-31T00:26:48.753Z","releaseDate":"2015-01-31T00:26:48.753Z","categories":["54cc2149380ecd0d00ca18ab","54cc2149380ecd0d00ca18ac","54cc2149380ecd0d00ca18ad","54cc2149380ecd0d00ca18ae","54cc2149380ecd0d00ca18af","54cc2149380ecd0d00ca18b0","54cc2149380ecd0d00ca18b1","54cc2149380ecd0d00ca18b2","54cc2149380ecd0d00ca18b3","552f29ca633a5b0d00e99d09"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.1.0","version":"1.1"},"user":"5436a1afb7cf0e1c0020d9ca","updates":[],"next":{"pages":[],"description":""},"createdAt":"2014-10-23T19:14:58.129Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"never","params":[],"url":""},"isReference":false,"order":3,"body":"To retrieve multiple orders, call the find_all method on the Order resource class with a ShippingEasy order ID specified.\n\n## Example\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"ShippingEasy::Resources::Order.find_all\",\n      \"language\": \"ruby\"\n    }\n  ]\n}\n[/block]\n## Example Response\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\\"orders\\\": [\\n    {\\n        \\\"id\\\": 73150,\\n        \\\"external_order_identifier\\\": \\\"45640\\\",\\n        \\\"ordered_at\\\": \\\"2014-03-05T08:00:00Z\\\",\\n        \\\"order_status\\\": \\\"ready_for_shipment\\\",\\n        \\\"total_including_tax\\\": \\\"94.90\\\",\\n        \\\"total_excluding_tax\\\": \\\"0.00\\\",\\n        \\\"discount_amount\\\": \\\"0.00\\\",\\n        \\\"coupon_discount\\\": \\\"0.00\\\",\\n        \\\"subtotal_including_tax\\\": \\\"89.95\\\",\\n        \\\"subtotal_excluding_tax\\\": \\\"0.00\\\",\\n        \\\"subtotal_tax\\\": \\\"0.00\\\",\\n        \\\"total_tax\\\": \\\"0.00\\\",\\n        \\\"base_shipping_cost\\\": \\\"4.95\\\",\\n        \\\"shipping_cost_including_tax\\\": \\\"4.95\\\",\\n        \\\"shipping_cost_excluding_tax\\\": \\\"0.00\\\",\\n        \\\"shipping_cost_tax\\\": \\\"0.00\\\",\\n        \\\"base_handling_cost\\\": \\\"0.00\\\",\\n        \\\"handling_cost_excluding_tax\\\": \\\"0.00\\\",\\n        \\\"handling_cost_including_tax\\\": \\\"0.00\\\",\\n        \\\"handling_cost_tax\\\": \\\"0.00\\\",\\n        \\\"base_wrapping_cost\\\": \\\"0.00\\\",\\n        \\\"wrapping_cost_excluding_tax\\\": \\\"0.00\\\",\\n        \\\"wrapping_cost_including_tax\\\": \\\"0.00\\\",\\n        \\\"wrapping_cost_tax\\\": \\\"0.00\\\",\\n        \\\"billing_company\\\": \\\"\\\",\\n        \\\"billing_first_name\\\": \\\"Tom\\\",\\n        \\\"billing_last_name\\\": \\\"Smith\\\",\\n        \\\"billing_address\\\": \\\"600 California St\\\",\\n        \\\"billing_address2\\\": \\\"\\\",\\n        \\\"billing_city\\\": \\\"San Francisco\\\",\\n        \\\"billing_state\\\": \\\"California\\\",\\n        \\\"billing_country\\\": \\\"United States\\\",\\n        \\\"billing_postal_code\\\": \\\"94108\\\",\\n        \\\"billing_phone_number\\\": null,\\n        \\\"billing_email\\\": \\\"melissa:::at:::shippingeasy.com\\\",\\n        \\\"recipients\\\": [\\n            {\\n                \\\"company\\\": \\\"\\\",\\n                \\\"first_name\\\": \\\"Tom\\\",\\n                \\\"last_name\\\": \\\"Smith\\\",\\n                \\\"address\\\": \\\"600 California St\\\",\\n                \\\"address2\\\": \\\"\\\",\\n                \\\"address3\\\": null,\\n                \\\"city\\\": \\\"San Francisco\\\",\\n                \\\"residential\\\": false,\\n                \\\"state\\\": \\\"CA\\\",\\n                \\\"province\\\": null,\\n                \\\"country\\\": \\\"United States\\\",\\n                \\\"postal_code\\\": \\\"94108\\\",\\n                \\\"postal_code_plus_4\\\": \\\"2704\\\",\\n                \\\"phone_number\\\": \\\"3453332222\\\",\\n                \\\"email\\\": \\\"melissa@shippingeasy.com\\\",\\n                \\\"base_cost\\\": \\\"0.00\\\",\\n                \\\"cost_excluding_tax\\\": \\\"0.00\\\",\\n                \\\"cost_including_tax\\\": \\\"0.00\\\",\\n                \\\"cost_tax\\\": \\\"0.00\\\",\\n                \\\"base_handling_cost\\\": \\\"0.00\\\",\\n                \\\"handling_cost_excluding_tax\\\": \\\"0.00\\\",\\n                \\\"handling_cost_including_tax\\\": \\\"0.00\\\",\\n                \\\"handling_cost_tax\\\": \\\"0.00\\\",\\n                \\\"shipping_zone_id\\\": null,\\n                \\\"shipping_zone_name\\\": null,\\n                \\\"items_total\\\": 0,\\n                \\\"shipping_method\\\": null,\\n                \\\"items_shipped\\\": 0,\\n                \\\"ext_shipping_detail_id\\\": 44370,\\n                \\\"line_items\\\": [\\n                    {\\n                        \\\"item_name\\\": \\\"Crumpler Bag\\\",\\n                        \\\"sku\\\": \\\"90907\\\",\\n                        \\\"bin_picking_number\\\": null,\\n                        \\\"weight_in_ounces\\\": \\\"46.08\\\",\\n                        \\\"quantity\\\": 1,\\n                        \\\"total_excluding_tax\\\": \\\"0.00\\\",\\n                        \\\"price_excluding_tax\\\": \\\"89.95\\\",\\n                        \\\"unit_price\\\": \\\"89.95\\\",\\n                        \\\"ext_line_item_id\\\": \\\"90908\\\",\\n                        \\\"ext_product_id\\\": \\\"1018\\\",\\n                        \\\"product_options\\\": null\\n                    },\\n                    {\\n                        \\\"item_name\\\": \\\"Downloadable - Office for PC\\\",\\n                        \\\"sku\\\": \\\"90909\\\",\\n                        \\\"bin_picking_number\\\": null,\\n                        \\\"weight_in_ounces\\\": \\\"36.8\\\",\\n                        \\\"quantity\\\": 1,\\n                        \\\"total_excluding_tax\\\": \\\"0.00\\\",\\n                        \\\"price_excluding_tax\\\": \\\"0.00\\\",\\n                        \\\"unit_price\\\": \\\"0.00\\\",\\n                        \\\"ext_line_item_id\\\": \\\"90910\\\",\\n                        \\\"ext_product_id\\\": \\\"1037\\\",\\n                        \\\"product_options\\\": null\\n                    }\\n                ]\\n            }\\n        ],\\n        \\\"store_api_key\\\": null\\n    }\\n], \\\"meta\\\": {\\n    \\\"current_page\\\": 1,\\n    \\\"next_page\\\": 2,\\n    \\\"prev_page\\\": null,\\n    \\\"total_pages\\\": 17,\\n    \\\"total_count\\\": 17,\\n    \\\"last_updated_at\\\": \\\"2014-02-21T14:54:07Z\\\",\\n    \\\"status\\\": [\\\"ready_for_shipment\\\", \\\"shipped\\\"]\\n}}\",\n      \"language\": \"ruby\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Filtering Results\"\n}\n[/block]\nResults may be filtered on a number of parameters.\n\n## Example\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"filters = {page: 1, per_page: 1, status: [\\\"ready_for_shipment\\\", \\\"shipped\\\"], last_updated_at: \\\"2014-05-07 14:42:18 UTC\\\"}\\n\\nShippingEasy::Resources::Order.find_all(filters)\",\n      \"language\": \"ruby\"\n    }\n  ]\n}\n[/block]\n## Filtering options\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"page\",\n    \"0-1\": \"*Integer*\\n\\nThe page to return in the paginated result set. \\n\\n*Default to 1.*\",\n    \"1-0\": \"per_page\",\n    \"2-0\": \"last_updated_at\",\n    \"3-0\": \"status\",\n    \"4-0\": \"page\",\n    \"1-1\": \"*Integer*\\n\\nThe number of result to include per pagein the paginated result set. \\n\\n*Defaults to 50 if not specified and the maximum number of results returned per page is 200*.\",\n    \"2-1\": \"*Datetime*\\n\\nFilters the results by the orders' last updated at timestamp and only returns results with a timestamp newer than or equal to the specified value. \\n\\n*Defaults to 1 week ago if not specified. The maxiumum time this value can be set to is 3 months ago.*\",\n    \"3-1\": \"*String* or *Array*\\n\\nFilters the results by the orders' ShippingEasy order status. \\n\\n*Defaults to \\\"shipped\\\". *\\n\\nPossible values: \\n* shipped\\n* ready_for_shipment\\n* pending\\n* cleared\\n\\nIt is possible to pass an array of statuses, e.g. [\\\"shipping\\\", \\\"ready_for_shipment\\\"].\",\n    \"h-0\": \"Name\",\n    \"h-1\": \"Description\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Exceptions\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Exception\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"ShippingEasy::AccessDeniedError\",\n    \"1-0\": \"ShippingEasy::InvalidRequestError\",\n    \"0-1\": \"Your credentials could not be authenticated or the store api_key could not be found.\",\n    \"1-1\": \"The orders could not retrieved for one or more of the following reasons:\\n\\n* The API timestamp could not be parsed.\\n\\nThe exception will contain a message that indicates which of these conditions failed.\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]","excerpt":"","slug":"retrieving-multiple-orders","type":"basic","title":"Retrieving multiple orders"}

Retrieving multiple orders


To retrieve multiple orders, call the find_all method on the Order resource class with a ShippingEasy order ID specified. ## Example [block:code] { "codes": [ { "code": "ShippingEasy::Resources::Order.find_all", "language": "ruby" } ] } [/block] ## Example Response [block:code] { "codes": [ { "code": "{\"orders\": [\n {\n \"id\": 73150,\n \"external_order_identifier\": \"45640\",\n \"ordered_at\": \"2014-03-05T08:00:00Z\",\n \"order_status\": \"ready_for_shipment\",\n \"total_including_tax\": \"94.90\",\n \"total_excluding_tax\": \"0.00\",\n \"discount_amount\": \"0.00\",\n \"coupon_discount\": \"0.00\",\n \"subtotal_including_tax\": \"89.95\",\n \"subtotal_excluding_tax\": \"0.00\",\n \"subtotal_tax\": \"0.00\",\n \"total_tax\": \"0.00\",\n \"base_shipping_cost\": \"4.95\",\n \"shipping_cost_including_tax\": \"4.95\",\n \"shipping_cost_excluding_tax\": \"0.00\",\n \"shipping_cost_tax\": \"0.00\",\n \"base_handling_cost\": \"0.00\",\n \"handling_cost_excluding_tax\": \"0.00\",\n \"handling_cost_including_tax\": \"0.00\",\n \"handling_cost_tax\": \"0.00\",\n \"base_wrapping_cost\": \"0.00\",\n \"wrapping_cost_excluding_tax\": \"0.00\",\n \"wrapping_cost_including_tax\": \"0.00\",\n \"wrapping_cost_tax\": \"0.00\",\n \"billing_company\": \"\",\n \"billing_first_name\": \"Tom\",\n \"billing_last_name\": \"Smith\",\n \"billing_address\": \"600 California St\",\n \"billing_address2\": \"\",\n \"billing_city\": \"San Francisco\",\n \"billing_state\": \"California\",\n \"billing_country\": \"United States\",\n \"billing_postal_code\": \"94108\",\n \"billing_phone_number\": null,\n \"billing_email\": \"melissa@shippingeasy.com\",\n \"recipients\": [\n {\n \"company\": \"\",\n \"first_name\": \"Tom\",\n \"last_name\": \"Smith\",\n \"address\": \"600 California St\",\n \"address2\": \"\",\n \"address3\": null,\n \"city\": \"San Francisco\",\n \"residential\": false,\n \"state\": \"CA\",\n \"province\": null,\n \"country\": \"United States\",\n \"postal_code\": \"94108\",\n \"postal_code_plus_4\": \"2704\",\n \"phone_number\": \"3453332222\",\n \"email\": \"melissa@shippingeasy.com\",\n \"base_cost\": \"0.00\",\n \"cost_excluding_tax\": \"0.00\",\n \"cost_including_tax\": \"0.00\",\n \"cost_tax\": \"0.00\",\n \"base_handling_cost\": \"0.00\",\n \"handling_cost_excluding_tax\": \"0.00\",\n \"handling_cost_including_tax\": \"0.00\",\n \"handling_cost_tax\": \"0.00\",\n \"shipping_zone_id\": null,\n \"shipping_zone_name\": null,\n \"items_total\": 0,\n \"shipping_method\": null,\n \"items_shipped\": 0,\n \"ext_shipping_detail_id\": 44370,\n \"line_items\": [\n {\n \"item_name\": \"Crumpler Bag\",\n \"sku\": \"90907\",\n \"bin_picking_number\": null,\n \"weight_in_ounces\": \"46.08\",\n \"quantity\": 1,\n \"total_excluding_tax\": \"0.00\",\n \"price_excluding_tax\": \"89.95\",\n \"unit_price\": \"89.95\",\n \"ext_line_item_id\": \"90908\",\n \"ext_product_id\": \"1018\",\n \"product_options\": null\n },\n {\n \"item_name\": \"Downloadable - Office for PC\",\n \"sku\": \"90909\",\n \"bin_picking_number\": null,\n \"weight_in_ounces\": \"36.8\",\n \"quantity\": 1,\n \"total_excluding_tax\": \"0.00\",\n \"price_excluding_tax\": \"0.00\",\n \"unit_price\": \"0.00\",\n \"ext_line_item_id\": \"90910\",\n \"ext_product_id\": \"1037\",\n \"product_options\": null\n }\n ]\n }\n ],\n \"store_api_key\": null\n }\n], \"meta\": {\n \"current_page\": 1,\n \"next_page\": 2,\n \"prev_page\": null,\n \"total_pages\": 17,\n \"total_count\": 17,\n \"last_updated_at\": \"2014-02-21T14:54:07Z\",\n \"status\": [\"ready_for_shipment\", \"shipped\"]\n}}", "language": "ruby" } ] } [/block] [block:api-header] { "type": "basic", "title": "Filtering Results" } [/block] Results may be filtered on a number of parameters. ## Example [block:code] { "codes": [ { "code": "filters = {page: 1, per_page: 1, status: [\"ready_for_shipment\", \"shipped\"], last_updated_at: \"2014-05-07 14:42:18 UTC\"}\n\nShippingEasy::Resources::Order.find_all(filters)", "language": "ruby" } ] } [/block] ## Filtering options [block:parameters] { "data": { "0-0": "page", "0-1": "*Integer*\n\nThe page to return in the paginated result set. \n\n*Default to 1.*", "1-0": "per_page", "2-0": "last_updated_at", "3-0": "status", "4-0": "page", "1-1": "*Integer*\n\nThe number of result to include per pagein the paginated result set. \n\n*Defaults to 50 if not specified and the maximum number of results returned per page is 200*.", "2-1": "*Datetime*\n\nFilters the results by the orders' last updated at timestamp and only returns results with a timestamp newer than or equal to the specified value. \n\n*Defaults to 1 week ago if not specified. The maxiumum time this value can be set to is 3 months ago.*", "3-1": "*String* or *Array*\n\nFilters the results by the orders' ShippingEasy order status. \n\n*Defaults to \"shipped\". *\n\nPossible values: \n* shipped\n* ready_for_shipment\n* pending\n* cleared\n\nIt is possible to pass an array of statuses, e.g. [\"shipping\", \"ready_for_shipment\"].", "h-0": "Name", "h-1": "Description" }, "cols": 2, "rows": 4 } [/block] [block:api-header] { "type": "basic", "title": "Exceptions" } [/block] [block:parameters] { "data": { "h-0": "Exception", "h-1": "Description", "0-0": "ShippingEasy::AccessDeniedError", "1-0": "ShippingEasy::InvalidRequestError", "0-1": "Your credentials could not be authenticated or the store api_key could not be found.", "1-1": "The orders could not retrieved for one or more of the following reasons:\n\n* The API timestamp could not be parsed.\n\nThe exception will contain a message that indicates which of these conditions failed." }, "cols": 2, "rows": 2 } [/block]