{
  "info": {
    "_postman_id": "bb4841a4-b339-472a-9872-f810c96fb29d",
    "name": "LionWheel API",
    "description": "###### For full documentation visit https://github.com/lionwheel/api",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "item": [
    {
      "name": "Create Delivery",
      "request": {
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"pickup_at\": \"13/05/2022\",\n    \"company_id\": \"1\",\n    \"notes\": \"Delivery notes\",\n    \"original_order_id\": \"541b\",\n    \"source_city\": \"\",\n    \"source_street\": \"\",\n    \"source_number\": \"\",\n    \"source_zip_code\": \"\",\n    \"source_floor\": \"\",\n    \"source_apartment\": \"\",\n    \"source_notes\": \"\",\n    \"source_recipient_name\": \"\",\n    \"source_phone\": \"\",\n    \"source_email\": \"\",\n    \"source_latitude\": \"\",\n    \"source_longitude\": \"\",\n    \"destination_city\": \"Tel Aviv\",\n    \"destination_street\": \"\",\n    \"destination_number\": \"\",\n    \"destination_zip_code\": \"\",\n    \"destination_floor\": \"\",\n    \"destination_apartment\": \"\",\n    \"destination_notes\": \"\",\n    \"destination_recipient_name\": \"\",\n    \"destination_phone\": \"\",\n    \"destination_phone2\": \"\",\n    \"destination_email\": \"\",\n    \"destination_latitude\": \"\",\n    \"destination_longitude\": \"\",\n    \"delivery_method\": \"\",\n    \"greeting\": \"\",\n    \"gifter_name\": \"\",\n    \"gifter_phone\": \"\",\n    \"is_roundtrip\": false,\n    \"packages_quantity\": 1,\n    \"money_collect\": 100,\n    \"is_self_pickup\": false,\n    \"earliest\": \"\",\n    \"latest\": \"\",\n    \"line_items\": [\n        {\n            \"name\": \"orange\",\n            \"quantity\": 6,\n            \"price\": \"11.99\"\n        },\n        {\n            \"name\": \"apple\",\n            \"quantity\": 8,\n            \"price\": \"11.99\"\n        }\n    ],\n    \"urgency\": 0,\n    \"driver_id\": \"\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{url}}/api/v1/tasks/create",
          "host": [
            "{{url}}"
          ],
          "path": [
            "api",
            "v1",
            "tasks",
            "create"
          ]
        },
        "description": "**Fields in bold are mandatory**\n\nField name | type | description\n------------ | ------------- | -------------\n**pickup_at** | DateTime | delivery date (defaults to the current day)\ncompany_id | integer | the company id to which the task should be associated\nnotes | string | general delivery notes\n**original_order_id** | string | id in external system, should be unique\nsource_city | string | \nsource_street | string | \nsource_number | string | \nsource_zip_code | string |  zip or postal code\nsource_floor | string | \nsource_apartment | string | \nsource_notes | string | \nsource_recipient_name | string | \nsource_phone | string | \nsource_email | string |\nsource_latitude | float | providing it will override address geolocation\nsource_longitude | float | providing it will override address geolocation\n**destination_city** | string |\n**destination_street** | string |\n**destination_number** | string |\ndestination_zip_code | string | zip or postal code\ndestination_floor | string |\ndestination_apartment | string |\ndestination_notes | string |\n**destination_recipient_name** | string |\n**destination_phone** | string |\ndestination_phone2 | string |\ndestination_email | string | \ndestination_latitude | float | providing it will override address geolocation\ndestination_longitude | float | providing it will override address geolocation\ndelivery_method | string | \ngreeting | string | \ngifter_name | string | \ngifter_phone | string | \nis_roundtrip | boolean | \npackages_quantity | integer | \nmoney_collect | integer | amount in cents, $3 should be 300\nis_self_pickup | boolean\nearliest | Time | earliest bound of time window\nlatest | Time | latest bound of time window\nline_items | json | Json of the content of the task <br> Supported fields: <br> name - string <br> quantity - string <br> sku - string <br> price - string <br> weight - string <br> variant - string <br> notes - string <br> `[{\"name\":\"orange\",\"quantity\":\"6\", \"price\": \"11.99\"}, {\"name\":\"apple\",\"quantity\":\"8\", \"price\": \"10.99\"}]`\nurgency | integer | REGULAR: 0 <br> URGENT: 1 <br> SUPER_URGENT: 2\ndriver_id | integer | assigned driver"
      },
      "response": []
    },
    {
      "name": "Get Delivery",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{url}}/api/v1/tasks/show/:task_id",
          "host": [
            "{{url}}"
          ],
          "path": [
            "api",
            "v1",
            "tasks",
            "show",
            ":task_id"
          ],
          "variable": [
            {
              "key": "task_id",
              "value": ""
            }
          ]
        }
      },
      "response": []
    },
    {
      "name": "Get Deliveries by Order id",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{url}}/api/v1/tasks/by_order_id/:order_id",
          "host": [
            "{{url}}"
          ],
          "path": [
            "api",
            "v1",
            "tasks",
            "by_order_id",
            ":order_id"
          ],
          "variable": [
            {
              "key": "order_id",
              "value": ""
            }
          ]
        }
      },
      "response": []
    },
    {
      "name": "Update Delivery",
      "request": {
        "method": "PUT",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"driver_id\": \"1\",\n    \"pickup_at\": \"13/05/2022\",\n    \"status\": \"1\" \n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{url}}/api/v1/tasks/:task_id/update",
          "host": [
            "{{url}}"
          ],
          "path": [
            "api",
            "v1",
            "tasks",
            ":task_id",
            "update"
          ],
          "variable": [
            {
              "key": "task_id",
              "value": ""
            }
          ]
        },
        "description": "Field name | type | description\n------------ | ------------- | -------------\ndriver_id | integer | driver that is assigned on the task\npickup_at | date | date of the task\nstatus | integer | UNASSIGNED: 0 <br> ASSIGNED: 1 <br> ACTIVE: 2 <br> COMPLETED: 3 <br> CANCELED: 4 <br> ROUNDTRIP_DELIVERED: 5 <br> FAILED: 8"
      },
      "response": []
    },
    {
      "name": "Get Daily Route",
      "protocolProfileBehavior": {
        "disableBodyPruning": true
      },
      "request": {
        "method": "GET",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"date\": \"13/05/2022\" \n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{url}}/api/v1/drivers/:driver_id/daily_route",
          "host": [
            "{{url}}"
          ],
          "path": [
            "api",
            "v1",
            "drivers",
            ":driver_id",
            "daily_route"
          ],
          "variable": [
            {
              "key": "driver_id",
              "value": ""
            }
          ]
        },
        "description": "Field name | type | description\n------------ | ------------- | -------------\ndate | DateTime | route date (defaults to the current day)"
      },
      "response": []
    },
    {
      "name": "Get Visit",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{url}}/api/v1/visits/:visit_id",
          "host": [
            "{{url}}"
          ],
          "path": [
            "api",
            "v1",
            "visits",
            ":visit_id"
          ],
          "variable": [
            {
              "key": "visit_id",
              "value": ""
            }
          ]
        }
      },
      "response": []
    },
    {
      "name": "Update Visit",
      "request": {
        "method": "PUT",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"driver_id\": \"3\",\n    \"visit_at\": \"13/05/2022\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{url}}/api/v1/visits/:visit_id",
          "host": [
            "{{url}}"
          ],
          "path": [
            "api",
            "v1",
            "visits",
            ":visit_id"
          ],
          "variable": [
            {
              "key": "visit_id",
              "value": ""
            }
          ]
        },
        "description": "Field name | type | description\n------------ | ------------- | -------------\ndriver_id | integer | driver that is assigned on the visit\nvisit_at | date | date of the visit"
      },
      "response": []
    }
  ],
  "auth": {
    "type": "apikey",
    "apikey": [
      {
        "key": "value",
        "value": "",
        "type": "string"
      },
      {
        "key": "key",
        "value": "key",
        "type": "string"
      },
      {
        "key": "in",
        "value": "query",
        "type": "string"
      }
    ]
  },
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "type": "text/javascript",
        "exec": [
          ""
        ]
      }
    },
    {
      "listen": "test",
      "script": {
        "type": "text/javascript",
        "exec": [
          ""
        ]
      }
    }
  ],
  "variable": [
    {
      "key": "url",
      "value": "https://members.lionwheel.com"
    }
  ]
}
