{
  "openapi": "3.1.0",
  "info": {
    "title": "Hemostat Partner API",
    "description": "Public partner API for Hemostat — chain-of-custody medical transport orders, locations and webhooks. Authenticate with `Authorization: Bearer hs_live_…` (or `hs_test_…` on the QA sandbox). Errors use the envelope `{\"error\": {\"code\", \"message\", \"details\"}}`. Rate limits: 600/min reads, 60/min writes per API key (X-RateLimit-* headers).",
    "version": "1.0.0"
  },
  "paths": {
    "/ping": {
      "get": {
        "tags": [
          "meta"
        ],
        "summary": "Ping",
        "description": "Verbindungs-/Key-Test: 200 = Key gültig, Org freigeschaltet.",
        "operationId": "ping_ping_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerPingResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/orders": {
      "post": {
        "tags": [
          "orders"
        ],
        "summary": "Create Order",
        "operationId": "create_order_orders_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerOrderCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerOrderRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "orders"
        ],
        "summary": "List Orders",
        "description": "Cursor-Pagination über (created_at, id) absteigend (Konzept §3).",
        "operationId": "list_orders_orders_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/OrderStatus"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "name": "external_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "External Id"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Updated Since"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerOrderListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/orders/{order_id}": {
      "get": {
        "tags": [
          "orders"
        ],
        "summary": "Get Order",
        "operationId": "get_order_orders__order_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Order Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerOrderRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/orders/{order_id}/cancel": {
      "post": {
        "tags": [
          "orders"
        ],
        "summary": "Cancel Order",
        "description": "Storno mit denselben pre-custody-Regeln wie intern (400 CANCEL_NOT_ALLOWED).",
        "operationId": "cancel_order_orders__order_id__cancel_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Order Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerOrderCancel"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerOrderRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/orders/{order_id}/events": {
      "get": {
        "tags": [
          "orders"
        ],
        "summary": "List Order Events",
        "description": "Chain-of-Custody-Historie — hashverketteter Event-Log (USP, Konzept §3).",
        "operationId": "list_order_events_orders__order_id__events_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Order Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PartnerEventRead"
                  },
                  "title": "Response List Order Events Orders  Order Id  Events Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/locations": {
      "get": {
        "tags": [
          "locations"
        ],
        "summary": "List Locations",
        "operationId": "list_locations_locations_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PartnerLocationRead"
                  },
                  "type": "array",
                  "title": "Response List Locations Locations Get"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "locations"
        ],
        "summary": "Create Location",
        "description": "Legt eine Org-Location an (best-effort geocodiert wie im Web,\nMuster location_service.create_location).",
        "operationId": "create_location_locations_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerLocationCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerLocationRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/webhooks": {
      "get": {
        "tags": [
          "webhooks"
        ],
        "summary": "List Webhooks",
        "operationId": "list_webhooks_webhooks_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/WebhookEndpointRead"
                  },
                  "type": "array",
                  "title": "Response List Webhooks Webhooks Get"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "webhooks"
        ],
        "summary": "Create Webhook",
        "description": "Legt einen Endpoint an; das Secret ist NUR in dieser Response sichtbar.\nHandshake (GET ?verification=<nonce> mit Echo) läuft sofort — bei Erfolg\nENABLED, sonst bleibt der Endpoint PENDING_VERIFICATION (Retry via\nPOST /webhooks/{id}/verify).",
        "operationId": "create_webhook_webhooks_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEndpointCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointCreated"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/webhooks/{endpoint_id}": {
      "get": {
        "tags": [
          "webhooks"
        ],
        "summary": "Get Webhook",
        "operationId": "get_webhook_webhooks__endpoint_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Endpoint Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "webhooks"
        ],
        "summary": "Update Webhook",
        "description": "URL-Änderung erzwingt einen neuen Handshake (PENDING → ggf. ENABLED).",
        "operationId": "update_webhook_webhooks__endpoint_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Endpoint Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEndpointUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "webhooks"
        ],
        "summary": "Delete Webhook",
        "operationId": "delete_webhook_webhooks__endpoint_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Endpoint Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/{endpoint_id}/verify": {
      "post": {
        "tags": [
          "webhooks"
        ],
        "summary": "Verify Webhook",
        "description": "Handshake-Retry — auch der Weg aus BROKEN zurück zu ENABLED.",
        "operationId": "verify_webhook_webhooks__endpoint_id__verify_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Endpoint Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookVerifyResult"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/{endpoint_id}/test": {
      "post": {
        "tags": [
          "webhooks"
        ],
        "summary": "Test Webhook",
        "description": "Sendet ein signiertes Beispiel-Event (order.test) an den Endpoint.",
        "operationId": "test_webhook_webhooks__endpoint_id__test_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Endpoint Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookTestResult"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "OrderStatus": {
        "type": "string",
        "enum": [
          "DRAFT",
          "SUBMITTED",
          "ASSIGNED",
          "ACCEPTED",
          "DRIVER_ASSIGNED",
          "PICKUP_STARTED",
          "SEALED",
          "IN_TRANSIT",
          "DELIVERED",
          "CLOSED",
          "CANCELLED"
        ],
        "title": "OrderStatus"
      },
      "PartnerAddress": {
        "properties": {
          "street": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Street"
          },
          "zip": {
            "type": "string",
            "maxLength": 20,
            "minLength": 1,
            "title": "Zip"
          },
          "city": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "City"
          },
          "country": {
            "type": "string",
            "maxLength": 10,
            "title": "Country",
            "default": "DE"
          },
          "label": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          }
        },
        "type": "object",
        "required": [
          "street",
          "zip",
          "city"
        ],
        "title": "PartnerAddress"
      },
      "PartnerEndpoint": {
        "properties": {
          "location_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Location Id"
          },
          "address": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PartnerAddress"
              },
              {
                "type": "null"
              }
            ]
          },
          "address_text": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500,
                "minLength": 3
              },
              {
                "type": "null"
              }
            ],
            "title": "Address Text"
          }
        },
        "type": "object",
        "title": "PartnerEndpoint",
        "description": "Abhol-/Zielpunkt: genau EINE der drei Varianten (Konzept §3):\nlocation_id | address (strukturiert) | address_text (Freitext)."
      },
      "PartnerEventRead": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "type": {
            "type": "string",
            "title": "Type"
          },
          "internal_type": {
            "type": "string",
            "title": "Internal Type"
          },
          "ts_utc": {
            "type": "string",
            "format": "date-time",
            "title": "Ts Utc"
          },
          "gps_lat": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gps Lat"
          },
          "gps_lng": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gps Lng"
          },
          "payload": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payload"
          },
          "prev_event_hash": {
            "type": "string",
            "title": "Prev Event Hash"
          },
          "event_hash": {
            "type": "string",
            "title": "Event Hash"
          }
        },
        "type": "object",
        "required": [
          "id",
          "type",
          "internal_type",
          "ts_utc",
          "prev_event_hash",
          "event_hash"
        ],
        "title": "PartnerEventRead"
      },
      "PartnerLocationCreate": {
        "properties": {
          "label": {
            "type": "string",
            "maxLength": 120,
            "minLength": 1,
            "title": "Label"
          },
          "street": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Street"
          },
          "zip": {
            "type": "string",
            "maxLength": 20,
            "minLength": 1,
            "title": "Zip"
          },
          "city": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "City"
          },
          "country": {
            "type": "string",
            "maxLength": 10,
            "title": "Country",
            "default": "DE"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "contact_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Name"
          },
          "contact_phone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 50
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Phone"
          }
        },
        "type": "object",
        "required": [
          "label",
          "street",
          "zip",
          "city"
        ],
        "title": "PartnerLocationCreate"
      },
      "PartnerLocationRead": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "label": {
            "type": "string",
            "title": "Label"
          },
          "street": {
            "type": "string",
            "title": "Street"
          },
          "zip": {
            "type": "string",
            "title": "Zip"
          },
          "city": {
            "type": "string",
            "title": "City"
          },
          "country": {
            "type": "string",
            "title": "Country"
          },
          "lat": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lat"
          },
          "lng": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lng"
          },
          "created_via_api": {
            "type": "boolean",
            "title": "Created Via Api",
            "default": false
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "label",
          "street",
          "zip",
          "city",
          "country",
          "created_at"
        ],
        "title": "PartnerLocationRead"
      },
      "PartnerOrderCancel": {
        "properties": {
          "reason": {
            "type": "string",
            "maxLength": 500,
            "minLength": 1,
            "title": "Reason"
          }
        },
        "type": "object",
        "required": [
          "reason"
        ],
        "title": "PartnerOrderCancel"
      },
      "PartnerOrderCreate": {
        "properties": {
          "external_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "External Id"
          },
          "pickup": {
            "$ref": "#/components/schemas/PartnerEndpoint"
          },
          "dropoff": {
            "$ref": "#/components/schemas/PartnerEndpoint"
          },
          "sla": {
            "$ref": "#/components/schemas/SLAType",
            "default": "STANDARD"
          },
          "pickup_window_start": {
            "type": "string",
            "format": "date-time",
            "title": "Pickup Window Start"
          },
          "pickup_window_end": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup Window End"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "pickup_detail": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup Detail"
          },
          "dropoff_detail": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Dropoff Detail"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/PartnerOrderItem"
            },
            "type": "array",
            "title": "Items",
            "default": []
          },
          "goods_type": {
            "type": "string",
            "maxLength": 100,
            "title": "Goods Type",
            "default": ""
          },
          "auto_dispatch": {
            "type": "boolean",
            "title": "Auto Dispatch",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "pickup",
          "dropoff",
          "pickup_window_start"
        ],
        "title": "PartnerOrderCreate"
      },
      "PartnerOrderItem": {
        "properties": {
          "goods_type": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Goods Type"
          }
        },
        "type": "object",
        "required": [
          "goods_type"
        ],
        "title": "PartnerOrderItem"
      },
      "PartnerOrderItemRead": {
        "properties": {
          "goods_type": {
            "type": "string",
            "title": "Goods Type"
          },
          "seal_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seal Id"
          }
        },
        "type": "object",
        "required": [
          "goods_type"
        ],
        "title": "PartnerOrderItemRead"
      },
      "PartnerOrderListResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/PartnerOrderRead"
            },
            "type": "array",
            "title": "Data"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          }
        },
        "type": "object",
        "required": [
          "data"
        ],
        "title": "PartnerOrderListResponse"
      },
      "PartnerOrderRead": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "external_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Id"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "sla": {
            "$ref": "#/components/schemas/SLAType"
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          },
          "pickup_location": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PartnerLocationRead"
              },
              {
                "type": "null"
              }
            ]
          },
          "dropoff_location": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PartnerLocationRead"
              },
              {
                "type": "null"
              }
            ]
          },
          "dropoff_address_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dropoff Address Text"
          },
          "pickup_window_start": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup Window Start"
          },
          "pickup_window_end": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup Window End"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "pickup_detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup Detail"
          },
          "dropoff_detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dropoff Detail"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/PartnerOrderItemRead"
            },
            "type": "array",
            "title": "Items",
            "default": []
          },
          "price_total": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Total"
          },
          "cancel_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cancel Reason"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "status",
          "sla",
          "created_at"
        ],
        "title": "PartnerOrderRead"
      },
      "PartnerPingResponse": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status",
            "default": "ok"
          },
          "organization": {
            "type": "string",
            "title": "Organization"
          },
          "environment": {
            "type": "string",
            "title": "Environment"
          }
        },
        "type": "object",
        "required": [
          "organization",
          "environment"
        ],
        "title": "PartnerPingResponse"
      },
      "SLAType": {
        "type": "string",
        "enum": [
          "STANDARD",
          "EXPRESS",
          "CRITICAL"
        ],
        "title": "SLAType"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "WebhookEndpointCreate": {
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 500,
            "minLength": 12,
            "title": "Url"
          },
          "event_filter": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Event Filter"
          }
        },
        "type": "object",
        "required": [
          "url"
        ],
        "title": "WebhookEndpointCreate"
      },
      "WebhookEndpointCreated": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "url": {
            "type": "string",
            "title": "Url"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "event_filter": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Event Filter"
          },
          "consecutive_failures": {
            "type": "integer",
            "title": "Consecutive Failures",
            "default": 0
          },
          "last_success_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Success At"
          },
          "last_failure_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Failure At"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "secret": {
            "type": "string",
            "title": "Secret"
          }
        },
        "type": "object",
        "required": [
          "id",
          "url",
          "status",
          "created_at",
          "secret"
        ],
        "title": "WebhookEndpointCreated"
      },
      "WebhookEndpointRead": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "url": {
            "type": "string",
            "title": "Url"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "event_filter": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Event Filter"
          },
          "consecutive_failures": {
            "type": "integer",
            "title": "Consecutive Failures",
            "default": 0
          },
          "last_success_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Success At"
          },
          "last_failure_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Failure At"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "url",
          "status",
          "created_at"
        ],
        "title": "WebhookEndpointRead"
      },
      "WebhookEndpointUpdate": {
        "properties": {
          "url": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500,
                "minLength": 12
              },
              {
                "type": "null"
              }
            ],
            "title": "Url"
          },
          "event_filter": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Event Filter"
          },
          "disabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disabled"
          }
        },
        "type": "object",
        "title": "WebhookEndpointUpdate"
      },
      "WebhookTestResult": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "delivered": {
            "type": "boolean",
            "title": "Delivered"
          },
          "status_code": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status Code"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          }
        },
        "type": "object",
        "required": [
          "id",
          "delivered"
        ],
        "title": "WebhookTestResult"
      },
      "WebhookVerifyResult": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "verified": {
            "type": "boolean",
            "title": "Verified"
          }
        },
        "type": "object",
        "required": [
          "id",
          "status",
          "verified"
        ],
        "title": "WebhookVerifyResult"
      }
    },
    "securitySchemes": {
      "HTTPBearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "servers": [
    {
      "url": "https://my.hemostat.de/api/partner/v1",
      "description": "Production"
    },
    {
      "url": "https://qa.hemostat.de/api/partner/v1",
      "description": "Sandbox (QA, hs_test_ keys)"
    }
  ]
}