{
  "openapi": "3.1.0",
  "info": {
    "title": "Nordify API",
    "version": "2026-11-26",
    "description": "Book and follow freight on Nordify from your own system.\n\n**Authentication:** send your API key in the `X-API-Key` header. Create keys under Settings → Integration in Nordify.\n\n**Time:** Time windows are Danish local time. Send an offset (e.g. \"2026-12-01T08:00:00+01:00\") and it is converted; a time with \"Z\" or no offset is read as Danish local time.\n\n**Prices:** every amount you receive is your own total price (all-in, ex. VAT).\n\n**Errors:** every error has the form `{ \"error\": \"<code>\", \"message\": \"...\", \"field\"?: \"...\" }`. Use `error` in your code; `message` may change.\n\n**Forward compatibility:** new fields can be added to responses. Ignore fields you do not know.",
    "contact": {
      "name": "Nordify",
      "url": "https://nordify.app/developers"
    }
  },
  "servers": [
    {
      "url": "https://api.nordify.app"
    }
  ],
  "security": [
    {
      "ApiKey": []
    }
  ],
  "tags": [
    {
      "name": "Loads"
    },
    {
      "name": "Bids"
    },
    {
      "name": "Documents"
    },
    {
      "name": "Labels"
    },
    {
      "name": "Webhooks"
    },
    {
      "name": "Autopilot"
    },
    {
      "name": "Price estimate"
    }
  ],
  "paths": {
    "/api-loads": {
      "post": {
        "tags": [
          "Loads"
        ],
        "operationId": "createLoad",
        "summary": "Create a load",
        "description": "Creates a load with the same rules as \"Create transport\" in Nordify. Time windows are Danish local time. Send an offset (e.g. \"2026-12-01T08:00:00+01:00\") and it is converted; a time with \"Z\" or no offset is read as Danish local time. If you have a contract rate on the lane, the load goes directly to that carrier and the response has `contract`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoadCreate"
              },
              "example": {
                "from_address": "Industrivej 10, 2630 Taastrup, Denmark",
                "to_address": "Havnevej 5, 5000 Odense, Denmark",
                "weight_kg": 400,
                "volume_m3": 2.5,
                "pallets": 1,
                "goods_type": "PLL",
                "pallet_breakdown": [
                  {
                    "type": "hel",
                    "count": 1,
                    "dimensions": {
                      "length": 120,
                      "width": 80,
                      "height": 135
                    }
                  }
                ],
                "delivery_option": "interval",
                "pickup_earliest": "2026-12-01T08:00:00+01:00",
                "pickup_latest": "2026-12-01T10:00:00+01:00",
                "delivery_start": "2026-12-01T12:00:00+01:00",
                "delivery_end": "2026-12-01T16:00:00+01:00",
                "requested_vehicle": "rigid_truck",
                "requires_tailgate_delivery": true,
                "recipient_company": "Odense Elektronik A/S",
                "delivery_contact": {
                  "name": "Mette",
                  "phone": "+45 87 65 43 21",
                  "site_notes": "Gate 3"
                },
                "delivery_ref": "DO-2026-042",
                "max_all_in_price_dkk": 5000
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "load": {
                      "$ref": "#/components/schemas/Load"
                    },
                    "contract": {
                      "type": "object",
                      "properties": {
                        "contract_id": {
                          "type": "string"
                        },
                        "contract_name": {
                          "type": "string"
                        },
                        "zone_name": {
                          "type": "string"
                        },
                        "carrier_id": {
                          "type": "string"
                        },
                        "price_dkk": {
                          "type": "number",
                          "description": "Your agreed price"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "units": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string"
                              },
                              "count": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      },
                      "description": "Only when a contract rate matched"
                    },
                    "missing_fields": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Fields the carrier will ask for if they are not added"
                    }
                  },
                  "required": [
                    "success",
                    "load"
                  ]
                },
                "example": {
                  "success": true,
                  "load": {
                    "id": "550e8400-e29b-41d4-a716-446655440000",
                    "load_number": "NDF-12345",
                    "status": "open",
                    "from_address": "Industrivej 10, 2630 Taastrup, Denmark",
                    "to_address": "Havnevej 5, 5000 Odense, Denmark",
                    "from_city": "Taastrup",
                    "to_city": "Odense",
                    "weight_kg": 400,
                    "volume_m3": 2.5,
                    "pallets": 1,
                    "pickup_earliest": "2026-12-01T08:00:00.000Z",
                    "pickup_latest": "2026-12-01T10:00:00.000Z",
                    "delivery_start": "2026-12-01T12:00:00.000Z",
                    "delivery_end": "2026-12-01T16:00:00.000Z",
                    "transport_mode": "road",
                    "created_at": "2026-11-27T09:00:00Z"
                  },
                  "missing_fields": [
                    "pickup_contact"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error (invalid_value, missing_fields, address_incomplete, invalid_stop_details, invalid_sender_company)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      },
      "get": {
        "tags": [
          "Loads"
        ],
        "operationId": "listLoads",
        "summary": "List your loads",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "open, bidding, assigned, in_transit, delivered, cancelled"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "loads": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Load"
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Number of loads in this page (not the total)"
                    }
                  },
                  "required": [
                    "success"
                  ]
                },
                "example": {
                  "success": true,
                  "loads": [
                    {
                      "id": "550e8400-e29b-41d4-a716-446655440000",
                      "load_number": "NDF-12345",
                      "status": "bidding",
                      "from_address": "Industrivej 10, 2630 Taastrup, Denmark",
                      "to_address": "Havnevej 5, 5000 Odense, Denmark",
                      "from_city": "Taastrup",
                      "to_city": "Odense",
                      "weight_kg": 400,
                      "volume_m3": 2.5,
                      "pallets": 1,
                      "pickup_earliest": "2026-12-01T08:00:00.000Z",
                      "pickup_latest": "2026-12-01T10:00:00.000Z",
                      "delivery_start": "2026-12-01T12:00:00.000Z",
                      "delivery_end": "2026-12-01T16:00:00.000Z",
                      "transport_mode": "road",
                      "created_at": "2026-11-27T09:00:00Z"
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/api-loads/{id}": {
      "get": {
        "tags": [
          "Loads"
        ],
        "operationId": "getLoad",
        "summary": "Get a load with bids, assignment and CO₂",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Load id (uuid)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "load": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/Load"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "bids": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/Bid"
                              }
                            },
                            "assignments": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/Assignment"
                              }
                            }
                          }
                        }
                      ]
                    },
                    "esg_data": {
                      "type": "object",
                      "properties": {
                        "total_co2e_kg": {
                          "type": "number"
                        },
                        "records": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {}
                          }
                        }
                      }
                    },
                    "missing_fields": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "success"
                  ]
                },
                "example": {
                  "success": true,
                  "load": {
                    "id": "550e8400-e29b-41d4-a716-446655440000",
                    "load_number": "NDF-12345",
                    "status": "bidding",
                    "from_address": "Industrivej 10, 2630 Taastrup, Denmark",
                    "to_address": "Havnevej 5, 5000 Odense, Denmark",
                    "from_city": "Taastrup",
                    "to_city": "Odense",
                    "weight_kg": 400,
                    "volume_m3": 2.5,
                    "pallets": 1,
                    "pickup_earliest": "2026-12-01T08:00:00.000Z",
                    "pickup_latest": "2026-12-01T10:00:00.000Z",
                    "delivery_start": "2026-12-01T12:00:00.000Z",
                    "delivery_end": "2026-12-01T16:00:00.000Z",
                    "transport_mode": "road",
                    "created_at": "2026-11-27T09:00:00Z",
                    "bids": [
                      {
                        "id": "b1c2d3e4-f5a6-7890-bcde-f12345678901",
                        "currency": "DKK",
                        "price_ex_vat_dkk": 2500,
                        "price_display": "2500 DKK",
                        "vat_dkk": 625,
                        "price_inc_vat_dkk": 3125,
                        "status": "pending",
                        "created_at": "2026-11-27T10:15:00Z",
                        "estimated_time_days": 1
                      }
                    ],
                    "assignments": []
                  },
                  "esg_data": {
                    "total_co2e_kg": 12.5,
                    "records": []
                  },
                  "missing_fields": []
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      },
      "delete": {
        "tags": [
          "Loads"
        ],
        "operationId": "deleteLoad",
        "summary": "Delete a load (open or bidding only)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Load id (uuid)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success"
                  ]
                },
                "example": {
                  "success": true,
                  "message": "Load deleted successfully"
                }
              }
            }
          },
          "400": {
            "description": "invalid_load_status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/api-loads/{id}/cancel": {
      "post": {
        "tags": [
          "Loads"
        ],
        "operationId": "cancelLoad",
        "summary": "Cancel a load",
        "description": "Allowed in status open, bidding, assigned or in_transit. At most 15 cancellations per 7 days per account (429 rate_limited).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Load id (uuid)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "load_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "const": "cancelled"
                    }
                  },
                  "required": [
                    "success"
                  ]
                },
                "example": {
                  "success": true,
                  "message": "Load cancelled successfully",
                  "load_id": "550e8400-e29b-41d4-a716-446655440000",
                  "status": "cancelled"
                }
              }
            }
          },
          "400": {
            "description": "invalid_load_status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/api-loads/{id}/reopen": {
      "post": {
        "tags": [
          "Loads"
        ],
        "operationId": "reopenLoad",
        "summary": "Reopen a cancelled load",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Load id (uuid)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success"
                  ]
                },
                "example": {
                  "success": true,
                  "message": "Load reopened successfully"
                }
              }
            }
          },
          "400": {
            "description": "invalid_load_status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/api-loads/{id}/rate": {
      "post": {
        "tags": [
          "Loads"
        ],
        "operationId": "rateCarrier",
        "summary": "Rate the carrier after delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Load id (uuid)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "rating": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 5
                  },
                  "comment": {
                    "type": "string"
                  }
                },
                "required": [
                  "rating"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success"
                  ]
                },
                "example": {
                  "success": true,
                  "message": "Rating submitted successfully"
                }
              }
            }
          },
          "400": {
            "description": "invalid_rating, invalid_load_status, already_rated, no_assignment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/api-loads/{id}/emissions": {
      "get": {
        "tags": [
          "Loads"
        ],
        "operationId": "getEmissions",
        "summary": "CO₂ emissions (ISO 14083 / GLEC v3)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Load id (uuid)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "load_id": {
                      "type": "string"
                    },
                    "esg_data": {
                      "type": "object",
                      "properties": {
                        "total_co2e_kg": {
                          "type": "number"
                        },
                        "total_ton_km": {
                          "type": "number"
                        },
                        "methodology": {
                          "type": "string"
                        },
                        "emission_factor_gco2e_per_tkm": {
                          "type": "number"
                        },
                        "records": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "co2e_kg": {
                                "type": "number"
                              },
                              "distance_km": {
                                "type": "number"
                              },
                              "weight_kg": {
                                "type": "number"
                              },
                              "ton_km": {
                                "type": "number"
                              },
                              "iso_14083_compliant": {
                                "type": "boolean"
                              },
                              "recorded_at": {
                                "type": "string",
                                "description": "Recorded",
                                "format": "date-time"
                              }
                            }
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ]
                },
                "example": {
                  "success": true,
                  "load_id": "550e8400-e29b-41d4-a716-446655440000",
                  "esg_data": {
                    "total_co2e_kg": 12.5,
                    "total_ton_km": 45.6,
                    "methodology": "ISO 14083 / GLEC v3",
                    "emission_factor_gco2e_per_tkm": 78.47,
                    "records": [
                      {
                        "id": "e1",
                        "co2e_kg": 12.5,
                        "distance_km": 114,
                        "weight_kg": 400,
                        "ton_km": 45.6,
                        "iso_14083_compliant": true,
                        "recorded_at": "2026-12-01T15:30:00Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/api-loads/{id}/bids/{bidId}/accept": {
      "post": {
        "tags": [
          "Bids"
        ],
        "operationId": "acceptBid",
        "summary": "Accept a bid",
        "description": "Chooses the bid. The carrier then confirms; only then is an assignment created (webhook load.assigned).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Load id (uuid)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "bidId",
            "in": "path",
            "required": true,
            "description": "Bid id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "bid_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "const": "pending_carrier_acceptance"
                    }
                  },
                  "required": [
                    "success"
                  ]
                },
                "example": {
                  "success": true,
                  "message": "Bid accepted, awaiting carrier confirmation",
                  "bid_id": "b1c2d3e4-f5a6-7890-bcde-f12345678901",
                  "status": "pending_carrier_acceptance"
                }
              }
            }
          },
          "400": {
            "description": "invalid_bid_status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/api-loads/{id}/bids/{bidId}/cancel": {
      "post": {
        "tags": [
          "Bids"
        ],
        "operationId": "cancelBidAcceptance",
        "summary": "Undo a bid acceptance before the carrier confirms",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Load id (uuid)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "bidId",
            "in": "path",
            "required": true,
            "description": "Bid id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "bid_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "const": "pending"
                    }
                  },
                  "required": [
                    "success"
                  ]
                },
                "example": {
                  "success": true,
                  "message": "Bid acceptance cancelled",
                  "bid_id": "b1c2d3e4-f5a6-7890-bcde-f12345678901",
                  "status": "pending"
                }
              }
            }
          },
          "400": {
            "description": "invalid_bid_status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/api-documents/{id}/cmr": {
      "get": {
        "tags": [
          "Documents"
        ],
        "operationId": "getCmr",
        "summary": "CMR consignment note (signed download link)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Load id (uuid)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "document_type": {
                      "type": "string",
                      "const": "cmr"
                    },
                    "cmr_number": {
                      "type": "string"
                    },
                    "download_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "expires_in": {
                      "type": "integer",
                      "description": "Seconds"
                    }
                  },
                  "required": [
                    "success"
                  ]
                },
                "example": {
                  "success": true,
                  "document_type": "cmr",
                  "cmr_number": "CMR-20261201-001",
                  "download_url": "https://files.example/cmr.pdf?token=...",
                  "expires_in": 3600
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "not_found, document_not_ready",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/api-documents/{id}/pod": {
      "get": {
        "tags": [
          "Documents"
        ],
        "operationId": "getPod",
        "summary": "Proof of delivery (signed download link)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Load id (uuid)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "document_type": {
                      "type": "string",
                      "const": "pod"
                    },
                    "download_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "expires_in": {
                      "type": "integer",
                      "description": "Seconds"
                    }
                  },
                  "required": [
                    "success"
                  ]
                },
                "example": {
                  "success": true,
                  "document_type": "pod",
                  "download_url": "https://files.example/pod.pdf?token=...",
                  "expires_in": 3600
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "not_found, document_not_ready",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/api-labels/{id}": {
      "get": {
        "tags": [
          "Labels"
        ],
        "operationId": "getLabels",
        "summary": "Shipping labels (PDF 100×150 mm, or JSON)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Load id (uuid)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "json"
              ]
            },
            "description": "json for raw label data"
          }
        ],
        "responses": {
          "200": {
            "description": "PDF, or JSON with ?format=json",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "load_id": {
                      "type": "string"
                    },
                    "load_number": {
                      "type": "string"
                    },
                    "total_labels": {
                      "type": "integer"
                    },
                    "labels": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {}
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "load_id": "550e8400-e29b-41d4-a716-446655440000",
                  "load_number": "NDF-12345",
                  "total_labels": 1,
                  "labels": [
                    {
                      "label_index": 1,
                      "barcode_value": "NDF-12345-1"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/api-webhooks": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "createWebhook",
        "summary": "Register a webhook",
        "description": "The secret is only shown once. Every delivery is signed: X-Webhook-Signature = hex HMAC-SHA256 of the raw body with your secret. Webhooks never carry amounts; fetch prices with GET /api-loads/{id}.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "webhook_url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "load.created",
                        "load.assigned",
                        "load.in_transit",
                        "load.delivered",
                        "load.cancelled",
                        "load.closed",
                        "load.deleted",
                        "bid.created",
                        "bid.accepted"
                      ]
                    }
                  }
                },
                "required": [
                  "webhook_url",
                  "events"
                ]
              },
              "example": {
                "webhook_url": "https://your-system.example/webhook",
                "events": [
                  "bid.created",
                  "load.delivered"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "webhook": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "webhook_url": {
                          "type": "string"
                        },
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "secret": {
                          "type": "string",
                          "description": "Shown only now"
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ]
                },
                "example": {
                  "success": true,
                  "webhook": {
                    "id": "a9b8c7d6-0000-4000-8000-000000000002",
                    "webhook_url": "https://your-system.example/webhook",
                    "events": [
                      "bid.created",
                      "load.delivered"
                    ],
                    "secret": "shown-only-once"
                  }
                }
              }
            }
          },
          "400": {
            "description": "missing_fields, invalid_events, invalid_webhook_url",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      },
      "get": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "listWebhooks",
        "summary": "List your webhooks",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "webhooks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "webhook_url": {
                            "type": "string"
                          },
                          "events": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "is_active": {
                            "type": "boolean"
                          },
                          "created_at": {
                            "type": "string",
                            "description": "Created",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ]
                },
                "example": {
                  "success": true,
                  "webhooks": [
                    {
                      "id": "a9b8c7d6-0000-4000-8000-000000000002",
                      "webhook_url": "https://your-system.example/webhook",
                      "events": [
                        "bid.created",
                        "load.delivered"
                      ],
                      "is_active": true,
                      "created_at": "2026-11-27T09:00:00Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/api-webhooks/{id}": {
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "deleteWebhook",
        "summary": "Delete a webhook",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Webhook id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success"
                  ]
                },
                "example": {
                  "success": true,
                  "message": "Webhook deleted successfully"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/api-autopilot": {
      "get": {
        "tags": [
          "Autopilot"
        ],
        "operationId": "getAutopilot",
        "summary": "Your Autopilot settings",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "settings": {
                      "type": "object",
                      "properties": {}
                    }
                  },
                  "required": [
                    "success"
                  ]
                },
                "example": {
                  "success": true,
                  "settings": {
                    "enabled": true,
                    "mode": "auto_accept_best",
                    "acceptance_mode": "time_of_day",
                    "acceptance_time_local": "11:00",
                    "require_min_bids": 2,
                    "hard_max_price": 5000
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "autopilot_not_enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      },
      "patch": {
        "tags": [
          "Autopilot"
        ],
        "operationId": "updateAutopilot",
        "summary": "Update your Autopilot settings",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "acceptance_mode": {
                    "type": "string",
                    "enum": [
                      "delay_based",
                      "time_of_day",
                      "hybrid"
                    ]
                  },
                  "acceptance_time_local": {
                    "type": "string",
                    "description": "HH:MM"
                  },
                  "acceptance_delay_seconds": {
                    "type": "integer"
                  },
                  "require_min_bids": {
                    "type": "integer"
                  },
                  "max_wait_minutes": {
                    "type": "integer"
                  },
                  "hard_max_price": {
                    "type": "number"
                  },
                  "auto_cancel_enabled": {
                    "type": "boolean"
                  },
                  "cancel_mode": {
                    "type": "string"
                  },
                  "cancel_offset_minutes": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success"
                  ]
                },
                "example": {
                  "success": true,
                  "message": "Settings updated"
                }
              }
            }
          },
          "400": {
            "description": "validation_error, no_valid_fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "autopilot_not_enabled, customer_edit_locked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/api-autopilot/lane-rules": {
      "get": {
        "tags": [
          "Autopilot"
        ],
        "operationId": "listLaneRules",
        "summary": "Your lane rules",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "lane_rules": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LaneRule"
                      }
                    }
                  },
                  "required": [
                    "success"
                  ]
                },
                "example": {
                  "success": true,
                  "lane_rules": [
                    {
                      "id": "7d1e2f30-0000-4000-8000-000000000001",
                      "origin_postcode_from": "1000",
                      "origin_postcode_to": "2999",
                      "destination_postcode_from": "5000",
                      "destination_postcode_to": "5999",
                      "max_all_in_price": 4500,
                      "currency": "DKK",
                      "active": true
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "autopilot_not_enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      },
      "post": {
        "tags": [
          "Autopilot"
        ],
        "operationId": "createLaneRule",
        "summary": "Create a lane rule",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LaneRule"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "lane_rule": {
                      "$ref": "#/components/schemas/LaneRule"
                    }
                  },
                  "required": [
                    "success"
                  ]
                },
                "example": {
                  "success": true,
                  "lane_rule": {
                    "id": "7d1e2f30-0000-4000-8000-000000000001",
                    "origin_postcode_from": "1000",
                    "origin_postcode_to": "2999",
                    "destination_postcode_from": "5000",
                    "destination_postcode_to": "5999",
                    "max_all_in_price": 4500,
                    "currency": "DKK",
                    "active": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_lane_rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "autopilot_not_enabled, customer_edit_locked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/api-autopilot/lane-rules/{id}": {
      "patch": {
        "tags": [
          "Autopilot"
        ],
        "operationId": "updateLaneRule",
        "summary": "Update a lane rule",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Lane rule id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LaneRule"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success"
                  ]
                },
                "example": {
                  "success": true,
                  "message": "Lane rule updated"
                }
              }
            }
          },
          "400": {
            "description": "invalid_lane_rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      },
      "delete": {
        "tags": [
          "Autopilot"
        ],
        "operationId": "deleteLaneRule",
        "summary": "Delete a lane rule",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Lane rule id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success"
                  ]
                },
                "example": {
                  "success": true,
                  "message": "Lane rule deleted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/api-price-estimate": {
      "post": {
        "tags": [
          "Price estimate"
        ],
        "operationId": "estimatePrice",
        "summary": "Estimated market price for a shipment",
        "description": "A reference range from comparable shipments. Carriers set the actual price.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "origin_postcode": {
                    "type": "string"
                  },
                  "origin_country": {
                    "type": "string"
                  },
                  "destination_postcode": {
                    "type": "string"
                  },
                  "destination_country": {
                    "type": "string"
                  },
                  "weight_kg": {
                    "type": "number"
                  },
                  "pallets": {
                    "type": "number"
                  },
                  "volume_m3": {
                    "type": "number"
                  },
                  "pickup_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "delivery_date": {
                    "type": "string",
                    "format": "date"
                  }
                },
                "required": [
                  "origin_postcode",
                  "destination_postcode"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "currency": {
                      "type": "string"
                    },
                    "estimated_min_price": {
                      "type": "number"
                    },
                    "estimated_max_price": {
                      "type": "number"
                    },
                    "recommended_price": {
                      "type": "number"
                    },
                    "confidence": {
                      "type": "string",
                      "enum": [
                        "high",
                        "medium",
                        "low"
                      ]
                    },
                    "confidence_score": {
                      "type": "number"
                    },
                    "based_on_comparable_shipments": {
                      "type": "integer"
                    },
                    "distance_km": {
                      "type": "number"
                    },
                    "insufficient_data": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success"
                  ]
                },
                "example": {
                  "success": true,
                  "currency": "DKK",
                  "estimated_min_price": 4200,
                  "estimated_max_price": 5800,
                  "recommended_price": 4950,
                  "confidence": "medium",
                  "confidence_score": 0.65,
                  "based_on_comparable_shipments": 84,
                  "distance_km": 114
                }
              }
            }
          },
          "400": {
            "description": "validation_error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    },
    "schemas": {
      "LoadCreate": {
        "type": "object",
        "properties": {
          "from_address": {
            "type": "string",
            "description": "Street, postcode, city and country",
            "minLength": 5
          },
          "to_address": {
            "type": "string",
            "description": "Street, postcode, city and country",
            "minLength": 5
          },
          "from_postal": {
            "type": "string",
            "description": "Postcode used for contract matching (optional, otherwise read from the address)"
          },
          "to_postal": {
            "type": "string",
            "description": "Postcode used for contract matching"
          },
          "from_country": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2"
          },
          "to_country": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2"
          },
          "from_lat": {
            "type": "number"
          },
          "from_lng": {
            "type": "number"
          },
          "to_lat": {
            "type": "number"
          },
          "to_lng": {
            "type": "number"
          },
          "weight_kg": {
            "type": "number",
            "description": "Total weight in kg",
            "exclusiveMinimum": 0
          },
          "volume_m3": {
            "type": "number",
            "description": "Total volume in m³",
            "exclusiveMinimum": 0
          },
          "pallets": {
            "type": "number",
            "description": "Number of pallet places"
          },
          "pallet_breakdown": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "hel",
                    "halv",
                    "kvart",
                    "custom",
                    "oversized",
                    "pkk",
                    "cll",
                    "eur",
                    "eur-pl",
                    "full"
                  ]
                },
                "count": {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                "quantity": {
                  "type": "number",
                  "description": "Alias for count"
                },
                "dimensions": {
                  "type": "object",
                  "properties": {
                    "length": {
                      "type": "number",
                      "description": "cm"
                    },
                    "width": {
                      "type": "number",
                      "description": "cm"
                    },
                    "height": {
                      "type": "number",
                      "description": "cm"
                    }
                  }
                }
              }
            },
            "description": "Pallets by type and size"
          },
          "goods_type": {
            "type": "string",
            "description": "Goods form: PLL pallets, PKK parcels, CLL loose cargo (case-insensitive)",
            "enum": [
              "PLL",
              "PKK",
              "CLL"
            ]
          },
          "goods_description": {
            "type": "string",
            "description": "What the goods are"
          },
          "package_count": {
            "type": "integer",
            "minimum": 0
          },
          "delivery_option": {
            "type": "string",
            "enum": [
              "interval",
              "fixed",
              "flexible"
            ]
          },
          "pickup_earliest": {
            "type": "string",
            "description": "Time windows are Danish local time. Send an offset (e.g. \"2026-12-01T08:00:00+01:00\") and it is converted; a time with \"Z\" or no offset is read as Danish local time.",
            "format": "date-time"
          },
          "pickup_latest": {
            "type": "string",
            "description": "Time windows are Danish local time. Send an offset (e.g. \"2026-12-01T08:00:00+01:00\") and it is converted; a time with \"Z\" or no offset is read as Danish local time.",
            "format": "date-time"
          },
          "delivery_start": {
            "type": "string",
            "description": "Time windows are Danish local time. Send an offset (e.g. \"2026-12-01T08:00:00+01:00\") and it is converted; a time with \"Z\" or no offset is read as Danish local time.",
            "format": "date-time"
          },
          "delivery_end": {
            "type": "string",
            "description": "Time windows are Danish local time. Send an offset (e.g. \"2026-12-01T08:00:00+01:00\") and it is converted; a time with \"Z\" or no offset is read as Danish local time.",
            "format": "date-time"
          },
          "delivery_fixed": {
            "type": "string",
            "description": "Time windows are Danish local time. Send an offset (e.g. \"2026-12-01T08:00:00+01:00\") and it is converted; a time with \"Z\" or no offset is read as Danish local time.",
            "format": "date-time"
          },
          "delivery_windows": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "start": {
                  "type": "string",
                  "description": "Time windows are Danish local time. Send an offset (e.g. \"2026-12-01T08:00:00+01:00\") and it is converted; a time with \"Z\" or no offset is read as Danish local time.",
                  "format": "date-time"
                },
                "end": {
                  "type": "string",
                  "description": "Time windows are Danish local time. Send an offset (e.g. \"2026-12-01T08:00:00+01:00\") and it is converted; a time with \"Z\" or no offset is read as Danish local time.",
                  "format": "date-time"
                }
              }
            },
            "description": "Several delivery windows"
          },
          "slot_time_mode": {
            "type": "string"
          },
          "requested_vehicle": {
            "type": "string",
            "enum": [
              "1_pll",
              "4_pll",
              "8_pll",
              "16_pll",
              "33_pll",
              "van",
              "rigid_truck",
              "artic_truck",
              "semi_trailer",
              "megatrailer",
              "koeletrailer",
              "citytrailer",
              "gardin_trailer",
              "p_trailer",
              "box_trailer"
            ]
          },
          "temp_sensitive": {
            "type": "string",
            "enum": [
              "none",
              "cooling",
              "freezing"
            ]
          },
          "express": {
            "type": "boolean"
          },
          "remarks": {
            "type": "string",
            "description": "Free text for the carrier"
          },
          "loading_requirements": {
            "type": "string",
            "description": "Free text, e.g. \"Side loading\""
          },
          "requires_tailgate_pickup": {
            "type": "boolean"
          },
          "requires_tailgate_delivery": {
            "type": "boolean"
          },
          "pickup_ref": {
            "type": "string"
          },
          "delivery_ref": {
            "type": "string"
          },
          "incoterms": {
            "type": "string",
            "description": "E.g. DAP, EXW"
          },
          "recipient_company": {
            "type": "string",
            "description": "Max 200 characters"
          },
          "sender_company": {
            "type": "string",
            "description": "Sender on CMR and label if it is not you (1-200 characters)"
          },
          "pickup_opening_hours": {
            "type": "string",
            "description": "Max 200"
          },
          "delivery_opening_hours": {
            "type": "string",
            "description": "Max 200"
          },
          "pickup_call_ahead": {
            "type": "boolean"
          },
          "delivery_call_ahead": {
            "type": "boolean"
          },
          "pickup_access": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "rampe",
                "truck",
                "kran",
                "kun_mindre_bil"
              ]
            }
          },
          "delivery_access": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "rampe",
                "truck",
                "kran",
                "kun_mindre_bil"
              ]
            }
          },
          "pickup_contact": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "description": "Contact name (max 200)"
              },
              "phone": {
                "type": "string",
                "description": "Phone (max 50)"
              },
              "site_notes": {
                "type": "string",
                "description": "Notes for the driver on site (max 1000)"
              }
            },
            "description": "Contact on site. Only shown to the carrier that is assigned the load."
          },
          "delivery_contact": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "description": "Contact name (max 200)"
              },
              "phone": {
                "type": "string",
                "description": "Phone (max 50)"
              },
              "site_notes": {
                "type": "string",
                "description": "Notes for the driver on site (max 1000)"
              }
            },
            "description": "Contact on site. Only shown to the carrier that is assigned the load."
          },
          "max_all_in_price_dkk": {
            "type": "number",
            "description": "Your ceiling for the total price, ex. VAT"
          },
          "target_price_dkk": {
            "type": "number",
            "description": "Your target total price, ex. VAT"
          },
          "contract_bypass": {
            "type": "boolean",
            "description": "Skip your contract rates and send the load to the marketplace"
          },
          "contract_pallet_type": {
            "type": "string",
            "description": "Contract category, derived from pallet_breakdown when omitted",
            "enum": [
              "PLL",
              "PKK",
              "CLL"
            ]
          },
          "transport_mode": {
            "type": "string",
            "description": "Default \"road\"",
            "enum": [
              "road",
              "air",
              "sea"
            ]
          },
          "dangerous_goods": {
            "type": "boolean",
            "description": "Dangerous goods. Adds \"adr\" to required_certifications."
          },
          "adr_class": {
            "type": "string"
          },
          "un_number": {
            "type": "string",
            "description": "4-digit UN number, e.g. \"1203\" or \"UN 1203\". Requires dangerous_goods."
          },
          "adr_packing_group": {
            "type": "string",
            "description": "Requires dangerous_goods",
            "enum": [
              "I",
              "II",
              "III"
            ]
          },
          "required_certifications": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "adr",
                "gmp_plus",
                "food_safety",
                "iso_9001",
                "iso_14001",
                "iso_45001",
                "aeo",
                "danske_speditorer",
                "nsab_2015",
                "other"
              ]
            },
            "description": "Certifications the carrier must hold"
          },
          "requires_clean_vehicle": {
            "type": "boolean"
          },
          "requires_feed_approved_vehicle": {
            "type": "boolean"
          },
          "intermediate_stops": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "stop_type": {
                  "type": "string",
                  "description": "Default \"delivery\"",
                  "enum": [
                    "pickup",
                    "delivery",
                    "pickup_delivery"
                  ]
                },
                "address": {
                  "type": "string",
                  "description": "Street, postcode, city and country"
                },
                "company_name": {
                  "type": "string",
                  "description": "Max 200 characters"
                },
                "reference": {
                  "type": "string",
                  "description": "Max 100 characters"
                },
                "window_start": {
                  "type": "string",
                  "description": "Time windows are Danish local time. Send an offset (e.g. \"2026-12-01T08:00:00+01:00\") and it is converted; a time with \"Z\" or no offset is read as Danish local time.",
                  "format": "date-time"
                },
                "window_end": {
                  "type": "string",
                  "description": "Time windows are Danish local time. Send an offset (e.g. \"2026-12-01T08:00:00+01:00\") and it is converted; a time with \"Z\" or no offset is read as Danish local time.",
                  "format": "date-time"
                },
                "pallets": {
                  "type": "number",
                  "minimum": 0
                },
                "weight_kg": {
                  "type": "number",
                  "minimum": 0
                },
                "volume_m3": {
                  "type": "number",
                  "minimum": 0
                },
                "notes": {
                  "type": "string",
                  "description": "Max 500 characters"
                }
              },
              "required": [
                "address"
              ],
              "description": "Intermediate stop (road only). Contact name/phone are not accepted on stops: bidders can see stops."
            },
            "description": "Road only, at most 20",
            "maxItems": 20
          },
          "pickup_type": {
            "type": "string",
            "description": "Air/sea: \"door\" or the terminal (\"port\" for sea, \"airport\" for air)",
            "enum": [
              "door",
              "port",
              "airport"
            ]
          },
          "delivery_type": {
            "type": "string",
            "description": "Air/sea: \"door\" or the terminal",
            "enum": [
              "door",
              "port",
              "airport"
            ]
          },
          "pol": {
            "type": "string",
            "description": "Air/sea: port/airport of loading. UN/LOCODE (e.g. DKAAR), \"ANY\" (forwarder chooses) or free text up to 80 characters"
          },
          "pod": {
            "type": "string",
            "description": "Air/sea: port/airport of discharge, same format as pol"
          },
          "shipping_type": {
            "type": "string",
            "description": "Sea only",
            "enum": [
              "FCL",
              "LCL"
            ]
          },
          "container_size": {
            "type": "string",
            "description": "Sea FCL only",
            "enum": [
              "20ft",
              "40ft",
              "40hc",
              "45ft",
              "20ft_reefer",
              "40ft_reefer"
            ]
          },
          "container_count": {
            "type": "integer",
            "minimum": 1
          },
          "cbm": {
            "type": "number",
            "description": "Air/sea volume in m³"
          },
          "hs_code": {
            "type": "string",
            "description": "Customs tariff number"
          },
          "country_of_origin": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2"
          },
          "importer_name": {
            "type": "string"
          },
          "customs_help_needed": {
            "type": "boolean"
          },
          "neutral_address": {
            "type": "string",
            "description": "Neutral shipment: the address shown as sender instead of yours. Not combined with sender_company."
          },
          "insurance_requested": {
            "type": "boolean",
            "description": "Cargo insurance"
          },
          "declared_value_dkk": {
            "type": "number",
            "description": "Goods value for the insurance. Only with insurance_requested."
          }
        },
        "required": [
          "from_address",
          "to_address",
          "weight_kg",
          "volume_m3",
          "delivery_option"
        ]
      },
      "Load": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "load_number": {
            "type": "string",
            "description": "E.g. NDF-12345"
          },
          "status": {
            "type": "string",
            "description": "open, bidding, assigned, in_transit, delivered, cancelled, closed"
          },
          "from_address": {
            "type": "string"
          },
          "to_address": {
            "type": "string"
          },
          "from_city": {
            "type": "string"
          },
          "to_city": {
            "type": "string"
          },
          "weight_kg": {
            "type": "number"
          },
          "volume_m3": {
            "type": "number"
          },
          "pallets": {
            "type": "number"
          },
          "pickup_earliest": {
            "type": "string",
            "description": "Time windows are Danish local time. Send an offset (e.g. \"2026-12-01T08:00:00+01:00\") and it is converted; a time with \"Z\" or no offset is read as Danish local time.",
            "format": "date-time"
          },
          "pickup_latest": {
            "type": "string",
            "description": "Time windows are Danish local time. Send an offset (e.g. \"2026-12-01T08:00:00+01:00\") and it is converted; a time with \"Z\" or no offset is read as Danish local time.",
            "format": "date-time"
          },
          "delivery_start": {
            "type": "string",
            "description": "Time windows are Danish local time. Send an offset (e.g. \"2026-12-01T08:00:00+01:00\") and it is converted; a time with \"Z\" or no offset is read as Danish local time.",
            "format": "date-time"
          },
          "delivery_end": {
            "type": "string",
            "description": "Time windows are Danish local time. Send an offset (e.g. \"2026-12-01T08:00:00+01:00\") and it is converted; a time with \"Z\" or no offset is read as Danish local time.",
            "format": "date-time"
          },
          "transport_mode": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "description": "Created",
            "format": "date-time"
          }
        },
        "description": "A load. More fields from the create request are returned as sent. Ignore fields you do not know."
      },
      "Bid": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "currency": {
            "type": "string"
          },
          "price_ex_vat_dkk": {
            "type": "number",
            "description": "Your total price ex. VAT (all-in)"
          },
          "price_display": {
            "type": "string"
          },
          "vat_dkk": {
            "type": "number"
          },
          "price_inc_vat_dkk": {
            "type": "number"
          },
          "status": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "description": "Created",
            "format": "date-time"
          },
          "estimated_time_days": {
            "type": "number"
          }
        },
        "description": "A bid as you see it: your total price. Never the carrier's name or own amount."
      },
      "Assignment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "pickup_time_actual": {
            "type": "string",
            "description": "Actual pickup",
            "format": "date-time"
          },
          "delivery_time_actual": {
            "type": "string",
            "description": "Actual delivery",
            "format": "date-time"
          },
          "cmr_number": {
            "type": "string"
          },
          "carrier": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "company_name": {
                "type": "string"
              }
            },
            "description": "No phone number"
          }
        }
      },
      "IntermediateStop": {
        "type": "object",
        "properties": {
          "stop_type": {
            "type": "string",
            "description": "Default \"delivery\"",
            "enum": [
              "pickup",
              "delivery",
              "pickup_delivery"
            ]
          },
          "address": {
            "type": "string",
            "description": "Street, postcode, city and country"
          },
          "company_name": {
            "type": "string",
            "description": "Max 200 characters"
          },
          "reference": {
            "type": "string",
            "description": "Max 100 characters"
          },
          "window_start": {
            "type": "string",
            "description": "Time windows are Danish local time. Send an offset (e.g. \"2026-12-01T08:00:00+01:00\") and it is converted; a time with \"Z\" or no offset is read as Danish local time.",
            "format": "date-time"
          },
          "window_end": {
            "type": "string",
            "description": "Time windows are Danish local time. Send an offset (e.g. \"2026-12-01T08:00:00+01:00\") and it is converted; a time with \"Z\" or no offset is read as Danish local time.",
            "format": "date-time"
          },
          "pallets": {
            "type": "number",
            "minimum": 0
          },
          "weight_kg": {
            "type": "number",
            "minimum": 0
          },
          "volume_m3": {
            "type": "number",
            "minimum": 0
          },
          "notes": {
            "type": "string",
            "description": "Max 500 characters"
          }
        },
        "required": [
          "address"
        ],
        "description": "Intermediate stop (road only). Contact name/phone are not accepted on stops: bidders can see stops."
      },
      "LaneRule": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "origin_postcode_from": {
            "type": "string"
          },
          "origin_postcode_to": {
            "type": "string"
          },
          "destination_postcode_from": {
            "type": "string"
          },
          "destination_postcode_to": {
            "type": "string"
          },
          "max_all_in_price": {
            "type": "number",
            "description": "Your total price ceiling, ex. VAT"
          },
          "currency": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "notes": {
            "type": "string"
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Stable error code: use this in your integration",
            "enum": [
              "invalid_request",
              "invalid_value",
              "missing_fields",
              "address_incomplete",
              "invalid_sender_company",
              "invalid_stop_details",
              "validation_error",
              "invalid_lane_rule",
              "invalid_path",
              "invalid_document_type",
              "invalid_events",
              "invalid_webhook_url",
              "invalid_rating",
              "no_valid_fields",
              "missing_api_key",
              "invalid_api_key",
              "api_key_expired",
              "unauthorized",
              "forbidden",
              "customer_edit_locked",
              "autopilot_not_enabled",
              "not_found",
              "no_assignment",
              "document_not_ready",
              "method_not_allowed",
              "invalid_load_status",
              "invalid_bid_status",
              "already_rated",
              "conflict",
              "rate_limited",
              "too_many_failed_attempts",
              "estimation_failed",
              "update_failed",
              "internal_error"
            ]
          },
          "message": {
            "type": "string",
            "description": "Human-readable explanation"
          },
          "field": {
            "type": "string",
            "description": "The field that failed, when it is about one field"
          },
          "allowed": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Allowed values, when relevant"
          }
        },
        "required": [
          "error",
          "message"
        ]
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "missing_api_key, invalid_api_key or api_key_expired",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimited": {
        "description": "rate_limited or too_many_failed_attempts",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "InternalError": {
        "description": "internal_error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  }
}
