{"_id":"54cc2149380ecd0d00ca18be","project":"5436a1e1d0ffee0e00f18f8c","category":{"_id":"54cc2149380ecd0d00ca18b2","project":"5436a1e1d0ffee0e00f18f8c","__v":2,"version":"54cc2148380ecd0d00ca18aa","pages":["54cc2149380ecd0d00ca18bc","54cc2149380ecd0d00ca18bd","54cc2149380ecd0d00ca18be","54cc2149380ecd0d00ca18bf","54cc2149380ecd0d00ca18c0","54cc2149380ecd0d00ca18c1","54cc2149380ecd0d00ca18c2","55cbcc534cf2180d00bb1bf4"],"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-30T14:26:30.616Z","from_sync":false,"order":7,"slug":"php-client","title":"PHP client"},"user":"5436a1afb7cf0e1c0020d9ca","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"},"__v":4,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2014-10-30T14:31:02.772Z","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 with a ShippingEasy order ID specified. To instead use your store's order ID, call findByStore().\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n$order = new ShippingEasy_Order();\\n$order->find(876);\",\n      \"language\": \"php\",\n      \"name\": \"Find by ShippingEasy ID\"\n    },\n    {\n      \"code\": \"<?php\\n$order = new ShippingEasy_Order(\\\"XXXX\\\");\\n$order->findByStore(\\\"ABC123\\\");\",\n      \"language\": \"php\",\n      \"name\": \"Find by external order identifier (store ID)\"\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\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Possible Exceptions\"\n}\n[/block]\n## ShippingEasy_AuthenticationError\nYour credentials could not be authenticated.\n\n## ShippingEasy_InvalidRequestError\nThe 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* The requested resource could not be found.\n\nThe exception will contain a message that indicates which of these conditions failed.","excerpt":"","slug":"php-finding-an-order","type":"basic","title":"Finding an order"}
To retrieve a specific order, call the find method on the Order resource class with a ShippingEasy order ID specified. To instead use your store's order ID, call findByStore(). [block:code] { "codes": [ { "code": "<?php\n$order = new ShippingEasy_Order();\n$order->find(876);", "language": "php", "name": "Find by ShippingEasy ID" }, { "code": "<?php\n$order = new ShippingEasy_Order(\"XXXX\");\n$order->findByStore(\"ABC123\");", "language": "php", "name": "Find by external order identifier (store ID)" } ] } [/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": "json" } ] } [/block] [block:api-header] { "type": "basic", "title": "Possible Exceptions" } [/block] ## ShippingEasy_AuthenticationError Your credentials could not be authenticated. ## ShippingEasy_InvalidRequestError The order could not be created on the server for one or more of the following reasons: * The API timestamp could not be parsed. * The requested resource could not be found. The exception will contain a message that indicates which of these conditions failed.