{"_id":"54cc2149380ecd0d00ca18cc","user":"5436a1afb7cf0e1c0020d9ca","project":"5436a1e1d0ffee0e00f18f8c","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"},"parentDoc":null,"__v":1,"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"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2014-10-23T19:11:38.266Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"never","params":[],"url":""},"isReference":false,"order":2,"body":"To retrieve a specific order, call the find method on the Order resource class.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"ShippingEasy::Resources::Order.find(id: 876)\",\n      \"language\": \"ruby\",\n      \"name\": \"Find by ShippingEasy ID\"\n    },\n    {\n      \"code\": \"ShippingEasy::Resources::Order.find(store_api_key: \\\"xxx\\\", id: \\\"ABC123\\\")\",\n      \"language\": \"ruby\",\n      \"name\": \"Find by external order identifier\"\n    }\n  ]\n}\n[/block]\nIf successful the call will return a JSON hash with the ShippingEasy order:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\\"order\\\": {\\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      \"language\": \"ruby\"\n    }\n  ]\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    \"0-0\": \"ShippingEasy::AccessDeniedError\",\n    \"0-1\": \"Your credentials could not be authenticated or the store api_key could not be found.\",\n    \"1-0\": \"ShippingEasy::ResourceNotFoundError\",\n    \"1-1\": \"The requested resource could not be found.\",\n    \"h-1\": \"Description\",\n    \"2-0\": \"ShippingEasy::InvalidRequestError\",\n    \"2-1\": \"The order could not be created on the server 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\": 3\n}\n[/block]","excerpt":"","slug":"finding-an-order","type":"basic","title":"Finding an order"}
To retrieve a specific order, call the find method on the Order resource class. [block:code] { "codes": [ { "code": "ShippingEasy::Resources::Order.find(id: 876)", "language": "ruby", "name": "Find by ShippingEasy ID" }, { "code": "ShippingEasy::Resources::Order.find(store_api_key: \"xxx\", id: \"ABC123\")", "language": "ruby", "name": "Find by external order identifier" } ] } [/block] If successful the call will return a JSON hash with the ShippingEasy order: [block:code] { "codes": [ { "code": "{\"order\": {\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}}", "language": "ruby" } ] } [/block] [block:api-header] { "type": "basic", "title": "Exceptions" } [/block] [block:parameters] { "data": { "h-0": "Exception", "0-0": "ShippingEasy::AccessDeniedError", "0-1": "Your credentials could not be authenticated or the store api_key could not be found.", "1-0": "ShippingEasy::ResourceNotFoundError", "1-1": "The requested resource could not be found.", "h-1": "Description", "2-0": "ShippingEasy::InvalidRequestError", "2-1": "The order could not be created on the server 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": 3 } [/block]