{
  "openapi": "3.1.0",
  "info": {
    "title": "Delivery Platform API",
    "version": "v1",
    "description": "### Introduction\nConnect your on-demand delivery company **or your delivery software platform used by multiple fleets** to Sinqro (consuming Sinqro APIs and listening Sinqro webhooks). Works whether you operate the fleet/logistics or provide the software for partners.\n\n### Getting started\nThe developer account is created with your company account. If you need an account or access issues, contact integrations@sinqro.com.\n\n### API Environments\n- We do not provide a separate test environment. Always use production `https://api.sinqro.com/delivery-platform/v1` with the test data (restaurants/orders/etc.) we enable for you.\n\n### API Security\n- Authorization: header `x-api-server-access-token`\n- Authentication: header `x-api-user-access-token`.\n- Retrieve it via login API service.\n\n### What you can do\n- Manage driver profiles (create/update drivers, documents, availability).\n- Manage deliveries and status updates.\n- Integrate with delivery accounts, contracts, and payment flows.\n\nIntegration case: https://www.sinqro.com/docs/delivery_service_integration\n\n### Accepting or rejecting a delivery\n\nYou accept or reject each new delivery with the HTTP status of your answer to the `new_delivery` webhook: any `2xx` accepts it, any other status rejects it. See the *Delivery created* webhook.\n\n### Drivers are optional\n\nRegistering and assigning drivers in Sinqro is not required for the integration. Do it when you want the restaurant to see who has the delivery and how to contact them; otherwise you can manage the assignment only in your own system."
  },
  "servers": [
    {
      "url": "https://api.sinqro.com/delivery-platform/v1"
    }
  ],
  "tags": [
    {
      "name": "Driver",
      "description": "Services to manage driver user data"
    },
    {
      "name": "Delivery",
      "description": "Services to manage deliveries"
    }
  ],
  "paths": {
    "/drivers": {
      "put": {
        "summary": "Create new driver",
        "description": "Create new driver for given delivery account",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "deliveryAccountId": {
                    "type": "integer",
                    "format": "int64",
                    "description": "Delivery account identifier"
                  },
                  "name": {
                    "type": "string",
                    "description": "Driver name"
                  },
                  "lastname": {
                    "type": "string",
                    "description": "Driver last name"
                  },
                  "phone": {
                    "type": "string",
                    "description": "Driver phone number (international format, e.g. +34600000000)"
                  },
                  "email": {
                    "type": "string",
                    "description": "Driver email"
                  },
                  "image": {
                    "description": "Driver avatar. Send a URL string or an object with filename and base64 data URI.",
                    "oneOf": [
                      {
                        "type": "string",
                        "description": "Image URL"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "filename": {
                            "type": "string"
                          },
                          "data": {
                            "type": "string",
                            "description": "Base64 data URI"
                          }
                        },
                        "required": [
                          "filename",
                          "data"
                        ]
                      }
                    ]
                  }
                },
                "required": [
                  "deliveryAccountId",
                  "name",
                  "lastname"
                ]
              },
              "example": {
                "deliveryAccountId": 123,
                "name": "John",
                "lastname": "Doe",
                "phone": "+34600000000",
                "email": "john@example.com",
                "image": {
                  "filename": "driver.png",
                  "data": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUg..."
                }
              }
            }
          }
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Driver"
                },
                "example": {
                  "id": 1003,
                  "email": "john@example.com",
                  "name": "John",
                  "lastname": "Doe",
                  "image": "https://cdn.sinqro.com/assets/images/placeholder_image.jpg",
                  "phone": "+34600000000",
                  "transport": {
                    "code": "SCOOTER",
                    "name": "Scooter"
                  },
                  "status": {
                    "code": "onduty",
                    "name": "En servicio",
                    "color": "#5aac44"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error/s",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "errors": [
                    {
                      "code": "ERROR_CODE_EXAMPLE",
                      "message": "Error message"
                    }
                  ],
                  "code": "ERROR_CODE_EXAMPLE",
                  "message": "Error message",
                  "httpResponseCode": "400"
                }
              }
            }
          }
        },
        "tags": [
          "Driver"
        ],
        "security": [
          {
            "ServerAccessToken": [],
            "UserAccessToken": []
          }
        ]
      }
    },
    "/deliveries/status": {
      "post": {
        "summary": "Post delivery status",
        "description": "Post delivery status",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "deliveryId": {
                    "type": "integer",
                    "format": "int64",
                    "description": "Sinqro delivery identifier"
                  },
                  "statusCode": {
                    "type": "string",
                    "description": "New delivery status code",
                    "enum": [
                      "WAITING_DRIVER_ACCEPTANCE",
                      "PICKING",
                      "WAITING_SELLING_POINT_PREPARATION",
                      "DELIVERING",
                      "WAITING_CUSTOMER",
                      "DELIVERED",
                      "CANCELLED",
                      "INCIDENT",
                      "ACCEPTED_BY_DRIVER"
                    ]
                  },
                  "silenceErrors": {
                    "type": "boolean",
                    "description": "When true, returns false instead of throwing errors (for async retries)."
                  }
                },
                "required": [
                  "deliveryId",
                  "statusCode"
                ]
              },
              "example": {
                "deliveryId": 123,
                "statusCode": "WAITING_DRIVER_ACCEPTANCE",
                "silenceErrors": false
              }
            }
          }
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Delivery"
                },
                "example": {
                  "id": 1003,
                  "pickupAddress": {
                    "id": 1003,
                    "street": "C/ Example, 23",
                    "details": "Canada building",
                    "city": "City name",
                    "province": "Province name",
                    "postalCode": "12345",
                    "latitude": 41.308166,
                    "longitude": 2.019725,
                    "googlePlaceId": "xxxxxxxxxxxx",
                    "placeName": "C/ Example, 23, City name"
                  },
                  "deliveryAddress": {
                    "id": 1003,
                    "street": "C/ Example, 23",
                    "details": "Canada building",
                    "city": "City name",
                    "province": "Province name",
                    "postalCode": "12345",
                    "latitude": 41.308166,
                    "longitude": 2.019725,
                    "googlePlaceId": "xxxxxxxxxxxx",
                    "placeName": "C/ Example, 23, City name"
                  },
                  "pickupAgreedAt": "2017-02-09T12:00:00+0000",
                  "pickupConfirmedAt": "2017-02-09T12:00:00+0000",
                  "deliveryAgreedAt": "2017-02-09T12:15:00+0000",
                  "deliveryConfirmedAt": "2017-02-09T12:15:00+0000",
                  "pickupInstructions": null,
                  "deliveryInstructions": null,
                  "forSenderInstructions": null,
                  "linearDistance": "1.56",
                  "realDistance": "1.97",
                  "estimatedDeliveryDuration": "15",
                  "status": {
                    "code": "PICKING",
                    "name": "Picking",
                    "color": "blue",
                    "isFinalStatus": false,
                    "callToAction": "Start picking"
                  },
                  "pickupContactName": "John",
                  "pickupContactPhone": "600000000",
                  "pickupContactEmail": "john@example.com",
                  "destinationContactEmail": "jane@example.com",
                  "destinationContactName": "Jane",
                  "destinationContactPhone": "600000000",
                  "deliveryDescription": "Selling point order delivery",
                  "onPickupPayments": [
                    {
                      "id": 1003,
                      "amount": "28.60",
                      "paymentMethodName": "Cash"
                    }
                  ],
                  "onDeliveryPayments": [
                    {
                      "id": 1003,
                      "amount": "28.60",
                      "paymentMethodName": "Cash"
                    }
                  ],
                  "newStatusOptions": [
                    {
                      "code": "PICKING",
                      "name": "Picking",
                      "color": "blue",
                      "isFinalStatus": false,
                      "callToAction": "Start picking"
                    }
                  ],
                  "driver": {
                    "id": 1003,
                    "email": "john@example.com",
                    "name": "John",
                    "lastname": "Doe",
                    "image": "https://cdn.sinqro.com/assets/images/placeholder_image.jpg",
                    "phone": "+34600000000",
                    "transport": {
                      "code": "SCOOTER",
                      "name": "Scooter"
                    },
                    "status": {
                      "code": "onduty",
                      "name": "En servicio",
                      "color": "#5aac44"
                    },
                    "lastGeolocation": {
                      "latitude": 41.308166,
                      "longitude": 2.019725,
                      "createdAt": "2018-03-015T12:15:00+0000"
                    }
                  },
                  "deliveryPrice": 5
                }
              }
            }
          },
          "400": {
            "description": "Error/s",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "errors": [
                    {
                      "code": "ERROR_CODE_EXAMPLE",
                      "message": "Error message"
                    }
                  ],
                  "code": "ERROR_CODE_EXAMPLE",
                  "message": "Error message",
                  "httpResponseCode": "400"
                }
              }
            }
          }
        },
        "tags": [
          "Delivery"
        ],
        "security": [
          {
            "ServerAccessToken": [],
            "UserAccessToken": []
          }
        ]
      }
    },
    "/deliveries/location": {
      "post": {
        "summary": "Post delivery driver location",
        "description": "Update delivery driver location",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "deliveryId": {
                    "type": "integer",
                    "format": "int64",
                    "description": "Sinqro delivery identifier"
                  },
                  "latitude": {
                    "type": "number",
                    "format": "float",
                    "description": "Driver latitude position"
                  },
                  "longitude": {
                    "type": "number",
                    "format": "float",
                    "description": "Driver longitude position"
                  },
                  "silenceErrors": {
                    "type": "boolean",
                    "description": "When true, returns false instead of throwing errors (for async retries)."
                  }
                },
                "required": [
                  "deliveryId",
                  "latitude",
                  "longitude"
                ]
              },
              "example": {
                "deliveryId": 123,
                "latitude": 41.308166,
                "longitude": 2.019725,
                "silenceErrors": false
              }
            }
          }
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Delivery"
                },
                "example": {
                  "id": 1003,
                  "pickupAddress": {
                    "id": 1003,
                    "street": "C/ Example, 23",
                    "details": "Canada building",
                    "city": "City name",
                    "province": "Province name",
                    "postalCode": "12345",
                    "latitude": 41.308166,
                    "longitude": 2.019725,
                    "googlePlaceId": "xxxxxxxxxxxx",
                    "placeName": "C/ Example, 23, City name"
                  },
                  "deliveryAddress": {
                    "id": 1003,
                    "street": "C/ Example, 23",
                    "details": "Canada building",
                    "city": "City name",
                    "province": "Province name",
                    "postalCode": "12345",
                    "latitude": 41.308166,
                    "longitude": 2.019725,
                    "googlePlaceId": "xxxxxxxxxxxx",
                    "placeName": "C/ Example, 23, City name"
                  },
                  "pickupAgreedAt": "2017-02-09T12:00:00+0000",
                  "pickupConfirmedAt": "2017-02-09T12:00:00+0000",
                  "deliveryAgreedAt": "2017-02-09T12:15:00+0000",
                  "deliveryConfirmedAt": "2017-02-09T12:15:00+0000",
                  "pickupInstructions": null,
                  "deliveryInstructions": null,
                  "forSenderInstructions": null,
                  "linearDistance": "1.56",
                  "realDistance": "1.97",
                  "estimatedDeliveryDuration": "15",
                  "status": {
                    "code": "PICKING",
                    "name": "Picking",
                    "color": "blue",
                    "isFinalStatus": false,
                    "callToAction": "Start picking"
                  },
                  "pickupContactName": "John",
                  "pickupContactPhone": "600000000",
                  "pickupContactEmail": "john@example.com",
                  "destinationContactEmail": "jane@example.com",
                  "destinationContactName": "Jane",
                  "destinationContactPhone": "600000000",
                  "deliveryDescription": "Selling point order delivery",
                  "onPickupPayments": [
                    {
                      "id": 1003,
                      "amount": "28.60",
                      "paymentMethodName": "Cash"
                    }
                  ],
                  "onDeliveryPayments": [
                    {
                      "id": 1003,
                      "amount": "28.60",
                      "paymentMethodName": "Cash"
                    }
                  ],
                  "newStatusOptions": [
                    {
                      "code": "PICKING",
                      "name": "Picking",
                      "color": "blue",
                      "isFinalStatus": false,
                      "callToAction": "Start picking"
                    }
                  ],
                  "driver": {
                    "id": 1003,
                    "email": "john@example.com",
                    "name": "John",
                    "lastname": "Doe",
                    "image": "https://cdn.sinqro.com/assets/images/placeholder_image.jpg",
                    "phone": "+34600000000",
                    "transport": {
                      "code": "SCOOTER",
                      "name": "Scooter"
                    },
                    "status": {
                      "code": "onduty",
                      "name": "En servicio",
                      "color": "#5aac44"
                    },
                    "lastGeolocation": {
                      "latitude": 41.308166,
                      "longitude": 2.019725,
                      "createdAt": "2018-03-015T12:15:00+0000"
                    }
                  },
                  "deliveryPrice": 5
                }
              }
            }
          },
          "400": {
            "description": "Error/s",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "errors": [
                    {
                      "code": "ERROR_CODE_EXAMPLE",
                      "message": "Error message"
                    }
                  ],
                  "code": "ERROR_CODE_EXAMPLE",
                  "message": "Error message",
                  "httpResponseCode": "400"
                }
              }
            }
          }
        },
        "tags": [
          "Delivery"
        ],
        "security": [
          {
            "ServerAccessToken": [],
            "UserAccessToken": []
          }
        ]
      }
    },
    "/deliveries/assign": {
      "post": {
        "summary": "Assign delivery driver",
        "description": "Assign driver to delivery",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "deliveryId": {
                    "type": "integer",
                    "format": "int64",
                    "description": "Sinqro delivery identifier"
                  },
                  "driverId": {
                    "type": "integer",
                    "format": "int64",
                    "description": "Driver identifier"
                  },
                  "pickupTime": {
                    "type": "string",
                    "description": "Pickup time (ISO-8601). Optional."
                  },
                  "silenceErrors": {
                    "type": "boolean",
                    "description": "When true, returns false instead of throwing errors (for async retries)."
                  }
                },
                "required": [
                  "deliveryId",
                  "driverId"
                ]
              },
              "example": {
                "deliveryId": 123,
                "driverId": 456,
                "pickupTime": "2024-08-01T12:30:00Z",
                "silenceErrors": false
              }
            }
          }
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Delivery"
                },
                "example": {
                  "id": 1003,
                  "pickupAddress": {
                    "id": 1003,
                    "street": "C/ Example, 23",
                    "details": "Canada building",
                    "city": "City name",
                    "province": "Province name",
                    "postalCode": "12345",
                    "latitude": 41.308166,
                    "longitude": 2.019725,
                    "googlePlaceId": "xxxxxxxxxxxx",
                    "placeName": "C/ Example, 23, City name"
                  },
                  "deliveryAddress": {
                    "id": 1003,
                    "street": "C/ Example, 23",
                    "details": "Canada building",
                    "city": "City name",
                    "province": "Province name",
                    "postalCode": "12345",
                    "latitude": 41.308166,
                    "longitude": 2.019725,
                    "googlePlaceId": "xxxxxxxxxxxx",
                    "placeName": "C/ Example, 23, City name"
                  },
                  "pickupAgreedAt": "2017-02-09T12:00:00+0000",
                  "pickupConfirmedAt": "2017-02-09T12:00:00+0000",
                  "deliveryAgreedAt": "2017-02-09T12:15:00+0000",
                  "deliveryConfirmedAt": "2017-02-09T12:15:00+0000",
                  "pickupInstructions": null,
                  "deliveryInstructions": null,
                  "forSenderInstructions": null,
                  "linearDistance": "1.56",
                  "realDistance": "1.97",
                  "estimatedDeliveryDuration": "15",
                  "status": {
                    "code": "PICKING",
                    "name": "Picking",
                    "color": "blue",
                    "isFinalStatus": false,
                    "callToAction": "Start picking"
                  },
                  "pickupContactName": "John",
                  "pickupContactPhone": "600000000",
                  "pickupContactEmail": "john@example.com",
                  "destinationContactEmail": "jane@example.com",
                  "destinationContactName": "Jane",
                  "destinationContactPhone": "600000000",
                  "deliveryDescription": "Selling point order delivery",
                  "onPickupPayments": [
                    {
                      "id": 1003,
                      "amount": "28.60",
                      "paymentMethodName": "Cash"
                    }
                  ],
                  "onDeliveryPayments": [
                    {
                      "id": 1003,
                      "amount": "28.60",
                      "paymentMethodName": "Cash"
                    }
                  ],
                  "newStatusOptions": [
                    {
                      "code": "PICKING",
                      "name": "Picking",
                      "color": "blue",
                      "isFinalStatus": false,
                      "callToAction": "Start picking"
                    }
                  ],
                  "driver": {
                    "id": 1003,
                    "email": "john@example.com",
                    "name": "John",
                    "lastname": "Doe",
                    "image": "https://cdn.sinqro.com/assets/images/placeholder_image.jpg",
                    "phone": "+34600000000",
                    "transport": {
                      "code": "SCOOTER",
                      "name": "Scooter"
                    },
                    "status": {
                      "code": "onduty",
                      "name": "En servicio",
                      "color": "#5aac44"
                    },
                    "lastGeolocation": {
                      "latitude": 41.308166,
                      "longitude": 2.019725,
                      "createdAt": "2018-03-015T12:15:00+0000"
                    }
                  },
                  "deliveryPrice": 5
                }
              }
            }
          },
          "400": {
            "description": "Error/s",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "errors": [
                    {
                      "code": "ERROR_CODE_EXAMPLE",
                      "message": "Error message"
                    }
                  ],
                  "code": "ERROR_CODE_EXAMPLE",
                  "message": "Error message",
                  "httpResponseCode": "400"
                }
              }
            }
          }
        },
        "tags": [
          "Delivery"
        ],
        "security": [
          {
            "ServerAccessToken": [],
            "UserAccessToken": []
          }
        ]
      }
    }
  },
  "webhooks": {
    "newDeliveryWebhook": {
      "post": {
        "summary": "Delivery created WebHook",
        "description": "Sent every time a new delivery is created for your company. The event code is `new_delivery`.\n\nThis is an outgoing webhook sent by Sinqro. **Your HTTP response tells Sinqro whether you take the delivery**, so answer in the same request.\n\n### How your response is read\n\n| Your answer | Meaning for Sinqro |\n|---|---|\n| Any HTTP `2xx`, with or without body | **Accepted**: the delivery has been delegated to you |\n| Any other HTTP status | **Rejected**: the delivery could not be delegated |\n| No answer (connection error or timeout) | The delivery could not be delegated |\n\n- Only the HTTP status decides. A `200` whose body reports an error (for example `{\"success\": false}`) **is an acceptance**.\n- To reject, for example because no driver is available, answer with a non `2xx` status such as `400`. No error body is required, and none is processed.\n- Your server must accept the connection within 1 second.\n- No JSON body is required to accept.\n\n### Optional data in an acceptance\n\nYou may add data to a `2xx` answer. It is **only processed when `deliveryId` is present**; without `deliveryId` the other fields are ignored.\n\n| Field | Meaning |\n|---|---|\n| `deliveryId` | Your identifier of the delivery |\n| `statusCode` | Initial status of the delivery, one of the listed codes. Other values are not applied |\n| `pickupTime` | Expected pickup date and time, ISO 8601 |\n| `trackingUrl` | Public tracking page of the delivery |\n\nRejecting here is different from cancelling later a delivery you already accepted.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Delivery"
              },
              "example": {
                "id": 1003,
                "pickupAddress": {
                  "id": 1003,
                  "street": "C/ Example, 23",
                  "details": "Canada building",
                  "city": "City name",
                  "province": "Province name",
                  "postalCode": "12345",
                  "latitude": 41.308166,
                  "longitude": 2.019725,
                  "googlePlaceId": "xxxxxxxxxxxx",
                  "placeName": "C/ Example, 23, City name"
                },
                "deliveryAddress": {
                  "id": 1003,
                  "street": "C/ Example, 23",
                  "details": "Canada building",
                  "city": "City name",
                  "province": "Province name",
                  "postalCode": "12345",
                  "latitude": 41.308166,
                  "longitude": 2.019725,
                  "googlePlaceId": "xxxxxxxxxxxx",
                  "placeName": "C/ Example, 23, City name"
                },
                "pickupAgreedAt": "2017-02-09T12:00:00+0000",
                "pickupConfirmedAt": "2017-02-09T12:00:00+0000",
                "deliveryAgreedAt": "2017-02-09T12:15:00+0000",
                "deliveryConfirmedAt": "2017-02-09T12:15:00+0000",
                "pickupInstructions": null,
                "deliveryInstructions": null,
                "forSenderInstructions": null,
                "linearDistance": "1.56",
                "realDistance": "1.97",
                "estimatedDeliveryDuration": "15",
                "status": {
                  "code": "PICKING",
                  "name": "Picking",
                  "color": "blue",
                  "isFinalStatus": false,
                  "callToAction": "Start picking"
                },
                "pickupContactName": "John",
                "pickupContactPhone": "600000000",
                "pickupContactEmail": "john@example.com",
                "destinationContactEmail": "jane@example.com",
                "destinationContactName": "Jane",
                "destinationContactPhone": "600000000",
                "deliveryDescription": "Selling point order delivery",
                "onPickupPayments": [
                  {
                    "id": 1003,
                    "amount": "28.60",
                    "paymentMethodName": "Cash"
                  }
                ],
                "onDeliveryPayments": [
                  {
                    "id": 1003,
                    "amount": "28.60",
                    "paymentMethodName": "Cash"
                  }
                ],
                "newStatusOptions": [
                  {
                    "code": "PICKING",
                    "name": "Picking",
                    "color": "blue",
                    "isFinalStatus": false,
                    "callToAction": "Start picking"
                  }
                ],
                "driver": {
                  "id": 1003,
                  "email": "john@example.com",
                  "name": "John",
                  "lastname": "Doe",
                  "image": "https://cdn.sinqro.com/assets/images/placeholder_image.jpg",
                  "phone": "+34600000000",
                  "transport": {
                    "code": "SCOOTER",
                    "name": "Scooter"
                  },
                  "status": {
                    "code": "onduty",
                    "name": "En servicio",
                    "color": "#5aac44"
                  },
                  "lastGeolocation": {
                    "latitude": 41.308166,
                    "longitude": 2.019725,
                    "createdAt": "2018-03-015T12:15:00+0000"
                  }
                },
                "deliveryPrice": 5
              }
            }
          }
        },
        "tags": [
          "Delivery"
        ],
        "x-webhook": true,
        "responses": {
          "200": {
            "description": "Accepted. Any `2xx` status means the same. The body is optional.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deliveryId": {
                      "type": "string",
                      "description": "Your identifier of the delivery. The other fields are only processed when it is present."
                    },
                    "statusCode": {
                      "type": "string",
                      "enum": [
                        "ACCEPTED_BY_DRIVER",
                        "CANCELLED_BY_DRIVER",
                        "REFUSED_BY_DRIVER",
                        "UNASSIGNED_BY_DISPATCH",
                        "PICKING",
                        "WAITING_SELLING_POINT_PREPARATION",
                        "DELIVERING",
                        "DELIVERED"
                      ]
                    },
                    "pickupTime": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "trackingUrl": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                },
                "examples": {
                  "acceptedWithoutData": {
                    "summary": "Accepted, no data (the body may also be empty)",
                    "value": {}
                  },
                  "acceptedWithData": {
                    "summary": "Accepted, with your delivery data",
                    "value": {
                      "deliveryId": "YOUR-DELIVERY-123",
                      "statusCode": "ACCEPTED_BY_DRIVER",
                      "pickupTime": "2026-11-26T13:45:00+01:00",
                      "trackingUrl": "https://tracking.example.com/YOUR-DELIVERY-123"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Rejected: you cannot take the delivery. Any non `2xx` status means the same. No body is required."
          }
        }
      }
    },
    "deliveryCancelledWebhook": {
      "post": {
        "summary": "Delivery cancelled WebHook",
        "description": "Always a delivery is cancelled, the system will send the delivery object to this endpoint.<br>The event code is <b>delivery_cancellation</b>\n\nThis is an outgoing webhook sent by Sinqro.\n\nIt concerns a delivery that already exists, and it is not the way to reject a new one: to reject, answer the `new_delivery` webhook with a non `2xx` status. A cancelled delivery does not by itself mean that the restaurant order is cancelled.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "tags": [
          "Delivery"
        ],
        "x-webhook": true,
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "TransportType": {
        "type": "object",
        "description": "",
        "example": {
          "code": "SCOOTER",
          "name": "Scooter"
        },
        "properties": {
          "code": {
            "type": "string",
            "description": "Transport type identifier code",
            "enum": [
              "BIKE",
              "SCOOTER",
              "MOTORBIKE",
              "CAR",
              "VAN",
              "WALKING"
            ],
            "example": "BIKE"
          },
          "name": {
            "type": "string",
            "description": "Transport type name",
            "example": "string"
          }
        },
        "required": [
          "code",
          "name"
        ]
      },
      "Status": {
        "type": "object",
        "description": "Current driver status",
        "example": {
          "code": "onduty",
          "name": "En servicio",
          "color": "#5aac44"
        },
        "properties": {
          "code": {
            "type": "string",
            "description": "Status identifier code",
            "enum": [
              "offduty",
              "onduty",
              "pending",
              "disabled"
            ],
            "example": "offduty"
          },
          "name": {
            "type": "string",
            "description": "Status name",
            "example": "string"
          },
          "color": {
            "type": "string",
            "description": "HEX color code for the status",
            "example": "string"
          }
        },
        "required": [
          "code",
          "name",
          "color"
        ]
      },
      "Driver": {
        "type": "object",
        "description": "",
        "example": {
          "id": 1003,
          "email": "john@example.com",
          "name": "John",
          "lastname": "Doe",
          "image": "https://cdn.sinqro.com/assets/images/placeholder_image.jpg",
          "phone": "+34600000000",
          "transport": {
            "code": "SCOOTER",
            "name": "Scooter"
          },
          "status": {
            "code": "onduty",
            "name": "En servicio",
            "color": "#5aac44"
          }
        },
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "description": "Driver identifier",
            "example": 0
          },
          "email": {
            "type": "string",
            "description": "Driver email",
            "example": "string"
          },
          "name": {
            "type": "string",
            "description": "Driver name",
            "example": "string"
          },
          "lastname": {
            "type": "string",
            "description": "Driver last name",
            "example": "string"
          },
          "image": {
            "type": "string",
            "description": "Driver image url",
            "example": "string"
          },
          "phone": {
            "type": "string",
            "description": "In international format. Ex. +34600000000",
            "example": "string"
          },
          "transport": {
            "$ref": "#/components/schemas/TransportType"
          },
          "status": {
            "$ref": "#/components/schemas/Status"
          }
        },
        "required": [
          "id",
          "email",
          "name",
          "lastname",
          "phone",
          "transport",
          "status"
        ]
      },
      "Error": {
        "type": "object",
        "description": "Error",
        "example": {
          "code": "ERROR_CODE_EXAMPLE",
          "message": "Error message"
        },
        "properties": {
          "code": {
            "type": "string",
            "description": "Error code identifier",
            "example": "string"
          },
          "message": {
            "type": "string",
            "description": "Error description",
            "example": "string"
          }
        },
        "required": [
          "code",
          "message"
        ]
      },
      "errors": {
        "type": "array",
        "description": "Errors",
        "example": [
          {
            "code": "ERROR_CODE_EXAMPLE",
            "message": "Error message"
          }
        ],
        "items": {
          "$ref": "#/components/schemas/Error"
        }
      },
      "ErrorResponse": {
        "type": "object",
        "description": "Error response",
        "example": {
          "errors": [
            {
              "code": "ERROR_CODE_EXAMPLE",
              "message": "Error message"
            }
          ],
          "code": "ERROR_CODE_EXAMPLE",
          "message": "Error message",
          "httpResponseCode": "400"
        },
        "properties": {
          "errors": {
            "$ref": "#/components/schemas/errors"
          },
          "code": {
            "type": "string",
            "description": "Error code identifier",
            "example": "string"
          },
          "message": {
            "type": "string",
            "description": "Error description",
            "example": "string"
          },
          "httpResponseCode": {
            "type": "string",
            "description": "HTTP response code",
            "example": "string"
          }
        },
        "required": [
          "code",
          "message",
          "httpResponseCode"
        ]
      },
      "PickupAddress": {
        "type": "object",
        "description": "Delivery pickup address",
        "example": {
          "id": 1003,
          "street": "C/ Example, 23",
          "details": "Canada building",
          "city": "City name",
          "province": "Province name",
          "postalCode": "12345",
          "latitude": 41.308166,
          "longitude": 2.019725,
          "googlePlaceId": "xxxxxxxxxxxx",
          "placeName": "C/ Example, 23, City name"
        },
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "description": "Address identifier",
            "example": 0
          },
          "street": {
            "type": "string",
            "description": "Address street with number",
            "example": "string"
          },
          "details": {
            "type": "string",
            "description": "Extra address information",
            "example": "string"
          },
          "city": {
            "type": "string",
            "description": "Address city name",
            "example": "string"
          },
          "province": {
            "type": "string",
            "description": "Address province name",
            "example": "string"
          },
          "postalCode": {
            "type": "string",
            "description": "Address postal code",
            "example": "string"
          },
          "latitude": {
            "type": "number",
            "format": "float",
            "description": "Address latitude",
            "example": 0
          },
          "longitude": {
            "type": "number",
            "format": "float",
            "description": "Address longitude",
            "example": 0
          },
          "googlePlaceId": {
            "type": "string",
            "description": "Google place identifier",
            "example": "string"
          },
          "placeName": {
            "type": "string",
            "description": "Place name",
            "example": "string"
          }
        },
        "required": [
          "id",
          "street"
        ]
      },
      "DeliveryAddress": {
        "type": "object",
        "description": "Delivery address",
        "example": {
          "id": 1003,
          "street": "C/ Example, 23",
          "details": "Canada building",
          "city": "City name",
          "province": "Province name",
          "postalCode": "12345",
          "latitude": 41.308166,
          "longitude": 2.019725,
          "googlePlaceId": "xxxxxxxxxxxx",
          "placeName": "C/ Example, 23, City name"
        },
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "description": "Address identifier",
            "example": 0
          },
          "street": {
            "type": "string",
            "description": "Address street with number",
            "example": "string"
          },
          "details": {
            "type": "string",
            "description": "Extra address information",
            "example": "string"
          },
          "city": {
            "type": "string",
            "description": "Address city name",
            "example": "string"
          },
          "province": {
            "type": "string",
            "description": "Address province name",
            "example": "string"
          },
          "postalCode": {
            "type": "string",
            "description": "Address postal code",
            "example": "string"
          },
          "latitude": {
            "type": "number",
            "format": "float",
            "description": "Address latitude",
            "example": 0
          },
          "longitude": {
            "type": "number",
            "format": "float",
            "description": "Address longitude",
            "example": 0
          },
          "googlePlaceId": {
            "type": "string",
            "description": "Google place identifier",
            "example": "string"
          },
          "placeName": {
            "type": "string",
            "description": "Place name",
            "example": "string"
          }
        },
        "required": [
          "id",
          "street"
        ]
      },
      "Payment": {
        "type": "object",
        "description": "Payments required on pickup action",
        "example": {
          "id": 1003,
          "amount": "28.60",
          "paymentMethodName": "Cash"
        },
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "description": "Payment identifier",
            "example": 0
          },
          "amount": {
            "type": "number",
            "format": "float",
            "description": "Payment amount",
            "example": 0
          },
          "paymentMethodName": {
            "type": "string",
            "description": "Payment method name",
            "example": "string"
          }
        }
      },
      "onPickupPayments": {
        "type": "array",
        "description": "Payments required on pickup action",
        "example": [
          {
            "id": 1003,
            "amount": "28.60",
            "paymentMethodName": "Cash"
          }
        ],
        "items": {
          "$ref": "#/components/schemas/Payment"
        }
      },
      "onDeliveryPayments": {
        "type": "array",
        "description": "Payments required on delivery action",
        "example": [
          {
            "id": 1003,
            "amount": "28.60",
            "paymentMethodName": "Cash"
          }
        ],
        "items": {
          "$ref": "#/components/schemas/Payment"
        }
      },
      "newStatusOptions": {
        "type": "array",
        "description": "Array with new possible statuses for delivery",
        "example": [
          {
            "code": "PICKING",
            "name": "Picking",
            "color": "blue",
            "isFinalStatus": false,
            "callToAction": "Start picking"
          }
        ],
        "items": {
          "$ref": "#/components/schemas/Status"
        }
      },
      "Geolocation": {
        "type": "object",
        "description": "Driver last geolocation",
        "example": {
          "latitude": 41.308166,
          "longitude": 2.019725,
          "createdAt": "2018-03-015T12:15:00+0000"
        },
        "properties": {
          "latitude": {
            "type": "number",
            "format": "float",
            "description": "Geolocation latitude",
            "example": 0
          },
          "longitude": {
            "type": "number",
            "format": "float",
            "description": "Geolocation longitude",
            "example": 0
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Geolocation creation time",
            "example": "string"
          }
        },
        "required": [
          "latitude",
          "longitude",
          "createdAt"
        ]
      },
      "driver": {
        "type": "object",
        "description": "Driver",
        "example": {
          "id": 1003,
          "email": "john@example.com",
          "name": "John",
          "lastname": "Doe",
          "image": "https://cdn.sinqro.com/assets/images/placeholder_image.jpg",
          "phone": "+34600000000",
          "transport": {
            "code": "SCOOTER",
            "name": "Scooter"
          },
          "status": {
            "code": "onduty",
            "name": "En servicio",
            "color": "#5aac44"
          },
          "lastGeolocation": {
            "latitude": 41.308166,
            "longitude": 2.019725,
            "createdAt": "2018-03-015T12:15:00+0000"
          }
        },
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "description": "Driver identifier",
            "example": 0
          },
          "email": {
            "type": "string",
            "description": "Driver email",
            "example": "string"
          },
          "name": {
            "type": "string",
            "description": "Driver name",
            "example": "string"
          },
          "lastname": {
            "type": "string",
            "description": "Driver last name",
            "example": "string"
          },
          "image": {
            "type": "string",
            "description": "Driver image url",
            "example": "string"
          },
          "phone": {
            "type": "string",
            "description": "In international format. Ex. +34600000000",
            "example": "string"
          },
          "transport": {
            "$ref": "#/components/schemas/TransportType"
          },
          "status": {
            "$ref": "#/components/schemas/Status"
          },
          "lastGeolocation": {
            "$ref": "#/components/schemas/Geolocation"
          }
        },
        "required": [
          "id",
          "email",
          "name",
          "lastname",
          "phone",
          "transport",
          "status"
        ]
      },
      "Delivery": {
        "type": "object",
        "description": "Delivery",
        "example": {
          "id": 1003,
          "pickupAddress": {
            "id": 1003,
            "street": "C/ Example, 23",
            "details": "Canada building",
            "city": "City name",
            "province": "Province name",
            "postalCode": "12345",
            "latitude": 41.308166,
            "longitude": 2.019725,
            "googlePlaceId": "xxxxxxxxxxxx",
            "placeName": "C/ Example, 23, City name"
          },
          "deliveryAddress": {
            "id": 1003,
            "street": "C/ Example, 23",
            "details": "Canada building",
            "city": "City name",
            "province": "Province name",
            "postalCode": "12345",
            "latitude": 41.308166,
            "longitude": 2.019725,
            "googlePlaceId": "xxxxxxxxxxxx",
            "placeName": "C/ Example, 23, City name"
          },
          "pickupAgreedAt": "2017-02-09T12:00:00+0000",
          "pickupConfirmedAt": "2017-02-09T12:00:00+0000",
          "deliveryAgreedAt": "2017-02-09T12:15:00+0000",
          "deliveryConfirmedAt": "2017-02-09T12:15:00+0000",
          "pickupInstructions": null,
          "deliveryInstructions": null,
          "forSenderInstructions": null,
          "linearDistance": "1.56",
          "realDistance": "1.97",
          "estimatedDeliveryDuration": "15",
          "status": {
            "code": "PICKING",
            "name": "Picking",
            "color": "blue",
            "isFinalStatus": false,
            "callToAction": "Start picking"
          },
          "pickupContactName": "John",
          "pickupContactPhone": "600000000",
          "pickupContactEmail": "john@example.com",
          "destinationContactEmail": "jane@example.com",
          "destinationContactName": "Jane",
          "destinationContactPhone": "600000000",
          "deliveryDescription": "Selling point order delivery",
          "onPickupPayments": [
            {
              "id": 1003,
              "amount": "28.60",
              "paymentMethodName": "Cash"
            }
          ],
          "onDeliveryPayments": [
            {
              "id": 1003,
              "amount": "28.60",
              "paymentMethodName": "Cash"
            }
          ],
          "newStatusOptions": [
            {
              "code": "PICKING",
              "name": "Picking",
              "color": "blue",
              "isFinalStatus": false,
              "callToAction": "Start picking"
            }
          ],
          "driver": {
            "id": 1003,
            "email": "john@example.com",
            "name": "John",
            "lastname": "Doe",
            "image": "https://cdn.sinqro.com/assets/images/placeholder_image.jpg",
            "phone": "+34600000000",
            "transport": {
              "code": "SCOOTER",
              "name": "Scooter"
            },
            "status": {
              "code": "onduty",
              "name": "En servicio",
              "color": "#5aac44"
            },
            "lastGeolocation": {
              "latitude": 41.308166,
              "longitude": 2.019725,
              "createdAt": "2018-03-015T12:15:00+0000"
            }
          },
          "deliveryPrice": 5
        },
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "description": "Delivery identifier",
            "example": 0
          },
          "pickupAddress": {
            "$ref": "#/components/schemas/PickupAddress"
          },
          "deliveryAddress": {
            "$ref": "#/components/schemas/DeliveryAddress"
          },
          "pickupAgreedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Pickup agreed time",
            "example": "string"
          },
          "pickupConfirmedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Confirmed pickup time",
            "example": "string"
          },
          "deliveryAgreedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Delivery agreed time",
            "example": "string"
          },
          "deliveryConfirmedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Confirmed delivery time",
            "example": "string"
          },
          "pickupInstructions": {
            "type": "string",
            "description": "Pickup instructions",
            "example": "string"
          },
          "deliveryInstructions": {
            "type": "string",
            "description": "Driver instructions",
            "example": "string"
          },
          "forSenderInstructions": {
            "type": "string",
            "description": "Instructions for the person or company that will hand the order to the driver",
            "example": "string"
          },
          "linearDistance": {
            "type": "number",
            "format": "float",
            "description": "Linear distance between pickup and delivery points",
            "example": 0
          },
          "realDistance": {
            "type": "number",
            "format": "float",
            "description": "Real distance between pickup and delivery points",
            "example": 0
          },
          "estimatedDeliveryDuration": {
            "type": "number",
            "format": "float",
            "description": "Estimated delivery duration in minutes",
            "example": 0
          },
          "status": {
            "$ref": "#/components/schemas/Status"
          },
          "pickupContactName": {
            "type": "string",
            "description": "Pickup contact name",
            "example": "string"
          },
          "pickupContactPhone": {
            "type": "string",
            "description": "Pickup contact phone number",
            "example": "string"
          },
          "pickupContactEmail": {
            "type": "string",
            "description": "Pickup contact email",
            "example": "string"
          },
          "destinationContactEmail": {
            "type": "string",
            "description": "Destination contact email",
            "example": "string"
          },
          "destinationContactName": {
            "type": "string",
            "description": "Destination contact name",
            "example": "string"
          },
          "destinationContactPhone": {
            "type": "string",
            "description": "Destination contact phone number",
            "example": "string"
          },
          "deliveryDescription": {
            "type": "string",
            "description": "Delivery description",
            "example": "string"
          },
          "onPickupPayments": {
            "$ref": "#/components/schemas/onPickupPayments"
          },
          "onDeliveryPayments": {
            "$ref": "#/components/schemas/onDeliveryPayments"
          },
          "newStatusOptions": {
            "$ref": "#/components/schemas/newStatusOptions"
          },
          "driver": {
            "$ref": "#/components/schemas/driver"
          },
          "deliveryPrice": {
            "type": "number",
            "format": "float",
            "description": "Delivery price without taxes",
            "example": 0
          }
        },
        "required": [
          "id",
          "pickupAddress",
          "deliveryAddress",
          "pickupAgreedAt",
          "pickupConfirmedAt",
          "deliveryAgreedAt",
          "deliveryConfirmedAt",
          "linearDistance",
          "estimatedDeliveryDuration",
          "status"
        ]
      }
    },
    "securitySchemes": {
      "ServerAccessToken": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-server-access-token",
        "description": "Server access token issued from the developer panel."
      },
      "UserAccessToken": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-user-access-token",
        "description": "User access token issued from the developer panel."
      }
    }
  },
  "security": [
    {
      "ServerAccessToken": [],
      "UserAccessToken": []
    }
  ],
  "x-tagGroups": [
    {
      "name": "Delivery",
      "tags": [
        "Delivery",
        "Driver"
      ]
    }
  ]
}
