---
agentTools:
  projectIndex: https://docs.qdelivery.app/llms.txt
---

# Solve

## Available profiles

| Country    | Profile       | Description                                                          |
| ---------- | ------------- | -------------------------------------------------------------------- |
| Europe     | car           | Demo car profile.                                                    |
| Türkiye    | tr-car        | Car profile.                                                         |
| Türkiye    | tr-truck      | Truck profile that can only use the 1st and 2nd bridges in Istanbul. |
| Türkiye    | tr-truck-fsmb | Truck profile that can only use the 2nd bridge (FSM) in Istanbul.    |
| Azerbaijan | az-car        | Car profile.                                                         |
| Azerbaijan | az-truck      | Truck profile.                                                       |

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Integration",
    "version": "1.6.1"
  },
  "servers": [
    {
      "url": "https://api.dev.qdelivery.app/api/integration"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "x-bearer-format": "bearer"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/routing/solve": {
      "post": {
        "summary": "Solve",
        "description": "",
        "operationId": "solve",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "vehicles"
                ],
                "properties": {
                  "vehicles": {
                    "type": "array",
                    "description": "List of vehicles to be included in the routing",
                    "items": {
                      "properties": {
                        "id": {
                          "type": "integer",
                          "description": "Vehicle id.",
                          "format": "int32"
                        },
                        "profile": {
                          "type": "string",
                          "description": "Routing profile. Available profiles car, tr-car, tr-truck, tr-truck-fsmb, az-car, az-truck. Please check the available profiles table."
                        },
                        "description": {
                          "type": "string"
                        },
                        "start": {
                          "type": "array",
                          "description": "Starting coordinates of the vehicle in [lon, lat] format. If you want it to start from the first task, do not include them.",
                          "default": [],
                          "items": {
                            "type": "number",
                            "format": "double"
                          }
                        },
                        "end": {
                          "type": "array",
                          "description": "Ending coordinates of the vehicle in [lon, lat] format. If you want it to end at the last task, do not include them.",
                          "default": [],
                          "items": {
                            "type": "number",
                            "format": "double"
                          }
                        },
                        "capacity": {
                          "type": "array",
                          "description": "A multidimensional array expressing capacity. For example, you can provide it as [quantity] or [quantity, weight, volume], such as [5] or [5, 60, 33]. The number of elements and their order in the array must be the same as what you provided for the task.",
                          "default": [],
                          "items": {
                            "type": "integer",
                            "format": "int32"
                          }
                        },
                        "speed_factor": {
                          "type": "number",
                          "description": "A double value in the range (0, 5] used to scale all vehicle travel times (defaults to 1.), the respected precision is limited to two digits after the decimal point. For example, 1.2 means the vehicle should be 20% faster than its normal profile speed.",
                          "default": 1,
                          "format": "double"
                        },
                        "max_tasks": {
                          "type": "integer",
                          "description": "Maximum number of tasks in a route for this vehicle.",
                          "format": "int32"
                        },
                        "max_travel_time": {
                          "type": "integer",
                          "description": "Maximum travel time in seconds for the vehicle.",
                          "format": "int32"
                        },
                        "max_distance": {
                          "type": "integer",
                          "description": "Maximum travel distance in meters for the vehicle.",
                          "format": "int32"
                        },
                        "time_window": {
                          "type": "array",
                          "description": "Vehicle operating hours in the format [unix_timestamp, unix_timestamp]. If you do not want time restrictions, do not include them.",
                          "default": [],
                          "items": {
                            "type": "integer",
                            "format": "int32"
                          }
                        },
                        "skills": {
                          "type": "array",
                          "description": "This parameter is primarily used to ensure that only vehicles with certain skills can handle specific jobs or shipments, which might have particular requirements or constraints. e.g. [2, 45]. A vehicle can only be assigned to a job if it possesses all the skills required by that job.",
                          "default": [],
                          "items": {
                            "type": "integer",
                            "format": "int32"
                          }
                        },
                        "cost": {
                          "type": "object",
                          "properties": {
                            "fixed": {
                              "type": "integer",
                              "description": "Integer defining the cost of using this vehicle in the solution.",
                              "default": 0,
                              "format": "int32"
                            },
                            "per_hour": {
                              "type": "integer",
                              "description": "Integer defining the cost for one hour of travel time with this vehicle.",
                              "default": 3600,
                              "format": "int32"
                            },
                            "per_km": {
                              "type": "integer",
                              "description": "Integer defining the cost for one km of travel time with this vehicle.",
                              "default": 0,
                              "format": "int32"
                            }
                          }
                        },
                        "break": {
                          "type": "array",
                          "description": "Defines mandatory or optional rest periods for vehicles during their routes, including the duration and timing of each break. These breaks ensure compliance with regulations and improve driver well-being by scheduling necessary pauses in the journey.",
                          "items": {
                            "properties": {
                              "id": {
                                "type": "integer",
                                "format": "int32"
                              },
                              "time_windows": {
                                "type": "string",
                                "description": "An array of time_window objects describing valid slots for break start. Should be array of arrays like [[unix_timestamp, unix_timestamp]] e.g [[1600419600, 1600423200]]",
                                "format": "json"
                              },
                              "service": {
                                "type": "integer",
                                "description": "Break duration in seconds",
                                "default": 0,
                                "format": "int32"
                              },
                              "description": {
                                "type": "string"
                              },
                              "max_load": {
                                "type": "array",
                                "description": "An array of integers describing the maximum vehicle load for which this break can happen. Size of array and order should be consistent with vehicle capacity. .e.g [2, 44, 65]",
                                "default": [],
                                "items": {
                                  "type": "integer",
                                  "format": "int32"
                                }
                              }
                            },
                            "required": [
                              "id"
                            ],
                            "type": "object"
                          }
                        },
                        "steps": {
                          "type": "array",
                          "description": "An array detailing the sequence of locations and activities for a vehicle's route, including start, job visits, and end points.",
                          "items": {
                            "properties": {
                              "type": {
                                "type": "string",
                                "description": "Task type. Available values are start, job, pickup, delivery, break or end."
                              },
                              "id": {
                                "type": "integer",
                                "description": "id of the task to be performed at this step if type value is job, pickup, delivery or break",
                                "format": "int32"
                              }
                            },
                            "required": [
                              "type"
                            ],
                            "type": "object"
                          }
                        }
                      },
                      "required": [
                        "id",
                        "profile"
                      ],
                      "type": "object"
                    }
                  },
                  "jobs": {
                    "type": "array",
                    "items": {
                      "properties": {
                        "id": {
                          "type": "integer",
                          "format": "int32"
                        },
                        "description": {
                          "type": "string"
                        },
                        "location": {
                          "type": "array",
                          "description": "Coordinates in [lon,lat] format.",
                          "default": [],
                          "items": {
                            "type": "number",
                            "format": "double"
                          }
                        },
                        "setup": {
                          "type": "integer",
                          "description": "Job setup duration in seconds.",
                          "default": 0,
                          "format": "int32"
                        },
                        "service": {
                          "type": "integer",
                          "description": "Job service duration in seconds.",
                          "default": 0,
                          "format": "int32"
                        },
                        "delivery": {
                          "type": "array",
                          "description": "Multidimensional quantities to deliver from the route start. Size of array should be consistent with vehicle capacity.",
                          "default": [],
                          "items": {
                            "type": "integer",
                            "format": "int32"
                          }
                        },
                        "pickup": {
                          "type": "array",
                          "description": "Multidimensional quantities to pickup to the route end. Size of array should be consistent with vehicle capacity.",
                          "default": [],
                          "items": {
                            "type": "integer",
                            "format": "int32"
                          }
                        },
                        "skills": {
                          "type": "array",
                          "description": "Mandatory skills for this job. A job without skills can be served by any vehicle.",
                          "default": [],
                          "items": {
                            "type": "integer",
                            "format": "int32"
                          }
                        },
                        "priority": {
                          "type": "integer",
                          "description": "Job priority level between 0 and 100. Setting a high priority value for some tasks will tend as much as possible to have them included in the solution over lower-priority tasks.",
                          "default": 0,
                          "format": "int32"
                        },
                        "time_windows": {
                          "type": "string",
                          "description": "Valid slots for job service start. Omit if no timing constraint applies. Should be array of array of integers (unix timestamps)",
                          "format": "json"
                        }
                      },
                      "required": [
                        "id",
                        "location"
                      ],
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "6602b1495613fc002042a788:66bf405938ff2e00550dac3f"
}
```