{
  "openapi": "3.1.0",
  "info": {
    "title": "Translogics Open API",
    "version": "1.0.0",
    "summary": "The carrier's own data from Translogics: shipments, trips, stops, vehicles, CO2 per shipment and invoice headers, with webhooks.",
    "description": "Read-only API for a carrier using Translogics, for its own systems (data warehouse, BI, TMS).\n\n**Authentication.** Create a key on the screen *Open API en webhooks* (backoffice, line 7). Send it as `Authorization: Bearer tlo_...`. A key has scopes; every path needs one. The key is shown once.\n\n**Pagination.** Lists use a cursor: follow `next_cursor` until `has_more` is false. With `updated_since` the list is ordered by `updated_at`, so an incremental sync asks for everything changed since its previous run.\n\n**CSV.** Every list is also available as CSV with `format=csv` or `Accept: text/csv`; nested lists become a JSON cell.\n\n**CO2.** With the scope `open:co2`, stops, shipments and trips carry their emissions, calculated per ISO 14083:2023 and the GLEC Framework with versioned emission factors (CO2emissiefactoren.nl 2026). Values are kg CO2e; `wtw_kg` (well-to-wheel) is what a client reports in scope 3.\n\n**Errors.** JSON with `message` (and `fout`), in the language of `Accept-Language` (nl, en, fr, de). Field names and codes are fixed English.\n\n**Webhooks.** See the `webhooks` section: signed with HMAC-SHA256, retried with backoff, switched off after 10 failed attempts in a row spanning more than 24 hours.",
    "contact": {
      "name": "Translogics",
      "url": "https://translogics.eu/api"
    }
  },
  "servers": [
    {
      "url": "https://operation.translogics.eu/api",
      "description": "Production"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "tags": [
    {
      "name": "Meta"
    },
    {
      "name": "Shipments"
    },
    {
      "name": "Trips"
    },
    {
      "name": "Stops"
    },
    {
      "name": "Vehicles"
    },
    {
      "name": "Invoices"
    },
    {
      "name": "CO2"
    },
    {
      "name": "Webhooks"
    }
  ],
  "paths": {
    "/open/v1/openapi.json": {
      "get": {
        "operationId": "getSpec",
        "summary": "This description (public, no key).",
        "tags": [
          "Meta"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "OpenAPI 3.1 document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/open/v1/me": {
      "get": {
        "operationId": "getMe",
        "summary": "The carrier and the scopes of this key.",
        "tags": [
          "Meta"
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "The key.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "carrier": {
                      "type": "string"
                    },
                    "key": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "prefix": {
                          "type": "string"
                        },
                        "scopes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "co2_available": {
                      "type": "boolean"
                    },
                    "api_version": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No key, or the key is unknown or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope for this path.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The carrier's environment is blocked or its subscription is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or the module is switched off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A parameter is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests (240 per minute).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/open/v1/shipments": {
      "get": {
        "operationId": "listShipments",
        "summary": "Transport orders with stops, goods and status.",
        "tags": [
          "Shipments"
        ],
        "security": [
          {
            "bearer": [
              "open:shipments"
            ]
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 500.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The next_cursor of the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Only rows changed at or after this moment (ISO 8601). The list is then ordered by updated_at.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "json (default) or csv. Also with Accept: text/csv.",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter on status.",
            "schema": {
              "type": "string",
              "enum": [
                "requested",
                "accepted",
                "planned",
                "in_transit",
                "delivered",
                "cancelled",
                "declined"
              ]
            }
          },
          {
            "name": "client_id",
            "in": "query",
            "required": false,
            "description": "Filter on client.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page.",
            "headers": {
              "X-Next-Cursor": {
                "description": "With format=csv: the next cursor.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Page"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Shipment"
                          }
                        }
                      },
                      "required": [
                        "data"
                      ]
                    }
                  ]
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "No key, or the key is unknown or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope for this path.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The carrier's environment is blocked or its subscription is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or the module is switched off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A parameter is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests (240 per minute).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/open/v1/shipments/{id}": {
      "get": {
        "operationId": "getShipment",
        "summary": "One transport order.",
        "tags": [
          "Shipments"
        ],
        "security": [
          {
            "bearer": [
              "open:shipments"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The id.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One item.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Shipment"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "No key, or the key is unknown or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope for this path.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The carrier's environment is blocked or its subscription is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or the module is switched off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A parameter is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests (240 per minute).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/open/v1/trips": {
      "get": {
        "operationId": "listTrips",
        "summary": "Trips with vehicle, driver, status and distance.",
        "tags": [
          "Trips"
        ],
        "security": [
          {
            "bearer": [
              "open:trips"
            ]
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 500.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The next_cursor of the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Only rows changed at or after this moment (ISO 8601). The list is then ordered by updated_at.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "json (default) or csv. Also with Accept: text/csv.",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter on status.",
            "schema": {
              "type": "string",
              "enum": [
                "planned",
                "in_progress",
                "completed",
                "cancelled"
              ]
            }
          },
          {
            "name": "vehicle_id",
            "in": "query",
            "required": false,
            "description": "Filter on vehicle.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "description": "Trip date from (inclusive).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "description": "Trip date to (inclusive).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page.",
            "headers": {
              "X-Next-Cursor": {
                "description": "With format=csv: the next cursor.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Page"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Trip"
                          }
                        }
                      },
                      "required": [
                        "data"
                      ]
                    }
                  ]
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "No key, or the key is unknown or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope for this path.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The carrier's environment is blocked or its subscription is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or the module is switched off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A parameter is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests (240 per minute).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/open/v1/trips/{id}": {
      "get": {
        "operationId": "getTrip",
        "summary": "One trip.",
        "tags": [
          "Trips"
        ],
        "security": [
          {
            "bearer": [
              "open:trips"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The id.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One item.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Trip"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "No key, or the key is unknown or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope for this path.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The carrier's environment is blocked or its subscription is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or the module is switched off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A parameter is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests (240 per minute).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/open/v1/stops": {
      "get": {
        "operationId": "listStops",
        "summary": "Stops with status and proof of delivery metadata.",
        "tags": [
          "Stops"
        ],
        "security": [
          {
            "bearer": [
              "open:stops"
            ]
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 500.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The next_cursor of the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Only rows changed at or after this moment (ISO 8601). The list is then ordered by updated_at.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "json (default) or csv. Also with Accept: text/csv.",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter on status.",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "arrived",
                "completed",
                "skipped"
              ]
            }
          },
          {
            "name": "trip_id",
            "in": "query",
            "required": false,
            "description": "Filter on trip.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "reference",
            "in": "query",
            "required": false,
            "description": "Filter on the shipment reference.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "description": "Trip date from (inclusive).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "description": "Trip date to (inclusive).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page.",
            "headers": {
              "X-Next-Cursor": {
                "description": "With format=csv: the next cursor.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Page"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Stop"
                          }
                        }
                      },
                      "required": [
                        "data"
                      ]
                    }
                  ]
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "No key, or the key is unknown or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope for this path.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The carrier's environment is blocked or its subscription is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or the module is switched off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A parameter is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests (240 per minute).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/open/v1/stops/{id}": {
      "get": {
        "operationId": "getStop",
        "summary": "One stop.",
        "tags": [
          "Stops"
        ],
        "security": [
          {
            "bearer": [
              "open:stops"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The id.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One item.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Stop"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "No key, or the key is unknown or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope for this path.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The carrier's environment is blocked or its subscription is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or the module is switched off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A parameter is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests (240 per minute).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/open/v1/vehicles": {
      "get": {
        "operationId": "listVehicles",
        "summary": "Vehicles with fuel and capacity.",
        "tags": [
          "Vehicles"
        ],
        "security": [
          {
            "bearer": [
              "open:vehicles"
            ]
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 500.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The next_cursor of the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Only rows changed at or after this moment (ISO 8601). The list is then ordered by updated_at.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "json (default) or csv. Also with Accept: text/csv.",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ]
            }
          },
          {
            "name": "include_archived",
            "in": "query",
            "required": false,
            "description": "Also archived vehicles.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page.",
            "headers": {
              "X-Next-Cursor": {
                "description": "With format=csv: the next cursor.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Page"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Vehicle"
                          }
                        }
                      },
                      "required": [
                        "data"
                      ]
                    }
                  ]
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "No key, or the key is unknown or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope for this path.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The carrier's environment is blocked or its subscription is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or the module is switched off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A parameter is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests (240 per minute).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/open/v1/invoices": {
      "get": {
        "operationId": "listInvoices",
        "summary": "Invoice headers, without lines.",
        "tags": [
          "Invoices"
        ],
        "security": [
          {
            "bearer": [
              "open:invoices"
            ]
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 500.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The next_cursor of the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Only rows changed at or after this moment (ISO 8601). The list is then ordered by updated_at.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "json (default) or csv. Also with Accept: text/csv.",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter on status.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "client_id",
            "in": "query",
            "required": false,
            "description": "Filter on client.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "period_from",
            "in": "query",
            "required": false,
            "description": "Invoices whose period ends on or after this date.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "period_to",
            "in": "query",
            "required": false,
            "description": "Invoices whose period starts on or before this date.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page.",
            "headers": {
              "X-Next-Cursor": {
                "description": "With format=csv: the next cursor.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Page"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Invoice"
                          }
                        }
                      },
                      "required": [
                        "data"
                      ]
                    }
                  ]
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "No key, or the key is unknown or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope for this path.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The carrier's environment is blocked or its subscription is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or the module is switched off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A parameter is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests (240 per minute).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/open/v1/co2/summary": {
      "get": {
        "operationId": "getCo2Summary",
        "summary": "CO2 over a period (at most one year), grouped.",
        "tags": [
          "CO2"
        ],
        "security": [
          {
            "bearer": [
              "open:co2"
            ]
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "description": "First day.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "description": "Last day.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "group_by",
            "in": "query",
            "required": false,
            "description": "client (default), vehicle, type or period (per month).",
            "schema": {
              "type": "string",
              "enum": [
                "client",
                "vehicle",
                "type",
                "period"
              ]
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "json (default) or csv (the groups).",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The summary.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Co2Summary"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "No key, or the key is unknown or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope for this path.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The carrier's environment is blocked or its subscription is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or the module is switched off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A parameter is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests (240 per minute).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/open/v1/co2/trips/{id}": {
      "get": {
        "operationId": "getCo2Trip",
        "summary": "The full calculation of a completed trip, with every consignment.",
        "tags": [
          "CO2"
        ],
        "security": [
          {
            "bearer": [
              "open:co2"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The trip id.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The calculation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "allOf": [
                        {
                          "type": "object",
                          "properties": {
                            "trip_id": {
                              "type": "integer"
                            },
                            "date": {
                              "type": "string",
                              "format": "date"
                            }
                          }
                        },
                        {
                          "$ref": "#/components/schemas/TripCo2"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "The trip is not completed yet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No key, or the key is unknown or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope for this path.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The carrier's environment is blocked or its subscription is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or the module is switched off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A parameter is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests (240 per minute).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {
    "zending.aangemaakt": {
      "post": {
        "operationId": "webhook_zending_aangemaakt",
        "summary": "A shipment was created: a stop, or a transport order.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "X-Translogics-Event",
            "in": "header",
            "required": true,
            "description": "The event.",
            "schema": {
              "type": "string",
              "const": "zending.aangemaakt"
            }
          },
          {
            "name": "X-Translogics-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery (also `id` in the body).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Translogics-Webhook",
            "in": "header",
            "required": true,
            "description": "The id of the webhook.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Translogics-Signature",
            "in": "header",
            "required": true,
            "description": "t=<unix time>,v1=<hex HMAC-SHA256 of '<t>.<raw body>' with the webhook secret>. Reject a t more than 5 minutes off.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Anything else, a timeout (8 s) or a redirect is a failed attempt; retries follow after 1, 5, 15, 60, 240 and 720 minutes."
          }
        }
      }
    },
    "stop.afgeleverd": {
      "post": {
        "operationId": "webhook_stop_afgeleverd",
        "summary": "A stop was delivered or picked up.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "X-Translogics-Event",
            "in": "header",
            "required": true,
            "description": "The event.",
            "schema": {
              "type": "string",
              "const": "stop.afgeleverd"
            }
          },
          {
            "name": "X-Translogics-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery (also `id` in the body).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Translogics-Webhook",
            "in": "header",
            "required": true,
            "description": "The id of the webhook.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Translogics-Signature",
            "in": "header",
            "required": true,
            "description": "t=<unix time>,v1=<hex HMAC-SHA256 of '<t>.<raw body>' with the webhook secret>. Reject a t more than 5 minutes off.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Anything else, a timeout (8 s) or a redirect is a failed attempt; retries follow after 1, 5, 15, 60, 240 and 720 minutes."
          }
        }
      }
    },
    "stop.mislukt": {
      "post": {
        "operationId": "webhook_stop_mislukt",
        "summary": "A stop failed: refused or nobody present.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "X-Translogics-Event",
            "in": "header",
            "required": true,
            "description": "The event.",
            "schema": {
              "type": "string",
              "const": "stop.mislukt"
            }
          },
          {
            "name": "X-Translogics-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery (also `id` in the body).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Translogics-Webhook",
            "in": "header",
            "required": true,
            "description": "The id of the webhook.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Translogics-Signature",
            "in": "header",
            "required": true,
            "description": "t=<unix time>,v1=<hex HMAC-SHA256 of '<t>.<raw body>' with the webhook secret>. Reject a t more than 5 minutes off.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Anything else, a timeout (8 s) or a redirect is a failed attempt; retries follow after 1, 5, 15, 60, 240 and 720 minutes."
          }
        }
      }
    },
    "rit.gestart": {
      "post": {
        "operationId": "webhook_rit_gestart",
        "summary": "A trip started.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "X-Translogics-Event",
            "in": "header",
            "required": true,
            "description": "The event.",
            "schema": {
              "type": "string",
              "const": "rit.gestart"
            }
          },
          {
            "name": "X-Translogics-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery (also `id` in the body).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Translogics-Webhook",
            "in": "header",
            "required": true,
            "description": "The id of the webhook.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Translogics-Signature",
            "in": "header",
            "required": true,
            "description": "t=<unix time>,v1=<hex HMAC-SHA256 of '<t>.<raw body>' with the webhook secret>. Reject a t more than 5 minutes off.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Anything else, a timeout (8 s) or a redirect is a failed attempt; retries follow after 1, 5, 15, 60, 240 and 720 minutes."
          }
        }
      }
    },
    "rit.afgerond": {
      "post": {
        "operationId": "webhook_rit_afgerond",
        "summary": "A trip was completed.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "X-Translogics-Event",
            "in": "header",
            "required": true,
            "description": "The event.",
            "schema": {
              "type": "string",
              "const": "rit.afgerond"
            }
          },
          {
            "name": "X-Translogics-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery (also `id` in the body).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Translogics-Webhook",
            "in": "header",
            "required": true,
            "description": "The id of the webhook.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Translogics-Signature",
            "in": "header",
            "required": true,
            "description": "t=<unix time>,v1=<hex HMAC-SHA256 of '<t>.<raw body>' with the webhook secret>. Reject a t more than 5 minutes off.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Anything else, a timeout (8 s) or a redirect is a failed attempt; retries follow after 1, 5, 15, 60, 240 and 720 minutes."
          }
        }
      }
    },
    "factuur.aangemaakt": {
      "post": {
        "operationId": "webhook_factuur_aangemaakt",
        "summary": "A sales invoice was created.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "X-Translogics-Event",
            "in": "header",
            "required": true,
            "description": "The event.",
            "schema": {
              "type": "string",
              "const": "factuur.aangemaakt"
            }
          },
          {
            "name": "X-Translogics-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery (also `id` in the body).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Translogics-Webhook",
            "in": "header",
            "required": true,
            "description": "The id of the webhook.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Translogics-Signature",
            "in": "header",
            "required": true,
            "description": "t=<unix time>,v1=<hex HMAC-SHA256 of '<t>.<raw body>' with the webhook secret>. Reject a t more than 5 minutes off.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Anything else, a timeout (8 s) or a redirect is a failed attempt; retries follow after 1, 5, 15, 60, 240 and 720 minutes."
          }
        }
      }
    },
    "ping": {
      "post": {
        "operationId": "webhook_ping",
        "summary": "A test message from the screen Open API en webhooks.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "X-Translogics-Event",
            "in": "header",
            "required": true,
            "description": "The event.",
            "schema": {
              "type": "string",
              "const": "ping"
            }
          },
          {
            "name": "X-Translogics-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery (also `id` in the body).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Translogics-Webhook",
            "in": "header",
            "required": true,
            "description": "The id of the webhook.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Translogics-Signature",
            "in": "header",
            "required": true,
            "description": "t=<unix time>,v1=<hex HMAC-SHA256 of '<t>.<raw body>' with the webhook secret>. Reject a t more than 5 minutes off.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Anything else, a timeout (8 s) or a redirect is a failed attempt; retries follow after 1, 5, 15, 60, 240 and 720 minutes."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "A key of the open API (tlo_...). Scopes: open:shipments, open:trips, open:stops, open:vehicles, open:co2, open:invoices."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "A sentence in the language of Accept-Language (nl, en, fr, de)."
          },
          "fout": {
            "type": "string",
            "description": "The same sentence in plain words, for display."
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Per field, on 422."
          }
        },
        "required": [
          "message"
        ]
      },
      "Page": {
        "type": "object",
        "properties": {
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to get the next page; null on the last page."
          },
          "has_more": {
            "type": "boolean"
          }
        },
        "required": [
          "next_cursor",
          "has_more"
        ]
      },
      "Location": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "lat": {
            "type": "number"
          },
          "lng": {
            "type": "number"
          }
        }
      },
      "FactorSet": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        }
      },
      "ConsignmentCo2": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "calculated",
              "not_calculable",
              "not_completed",
              "not_planned",
              "see_shipment"
            ],
            "description": "`calculated` once the trip is completed. A stop that belongs to a transport order carries the CO2 on the shipment (`see_shipment`)."
          },
          "shipment_id": {
            "type": "integer",
            "description": "Only with `see_shipment`."
          },
          "method": {
            "type": "string",
            "examples": [
              "ISO 14083:2023 / GLEC Framework"
            ]
          },
          "client_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "mass_kg": {
            "type": "number"
          },
          "mass_source": {
            "type": "string",
            "enum": [
              "measured",
              "default"
            ]
          },
          "distance_km": {
            "type": "number",
            "description": "Allocation distance: great circle from the depot to the address times the detour factor, or the order distance."
          },
          "distance_source": {
            "type": "string",
            "enum": [
              "order",
              "great_circle",
              "average_of_trip",
              "mass_only",
              "unknown"
            ]
          },
          "tkm": {
            "type": "number",
            "description": "Tonne-kilometres: mass in tonnes times distance."
          },
          "share": {
            "type": "number",
            "description": "Share of the trip's emissions (tkm of this consignment divided by tkm of the trip)."
          },
          "wtw_kg": {
            "type": "number",
            "description": "Well-to-wheel, kg CO2e. Report this in scope 3 category 4 or 9."
          },
          "ttw_kg": {
            "type": "number",
            "description": "Tank-to-wheel, kg CO2e."
          },
          "wtt_kg": {
            "type": "number",
            "description": "Well-to-tank, kg CO2e."
          },
          "biogenic_kg": {
            "type": "number",
            "description": "Biogenic CO2 from biofuels, outside the scopes."
          },
          "g_per_tkm": {
            "type": [
              "number",
              "null"
            ]
          },
          "factor_set": {
            "$ref": "#/components/schemas/FactorSet"
          }
        },
        "required": [
          "status"
        ]
      },
      "TripCo2": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "calculated",
              "not_calculable",
              "not_completed"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "geen_afstand",
              "geen_verbruik",
              null
            ]
          },
          "method": {
            "type": "string"
          },
          "distance_km": {
            "type": "number"
          },
          "distance_source": {
            "type": "string",
            "enum": [
              "odometer",
              "route_plan",
              "stop_distances",
              "great_circle",
              "unknown"
            ]
          },
          "vehicle_class": {
            "type": "string",
            "enum": [
              "van",
              "rigid_truck",
              "tractor_trailer"
            ]
          },
          "energy_carrier": {
            "type": "string",
            "examples": [
              "diesel_b7",
              "hvo100",
              "stroom_gridmix"
            ]
          },
          "consumption_per_100km": {
            "type": [
              "number",
              "null"
            ]
          },
          "consumption_source": {
            "type": "string",
            "enum": [
              "vehicle_profile",
              "measured_fuel_entries",
              "default",
              "unknown"
            ]
          },
          "energy": {
            "type": "number"
          },
          "energy_unit": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "liter",
              "kg",
              "kWh"
            ]
          },
          "energy_mj": {
            "type": "number"
          },
          "wtw_kg": {
            "type": "number"
          },
          "ttw_kg": {
            "type": "number"
          },
          "wtt_kg": {
            "type": "number"
          },
          "biogenic_kg": {
            "type": "number"
          },
          "tkm": {
            "type": "number"
          },
          "g_per_tkm": {
            "type": [
              "number",
              "null"
            ]
          },
          "subcontracted": {
            "type": "boolean"
          },
          "factor_set": {
            "$ref": "#/components/schemas/FactorSet"
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "consignments": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "stop",
                        "shipment"
                      ]
                    },
                    "id": {
                      "type": "integer"
                    }
                  }
                },
                {
                  "$ref": "#/components/schemas/ConsignmentCo2"
                }
              ]
            }
          }
        },
        "required": [
          "status"
        ]
      },
      "Shipment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "client_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "trip_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "number": {
            "type": "string"
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "requested",
              "accepted",
              "planned",
              "in_transit",
              "delivered",
              "cancelled",
              "declined"
            ]
          },
          "source": {
            "type": [
              "string",
              "null"
            ]
          },
          "requested_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "reviewed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "delivered_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "stops": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "load",
                    "unload"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "street": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "postal_code": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "city": {
                  "type": "string"
                },
                "country": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "date": {
                  "type": "string",
                  "format": "date"
                },
                "time_from": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "time_to": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "reference": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "signed": {
                  "type": [
                    "object",
                    "null"
                  ]
                }
              }
            }
          },
          "goods": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "line": {
                  "type": "integer"
                },
                "quantity": {
                  "type": "integer"
                },
                "packaging": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "weight_kg": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "loading_metres": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "volume_m3": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "exchange_pallets": {
                  "type": "boolean"
                },
                "adr": {
                  "type": [
                    "object",
                    "null"
                  ]
                }
              }
            }
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "co2": {
            "$ref": "#/components/schemas/ConsignmentCo2",
            "description": "Only with the scope open:co2."
          }
        },
        "required": [
          "id",
          "number",
          "status"
        ]
      },
      "Stop": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "trip_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "shipment_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "type": {
            "type": "string",
            "enum": [
              "delivery",
              "pickup",
              "pallet"
            ]
          },
          "sequence": {
            "type": [
              "integer",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "arrived",
              "completed",
              "skipped"
            ]
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "client_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "recipient": {
            "type": "object",
            "properties": {
              "company": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "address": {
            "type": "object",
            "description": "Street, house number, postal code, city and country; or `line` and `city` for a stop without an address in the address book."
          },
          "location": {
            "$ref": "#/components/schemas/Location"
          },
          "window": {
            "type": "object",
            "properties": {
              "start": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "end": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "planned_eta": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "arrived_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "colli": {
            "type": [
              "integer",
              "null"
            ]
          },
          "weight_kg": {
            "type": [
              "number",
              "null"
            ]
          },
          "cod_amount_cents": {
            "type": [
              "integer",
              "null"
            ]
          },
          "proof": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "result": {
                "type": "string",
                "enum": [
                  "delivered",
                  "refused",
                  "not_present"
                ]
              },
              "recipient_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "delivery_location": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "reason": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "signature": {
                "type": "boolean"
              },
              "signature_kind": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "photos": {
                "type": "integer"
              },
              "completed_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "location": {
                "$ref": "#/components/schemas/Location"
              },
              "sealed": {
                "type": "boolean",
                "description": "The proof is frozen with a hash and cannot change."
              }
            }
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "co2": {
            "$ref": "#/components/schemas/ConsignmentCo2",
            "description": "Only with the scope open:co2."
          }
        },
        "required": [
          "id",
          "type",
          "status"
        ]
      },
      "Trip": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "type": "string",
            "enum": [
              "courier",
              "truck"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "planned",
              "in_progress",
              "completed",
              "cancelled"
            ]
          },
          "client_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "vehicle": {
            "type": "object",
            "properties": {
              "id": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "plate": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "trailer_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "driver": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "subcontracted": {
            "type": "boolean"
          },
          "planned_start_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "planned_distance_km": {
            "type": [
              "number",
              "null"
            ]
          },
          "odometer": {
            "type": "object",
            "properties": {
              "start_km": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "end_km": {
                "type": [
                  "integer",
                  "null"
                ]
              }
            }
          },
          "stops": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer"
              },
              "completed": {
                "type": "integer"
              }
            }
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "co2": {
            "$ref": "#/components/schemas/TripCo2",
            "description": "Only with the scope open:co2; without consignments (see /co2/trips/{id})."
          }
        },
        "required": [
          "id",
          "date",
          "status"
        ]
      },
      "Vehicle": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "plate": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "bus",
              "truck",
              "van",
              "taxi",
              "trekker",
              "oplegger",
              "aanhanger"
            ]
          },
          "brand": {
            "type": [
              "string",
              "null"
            ]
          },
          "model": {
            "type": [
              "string",
              "null"
            ]
          },
          "fuel_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "emission_class": {
            "type": [
              "string",
              "null"
            ]
          },
          "co2_class": {
            "type": [
              "integer",
              "null"
            ]
          },
          "max_mass_kg": {
            "type": [
              "integer",
              "null"
            ]
          },
          "capacity": {
            "type": "object",
            "properties": {
              "colli": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "weight_kg": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "volume_m3": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "pallet_places": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "loading_metres": {
                "type": [
                  "number",
                  "null"
                ]
              }
            }
          },
          "subcontractor_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "archived": {
            "type": "boolean"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "co2_profile": {
            "type": [
              "object",
              "null"
            ],
            "description": "Only with the scope open:co2.",
            "properties": {
              "energy_carrier": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "vehicle_class": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "consumption_per_100km": {
                "type": [
                  "number",
                  "null"
                ]
              }
            }
          }
        },
        "required": [
          "id",
          "plate",
          "type"
        ]
      },
      "Invoice": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "number": {
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "type": [
              "string",
              "null"
            ]
          },
          "client": {
            "type": "object",
            "properties": {
              "id": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "period_start": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "period_end": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "amount_ex_vat_cents": {
            "type": "integer"
          },
          "vat_cents": {
            "type": "integer"
          },
          "vat_percentage": {
            "type": [
              "number",
              "null"
            ]
          },
          "amount_cents": {
            "type": "integer"
          },
          "status": {
            "type": "string"
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "sent_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "paid_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "paid_amount_cents": {
            "type": [
              "integer",
              "null"
            ]
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "amount_cents",
          "status"
        ]
      },
      "Co2Summary": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "group_by": {
            "type": "string",
            "enum": [
              "client",
              "vehicle",
              "type",
              "period"
            ]
          },
          "totals": {
            "type": "object",
            "properties": {
              "trips": {
                "type": "integer"
              },
              "consignments": {
                "type": "integer"
              },
              "distance_km": {
                "type": "number"
              },
              "tkm": {
                "type": "number"
              },
              "wtw_kg": {
                "type": "number"
              },
              "ttw_kg": {
                "type": "number"
              },
              "wtt_kg": {
                "type": "number"
              },
              "biogenic_kg": {
                "type": "number"
              },
              "g_per_tkm": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "unallocated_kg": {
                "type": "number",
                "description": "Trips without consignments (empty runs)."
              }
            }
          },
          "scopes": {
            "type": "object",
            "properties": {
              "scope1_kg": {
                "type": "number"
              },
              "scope2_location_kg": {
                "type": "number"
              },
              "scope2_market_kg": {
                "type": "number"
              },
              "scope3_cat3_kg": {
                "type": "number"
              },
              "scope3_cat4_kg": {
                "type": "number"
              },
              "biogenic_kg": {
                "type": "number"
              }
            },
            "description": "The carrier's own scopes: own vehicles are scope 1 and 2, subcontracted trips scope 3 category 4."
          },
          "groups": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "factor_sets": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "WebhookEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Same as the header X-Translogics-Delivery. Use it to ignore a delivery you already processed."
          },
          "event": {
            "type": "string",
            "enum": [
              "zending.aangemaakt",
              "stop.afgeleverd",
              "stop.mislukt",
              "rit.gestart",
              "rit.afgerond",
              "factuur.aangemaakt",
              "ping"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "api_version": {
            "type": "string",
            "const": "v1"
          },
          "data": {
            "type": "object",
            "description": "`zending.aangemaakt`: {type, stop|shipment}; `stop.*`: {stop}; `rit.*`: {trip}; `factuur.aangemaakt`: {invoice}. The objects have the same shape as in the API, without co2."
          }
        },
        "required": [
          "id",
          "event",
          "created_at",
          "data"
        ]
      }
    }
  }
}
