{"action":"created","issue":{"url":"https://api.github.com/repos/woothemes/woocommerce/issues/7140","labels_url":"https://api.github.com/repos/woothemes/woocommerce/issues/7140/labels{/name}","comments_url":"https://api.github.com/repos/woothemes/woocommerce/issues/7140/comments","events_url":"https://api.github.com/repos/woothemes/woocommerce/issues/7140/events","html_url":"https://github.com/woothemes/woocommerce/issues/7140","id":54686575,"number":7140,"title":"REST API Warning when creating an order with a fee line","user":{"login":"madianas","id":7828566,"avatar_url":"https://avatars.githubusercontent.com/u/7828566?v=3","gravatar_id":"","url":"https://api.github.com/users/madianas","html_url":"https://github.com/madianas","followers_url":"https://api.github.com/users/madianas/followers","following_url":"https://api.github.com/users/madianas/following{/other_user}","gists_url":"https://api.github.com/users/madianas/gists{/gist_id}","starred_url":"https://api.github.com/users/madianas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madianas/subscriptions","organizations_url":"https://api.github.com/users/madianas/orgs","repos_url":"https://api.github.com/users/madianas/repos","events_url":"https://api.github.com/users/madianas/events{/privacy}","received_events_url":"https://api.github.com/users/madianas/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-18T05:13:02Z","updated_at":"2015-01-19T11:28:46Z","closed_at":"2015-01-19T11:28:46Z","body":"When creating an order via with a fee line via REST API, I get the following warning:\r\n\r\n```\r\n<br />\r\n<b>Warning</b>:  array_map(): Argument #2 should be an array in <b>html/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php</b> on line <b>412</b><br />\r\n```\r\nThe order is still created with fee lines, however I believe fee line taxes are not saved properly due to this warning.\r\n\r\nTo reproduce pass POST request to https://site/wc-api/v2/orders? with this in the body:\r\n\r\n```{\r\n  \"order\": {\r\n    \"order_number\": \"90519\",\r\n    \"customer_id\": \"2\",\r\n    \"shipping_lines\": [\r\n      {\r\n        \"method_id\": \"flat_rate\",\r\n        \"method_title\": \"Delivery\",\r\n        \"total\": \"123.2000\"\r\n      }\r\n    ],\r\n    \"fee_lines\": [\r\n      {\r\n        \"title\": \"OPT KITCHEN\",\r\n        \"total\": \"3186.0000\",\r\n        \"taxable\": true,\r\n        \"tax_class\": \"standard\",\r\n        \"total_tax\": \"414.180000\"\r\n      },\r\n      {\r\n        \"title\": \"Customer Discount Per Line\",\r\n        \"total\": \"-2102.7600\"\r\n      }\r\n    ]\r\n  }\r\n}```\r\n\r\nI am trying to add fee lines with tax"},"comment":{"url":"https://api.github.com/repos/woothemes/woocommerce/issues/comments/70479569","html_url":"https://github.com/woothemes/woocommerce/issues/7140#issuecomment-70479569","issue_url":"https://api.github.com/repos/woothemes/woocommerce/issues/7140","id":70479569,"user":{"login":"mikejolley","id":90977,"avatar_url":"https://avatars.githubusercontent.com/u/90977?v=3","gravatar_id":"","url":"https://api.github.com/users/mikejolley","html_url":"https://github.com/mikejolley","followers_url":"https://api.github.com/users/mikejolley/followers","following_url":"https://api.github.com/users/mikejolley/following{/other_user}","gists_url":"https://api.github.com/users/mikejolley/gists{/gist_id}","starred_url":"https://api.github.com/users/mikejolley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikejolley/subscriptions","organizations_url":"https://api.github.com/users/mikejolley/orgs","repos_url":"https://api.github.com/users/mikejolley/repos","events_url":"https://api.github.com/users/mikejolley/events{/privacy}","received_events_url":"https://api.github.com/users/mikejolley/received_events","type":"User","site_admin":false},"created_at":"2015-01-19T11:28:45Z","updated_at":"2015-01-19T11:28:45Z","body":"There is a workaround in 2.3 where it sets the tax_data array. This should be passed in though (it's an array of tax lines). Example https://github.com/woothemes/woocommerce/blob/master/includes/class-wc-cart.php#L1979"}}