{"_id":"544ea1facf9f860800800c94","category":{"_id":"544ea1c9cf9f860800800c8d","version":"5436a1e1d0ffee0e00f18f8f","__v":1,"pages":["544ea1facf9f860800800c94"],"project":"5436a1e1d0ffee0e00f18f8c","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-27T19:49:29.797Z","from_sync":false,"order":8,"slug":"making-requests-via-curl","title":"Making requests via curl"},"user":"5436a1afb7cf0e1c0020d9ca","githubsync":"","project":"5436a1e1d0ffee0e00f18f8c","version":{"_id":"5436a1e1d0ffee0e00f18f8f","project":"5436a1e1d0ffee0e00f18f8c","__v":12,"createdAt":"2014-10-09T14:55:29.536Z","releaseDate":"2014-10-09T14:55:29.536Z","categories":["5436a1e1d0ffee0e00f18f90","5436aa49d0ffee0e00f18ff1","5436aa50d0ffee0e00f18ff2","5436aa57b7cf0e1c0020da41","543979262e0fd70e00ec643a","54495081cdc9442200488577","54495092cdc9442200488579","544950ff3acc37080099e74f","544ea1a4cf9f860800800c8c","544ea1c9cf9f860800800c8d","54524a9604160008005b1cf2","5453c1e008d1800800473e4a"],"is_deprecated":true,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"","version_clean":"1.0.0","version":"1.0"},"__v":3,"is_link":false,"updates":["54be9f27ffb79c320030daec"],"next":{"pages":[],"description":""},"createdAt":"2014-10-27T19:50:18.862Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"basic_auth":false,"results":{"codes":[]},"try":true,"auth":"never","params":[],"url":""},"isReference":false,"order":0,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Before starting\"\n}\n[/block]\nAs with all ShippingEasy API calls, you will need to [calculate a signature](http://shippingeasy.readme.io/docs/authentication-signing-requests) to authenticate each request.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Examples\"\n}\n[/block]\n## Creating an order\n\n````shell\ncurl -H \"Content-Type: application/json\" --data :::at:::body.json \"https://app.shippingeasy.com/api/stores/27aa472e16faa83dd13b7758d31974ed/orders?api_key=f9a7c8ebdfd34beaf260d9b0296c7059&api_timestamp=1401803554&api_signature=c65f43beed46e581939898a78acd10064cfa146845e97885ec02124d7ad648e4\"\n````\n\nAn example body.json can be found here:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{ \\\"order\\\": \\n   {\\n      \\\"external_order_identifier\\\":\\\"ABC-100\\\",\\n      \\\"ordered_at\\\":\\\"2014-01-16 14:37:56 -0600\\\",\\n      \\\"order_status\\\":\\\"awaiting_shipment\\\",\\n      \\\"subtotal_including_tax\\\":\\\"10.00\\\",\\n      \\\"total_including_tax\\\":\\\"10.00\\\",\\n      \\\"total_excluding_tax\\\":\\\"10.00\\\",\\n      \\\"discount_amount\\\":\\\"0.00\\\",\\n      \\\"coupon_discount\\\":\\\"1.00\\\",\\n      \\\"subtotal_including_tax\\\":\\\"0.00\\\",\\n      \\\"subtotal_excluding_tax\\\":\\\"0.00\\\",\\n      \\\"subtotal_excluding_tax\\\":\\\"0.00\\\",\\n      \\\"subtotal_tax\\\":\\\"0.00\\\",\\n      \\\"total_tax\\\":\\\"0\\\",\\n      \\\"base_shipping_cost\\\":\\\"0.00\\\",\\n      \\\"shipping_cost_including_tax\\\":\\\"0.00\\\",\\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      \\\"notes\\\":\\\"Please send promptly.\\\",\\n      \\\"billing_company\\\":\\\"Acme Inc.\\\",\\n      \\\"billing_first_name\\\":\\\"Fred\\\",\\n      \\\"billing_last_name\\\":\\\"Jones\\\",\\n      \\\"billing_address\\\":\\\"1234 Street\\\",\\n      \\\"billing_address2\\\":\\\"Suite 100\\\",\\n      \\\"billing_city\\\":\\\"Austin\\\",\\n      \\\"billing_state\\\":\\\"TX\\\",\\n      \\\"billing_postal_code\\\":\\\"78701\\\",\\n      \\\"billing_country\\\":\\\"USA\\\",\\n      \\\"billing_phone_number\\\":\\\"512-123-1234\\\",\\n      \\\"billing_email\\\":\\\"test@test.com\\\",\\n      \\\"recipients\\\":[{\\n         \\\"first_name\\\":\\\"Colin\\\",\\n         \\\"last_name\\\":\\\"Homenick\\\",\\n         \\\"company\\\":\\\"Wintheiser-Hickle\\\",\\n         \\\"email\\\":\\\"charles.crona@okeefe.org\\\",\\n         \\\"phone_number\\\":\\\"637-481-6505\\\",\\n         \\\"residential\\\":\\\"true\\\",\\n         \\\"address\\\":\\\"21937 Adelbert Springs\\\",\\n         \\\"address2\\\":\\\"\\\",\\n         \\\"province\\\":\\\"\\\",\\n         \\\"state\\\":\\\"CT\\\",\\n         \\\"city\\\":\\\"Terryfurt\\\",\\n         \\\"postal_code\\\":\\\"93322\\\",\\n         \\\"postal_code_plus_4\\\":\\\"1234\\\",\\n         \\\"country\\\":\\\"Andorra\\\",\\n         \\\"shipping_method\\\":\\\"Ground\\\",\\n         \\\"base_cost\\\":\\\"10.00\\\",\\n         \\\"cost_excluding_tax\\\":\\\"10.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\\\":\\\"123\\\",\\n         \\\"shipping_zone_name\\\":\\\"XYZ\\\",\\n         \\\"items_total\\\":\\\"1\\\",\\n         \\\"items_shipped\\\":\\\"0\\\",\\n         \\\"line_items\\\":[{\\n            \\\"item_name\\\":\\\"Pencil Holder\\\",\\n            \\\"sku\\\":\\\"9876543\\\",\\n            \\\"bin_picking_number\\\":\\\"7\\\",\\n            \\\"unit_price\\\":\\\"1.30\\\",\\n            \\\"total_excluding_tax\\\":\\\"1.30\\\",\\n            \\\"weight_in_ounces\\\":\\\"10\\\",\\n            \\\"product_options\\\":{\\n               \\\"pa_size\\\":\\\"large\\\",\\n               \\\"Colour\\\":\\\"Blue\\\"\\n            },\\n            \\\"quantity\\\":\\\"1\\\"\\n         }]\\n      }]\\n   }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"body.json\"\n    }\n  ]\n}\n[/block]\n## Cancelling an order\n\n````shell\ncurl -X POST \"https://app.shippingeasy.com/api/stores/86eac265e87ea9a74a86fe248f2e79d2/orders/ABC123/cancellations?api_key=XXX&api_signature=c24c5118a2b2af27557af721145991594d00a0d914f0d9bc2b9a2fa26efb30cc&api_timestamp=1409173624\"\n````\n\n## Searching orders\n\n````shell\ncurl \"https://app.shippingeasy.com/api/orders?api_key=XXX&api_signature=a6ab10918d435ad2abfbbe6004dc2fc7faac62a291f4d66e4a36e5a654d15a54&api_timestamp=1409174329&page=3&per_page=10&status%5B%5D=ready_for_shipment&status%5B%5D=shipped\"\n````","excerpt":"","slug":"creating-a-signature","type":"basic","title":"Example requests"}
[block:api-header] { "type": "basic", "title": "Before starting" } [/block] As with all ShippingEasy API calls, you will need to [calculate a signature](http://shippingeasy.readme.io/docs/authentication-signing-requests) to authenticate each request. [block:api-header] { "type": "basic", "title": "Examples" } [/block] ## Creating an order ````shell curl -H "Content-Type: application/json" --data @body.json "https://app.shippingeasy.com/api/stores/27aa472e16faa83dd13b7758d31974ed/orders?api_key=f9a7c8ebdfd34beaf260d9b0296c7059&api_timestamp=1401803554&api_signature=c65f43beed46e581939898a78acd10064cfa146845e97885ec02124d7ad648e4" ```` An example body.json can be found here: [block:code] { "codes": [ { "code": "{ \"order\": \n {\n \"external_order_identifier\":\"ABC-100\",\n \"ordered_at\":\"2014-01-16 14:37:56 -0600\",\n \"order_status\":\"awaiting_shipment\",\n \"subtotal_including_tax\":\"10.00\",\n \"total_including_tax\":\"10.00\",\n \"total_excluding_tax\":\"10.00\",\n \"discount_amount\":\"0.00\",\n \"coupon_discount\":\"1.00\",\n \"subtotal_including_tax\":\"0.00\",\n \"subtotal_excluding_tax\":\"0.00\",\n \"subtotal_excluding_tax\":\"0.00\",\n \"subtotal_tax\":\"0.00\",\n \"total_tax\":\"0\",\n \"base_shipping_cost\":\"0.00\",\n \"shipping_cost_including_tax\":\"0.00\",\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 \"notes\":\"Please send promptly.\",\n \"billing_company\":\"Acme Inc.\",\n \"billing_first_name\":\"Fred\",\n \"billing_last_name\":\"Jones\",\n \"billing_address\":\"1234 Street\",\n \"billing_address2\":\"Suite 100\",\n \"billing_city\":\"Austin\",\n \"billing_state\":\"TX\",\n \"billing_postal_code\":\"78701\",\n \"billing_country\":\"USA\",\n \"billing_phone_number\":\"512-123-1234\",\n \"billing_email\":\"test@test.com\",\n \"recipients\":[{\n \"first_name\":\"Colin\",\n \"last_name\":\"Homenick\",\n \"company\":\"Wintheiser-Hickle\",\n \"email\":\"charles.crona@okeefe.org\",\n \"phone_number\":\"637-481-6505\",\n \"residential\":\"true\",\n \"address\":\"21937 Adelbert Springs\",\n \"address2\":\"\",\n \"province\":\"\",\n \"state\":\"CT\",\n \"city\":\"Terryfurt\",\n \"postal_code\":\"93322\",\n \"postal_code_plus_4\":\"1234\",\n \"country\":\"Andorra\",\n \"shipping_method\":\"Ground\",\n \"base_cost\":\"10.00\",\n \"cost_excluding_tax\":\"10.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\":\"123\",\n \"shipping_zone_name\":\"XYZ\",\n \"items_total\":\"1\",\n \"items_shipped\":\"0\",\n \"line_items\":[{\n \"item_name\":\"Pencil Holder\",\n \"sku\":\"9876543\",\n \"bin_picking_number\":\"7\",\n \"unit_price\":\"1.30\",\n \"total_excluding_tax\":\"1.30\",\n \"weight_in_ounces\":\"10\",\n \"product_options\":{\n \"pa_size\":\"large\",\n \"Colour\":\"Blue\"\n },\n \"quantity\":\"1\"\n }]\n }]\n }\n}", "language": "json", "name": "body.json" } ] } [/block] ## Cancelling an order ````shell curl -X POST "https://app.shippingeasy.com/api/stores/86eac265e87ea9a74a86fe248f2e79d2/orders/ABC123/cancellations?api_key=XXX&api_signature=c24c5118a2b2af27557af721145991594d00a0d914f0d9bc2b9a2fa26efb30cc&api_timestamp=1409173624" ```` ## Searching orders ````shell curl "https://app.shippingeasy.com/api/orders?api_key=XXX&api_signature=a6ab10918d435ad2abfbbe6004dc2fc7faac62a291f4d66e4a36e5a654d15a54&api_timestamp=1409174329&page=3&per_page=10&status%5B%5D=ready_for_shipment&status%5B%5D=shipped" ````