{"_id":"5951d6719df513001b1dec99","project":"56f962d8d522d81700600280","version":{"_id":"56f962d8d522d81700600283","hasDoc":true,"__v":5,"hasReference":true,"project":"56f962d8d522d81700600280","createdAt":"2016-03-28T16:59:04.166Z","releaseDate":"2016-03-28T16:59:04.166Z","categories":["56f962d8d522d81700600284","5951d5489435c30015923d54","5951d6de50727a00155053c6","5951d99224e2f70015dec6c6","5951e40ef5c137001533814b"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"category":{"_id":"5951d5489435c30015923d54","project":"56f962d8d522d81700600280","version":"56f962d8d522d81700600283","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-06-27T03:47:20.769Z","from_sync":false,"order":1,"slug":"tasks","title":"Reference"},"user":"57736a020a6d610e00dea1fd","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-06-27T03:52:17.365Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"Tasks represent units of work, defined by one destination and one recipient, that administrators create and assign to drivers for completion.\n\nTask assignment, state are important concepts that you should understand well prior to using the task endpoints.\n\n**Task Assignment**\nOnce tasks are created, you must assign them to an entity for further management or completion.\nIf you don't assign task , the task will be automatically assigned to the creator organization and appear as unassigned in the dashboard. To assign a task to an executing connected organization, drag and drop task to an entity.\n\n**State**\nIn addition to the parameters detailed for each endpoint in this section, tasks also have a special property state to help you understand the task's most recent status. The following integer values are valid task states:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Value\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"1\",\n    \"1-0\": \"6\",\n    \"2-0\": \"7\",\n    \"3-0\": \"9\",\n    \"4-0\": \"10\",\n    \"0-1\": \"Unassigned: task has not yet been assigned to a driver.\",\n    \"1-1\": \"Assigned: task has been assigned to a driver.\",\n    \"2-1\": \"In Transit: task has been started by its assigned driver.\",\n    \"3-1\": \"Completed: task has been completed by its assigned driver.\",\n    \"4-1\": \"Failed: task has been cancelled by its assigned driver.\"\n  },\n  \"cols\": 2,\n  \"rows\": 5\n}\n[/block]\n\n[block:html]\n{\n  \"html\": \"<span style=\\\"background-color: #248FB2; color:white; padding-left:5px; padding-right:5px;\\\">Post</span>\\n<a href=\\\"https://docs.wimo.ae/docs/create-task-1\\\">Create Task</a>\"\n}\n[/block]\n\nBody parameters:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"awb\",\n    \"0-1\": \"String\",\n    \"0-2\": \"Awb for the task.\",\n    \"1-0\": \"details\",\n    \"1-1\": \"String\",\n    \"1-2\": \"Details for the task.\",\n    \"2-0\": \"address\",\n    \"2-1\": \"Object\",\n    \"2-2\": \"The task's address.\\nContain the information such as: address, city, area, country, streetNumber, streetName, lat, lng.\",\n    \"3-0\": \"customer\",\n    \"3-1\": \"Object\",\n    \"3-2\": \"The task's customer.\\nContain the information as: name, phone.\",\n    \"4-0\": \"pickupTask\",\n    \"4-1\": \"Boolean\",\n    \"4-2\": \"Whether the task is a pickup task.\",\n    \"5-0\": \"totalPrice\",\n    \"5-1\": \"Integer\",\n    \"5-2\": \"The total amount that the customer must pay for this task.\",\n    \"6-0\": \"paymentTypeId\",\n    \"6-1\": \"Integer\",\n    \"6-2\": \"Whether the orders are paid by cash or credit card.\\n1: cash\\n2: credit card\",\n    \"7-0\": \"completeAfter\",\n    \"7-1\": \"String\",\n    \"7-2\": \"The Task must be completed after this time.\",\n    \"8-0\": \"completeBefore\",\n    \"8-1\": \"String\",\n    \"8-2\": \"The Task must be completed before this time.\"\n  },\n  \"cols\": 3,\n  \"rows\": 9\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl --request POST \\\\\\n  --url https://be.wimo.ae:3001/api/v1/tasks \\\\\\n  --header 'authorization: 95de9ce1f12861dca3335cc87b5cfd90' \\\\\\n  --data '{\\\"awb\\\":\\\"1234\\\",\\\"details\\\":\\\"Test Order\\\",\\\"address\\\":{\\\"address\\\":\\\"01 Nguyen Van Linh, Da Nang, Viet Nam\\\",\\\"city\\\":\\\"Da Nang\\\",\\\"area\\\":\\\"Da Nang\\\",\\\"country\\\":\\\"VN\\\",\\\"streetNumber\\\":\\\"69\\\",\\\"streetName\\\":\\\"Nguyen Van Linh\\\",\\\"lat\\\":16,\\\"lng\\\":108},\\\"customer\\\":{\\\"name\\\":\\\"Customer 01\\\",\\\"phone\\\":\\\"+84938123456\\\"},\\\"pickupTask\\\":true,\\\"totalPrice\\\":100,\\\"paymentTypeId\\\":1,\\\"completeAfter\\\":\\\"2016-12-16 09:00:00\\\",\\\"completeBefore\\\":\\\"2016-12-17 09:00:00\\\"}'\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"success\\\": true,\\n    \\\"task\\\": {\\n        \\\"id\\\": 197712,\\n        \\\"awb\\\": \\\"1498548004\\\",\\n        \\\"details\\\": \\\"Test Order 1498548004\\\",\\n        \\\"customerNotes\\\": null,\\n        \\\"totalPrice\\\": 100,\\n        \\\"leftToBePaid\\\": 100,\\n        \\\"currency\\\": \\\"AED\\\",\\n        \\\"inventory\\\": null,\\n        \\\"priority\\\": 9189,\\n        \\\"cancelReason\\\": null,\\n        \\\"quantity\\\": null,\\n        \\\"eta\\\": 0,\\n        \\\"etaText\\\": null,\\n        \\\"serviceTime\\\": null,\\n        \\\"uuid\\\": \\\"BJnmvFk4Z\\\",\\n        \\\"startedAt\\\": null,\\n        \\\"completedAt\\\": null,\\n        \\\"lastLocationLat\\\": null,\\n        \\\"lastLocationLng\\\": null,\\n        \\\"collectPayment\\\": true,\\n        \\\"completeBefore\\\": \\\"2017-12-17T09:00:00.000Z\\\",\\n        \\\"completeAfter\\\": \\\"2016-12-16T09:00:00.000Z\\\",\\n        \\\"pickupTask\\\": true,\\n        \\\"arrivalTime\\\": null,\\n        \\\"mobileTaskForm\\\": null,\\n        \\\"sendNotifications\\\": true,\\n        \\\"createdAt\\\": \\\"2017-06-27T07:20:04.000Z\\\",\\n        \\\"updatedAt\\\": \\\"2017-06-27T07:20:04.000Z\\\",\\n        \\\"ownerId\\\": 5400,\\n        \\\"fulfillerId\\\": 5400,\\n        \\\"userId\\\": null,\\n        \\\"teamId\\\": null,\\n        \\\"customerId\\\": 991,\\n        \\\"statusId\\\": 1,\\n        \\\"paymentTypeId\\\": 1,\\n        \\\"owner\\\": {\\n            \\\"id\\\": 5400,\\n            \\\"name\\\": \\\"bahaa:::at:::wimo.ae\\\",\\n            \\\"logo\\\": \\\"company-logos/1498537973478-ct-symbol.jpg\\\",\\n            \\\"email\\\": \\\"ahmed@wimo.ae\\\",\\n            \\\"phone\\\": null\\n        },\\n        \\\"fulfiller\\\": {\\n            \\\"id\\\": 5400,\\n            \\\"name\\\": \\\"bahaa@wimo.ae\\\",\\n            \\\"logo\\\": \\\"company-logos/1498537973478-ct-symbol.jpg\\\",\\n            \\\"email\\\": \\\"ahmed@wimo.ae\\\",\\n            \\\"phone\\\": null\\n        },\\n        \\\"user\\\": null,\\n        \\\"team\\\": null,\\n        \\\"customer\\\": {\\n            \\\"id\\\": 991,\\n            \\\"name\\\": \\\"Customer 01\\\",\\n            \\\"address\\\": null,\\n            \\\"addressSecondLine\\\": null,\\n            \\\"email\\\": null,\\n            \\\"phone\\\": \\\"+971501234567\\\",\\n            \\\"lat\\\": null,\\n            \\\"lng\\\": null,\\n            \\\"createdAt\\\": \\\"2017-04-27T08:15:50.000Z\\\",\\n            \\\"updatedAt\\\": \\\"2017-04-27T08:15:50.000Z\\\",\\n            \\\"companyId\\\": 5400\\n        },\\n        \\\"status\\\": {\\n            \\\"id\\\": 1,\\n            \\\"name\\\": \\\"Unassigned\\\"\\n        },\\n        \\\"paymentType\\\": {\\n            \\\"id\\\": 1,\\n            \\\"name\\\": \\\"Collect Cash\\\"\\n        },\\n        \\\"address\\\": {\\n            \\\"lat\\\": 16,\\n            \\\"lng\\\": 108,\\n            \\\"address\\\": \\\"Street 4 - Dubai - United Arab Emirates\\\",\\n            \\\"addressSecondLine\\\": null,\\n            \\\"city\\\": \\\"Dubai\\\",\\n            \\\"area\\\": \\\"Discovery Gardens\\\",\\n            \\\"country\\\": \\\"AE\\\",\\n            \\\"streetNumber\\\": \\\"4\\\",\\n            \\\"streetName\\\": \\\"Street 4\\\",\\n            \\\"postalCode\\\": null\\n        },\\n        \\\"notes\\\": [],\\n        \\\"feedbacks\\\": [],\\n        \\\"dependencies\\\": []\\n    }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:html]\n{\n  \"html\": \"<span style=\\\"background-color: #9B708B; color:white; padding-left:5px; padding-right:5px;\\\">Put</span>\\n<a href=\\\"https://docs.wimo.ae/docs/update-task-by-awb\\\">Update Task By AWB</a>\"\n}\n[/block]\nBody Paramaters:\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"awb\",\n    \"0-1\": \"String\",\n    \"0-2\": \"Awb for the task.\",\n    \"1-0\": \"details\",\n    \"1-1\": \"String\",\n    \"1-2\": \"Details for the task.\",\n    \"2-0\": \"address\",\n    \"2-2\": \"The task's address.\\nContain the information such as: address, city, area, country, streetNumber, streetName, lat, lng.\",\n    \"2-1\": \"Object\",\n    \"3-0\": \"customer\",\n    \"3-2\": \"The task's customer.\\nContain the information as: name, phone.\",\n    \"3-1\": \"Object\",\n    \"4-0\": \"pickupTask\",\n    \"4-2\": \"Whether the task is a pickup task.\",\n    \"4-1\": \"Boolean\",\n    \"5-0\": \"totalPrice\",\n    \"5-1\": \"Integer\",\n    \"5-2\": \"The total amount that the customer must pay for this task.\",\n    \"6-0\": \"paymentTypeId\",\n    \"6-2\": \"Whether the orders are paid by cash or credit card.\\n1: cash\\n2: credit card\",\n    \"6-1\": \"Integer\",\n    \"7-0\": \"completeAfter\",\n    \"7-2\": \"The Task must be completed after this time.\",\n    \"7-1\": \"String\",\n    \"8-0\": \"completeBefore\",\n    \"8-1\": \"String\",\n    \"8-2\": \"The Task must be completed before this time.\",\n    \"h-2\": \"Description\",\n    \"h-0\": \"Name\",\n    \"h-1\": \"Type\"\n  },\n  \"cols\": 3,\n  \"rows\": 9\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl --request POST \\\\\\n  --url https://be.wimo.ae:3001/api/v1/tasks \\\\\\n  --header 'authorization: 95de9ce1f12861dca3335cc87b5cfd90' \\\\\\n  --data '{\\\"awb\\\":\\\"1234\\\",\\\"details\\\":\\\"Test Order\\\",\\\"address\\\":{\\\"address\\\":\\\"01 Nguyen Van Linh, Da Nang, Viet Nam\\\",\\\"city\\\":\\\"Da Nang\\\",\\\"area\\\":\\\"Da Nang\\\",\\\"country\\\":\\\"VN\\\",\\\"streetNumber\\\":\\\"69\\\",\\\"streetName\\\":\\\"Nguyen Van Linh\\\",\\\"lat\\\":16,\\\"lng\\\":108},\\\"customer\\\":{\\\"name\\\":\\\"Customer 01\\\",\\\"phone\\\":\\\"+84938123456\\\"},\\\"pickupTask\\\":true,\\\"totalPrice\\\":100,\\\"paymentTypeId\\\":1,\\\"completeAfter\\\":\\\"2016-12-16 09:00:00\\\",\\\"completeBefore\\\":\\\"2016-12-17 09:00:00\\\"}'\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"success\\\": true,\\n    \\\"task\\\": {\\n        \\\"id\\\": 356996,\\n        \\\"awb\\\": \\\"1\\\",\\n        \\\"details\\\": \\\"Tests\\\",\\n        \\\"customerNotes\\\": null,\\n        \\\"totalPrice\\\": 0,\\n        \\\"leftToBePaid\\\": 0,\\n        \\\"deliveryPrice\\\": null,\\n        \\\"currency\\\": \\\"USD\\\",\\n        \\\"inventory\\\": null,\\n        \\\"priority\\\": 130,\\n        \\\"cancelReason\\\": \\\"\\\",\\n        \\\"quantity\\\": 0,\\n        \\\"sentETA\\\": false,\\n        \\\"eta\\\": 1,\\n        \\\"etaText\\\": null,\\n        \\\"serviceTime\\\": 0,\\n        \\\"uuid\\\": \\\"SkW0Qak7b\\\",\\n        \\\"startedAt\\\": \\\"2017-06-23T02:37:38.924Z\\\",\\n        \\\"completedAt\\\": \\\"2017-06-23T02:38:10.980Z\\\",\\n        \\\"lastLocationLat\\\": 37.421998333333335,\\n        \\\"lastLocationLng\\\": -122.08400000000002,\\n        \\\"collectPayment\\\": false,\\n        \\\"completeBefore\\\": null,\\n        \\\"completeAfter\\\": null,\\n        \\\"pickupTask\\\": false,\\n        \\\"arrivalTime\\\": null,\\n        \\\"mobileTaskForm\\\": \\\"[{\\\\\\\"field_key\\\\\\\":\\\\\\\"field key\\\\\\\",\\\\\\\"answer\\\\\\\":\\\\\\\"\\\\\\\"},{\\\\\\\"field_key\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"answer\\\\\\\":\\\\\\\"1\\\\\\\"},{\\\\\\\"field_key\\\\\\\":\\\\\\\"user_email\\\\\\\",\\\\\\\"answer\\\\\\\":\\\\\\\"Test\\\\\\\"},{\\\\\\\"field_key\\\\\\\":\\\\\\\"true\\\\\\\",\\\\\\\"answer\\\\\\\":true}]\\\",\\n        \\\"createdAt\\\": \\\"2017-06-15T08:22:33.000Z\\\",\\n        \\\"updatedAt\\\": \\\"2017-08-15T04:01:32.000Z\\\",\\n        \\\"ownerId\\\": 1,\\n        \\\"fulfillerId\\\": 1,\\n        \\\"userId\\\": 4,\\n        \\\"teamId\\\": null,\\n        \\\"customerId\\\": null,\\n        \\\"statusId\\\": 9,\\n        \\\"paymentTypeId\\\": 1,\\n        \\\"fulfiller\\\": {\\n            \\\"id\\\": 1,\\n            \\\"name\\\": \\\"Nikmesoft\\\",\\n            \\\"logo\\\": \\\"\\\",\\n            \\\"email\\\": \\\"nikmesoft@gmail.com\\\",\\n            \\\"phone\\\": \\\"0938765299\\\",\\n            \\\"paying\\\": true\\n        },\\n        \\\"user\\\": {\\n            \\\"id\\\": 4,\\n            \\\"name\\\": \\\"michaelll\\\",\\n            \\\"avatar\\\": \\\"user-avatars/1500952863933-e0870f3d-07e5-47df-8047-09d9ebf1e8f5.png\\\",\\n            \\\"email\\\": null,\\n            \\\"phone\\\": \\\"+841222976366\\\",\\n            \\\"inShift\\\": true,\\n            \\\"status\\\": 1\\n        },\\n        \\\"team\\\": null,\\n        \\\"customer\\\": null,\\n        \\\"status\\\": {\\n            \\\"id\\\": 9,\\n            \\\"name\\\": \\\"Succeeded\\\"\\n        },\\n        \\\"paymentType\\\": {\\n            \\\"id\\\": 1,\\n            \\\"name\\\": \\\"Collect Cash\\\"\\n        },\\n        \\\"address\\\": {\\n            \\\"id\\\": 356892,\\n            \\\"lat\\\": 37.421998333333335,\\n            \\\"lng\\\": -122.08400000000002,\\n            \\\"address\\\": \\\"test23356789911\\\",\\n            \\\"addressSecondLine\\\": \\\"\\\",\\n            \\\"city\\\": \\\"\\\",\\n            \\\"area\\\": \\\"\\\",\\n            \\\"country\\\": \\\"\\\",\\n            \\\"streetNumber\\\": \\\"\\\",\\n            \\\"streetName\\\": \\\"\\\",\\n            \\\"postalCode\\\": \\\"\\\"\\n        }\\n    }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:html]\n{\n  \"html\": \"<span style=\\\"background-color: #9B708B; color:white; padding-left:5px; padding-right:5px;\\\">Put</span>\\n<a href=\\\"https://docs.wimo.ae/docs/force-complete-task\\\">Force Complete Task</a>\"\n}\n[/block]\nComplete the task assigned to driver.\n\n\nBody Paramaters:\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"success\",\n    \"0-1\": \"Boolean\",\n    \"0-2\": \"Whether the task is a completed task or a failed task.\",\n    \"1-0\": \"failureReason\",\n    \"1-1\": \"String\",\n    \"1-2\": \"The reason for cancellation.\",\n    \"h-0\": \"Name\",\n    \"h-1\": \"Value\",\n    \"h-2\": \"Description\"\n  },\n  \"cols\": 3,\n  \"rows\": 2\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl --request PUT \\\\\\n  --url https://be.wimo.ae:3001/api/v1/tasks/awb/111/forceComplete \\\\\\n  --header 'authorization: 95de9ce1f12861dca3335cc87b5cfd90' \\\\\\n  --data '{\\\"success\\\":\\\"true\\\",\\\"failureReason\\\":\\\"reason\\\"}'\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"success\\\": true,\\n    \\\"task\\\": {\\n        \\\"id\\\": 197712,\\n        \\\"awb\\\": \\\"1498548004\\\",\\n        \\\"details\\\": \\\"Test Order 1498548004\\\",\\n        \\\"customerNotes\\\": null,\\n        \\\"totalPrice\\\": 100,\\n        \\\"leftToBePaid\\\": 100,\\n        \\\"currency\\\": \\\"AED\\\",\\n        \\\"inventory\\\": null,\\n        \\\"priority\\\": 9189,\\n        \\\"cancelReason\\\": null,\\n        \\\"quantity\\\": null,\\n        \\\"eta\\\": 0,\\n        \\\"etaText\\\": null,\\n        \\\"serviceTime\\\": null,\\n        \\\"uuid\\\": \\\"BJnmvFk4Z\\\",\\n        \\\"startedAt\\\": null,\\n        \\\"completedAt\\\": null,\\n        \\\"lastLocationLat\\\": null,\\n        \\\"lastLocationLng\\\": null,\\n        \\\"collectPayment\\\": true,\\n        \\\"completeBefore\\\": \\\"2017-12-17T09:00:00.000Z\\\",\\n        \\\"completeAfter\\\": \\\"2016-12-16T09:00:00.000Z\\\",\\n        \\\"pickupTask\\\": true,\\n        \\\"arrivalTime\\\": null,\\n        \\\"mobileTaskForm\\\": null,\\n        \\\"sendNotifications\\\": true,\\n        \\\"createdAt\\\": \\\"2017-06-27T07:20:04.000Z\\\",\\n        \\\"updatedAt\\\": \\\"2017-06-27T07:20:04.000Z\\\",\\n        \\\"ownerId\\\": 5400,\\n        \\\"fulfillerId\\\": 5400,\\n        \\\"userId\\\": null,\\n        \\\"teamId\\\": null,\\n        \\\"customerId\\\": 991,\\n        \\\"statusId\\\": 9,\\n        \\\"paymentTypeId\\\": 1,\\n        \\\"owner\\\": {\\n            \\\"id\\\": 5400,\\n            \\\"name\\\": \\\"bahaa@wimo.ae\\\",\\n            \\\"logo\\\": \\\"company-logos/1498537973478-ct-symbol.jpg\\\",\\n            \\\"email\\\": \\\"ahmed@wimo.ae\\\",\\n            \\\"phone\\\": null        \\n        },\\n        \\\"fulfiller\\\": {\\n            \\\"id\\\": 5400,\\n            \\\"name\\\": \\\"bahaa@wimo.ae\\\",\\n            \\\"logo\\\": \\\"company-logos/1498537973478-ct-symbol.jpg\\\",\\n            \\\"email\\\": \\\"ahmed@wimo.ae\\\",\\n            \\\"phone\\\": null\\n        },\\n        \\\"user\\\": null,\\n        \\\"team\\\": null,\\n        \\\"customer\\\": {\\n            \\\"id\\\": 991,\\n            \\\"name\\\": \\\"Customer 01\\\",\\n            \\\"address\\\": null,\\n            \\\"addressSecondLine\\\": null,\\n            \\\"email\\\": null,\\n            \\\"phone\\\": \\\"+971501234567\\\",\\n            \\\"lat\\\": null,\\n            \\\"lng\\\": null,\\n            \\\"createdAt\\\": \\\"2017-04-27T08:15:50.000Z\\\",\\n            \\\"updatedAt\\\": \\\"2017-04-27T08:15:50.000Z\\\",\\n            \\\"companyId\\\": 5400\\n        },\\n        \\\"status\\\": {\\n            \\\"id\\\": 1,\\n            \\\"name\\\": \\\"Unassigned\\\"\\n        },\\n        \\\"paymentType\\\": {\\n            \\\"id\\\": 1,\\n            \\\"name\\\": \\\"Collect Cash\\\"\\n        },\\n        \\\"address\\\": {\\n            \\\"lat\\\": 16,\\n            \\\"lng\\\": 108,\\n            \\\"address\\\": \\\"Street 4 - Dubai - United Arab Emirates\\\",\\n            \\\"addressSecondLine\\\": null,\\n            \\\"city\\\": \\\"Dubai\\\",\\n            \\\"area\\\": \\\"Discovery Gardens\\\",\\n            \\\"country\\\": \\\"AE\\\",\\n            \\\"streetNumber\\\": \\\"4\\\",\\n            \\\"streetName\\\": \\\"Street 4\\\",\\n            \\\"postalCode\\\": null\\n        },\\n        \\\"notes\\\": [],\\n        \\\"feedbacks\\\": [],\\n        \\\"dependencies\\\": []\\n    }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:html]\n{\n  \"html\": \"<span style=\\\"background-color: #248FB2; color:white; padding-left:5px; padding-right:5px;\\\">Post</span>\\n<a href=\\\"https://docs.wimo.ae/docs/bulk-unassign-tasks-by-awbs-1\\\">Bulk Unassign Tasks by AWBs</a>\"\n}\n[/block]\nBulk Unassign Tasks that you assigned to driver before.\n\nBody parameters\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"tasks\",\n    \"0-1\": \"Integer array\",\n    \"0-2\": \"An array of awbs\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl --request POST \\\\\\n  --url https://be.wimo.ae:3001/api/v1/tasks/bulkUnassign \\\\\\n  --header 'authorization: 95de9ce1f12861dca3335cc87b5cfd90' \\\\\\n  --data '{\\\"tasks\\\":[\\\"1156\\\"]}'\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"success\\\": true,\\n  \\\"tasks\\\": [\\n    {\\n      \\\"id\\\": 197713,\\n      \\\"statusId\\\": 1\\n    }\\n  ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:html]\n{\n  \"html\": \"<span style=\\\"background-color: #248FB2; color:white; padding-left:5px; padding-right:5px;\\\">Post</span>\\n<a href=\\\"https://docs.wimo.ae/docs/bulk-unassign-tasks-by-task-id\\\">Bulk Unassign Tasks by Task Id</a>\"\n}\n[/block]\nBody parameters\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"tasks\",\n    \"0-1\": \"Integer array\",\n    \"0-2\": \"An array of task Ids\",\n    \"h-0\": \"Name\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl --request POST \\\\\\n  --url https://be.wimo.ae:3001/api/v1/drivers/4/tasks/bulkAssign \\\\\\n  --header 'authorization: 319743994e9e0394ea69d86b68cf79d9' \\\\\\n  --data '{\\\"tasks\\\":[\\\"516770\\\"]}'\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"success\\\": true,\\n  \\\"results\\\": [\\n    {\\n      \\\"id\\\": 516770,\\n      \\\"success\\\": true\\n    }\\n  ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"create-task","type":"basic","title":"Tasks"}
Tasks represent units of work, defined by one destination and one recipient, that administrators create and assign to drivers for completion. Task assignment, state are important concepts that you should understand well prior to using the task endpoints. **Task Assignment** Once tasks are created, you must assign them to an entity for further management or completion. If you don't assign task , the task will be automatically assigned to the creator organization and appear as unassigned in the dashboard. To assign a task to an executing connected organization, drag and drop task to an entity. **State** In addition to the parameters detailed for each endpoint in this section, tasks also have a special property state to help you understand the task's most recent status. The following integer values are valid task states: [block:parameters] { "data": { "h-0": "Value", "h-1": "Description", "0-0": "1", "1-0": "6", "2-0": "7", "3-0": "9", "4-0": "10", "0-1": "Unassigned: task has not yet been assigned to a driver.", "1-1": "Assigned: task has been assigned to a driver.", "2-1": "In Transit: task has been started by its assigned driver.", "3-1": "Completed: task has been completed by its assigned driver.", "4-1": "Failed: task has been cancelled by its assigned driver." }, "cols": 2, "rows": 5 } [/block] [block:html] { "html": "<span style=\"background-color: #248FB2; color:white; padding-left:5px; padding-right:5px;\">Post</span>\n<a href=\"https://docs.wimo.ae/docs/create-task-1\">Create Task</a>" } [/block] Body parameters: [block:parameters] { "data": { "h-0": "Name", "h-1": "Type", "h-2": "Description", "0-0": "awb", "0-1": "String", "0-2": "Awb for the task.", "1-0": "details", "1-1": "String", "1-2": "Details for the task.", "2-0": "address", "2-1": "Object", "2-2": "The task's address.\nContain the information such as: address, city, area, country, streetNumber, streetName, lat, lng.", "3-0": "customer", "3-1": "Object", "3-2": "The task's customer.\nContain the information as: name, phone.", "4-0": "pickupTask", "4-1": "Boolean", "4-2": "Whether the task is a pickup task.", "5-0": "totalPrice", "5-1": "Integer", "5-2": "The total amount that the customer must pay for this task.", "6-0": "paymentTypeId", "6-1": "Integer", "6-2": "Whether the orders are paid by cash or credit card.\n1: cash\n2: credit card", "7-0": "completeAfter", "7-1": "String", "7-2": "The Task must be completed after this time.", "8-0": "completeBefore", "8-1": "String", "8-2": "The Task must be completed before this time." }, "cols": 3, "rows": 9 } [/block] [block:code] { "codes": [ { "code": "curl --request POST \\\n --url https://be.wimo.ae:3001/api/v1/tasks \\\n --header 'authorization: 95de9ce1f12861dca3335cc87b5cfd90' \\\n --data '{\"awb\":\"1234\",\"details\":\"Test Order\",\"address\":{\"address\":\"01 Nguyen Van Linh, Da Nang, Viet Nam\",\"city\":\"Da Nang\",\"area\":\"Da Nang\",\"country\":\"VN\",\"streetNumber\":\"69\",\"streetName\":\"Nguyen Van Linh\",\"lat\":16,\"lng\":108},\"customer\":{\"name\":\"Customer 01\",\"phone\":\"+84938123456\"},\"pickupTask\":true,\"totalPrice\":100,\"paymentTypeId\":1,\"completeAfter\":\"2016-12-16 09:00:00\",\"completeBefore\":\"2016-12-17 09:00:00\"}'", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "{\n \"success\": true,\n \"task\": {\n \"id\": 197712,\n \"awb\": \"1498548004\",\n \"details\": \"Test Order 1498548004\",\n \"customerNotes\": null,\n \"totalPrice\": 100,\n \"leftToBePaid\": 100,\n \"currency\": \"AED\",\n \"inventory\": null,\n \"priority\": 9189,\n \"cancelReason\": null,\n \"quantity\": null,\n \"eta\": 0,\n \"etaText\": null,\n \"serviceTime\": null,\n \"uuid\": \"BJnmvFk4Z\",\n \"startedAt\": null,\n \"completedAt\": null,\n \"lastLocationLat\": null,\n \"lastLocationLng\": null,\n \"collectPayment\": true,\n \"completeBefore\": \"2017-12-17T09:00:00.000Z\",\n \"completeAfter\": \"2016-12-16T09:00:00.000Z\",\n \"pickupTask\": true,\n \"arrivalTime\": null,\n \"mobileTaskForm\": null,\n \"sendNotifications\": true,\n \"createdAt\": \"2017-06-27T07:20:04.000Z\",\n \"updatedAt\": \"2017-06-27T07:20:04.000Z\",\n \"ownerId\": 5400,\n \"fulfillerId\": 5400,\n \"userId\": null,\n \"teamId\": null,\n \"customerId\": 991,\n \"statusId\": 1,\n \"paymentTypeId\": 1,\n \"owner\": {\n \"id\": 5400,\n \"name\": \"bahaa@wimo.ae\",\n \"logo\": \"company-logos/1498537973478-ct-symbol.jpg\",\n \"email\": \"ahmed@wimo.ae\",\n \"phone\": null\n },\n \"fulfiller\": {\n \"id\": 5400,\n \"name\": \"bahaa@wimo.ae\",\n \"logo\": \"company-logos/1498537973478-ct-symbol.jpg\",\n \"email\": \"ahmed@wimo.ae\",\n \"phone\": null\n },\n \"user\": null,\n \"team\": null,\n \"customer\": {\n \"id\": 991,\n \"name\": \"Customer 01\",\n \"address\": null,\n \"addressSecondLine\": null,\n \"email\": null,\n \"phone\": \"+971501234567\",\n \"lat\": null,\n \"lng\": null,\n \"createdAt\": \"2017-04-27T08:15:50.000Z\",\n \"updatedAt\": \"2017-04-27T08:15:50.000Z\",\n \"companyId\": 5400\n },\n \"status\": {\n \"id\": 1,\n \"name\": \"Unassigned\"\n },\n \"paymentType\": {\n \"id\": 1,\n \"name\": \"Collect Cash\"\n },\n \"address\": {\n \"lat\": 16,\n \"lng\": 108,\n \"address\": \"Street 4 - Dubai - United Arab Emirates\",\n \"addressSecondLine\": null,\n \"city\": \"Dubai\",\n \"area\": \"Discovery Gardens\",\n \"country\": \"AE\",\n \"streetNumber\": \"4\",\n \"streetName\": \"Street 4\",\n \"postalCode\": null\n },\n \"notes\": [],\n \"feedbacks\": [],\n \"dependencies\": []\n }\n}", "language": "json" } ] } [/block] [block:html] { "html": "<span style=\"background-color: #9B708B; color:white; padding-left:5px; padding-right:5px;\">Put</span>\n<a href=\"https://docs.wimo.ae/docs/update-task-by-awb\">Update Task By AWB</a>" } [/block] Body Paramaters: [block:parameters] { "data": { "0-0": "awb", "0-1": "String", "0-2": "Awb for the task.", "1-0": "details", "1-1": "String", "1-2": "Details for the task.", "2-0": "address", "2-2": "The task's address.\nContain the information such as: address, city, area, country, streetNumber, streetName, lat, lng.", "2-1": "Object", "3-0": "customer", "3-2": "The task's customer.\nContain the information as: name, phone.", "3-1": "Object", "4-0": "pickupTask", "4-2": "Whether the task is a pickup task.", "4-1": "Boolean", "5-0": "totalPrice", "5-1": "Integer", "5-2": "The total amount that the customer must pay for this task.", "6-0": "paymentTypeId", "6-2": "Whether the orders are paid by cash or credit card.\n1: cash\n2: credit card", "6-1": "Integer", "7-0": "completeAfter", "7-2": "The Task must be completed after this time.", "7-1": "String", "8-0": "completeBefore", "8-1": "String", "8-2": "The Task must be completed before this time.", "h-2": "Description", "h-0": "Name", "h-1": "Type" }, "cols": 3, "rows": 9 } [/block] [block:code] { "codes": [ { "code": "curl --request POST \\\n --url https://be.wimo.ae:3001/api/v1/tasks \\\n --header 'authorization: 95de9ce1f12861dca3335cc87b5cfd90' \\\n --data '{\"awb\":\"1234\",\"details\":\"Test Order\",\"address\":{\"address\":\"01 Nguyen Van Linh, Da Nang, Viet Nam\",\"city\":\"Da Nang\",\"area\":\"Da Nang\",\"country\":\"VN\",\"streetNumber\":\"69\",\"streetName\":\"Nguyen Van Linh\",\"lat\":16,\"lng\":108},\"customer\":{\"name\":\"Customer 01\",\"phone\":\"+84938123456\"},\"pickupTask\":true,\"totalPrice\":100,\"paymentTypeId\":1,\"completeAfter\":\"2016-12-16 09:00:00\",\"completeBefore\":\"2016-12-17 09:00:00\"}'", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "{\n \"success\": true,\n \"task\": {\n \"id\": 356996,\n \"awb\": \"1\",\n \"details\": \"Tests\",\n \"customerNotes\": null,\n \"totalPrice\": 0,\n \"leftToBePaid\": 0,\n \"deliveryPrice\": null,\n \"currency\": \"USD\",\n \"inventory\": null,\n \"priority\": 130,\n \"cancelReason\": \"\",\n \"quantity\": 0,\n \"sentETA\": false,\n \"eta\": 1,\n \"etaText\": null,\n \"serviceTime\": 0,\n \"uuid\": \"SkW0Qak7b\",\n \"startedAt\": \"2017-06-23T02:37:38.924Z\",\n \"completedAt\": \"2017-06-23T02:38:10.980Z\",\n \"lastLocationLat\": 37.421998333333335,\n \"lastLocationLng\": -122.08400000000002,\n \"collectPayment\": false,\n \"completeBefore\": null,\n \"completeAfter\": null,\n \"pickupTask\": false,\n \"arrivalTime\": null,\n \"mobileTaskForm\": \"[{\\\"field_key\\\":\\\"field key\\\",\\\"answer\\\":\\\"\\\"},{\\\"field_key\\\":\\\"1\\\",\\\"answer\\\":\\\"1\\\"},{\\\"field_key\\\":\\\"user_email\\\",\\\"answer\\\":\\\"Test\\\"},{\\\"field_key\\\":\\\"true\\\",\\\"answer\\\":true}]\",\n \"createdAt\": \"2017-06-15T08:22:33.000Z\",\n \"updatedAt\": \"2017-08-15T04:01:32.000Z\",\n \"ownerId\": 1,\n \"fulfillerId\": 1,\n \"userId\": 4,\n \"teamId\": null,\n \"customerId\": null,\n \"statusId\": 9,\n \"paymentTypeId\": 1,\n \"fulfiller\": {\n \"id\": 1,\n \"name\": \"Nikmesoft\",\n \"logo\": \"\",\n \"email\": \"nikmesoft@gmail.com\",\n \"phone\": \"0938765299\",\n \"paying\": true\n },\n \"user\": {\n \"id\": 4,\n \"name\": \"michaelll\",\n \"avatar\": \"user-avatars/1500952863933-e0870f3d-07e5-47df-8047-09d9ebf1e8f5.png\",\n \"email\": null,\n \"phone\": \"+841222976366\",\n \"inShift\": true,\n \"status\": 1\n },\n \"team\": null,\n \"customer\": null,\n \"status\": {\n \"id\": 9,\n \"name\": \"Succeeded\"\n },\n \"paymentType\": {\n \"id\": 1,\n \"name\": \"Collect Cash\"\n },\n \"address\": {\n \"id\": 356892,\n \"lat\": 37.421998333333335,\n \"lng\": -122.08400000000002,\n \"address\": \"test23356789911\",\n \"addressSecondLine\": \"\",\n \"city\": \"\",\n \"area\": \"\",\n \"country\": \"\",\n \"streetNumber\": \"\",\n \"streetName\": \"\",\n \"postalCode\": \"\"\n }\n }\n}", "language": "json" } ] } [/block] [block:html] { "html": "<span style=\"background-color: #9B708B; color:white; padding-left:5px; padding-right:5px;\">Put</span>\n<a href=\"https://docs.wimo.ae/docs/force-complete-task\">Force Complete Task</a>" } [/block] Complete the task assigned to driver. Body Paramaters: [block:parameters] { "data": { "0-0": "success", "0-1": "Boolean", "0-2": "Whether the task is a completed task or a failed task.", "1-0": "failureReason", "1-1": "String", "1-2": "The reason for cancellation.", "h-0": "Name", "h-1": "Value", "h-2": "Description" }, "cols": 3, "rows": 2 } [/block] [block:code] { "codes": [ { "code": "curl --request PUT \\\n --url https://be.wimo.ae:3001/api/v1/tasks/awb/111/forceComplete \\\n --header 'authorization: 95de9ce1f12861dca3335cc87b5cfd90' \\\n --data '{\"success\":\"true\",\"failureReason\":\"reason\"}'", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "{\n \"success\": true,\n \"task\": {\n \"id\": 197712,\n \"awb\": \"1498548004\",\n \"details\": \"Test Order 1498548004\",\n \"customerNotes\": null,\n \"totalPrice\": 100,\n \"leftToBePaid\": 100,\n \"currency\": \"AED\",\n \"inventory\": null,\n \"priority\": 9189,\n \"cancelReason\": null,\n \"quantity\": null,\n \"eta\": 0,\n \"etaText\": null,\n \"serviceTime\": null,\n \"uuid\": \"BJnmvFk4Z\",\n \"startedAt\": null,\n \"completedAt\": null,\n \"lastLocationLat\": null,\n \"lastLocationLng\": null,\n \"collectPayment\": true,\n \"completeBefore\": \"2017-12-17T09:00:00.000Z\",\n \"completeAfter\": \"2016-12-16T09:00:00.000Z\",\n \"pickupTask\": true,\n \"arrivalTime\": null,\n \"mobileTaskForm\": null,\n \"sendNotifications\": true,\n \"createdAt\": \"2017-06-27T07:20:04.000Z\",\n \"updatedAt\": \"2017-06-27T07:20:04.000Z\",\n \"ownerId\": 5400,\n \"fulfillerId\": 5400,\n \"userId\": null,\n \"teamId\": null,\n \"customerId\": 991,\n \"statusId\": 9,\n \"paymentTypeId\": 1,\n \"owner\": {\n \"id\": 5400,\n \"name\": \"bahaa@wimo.ae\",\n \"logo\": \"company-logos/1498537973478-ct-symbol.jpg\",\n \"email\": \"ahmed@wimo.ae\",\n \"phone\": null \n },\n \"fulfiller\": {\n \"id\": 5400,\n \"name\": \"bahaa@wimo.ae\",\n \"logo\": \"company-logos/1498537973478-ct-symbol.jpg\",\n \"email\": \"ahmed@wimo.ae\",\n \"phone\": null\n },\n \"user\": null,\n \"team\": null,\n \"customer\": {\n \"id\": 991,\n \"name\": \"Customer 01\",\n \"address\": null,\n \"addressSecondLine\": null,\n \"email\": null,\n \"phone\": \"+971501234567\",\n \"lat\": null,\n \"lng\": null,\n \"createdAt\": \"2017-04-27T08:15:50.000Z\",\n \"updatedAt\": \"2017-04-27T08:15:50.000Z\",\n \"companyId\": 5400\n },\n \"status\": {\n \"id\": 1,\n \"name\": \"Unassigned\"\n },\n \"paymentType\": {\n \"id\": 1,\n \"name\": \"Collect Cash\"\n },\n \"address\": {\n \"lat\": 16,\n \"lng\": 108,\n \"address\": \"Street 4 - Dubai - United Arab Emirates\",\n \"addressSecondLine\": null,\n \"city\": \"Dubai\",\n \"area\": \"Discovery Gardens\",\n \"country\": \"AE\",\n \"streetNumber\": \"4\",\n \"streetName\": \"Street 4\",\n \"postalCode\": null\n },\n \"notes\": [],\n \"feedbacks\": [],\n \"dependencies\": []\n }\n}", "language": "json" } ] } [/block] [block:html] { "html": "<span style=\"background-color: #248FB2; color:white; padding-left:5px; padding-right:5px;\">Post</span>\n<a href=\"https://docs.wimo.ae/docs/bulk-unassign-tasks-by-awbs-1\">Bulk Unassign Tasks by AWBs</a>" } [/block] Bulk Unassign Tasks that you assigned to driver before. Body parameters [block:parameters] { "data": { "h-0": "Name", "h-1": "Type", "h-2": "Description", "0-0": "tasks", "0-1": "Integer array", "0-2": "An array of awbs" }, "cols": 3, "rows": 1 } [/block] [block:code] { "codes": [ { "code": "curl --request POST \\\n --url https://be.wimo.ae:3001/api/v1/tasks/bulkUnassign \\\n --header 'authorization: 95de9ce1f12861dca3335cc87b5cfd90' \\\n --data '{\"tasks\":[\"1156\"]}'", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "{\n \"success\": true,\n \"tasks\": [\n {\n \"id\": 197713,\n \"statusId\": 1\n }\n ]\n}", "language": "json" } ] } [/block] [block:html] { "html": "<span style=\"background-color: #248FB2; color:white; padding-left:5px; padding-right:5px;\">Post</span>\n<a href=\"https://docs.wimo.ae/docs/bulk-unassign-tasks-by-task-id\">Bulk Unassign Tasks by Task Id</a>" } [/block] Body parameters [block:parameters] { "data": { "0-0": "tasks", "0-1": "Integer array", "0-2": "An array of task Ids", "h-0": "Name", "h-1": "Type", "h-2": "Description" }, "cols": 3, "rows": 1 } [/block] [block:code] { "codes": [ { "code": "curl --request POST \\\n --url https://be.wimo.ae:3001/api/v1/drivers/4/tasks/bulkAssign \\\n --header 'authorization: 319743994e9e0394ea69d86b68cf79d9' \\\n --data '{\"tasks\":[\"516770\"]}'", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "{\n \"success\": true,\n \"results\": [\n {\n \"id\": 516770,\n \"success\": true\n }\n ]\n}", "language": "json" } ] } [/block]