{
  "openapi": "3.1.0",
  "info": {
    "title": "OpenQloud Delivery Platform API",
    "version": "v1",
    "description": "### Introduction\nConnect delivery companies and delivery software to the OpenQloud standard through the Delivery Platform API.\n\n### Access\nManage integration credentials at https://console.openqloud.com. Requests use x-api-server-access-token and the connection-specific x-api-user-access-token; restaurant login is not part of this API.\n\n### API environment\nProduction base URL: https://api.openqloud.com/delivery-platform/v1.\n\n### Capabilities\nExchange delivery and driver data through the documented operations. Your software supplies dispatch applications and user interfaces; OpenQloud supplies the data API.\n\nDocumentation: https://www.openqloud.com/en/docs/delivery-platform-api/"
  },
  "servers": [
    {
      "url": "https://api.openqloud.com/delivery-platform/v1",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Driver",
      "description": "Services to manage driver user data"
    },
    {
      "name": "Delivery",
      "description": "Services to manage deliveries"
    }
  ],
  "paths": {
    "/definition.json": {
      "get": {
        "operationId": "getDefinition",
        "summary": "Get the Delivery Platform API definition",
        "security": [],
        "responses": {
          "200": {
            "description": "The public Delivery Platform API definition",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/deliveries/{deliveryId}": {
      "get": {
        "operationId": "getDelivery",
        "summary": "Get a delivery",
        "tags": [
          "Delivery"
        ],
        "x-implementation-status": "native-sgk",
        "x-parity-status": "binary-certified-local",
        "parameters": [
          {
            "in": "path",
            "name": "deliveryId",
            "required": true,
            "schema": {
              "type": "integer",
              "example": 1003
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Byte-compatible delivery",
            "content": {
              "application/json": {
                "example": {
                  "id": 1003,
                  "externalId": "DELIVERY-EXAMPLE-1003",
                  "status": {
                    "code": "DELIVERED",
                    "name": "Entregado",
                    "color": "#5aac44",
                    "callToAction": "Entregado",
                    "isFinalStatus": true
                  },
                  "driver": {
                    "id": 1004,
                    "name": "Example",
                    "lastname": "Driver",
                    "email": "driver@example.com",
                    "phone": "+34600000002",
                    "image": null,
                    "notificationsChannel": "example-notifications-channel",
                    "chatToken": null,
                    "language": "es",
                    "status": {
                      "code": "onduty",
                      "name": "En servicio",
                      "color": "#5aac44",
                      "callToAction": null,
                      "isFinalStatus": false
                    },
                    "transport": {
                      "code": "SCOOTER",
                      "name": "Scooter"
                    },
                    "lastGeolocation": null
                  },
                  "deliveryAccountId": 123,
                  "deliveryAccountName": "Example Delivery Company",
                  "deliveryAccountPhone": "+34600000001",
                  "deliveryAccountPhoneInternational": "+34600000001",
                  "deliveryPrice": null,
                  "moduleSetup": {
                    "id": 1005,
                    "sellingPoint": {
                      "id": 1108,
                      "uuid": "11111111-1111-4111-8111-111111111111",
                      "name": "Example Restaurant",
                      "timezone": "Europe/Madrid",
                      "currency": {
                        "isoCode": "EUR",
                        "symbol": "€",
                        "displayPattern": "{{ amount }} €",
                        "minorUnit": 2
                      }
                    },
                    "config": {
                      "api_client_id": "example-client-id",
                      "api_client_secret": "example-client-secret"
                    },
                    "constants": null,
                    "providerClientId": "example-provider-client",
                    "connectionId": "example-connection",
                    "module": {
                      "code": "STUART",
                      "typeCode": "DELIVERY",
                      "horizontalLogo": "https://example.com/modules/STUART.png",
                      "name": "Stuart",
                      "constants": null
                    }
                  },
                  "pickupAddress": {
                    "id": 1001,
                    "street": "Example Street, 1",
                    "details": null,
                    "city": "Example City",
                    "province": "Example Province",
                    "country": {
                      "isoCode": "ES",
                      "name": "Spain",
                      "currency": {
                        "isoCode": "EUR",
                        "symbol": "€",
                        "displayPattern": "{{ amount }} €",
                        "minorUnit": 2
                      }
                    },
                    "postalCode": "08001",
                    "latitude": 41.38,
                    "longitude": 2.17,
                    "googlePlaceId": "example-place-1",
                    "placeName": "Example Street, 1, Example City",
                    "autoGeolocated": true
                  },
                  "pickupAgreedAt": "2020-03-04T19:33:01+0000",
                  "pickupConfirmedAt": "2020-03-04T19:34:48+0000",
                  "deliveryAddress": {
                    "id": 1002,
                    "street": "Example Street, 2",
                    "details": null,
                    "city": "Example City",
                    "province": "Example Province",
                    "country": {
                      "isoCode": "ES",
                      "name": "Spain",
                      "currency": {
                        "isoCode": "EUR",
                        "symbol": "€",
                        "displayPattern": "{{ amount }} €",
                        "minorUnit": 2
                      }
                    },
                    "postalCode": "08001",
                    "latitude": 41.38,
                    "longitude": 2.17,
                    "googlePlaceId": "example-place-2",
                    "placeName": "Example Street, 2, Example City",
                    "autoGeolocated": true
                  },
                  "deliveryAgreedAt": "2020-03-04T19:43:01+0000",
                  "deliveryConfirmedAt": "2020-03-04T19:43:23+0000",
                  "pickupInstructions": null,
                  "deliveryInstructions": null,
                  "forSenderInstructions": null,
                  "linearDistance": 2.95,
                  "realDistance": 4.13,
                  "route": "example-encoded-route",
                  "estimatedDeliveryDuration": 10,
                  "realDeliveryDuration": 10,
                  "destinationContactEmail": "customer@example.com",
                  "destinationContactName": "Example Customer",
                  "destinationContactPhone": "+34600000000",
                  "destinationContactPhoneInternational": "+34600000000",
                  "pickupContactEmail": "restaurant@example.com",
                  "pickupContactName": "Example Restaurant",
                  "pickupContactPhone": "+34600000003",
                  "pickupContactPhoneInternational": "+34600000003",
                  "deliveryDescription": "Example delivery",
                  "onDeliveryPayments": [],
                  "onPickupPayments": [],
                  "newStatusOptions": [],
                  "trackingUrl": "https://example.com/tracking/example",
                  "openqloudOrderId": 2001,
                  "marketOrderCode": "ORDER-EXAMPLE",
                  "marketOrderId": "MARKET-ORDER-EXAMPLE",
                  "marketName": "Example Marketplace",
                  "marketCode": "EXAMPLE_MARKET",
                  "orderBrandId": 3001,
                  "orderBrandName": "Example Brand",
                  "orderTotalAmount": 34.05
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Delivery not found"
          }
        }
      },
      "patch": {
        "operationId": "updateDeliveryExternalId",
        "summary": "Assign the external delivery identifier",
        "tags": [
          "Delivery"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "deliveryId",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "externalDeliveryId"
                ],
                "properties": {
                  "externalDeliveryId": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated delivery",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "404": {
            "description": "Delivery not found"
          }
        }
      }
    },
    "/deliveries/external/{externalDeliveryId}": {
      "get": {
        "operationId": "getDeliveryByExternalId",
        "summary": "Get a delivery by external identifier",
        "tags": [
          "Delivery"
        ],
        "x-implementation-status": "native-sgk",
        "x-parity-status": "binary-certified-local",
        "parameters": [
          {
            "in": "path",
            "name": "externalDeliveryId",
            "required": true,
            "schema": {
              "type": "string",
              "example": "DELIVERY-EXAMPLE-1003"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Byte-compatible delivery",
            "content": {
              "application/json": {
                "example": {
                  "id": 1003,
                  "externalId": "DELIVERY-EXAMPLE-1003",
                  "status": {
                    "code": "DELIVERED",
                    "name": "Entregado",
                    "color": "#5aac44",
                    "callToAction": "Entregado",
                    "isFinalStatus": true
                  },
                  "driver": {
                    "id": 1004,
                    "name": "Example",
                    "lastname": "Driver",
                    "email": "driver@example.com",
                    "phone": "+34600000002",
                    "image": null,
                    "notificationsChannel": "example-notifications-channel",
                    "chatToken": null,
                    "language": "es",
                    "status": {
                      "code": "onduty",
                      "name": "En servicio",
                      "color": "#5aac44",
                      "callToAction": null,
                      "isFinalStatus": false
                    },
                    "transport": {
                      "code": "SCOOTER",
                      "name": "Scooter"
                    },
                    "lastGeolocation": null
                  },
                  "deliveryAccountId": 123,
                  "deliveryAccountName": "Example Delivery Company",
                  "deliveryAccountPhone": "+34600000001",
                  "deliveryAccountPhoneInternational": "+34600000001",
                  "deliveryPrice": null,
                  "moduleSetup": {
                    "id": 1005,
                    "sellingPoint": {
                      "id": 1108,
                      "uuid": "11111111-1111-4111-8111-111111111111",
                      "name": "Example Restaurant",
                      "timezone": "Europe/Madrid",
                      "currency": {
                        "isoCode": "EUR",
                        "symbol": "€",
                        "displayPattern": "{{ amount }} €",
                        "minorUnit": 2
                      }
                    },
                    "config": {
                      "api_client_id": "example-client-id",
                      "api_client_secret": "example-client-secret"
                    },
                    "constants": null,
                    "providerClientId": "example-provider-client",
                    "connectionId": "example-connection",
                    "module": {
                      "code": "STUART",
                      "typeCode": "DELIVERY",
                      "horizontalLogo": "https://example.com/modules/STUART.png",
                      "name": "Stuart",
                      "constants": null
                    }
                  },
                  "pickupAddress": {
                    "id": 1001,
                    "street": "Example Street, 1",
                    "details": null,
                    "city": "Example City",
                    "province": "Example Province",
                    "country": {
                      "isoCode": "ES",
                      "name": "Spain",
                      "currency": {
                        "isoCode": "EUR",
                        "symbol": "€",
                        "displayPattern": "{{ amount }} €",
                        "minorUnit": 2
                      }
                    },
                    "postalCode": "08001",
                    "latitude": 41.38,
                    "longitude": 2.17,
                    "googlePlaceId": "example-place-1",
                    "placeName": "Example Street, 1, Example City",
                    "autoGeolocated": true
                  },
                  "pickupAgreedAt": "2020-03-04T19:33:01+0000",
                  "pickupConfirmedAt": "2020-03-04T19:34:48+0000",
                  "deliveryAddress": {
                    "id": 1002,
                    "street": "Example Street, 2",
                    "details": null,
                    "city": "Example City",
                    "province": "Example Province",
                    "country": {
                      "isoCode": "ES",
                      "name": "Spain",
                      "currency": {
                        "isoCode": "EUR",
                        "symbol": "€",
                        "displayPattern": "{{ amount }} €",
                        "minorUnit": 2
                      }
                    },
                    "postalCode": "08001",
                    "latitude": 41.38,
                    "longitude": 2.17,
                    "googlePlaceId": "example-place-2",
                    "placeName": "Example Street, 2, Example City",
                    "autoGeolocated": true
                  },
                  "deliveryAgreedAt": "2020-03-04T19:43:01+0000",
                  "deliveryConfirmedAt": "2020-03-04T19:43:23+0000",
                  "pickupInstructions": null,
                  "deliveryInstructions": null,
                  "forSenderInstructions": null,
                  "linearDistance": 2.95,
                  "realDistance": 4.13,
                  "route": "example-encoded-route",
                  "estimatedDeliveryDuration": 10,
                  "realDeliveryDuration": 10,
                  "destinationContactEmail": "customer@example.com",
                  "destinationContactName": "Example Customer",
                  "destinationContactPhone": "+34600000000",
                  "destinationContactPhoneInternational": "+34600000000",
                  "pickupContactEmail": "restaurant@example.com",
                  "pickupContactName": "Example Restaurant",
                  "pickupContactPhone": "+34600000003",
                  "pickupContactPhoneInternational": "+34600000003",
                  "deliveryDescription": "Example delivery",
                  "onDeliveryPayments": [],
                  "onPickupPayments": [],
                  "newStatusOptions": [],
                  "trackingUrl": "https://example.com/tracking/example",
                  "openqloudOrderId": 2001,
                  "marketOrderCode": "ORDER-EXAMPLE",
                  "marketOrderId": "MARKET-ORDER-EXAMPLE",
                  "marketName": "Example Marketplace",
                  "marketCode": "EXAMPLE_MARKET",
                  "orderBrandId": 3001,
                  "orderBrandName": "Example Brand",
                  "orderTotalAmount": 34.05
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Delivery not found"
          }
        }
      }
    },
    "/deliveries/external/{deliveryAccountId}/{externalDeliveryId}": {
      "get": {
        "operationId": "getDeliveryByAccountAndExternalId",
        "summary": "Get an account delivery by external identifier",
        "tags": [
          "Delivery"
        ],
        "x-implementation-status": "native-sgk",
        "x-parity-status": "binary-certified-local",
        "parameters": [
          {
            "in": "path",
            "name": "deliveryAccountId",
            "required": true,
            "schema": {
              "type": "integer",
              "example": 123
            }
          },
          {
            "in": "path",
            "name": "externalDeliveryId",
            "required": true,
            "schema": {
              "type": "string",
              "example": "DELIVERY-EXAMPLE-1003"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Byte-compatible delivery",
            "content": {
              "application/json": {
                "example": {
                  "id": 1003,
                  "externalId": "DELIVERY-EXAMPLE-1003",
                  "status": {
                    "code": "DELIVERED",
                    "name": "Entregado",
                    "color": "#5aac44",
                    "callToAction": "Entregado",
                    "isFinalStatus": true
                  },
                  "driver": {
                    "id": 1004,
                    "name": "Example",
                    "lastname": "Driver",
                    "email": "driver@example.com",
                    "phone": "+34600000002",
                    "image": null,
                    "notificationsChannel": "example-notifications-channel",
                    "chatToken": null,
                    "language": "es",
                    "status": {
                      "code": "onduty",
                      "name": "En servicio",
                      "color": "#5aac44",
                      "callToAction": null,
                      "isFinalStatus": false
                    },
                    "transport": {
                      "code": "SCOOTER",
                      "name": "Scooter"
                    },
                    "lastGeolocation": null
                  },
                  "deliveryAccountId": 123,
                  "deliveryAccountName": "Example Delivery Company",
                  "deliveryAccountPhone": "+34600000001",
                  "deliveryAccountPhoneInternational": "+34600000001",
                  "deliveryPrice": null,
                  "moduleSetup": {
                    "id": 1005,
                    "sellingPoint": {
                      "id": 1108,
                      "uuid": "11111111-1111-4111-8111-111111111111",
                      "name": "Example Restaurant",
                      "timezone": "Europe/Madrid",
                      "currency": {
                        "isoCode": "EUR",
                        "symbol": "€",
                        "displayPattern": "{{ amount }} €",
                        "minorUnit": 2
                      }
                    },
                    "config": {
                      "api_client_id": "example-client-id",
                      "api_client_secret": "example-client-secret"
                    },
                    "constants": null,
                    "providerClientId": "example-provider-client",
                    "connectionId": "example-connection",
                    "module": {
                      "code": "STUART",
                      "typeCode": "DELIVERY",
                      "horizontalLogo": "https://example.com/modules/STUART.png",
                      "name": "Stuart",
                      "constants": null
                    }
                  },
                  "pickupAddress": {
                    "id": 1001,
                    "street": "Example Street, 1",
                    "details": null,
                    "city": "Example City",
                    "province": "Example Province",
                    "country": {
                      "isoCode": "ES",
                      "name": "Spain",
                      "currency": {
                        "isoCode": "EUR",
                        "symbol": "€",
                        "displayPattern": "{{ amount }} €",
                        "minorUnit": 2
                      }
                    },
                    "postalCode": "08001",
                    "latitude": 41.38,
                    "longitude": 2.17,
                    "googlePlaceId": "example-place-1",
                    "placeName": "Example Street, 1, Example City",
                    "autoGeolocated": true
                  },
                  "pickupAgreedAt": "2020-03-04T19:33:01+0000",
                  "pickupConfirmedAt": "2020-03-04T19:34:48+0000",
                  "deliveryAddress": {
                    "id": 1002,
                    "street": "Example Street, 2",
                    "details": null,
                    "city": "Example City",
                    "province": "Example Province",
                    "country": {
                      "isoCode": "ES",
                      "name": "Spain",
                      "currency": {
                        "isoCode": "EUR",
                        "symbol": "€",
                        "displayPattern": "{{ amount }} €",
                        "minorUnit": 2
                      }
                    },
                    "postalCode": "08001",
                    "latitude": 41.38,
                    "longitude": 2.17,
                    "googlePlaceId": "example-place-2",
                    "placeName": "Example Street, 2, Example City",
                    "autoGeolocated": true
                  },
                  "deliveryAgreedAt": "2020-03-04T19:43:01+0000",
                  "deliveryConfirmedAt": "2020-03-04T19:43:23+0000",
                  "pickupInstructions": null,
                  "deliveryInstructions": null,
                  "forSenderInstructions": null,
                  "linearDistance": 2.95,
                  "realDistance": 4.13,
                  "route": "example-encoded-route",
                  "estimatedDeliveryDuration": 10,
                  "realDeliveryDuration": 10,
                  "destinationContactEmail": "customer@example.com",
                  "destinationContactName": "Example Customer",
                  "destinationContactPhone": "+34600000000",
                  "destinationContactPhoneInternational": "+34600000000",
                  "pickupContactEmail": "restaurant@example.com",
                  "pickupContactName": "Example Restaurant",
                  "pickupContactPhone": "+34600000003",
                  "pickupContactPhoneInternational": "+34600000003",
                  "deliveryDescription": "Example delivery",
                  "onDeliveryPayments": [],
                  "onPickupPayments": [],
                  "newStatusOptions": [],
                  "trackingUrl": "https://example.com/tracking/example",
                  "openqloudOrderId": 2001,
                  "marketOrderCode": "ORDER-EXAMPLE",
                  "marketOrderId": "MARKET-ORDER-EXAMPLE",
                  "marketName": "Example Marketplace",
                  "marketCode": "EXAMPLE_MARKET",
                  "orderBrandId": 3001,
                  "orderBrandName": "Example Brand",
                  "orderTotalAmount": 34.05
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Delivery not found"
          }
        }
      }
    },
    "/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": 800,
                "name": "Alex",
                "lastname": "Example",
                "phone": "+34600000000",
                "email": "driver@example.com"
              }
            }
          }
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Driver"
                },
                "example": {
                  "id": 11823,
                  "email": null,
                  "name": "Alex",
                  "lastname": "Example",
                  "image": null,
                  "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": "OpenQloud 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": 38254,
                "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://example.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",
        "x-implementation-status": "native-sgk",
        "x-parity-status": "binary-state-certified-local",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "deliveryId": {
                    "type": "integer",
                    "format": "int64",
                    "description": "OpenQloud 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": 61204,
                "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://example.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": "OpenQloud 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": 38254,
                "driverId": 5058,
                "pickupTime": "2026-08-28T17: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://example.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": []
          }
        ]
      }
    },
    "/deliveryAccounts/{deliveryAccountId}/deliveries/active": {
      "get": {
        "operationId": "getActiveDeliveries",
        "summary": "List active deliveries for a delivery account",
        "tags": [
          "Delivery"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "deliveryAccountId",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Active deliveries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Delivery account not found"
          }
        }
      }
    },
    "/deliveryAccounts/{deliveryAccountId}/deliveries/{deliveryId}/status": {
      "post": {
        "operationId": "updateDeliveryStatusByAccount",
        "summary": "Update a delivery status using its delivery identifier",
        "tags": [
          "Delivery"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "deliveryAccountId",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "deliveryId",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "statusCode"
                ],
                "properties": {
                  "statusCode": {
                    "type": "string"
                  },
                  "silenceErrors": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated delivery",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "404": {
            "description": "Delivery not found"
          }
        }
      }
    },
    "/drivers/location": {
      "post": {
        "operationId": "updateDriverLocation",
        "summary": "Update a driver location",
        "tags": [
          "Driver"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "externalDriverId",
                  "latitude",
                  "longitude"
                ],
                "properties": {
                  "externalDriverId": {
                    "type": "string"
                  },
                  "latitude": {
                    "type": "number"
                  },
                  "longitude": {
                    "type": "number"
                  },
                  "silenceErrors": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated driver",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Driver not found"
          }
        }
      }
    }
  },
  "webhooks": {
    "newDeliveryWebhook": {
      "post": {
        "summary": "Delivery created WebHook",
        "description": "Always a new delivery is created, the system will send the delivery object to this endpoint.<br>The event code is <b>new_delivery</b>\n\nThis is an outgoing webhook sent by OpenQloud.",
        "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://example.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": "OK"
          },
          "400": {
            "description": "Bad Request"
          }
        }
      }
    },
    "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 OpenQloud.",
        "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://example.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://example.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://example.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"
      ]
    }
  ]
}
