{
  "openapi": "3.1.0",
  "info": {
    "title": "Lynq Partner API",
    "description": "## Lynq Partner API\n\nIntegrate delivery quotes, order intake, webhooks, and live courier tracking.\n\n### Authentication\nEvery request requires:\n- **`X-API-Key`** — partner API key issued by Lynq\n- **`X-Client-ID`** — partner client id (required; must match the value issued by Lynq)\n\nOptional IP allowlisting may be enforced per partner.\n\n### Idempotency\n`POST /orders` accepts **`partner_order_number`**. Reusing the same value for the same partner returns the existing order instead of creating a duplicate.\n\n### Errors\nResponses use FastAPI-style JSON: `{\"detail\": \"...\"}` or `{\"detail\": {\"error\": \"...\"}}`.\nCommon status codes: **401** invalid credentials, **403** IP not allowlisted, **404** not found, **409** conflict (e.g. cancel not allowed), **422** validation, **429** quote rate limited, **503** pricing/distance unavailable.\n\n### Drive time (ETA)\n`POST /etas` and `POST /etas/multi-leg` return **OSRM** driving distance and duration only (no price, no `quote_id`). Use these for map/ETA polling. They are **not** counted against quote rate limits.\n\n### Rate limits\n`POST /quotes` and `POST /quotes/multi-leg` are capped **per partner** (default **30/min** and **200/day**, Asia/Riyadh day boundary). Exceeding the cap returns **429** with `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset`. Quote once per checkout and reuse `quote_id` (valid ~15 minutes). Contact Lynq operations for a higher limit.\n\n### Webhooks\nSubscribe via `POST /webhooks`. Signing secret is shown **once** on create. Verify `X-Lynq-Signature: t=<unix>,v1=<hex>` over `{t}.{raw_body}` using HMAC-SHA256.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://uat-api.lynq-sa.com/partner",
      "description": "UAT (integration testing)"
    },
    {
      "url": "https://api.lynq-sa.com/partner",
      "description": "Production"
    }
  ],
  "paths": {
    "/api/v1/quotes": {
      "post": {
        "tags": [
          "quotes"
        ],
        "summary": "Create Quote",
        "operationId": "create_quote_api_v1_quotes_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API credentials",
            "content": {
              "application/json": {
                "example": {
                  "detail": "Invalid API credentials"
                }
              }
            }
          },
          "403": {
            "description": "IP not allowlisted",
            "content": {
              "application/json": {
                "example": {
                  "detail": "IP address 203.0.113.1 is not whitelisted for this partner"
                }
              }
            }
          },
          "429": {
            "description": "Per-partner quote rate limit exceeded",
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "error": "rate_limited",
                    "retry_after_seconds": 12
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "example": {
                  "detail": [
                    {
                      "loc": [
                        "body",
                        "pickup",
                        "lat"
                      ],
                      "msg": "Field required",
                      "type": "missing"
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Distance / pricing unavailable",
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "error": "distance_unavailable"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "X-API-Key": []
          },
          {
            "X-Client-ID": []
          }
        ]
      }
    },
    "/api/v1/quotes/multi-leg": {
      "post": {
        "tags": [
          "quotes"
        ],
        "summary": "Create Multi Leg Quote",
        "operationId": "create_multi_leg_quote_api_v1_quotes_multi_leg_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MultiLegQuoteCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MultiLegQuoteResponse"
                }
              }
            }
          },
          "429": {
            "description": "Per-partner quote rate limit exceeded",
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "error": "rate_limited",
                    "retry_after_seconds": 12
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "X-API-Key": []
          },
          {
            "X-Client-ID": []
          }
        ]
      }
    },
    "/api/v1/etas": {
      "post": {
        "tags": [
          "etas"
        ],
        "summary": "Create Eta",
        "operationId": "create_eta_api_v1_etas_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EtaCreate"
              },
              "example": {
                "pickup": {
                  "lat": 24.7136,
                  "lng": 46.6753,
                  "address": "RRRD2929"
                },
                "dropoff": {
                  "lat": 24.768,
                  "lng": 46.709,
                  "address": "RRRR1234"
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EtaResponse"
                },
                "example": {
                  "distance_km": 8.4,
                  "duration_minutes": 18.2,
                  "provider": "osrm",
                  "legs": [
                    {
                      "from_sequence": 1,
                      "to_sequence": 2,
                      "distance_km": 8.4,
                      "duration_minutes": 18.2
                    }
                  ],
                  "ordered_stops": [
                    {
                      "sequence": 1,
                      "stop_type": "pickup",
                      "lat": 24.7136,
                      "lng": 46.6753
                    },
                    {
                      "sequence": 2,
                      "stop_type": "dropoff",
                      "lat": 24.768,
                      "lng": 46.709
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API credentials",
            "content": {
              "application/json": {
                "example": {
                  "detail": "Invalid API credentials"
                }
              }
            }
          },
          "403": {
            "description": "IP not allowlisted",
            "content": {
              "application/json": {
                "example": {
                  "detail": "IP address 203.0.113.1 is not whitelisted for this partner"
                }
              }
            }
          },
          "429": {
            "description": "Quote rate limit exceeded",
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "error": "rate_limited",
                    "retry_after_seconds": 12
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "example": {
                  "detail": [
                    {
                      "loc": [
                        "body",
                        "pickup",
                        "lat"
                      ],
                      "msg": "Field required",
                      "type": "missing"
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "OSRM routing unavailable",
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "error": "eta_unavailable"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "X-API-Key": []
          },
          {
            "X-Client-ID": []
          }
        ]
      }
    },
    "/api/v1/etas/multi-leg": {
      "post": {
        "tags": [
          "etas"
        ],
        "summary": "Create Multi Leg Eta",
        "operationId": "create_multi_leg_eta_api_v1_etas_multi_leg_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MultiLegEtaCreate"
              },
              "example": {
                "pickups": [
                  {
                    "lat": 24.7136,
                    "lng": 46.6753,
                    "short_address": "RRRD2929"
                  },
                  {
                    "lat": 24.725,
                    "lng": 46.68,
                    "short_address": "RRRR5678"
                  }
                ],
                "dropoff": {
                  "lat": 24.768,
                  "lng": 46.709,
                  "short_address": "RRRR1234",
                  "contact_name": "Customer",
                  "contact_phone": "+966501234567"
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EtaResponse"
                },
                "example": {
                  "distance_km": 8.4,
                  "duration_minutes": 18.2,
                  "provider": "osrm",
                  "legs": [
                    {
                      "from_sequence": 1,
                      "to_sequence": 2,
                      "distance_km": 8.4,
                      "duration_minutes": 18.2
                    }
                  ],
                  "ordered_stops": [
                    {
                      "sequence": 1,
                      "stop_type": "pickup",
                      "lat": 24.7136,
                      "lng": 46.6753
                    },
                    {
                      "sequence": 2,
                      "stop_type": "dropoff",
                      "lat": 24.768,
                      "lng": 46.709
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API credentials",
            "content": {
              "application/json": {
                "example": {
                  "detail": "Invalid API credentials"
                }
              }
            }
          },
          "403": {
            "description": "IP not allowlisted",
            "content": {
              "application/json": {
                "example": {
                  "detail": "IP address 203.0.113.1 is not whitelisted for this partner"
                }
              }
            }
          },
          "429": {
            "description": "Quote rate limit exceeded",
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "error": "rate_limited",
                    "retry_after_seconds": 12
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "example": {
                  "detail": [
                    {
                      "loc": [
                        "body",
                        "pickup",
                        "lat"
                      ],
                      "msg": "Field required",
                      "type": "missing"
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "OSRM routing unavailable",
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "error": "eta_unavailable"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "X-API-Key": []
          },
          {
            "X-Client-ID": []
          }
        ]
      }
    },
    "/api/v1/orders": {
      "post": {
        "tags": [
          "orders"
        ],
        "summary": "Create Order",
        "operationId": "create_order_api_v1_orders_post",
        "security": [
          {
            "X-API-Key": []
          },
          {
            "X-Client-ID": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderCreate"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderCreateResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "orders"
        ],
        "summary": "List Orders",
        "operationId": "list_orders_api_v1_orders_get",
        "security": [
          {
            "X-API-Key": []
          },
          {
            "X-Client-ID": []
          }
        ],
        "parameters": [
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0,
              "title": "Skip"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "status_filter",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status Filter"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OrderResponse"
                  },
                  "title": "Response List Orders Api V1 Orders Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/orders/{order_id}/courier": {
      "get": {
        "tags": [
          "orders"
        ],
        "summary": "Get Order Courier",
        "operationId": "get_order_courier_api_v1_orders__order_id__courier_get",
        "security": [
          {
            "X-API-Key": []
          },
          {
            "X-Client-ID": []
          }
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Order Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderCourierResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/orders/{order_id}": {
      "get": {
        "tags": [
          "orders"
        ],
        "summary": "Get Order",
        "operationId": "get_order_api_v1_orders__order_id__get",
        "security": [
          {
            "X-API-Key": []
          },
          {
            "X-Client-ID": []
          }
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Order Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/orders/by-partner-ref/{partner_order_number}": {
      "get": {
        "tags": [
          "orders"
        ],
        "summary": "Get Order By Partner Ref",
        "operationId": "get_order_by_partner_ref_api_v1_orders_by_partner_ref__partner_order_number__get",
        "security": [
          {
            "X-API-Key": []
          },
          {
            "X-Client-ID": []
          }
        ],
        "parameters": [
          {
            "name": "partner_order_number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Partner Order Number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/orders/by-legacy-id/{legacy_external_id}": {
      "get": {
        "tags": [
          "orders"
        ],
        "summary": "Get Order By Legacy Id",
        "operationId": "get_order_by_legacy_id_api_v1_orders_by_legacy_id__legacy_external_id__get",
        "deprecated": true,
        "security": [
          {
            "X-API-Key": []
          },
          {
            "X-Client-ID": []
          }
        ],
        "parameters": [
          {
            "name": "legacy_external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Legacy External Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/orders/{order_id}/dropoff": {
      "patch": {
        "tags": [
          "orders"
        ],
        "summary": "Update Order Dropoff",
        "operationId": "update_order_dropoff_api_v1_orders__order_id__dropoff_patch",
        "security": [
          {
            "X-API-Key": []
          },
          {
            "X-Client-ID": []
          }
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Order Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderDropoffUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDropoffUpdateResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/orders/{order_id}/cancel": {
      "post": {
        "tags": [
          "orders"
        ],
        "summary": "Cancel Order",
        "operationId": "cancel_order_api_v1_orders__order_id__cancel_post",
        "security": [
          {
            "X-API-Key": []
          },
          {
            "X-Client-ID": []
          }
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Order Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/orders/{order_id}/proof": {
      "get": {
        "tags": [
          "orders"
        ],
        "summary": "Get Order Proof",
        "operationId": "get_order_proof_api_v1_orders__order_id__proof_get",
        "security": [
          {
            "X-API-Key": []
          },
          {
            "X-Client-ID": []
          }
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Order Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderProofResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/orders/test-simulation": {
      "post": {
        "tags": [
          "sandbox"
        ],
        "summary": "Create sandbox test order",
        "description": "Create a **test** order in order-worker only (no Lynq/Kafka intake). Lifecycle webhooks are enqueued with **`livemode: false`**. Same body as [Create order](#/orders/create_order_api_v1_orders_post), plus `scenario`, `step_interval_sec`, and optional `advance_first_step`. Advance manually via **Advance sandbox step** or run the `sandbox_simulator` worker.",
        "operationId": "create_test_simulation_order_api_v1_orders_test_simulation_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestOrderSimulationCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestOrderSimulationResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error"
          },
          "503": {
            "description": "Pricing / distance unavailable"
          }
        },
        "security": [
          {
            "X-API-Key": []
          },
          {
            "X-Client-ID": []
          }
        ]
      }
    },
    "/api/v1/orders/{order_id}/simulation/advance": {
      "post": {
        "tags": [
          "sandbox"
        ],
        "summary": "Advance sandbox simulation step",
        "description": "Apply the next scripted webhook for an order created via **Create sandbox test order**. Returns **409** with `not_a_test_order` or `simulation_complete` when advance is not allowed.",
        "operationId": "advance_test_simulation_api_v1_orders__order_id__simulation_advance_post",
        "security": [
          {
            "X-API-Key": []
          },
          {
            "X-Client-ID": []
          }
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Order Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimulationAdvanceResponse"
                }
              }
            }
          },
          "404": {
            "description": "Order not found"
          },
          "409": {
            "description": "Not a test order or simulation already complete",
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "error": "simulation_complete"
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/orders/multi-leg": {
      "post": {
        "tags": [
          "orders"
        ],
        "summary": "Create Multi Leg Order",
        "operationId": "create_multi_leg_order_api_v1_orders_multi_leg_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MultiLegOrderCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderCreateResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "X-API-Key": []
          },
          {
            "X-Client-ID": []
          }
        ]
      }
    },
    "/api/v1/webhooks": {
      "get": {
        "tags": [
          "webhooks"
        ],
        "summary": "List Webhooks",
        "operationId": "list_webhooks_api_v1_webhooks_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/WebhookResponse"
                  },
                  "type": "array",
                  "title": "Response List Webhooks Api V1 Webhooks Get"
                }
              }
            }
          }
        },
        "security": [
          {
            "X-API-Key": []
          },
          {
            "X-Client-ID": []
          }
        ]
      },
      "post": {
        "tags": [
          "webhooks"
        ],
        "summary": "Create Webhook",
        "operationId": "create_webhook_api_v1_webhooks_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookCreatedResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "X-API-Key": []
          },
          {
            "X-Client-ID": []
          }
        ]
      }
    },
    "/api/v1/webhooks/deliveries/recent": {
      "get": {
        "tags": [
          "webhooks"
        ],
        "summary": "List Recent Deliveries",
        "operationId": "list_recent_deliveries_api_v1_webhooks_deliveries_recent_get",
        "security": [
          {
            "X-API-Key": []
          },
          {
            "X-Client-ID": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "succeeded",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Succeeded"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WebhookDeliveryResponse"
                  },
                  "title": "Response List Recent Deliveries Api V1 Webhooks Deliveries Recent Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks/{webhook_id}": {
      "get": {
        "tags": [
          "webhooks"
        ],
        "summary": "Get Webhook",
        "operationId": "get_webhook_api_v1_webhooks__webhook_id__get",
        "security": [
          {
            "X-API-Key": []
          },
          {
            "X-Client-ID": []
          }
        ],
        "parameters": [
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Webhook Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "webhooks"
        ],
        "summary": "Update Webhook",
        "operationId": "update_webhook_api_v1_webhooks__webhook_id__put",
        "security": [
          {
            "X-API-Key": []
          },
          {
            "X-Client-ID": []
          }
        ],
        "parameters": [
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Webhook Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "webhooks"
        ],
        "summary": "Delete Webhook",
        "operationId": "delete_webhook_api_v1_webhooks__webhook_id__delete",
        "security": [
          {
            "X-API-Key": []
          },
          {
            "X-Client-ID": []
          }
        ],
        "parameters": [
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Webhook Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks/{webhook_id}/test": {
      "post": {
        "tags": [
          "webhooks"
        ],
        "summary": "Test Webhook",
        "operationId": "test_webhook_api_v1_webhooks__webhook_id__test_post",
        "security": [
          {
            "X-API-Key": []
          },
          {
            "X-Client-ID": []
          }
        ],
        "parameters": [
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Webhook Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookTestResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks/{webhook_id}/replay": {
      "post": {
        "tags": [
          "webhooks"
        ],
        "summary": "Replay Webhook",
        "operationId": "replay_webhook_api_v1_webhooks__webhook_id__replay_post",
        "security": [
          {
            "X-API-Key": []
          },
          {
            "X-Client-ID": []
          }
        ],
        "parameters": [
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Webhook Id"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "description": "ISO8601 lower bound on outbox created_at",
              "title": "Since"
            },
            "description": "ISO8601 lower bound on outbox created_at"
          },
          {
            "name": "event_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only replay this event type",
              "title": "Event Type"
            },
            "description": "Only replay this event type"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookReplayResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "summary": "Health Check",
        "operationId": "health_check_health_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/": {
      "get": {
        "summary": "Root",
        "operationId": "root__get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {
    "order.received": {
      "post": {
        "summary": "order.received",
        "description": "Order accepted for processing (after 202 intake).",
        "operationId": "handlerorder_received_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEnvelope_order_received"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "null",
                  "title": "Response Handlerorder Received Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "order.dropoff_updated": {
      "post": {
        "summary": "order.dropoff_updated",
        "description": "Partner changed dropoff location; delivery fee recalculated.",
        "operationId": "handlerorder_dropoff_updated_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEnvelope_order_dropoff_updated"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "null",
                  "title": "Response Handlerorder Dropoff Updated Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "order.accepted": {
      "post": {
        "summary": "order.accepted",
        "description": "Order acknowledged by the intake processor.",
        "operationId": "handlerorder_accepted_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEnvelope_order_accepted"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "null",
                  "title": "Response Handlerorder Accepted Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "order.assigned": {
      "post": {
        "summary": "order.assigned",
        "description": "Courier assigned; order status updated.",
        "operationId": "handlerorder_assigned_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEnvelope_order_assigned"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "null",
                  "title": "Response Handlerorder Assigned Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "order.courier_assigned": {
      "post": {
        "summary": "order.courier_assigned",
        "description": "Dedicated courier-assignment event with courier details.",
        "operationId": "handlerorder_courier_assigned_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEnvelope_order_courier_assigned"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "null",
                  "title": "Response Handlerorder Courier Assigned Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "order.picked_up": {
      "post": {
        "summary": "order.picked_up",
        "description": "Order picked up from pickup location.",
        "operationId": "handlerorder_picked_up_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEnvelope_order_picked_up"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "null",
                  "title": "Response Handlerorder Picked Up Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "order.in_transit": {
      "post": {
        "summary": "order.in_transit",
        "description": "Order en route to delivery.",
        "operationId": "handlerorder_in_transit_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEnvelope_order_in_transit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "null",
                  "title": "Response Handlerorder In Transit Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "order.delivered": {
      "post": {
        "summary": "order.delivered",
        "description": "Order delivered successfully.",
        "operationId": "handlerorder_delivered_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEnvelope_order_delivered"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "null",
                  "title": "Response Handlerorder Delivered Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "order.cancelled": {
      "post": {
        "summary": "order.cancelled",
        "description": "Order cancelled.",
        "operationId": "handlerorder_cancelled_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEnvelope_order_cancelled"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "null",
                  "title": "Response Handlerorder Cancelled Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "order.failed": {
      "post": {
        "summary": "order.failed",
        "description": "Order failed or rejected.",
        "operationId": "handlerorder_failed_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEnvelope_order_failed"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "null",
                  "title": "Response Handlerorder Failed Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "order.returned": {
      "post": {
        "summary": "order.returned",
        "description": "Order returned.",
        "operationId": "handlerorder_returned_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEnvelope_order_returned"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "null",
                  "title": "Response Handlerorder Returned Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "order.leg.picked_up": {
      "post": {
        "summary": "order.leg.picked_up",
        "description": "Multi-leg: a pickup stop completed.",
        "operationId": "handlerorder_leg_picked_up_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEnvelope_order_leg_picked_up"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "null",
                  "title": "Response Handlerorder Leg Picked Up Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "order.leg.skipped": {
      "post": {
        "summary": "order.leg.skipped",
        "description": "Multi-leg: a stop skipped.",
        "operationId": "handlerorder_leg_skipped_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEnvelope_order_leg_skipped"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "null",
                  "title": "Response Handlerorder Leg Skipped Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "order.arrived_at_pickup": {
      "post": {
        "summary": "order.arrived_at_pickup",
        "description": "Courier arrived at pickup geofence.",
        "operationId": "handlerorder_arrived_at_pickup_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEnvelope_order_arrived_at_pickup"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "null",
                  "title": "Response Handlerorder Arrived At Pickup Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "order.arrived_at_dropoff": {
      "post": {
        "summary": "order.arrived_at_dropoff",
        "description": "Courier arrived at dropoff geofence.",
        "operationId": "handlerorder_arrived_at_dropoff_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEnvelope_order_arrived_at_dropoff"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "null",
                  "title": "Response Handlerorder Arrived At Dropoff Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "order.leg.arrived": {
      "post": {
        "summary": "order.leg.arrived",
        "description": "Multi-leg: courier arrived at a stop.",
        "operationId": "handlerorder_leg_arrived_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEnvelope_order_leg_arrived"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "null",
                  "title": "Response Handlerorder Leg Arrived Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "quote.created": {
      "post": {
        "summary": "quote.created",
        "description": "Quote issued after POST /quotes.",
        "operationId": "handlerquote_created_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEnvelope_quote_created"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "null",
                  "title": "Response Handlerquote Created Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "tracking.courier_locations": {
      "post": {
        "summary": "tracking.courier_locations",
        "description": "Batch of live courier GPS positions for active orders.",
        "operationId": "handlertracking_courier_locations_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEnvelope_tracking_courier_locations"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "null",
                  "title": "Response Handlertracking Courier Locations Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "webhook.test": {
      "post": {
        "summary": "webhook.test",
        "description": "Synthetic test event from POST /webhooks/{id}/test.",
        "operationId": "handlerwebhook_test_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEnvelope_webhook_test"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "null",
                  "title": "Response Handlerwebhook Test Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CourierAssignedObject": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "order_ref": {
            "type": "string",
            "title": "Order Ref"
          },
          "partner_id": {
            "type": "integer",
            "title": "Partner Id"
          },
          "partner_order_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Partner Order Number"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "courier_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Courier Ref"
          },
          "courier": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Courier"
          },
          "courier_eta_minutes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Courier Eta Minutes"
          },
          "courier_eta_computed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Courier Eta Computed At"
          },
          "stops": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/CourierAssignedStopEta"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stops"
          }
        },
        "type": "object",
        "required": [
          "id",
          "order_ref",
          "partner_id",
          "status"
        ],
        "title": "CourierAssignedObject"
      },
      "CourierAssignedStopEta": {
        "properties": {
          "sequence": {
            "type": "integer",
            "title": "Sequence"
          },
          "stop_type": {
            "type": "string",
            "title": "Stop Type"
          },
          "eta_minutes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Eta Minutes"
          }
        },
        "type": "object",
        "required": [
          "sequence",
          "stop_type"
        ],
        "title": "CourierAssignedStopEta"
      },
      "CourierVehicleResponse": {
        "properties": {
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Type"
          },
          "brand": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Brand"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "color": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Color"
          },
          "plate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Plate"
          }
        },
        "type": "object",
        "title": "CourierVehicleResponse"
      },
      "EtaCreate": {
        "properties": {
          "pickup": {
            "$ref": "#/components/schemas/GeoPoint"
          },
          "dropoff": {
            "$ref": "#/components/schemas/GeoPoint"
          }
        },
        "type": "object",
        "required": [
          "pickup",
          "dropoff"
        ],
        "title": "EtaCreate",
        "examples": [
          {
            "pickup": {
              "lat": 24.7136,
              "lng": 46.6753,
              "address": "RRRD2929"
            },
            "dropoff": {
              "lat": 24.768,
              "lng": 46.709,
              "address": "RRRR1234"
            }
          }
        ]
      },
      "EtaLegOut": {
        "properties": {
          "from_sequence": {
            "type": "integer",
            "title": "From Sequence"
          },
          "to_sequence": {
            "type": "integer",
            "title": "To Sequence"
          },
          "distance_km": {
            "type": "number",
            "title": "Distance Km"
          },
          "duration_minutes": {
            "type": "number",
            "title": "Duration Minutes"
          }
        },
        "type": "object",
        "required": [
          "from_sequence",
          "to_sequence",
          "distance_km",
          "duration_minutes"
        ],
        "title": "EtaLegOut"
      },
      "EtaResponse": {
        "properties": {
          "distance_km": {
            "type": "number",
            "title": "Distance Km"
          },
          "duration_minutes": {
            "type": "number",
            "title": "Duration Minutes"
          },
          "provider": {
            "type": "string",
            "title": "Provider",
            "default": "osrm"
          },
          "legs": {
            "items": {
              "$ref": "#/components/schemas/EtaLegOut"
            },
            "type": "array",
            "title": "Legs"
          },
          "ordered_stops": {
            "items": {
              "$ref": "#/components/schemas/EtaStopOut"
            },
            "type": "array",
            "title": "Ordered Stops"
          }
        },
        "type": "object",
        "required": [
          "distance_km",
          "duration_minutes",
          "legs",
          "ordered_stops"
        ],
        "title": "EtaResponse",
        "examples": [
          {
            "distance_km": 8.4,
            "duration_minutes": 18.2,
            "provider": "osrm",
            "legs": [
              {
                "from_sequence": 1,
                "to_sequence": 2,
                "distance_km": 8.4,
                "duration_minutes": 18.2
              }
            ],
            "ordered_stops": [
              {
                "sequence": 1,
                "stop_type": "pickup",
                "lat": 24.7136,
                "lng": 46.6753
              },
              {
                "sequence": 2,
                "stop_type": "dropoff",
                "lat": 24.768,
                "lng": 46.709
              }
            ]
          }
        ]
      },
      "EtaStopOut": {
        "properties": {
          "sequence": {
            "type": "integer",
            "title": "Sequence"
          },
          "stop_type": {
            "type": "string",
            "title": "Stop Type"
          },
          "lat": {
            "type": "number",
            "title": "Lat"
          },
          "lng": {
            "type": "number",
            "title": "Lng"
          },
          "short_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Short Address"
          },
          "address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Address"
          },
          "contact_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Name"
          },
          "contact_phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Phone"
          }
        },
        "type": "object",
        "required": [
          "sequence",
          "stop_type",
          "lat",
          "lng"
        ],
        "title": "EtaStopOut"
      },
      "GeoPoint": {
        "properties": {
          "lat": {
            "type": "number",
            "maximum": 90.0,
            "minimum": -90.0,
            "title": "Lat"
          },
          "lng": {
            "type": "number",
            "maximum": 180.0,
            "minimum": -180.0,
            "title": "Lng"
          },
          "address": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Address"
          }
        },
        "type": "object",
        "required": [
          "lat",
          "lng"
        ],
        "title": "GeoPoint"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "MultiLegEtaCreate": {
        "properties": {
          "pickups": {
            "items": {
              "$ref": "#/components/schemas/PartnerLocation"
            },
            "type": "array",
            "maxItems": 10,
            "minItems": 1,
            "title": "Pickups"
          },
          "dropoff": {
            "$ref": "#/components/schemas/PartnerLocation"
          }
        },
        "type": "object",
        "required": [
          "pickups",
          "dropoff"
        ],
        "title": "MultiLegEtaCreate",
        "examples": [
          {
            "pickups": [
              {
                "lat": 24.7136,
                "lng": 46.6753,
                "short_address": "RRRD2929"
              },
              {
                "lat": 24.725,
                "lng": 46.68,
                "short_address": "RRRR5678"
              }
            ],
            "dropoff": {
              "lat": 24.768,
              "lng": 46.709,
              "short_address": "RRRR1234",
              "contact_name": "Customer",
              "contact_phone": "+966501234567"
            }
          }
        ]
      },
      "MultiLegOrderCreate": {
        "properties": {
          "partner_order_number": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Partner Order Number"
          },
          "quote_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 26,
                "minLength": 26
              },
              {
                "type": "null"
              }
            ],
            "title": "Quote Id"
          },
          "pickups": {
            "items": {
              "$ref": "#/components/schemas/PartnerLocation"
            },
            "type": "array",
            "maxItems": 10,
            "minItems": 1,
            "title": "Pickups"
          },
          "dropoff": {
            "$ref": "#/components/schemas/PartnerLocation"
          },
          "package": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/app__schemas__order__PackageInfo"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          }
        },
        "type": "object",
        "required": [
          "pickups",
          "dropoff"
        ],
        "title": "MultiLegOrderCreate"
      },
      "MultiLegQuoteCreate": {
        "properties": {
          "pickups": {
            "items": {
              "$ref": "#/components/schemas/PartnerLocation"
            },
            "type": "array",
            "maxItems": 10,
            "minItems": 1,
            "title": "Pickups"
          },
          "dropoff": {
            "$ref": "#/components/schemas/PartnerLocation"
          },
          "vehicle_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vehicle Type"
          },
          "package": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/app__schemas__order__PackageInfo"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "pickups",
          "dropoff"
        ],
        "title": "MultiLegQuoteCreate"
      },
      "MultiLegQuoteResponse": {
        "properties": {
          "quote_id": {
            "type": "string",
            "title": "Quote Id"
          },
          "total_sar": {
            "type": "number",
            "title": "Total Sar"
          },
          "distance_km": {
            "type": "number",
            "title": "Distance Km"
          },
          "duration_minutes": {
            "type": "number",
            "title": "Duration Minutes"
          },
          "breakdown": {
            "type": "object",
            "title": "Breakdown"
          },
          "currency": {
            "type": "string",
            "title": "Currency"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At"
          },
          "ordered_stops": {
            "items": {
              "$ref": "#/components/schemas/OrderedStopOut"
            },
            "type": "array",
            "title": "Ordered Stops"
          }
        },
        "type": "object",
        "required": [
          "quote_id",
          "total_sar",
          "distance_km",
          "duration_minutes",
          "breakdown",
          "currency",
          "expires_at",
          "ordered_stops"
        ],
        "title": "MultiLegQuoteResponse"
      },
      "OrderCourierResponse": {
        "properties": {
          "order_id": {
            "type": "string",
            "title": "Order Id"
          },
          "order_ref": {
            "type": "string",
            "title": "Order Ref"
          },
          "courier_ref": {
            "type": "string",
            "title": "Courier Ref"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "vehicle": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CourierVehicleResponse"
              },
              {
                "type": "null"
              }
            ]
          },
          "courier_eta_minutes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Courier Eta Minutes"
          }
        },
        "type": "object",
        "required": [
          "order_id",
          "order_ref",
          "courier_ref",
          "name"
        ],
        "title": "OrderCourierResponse"
      },
      "OrderCreate": {
        "properties": {
          "partner_order_number": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Partner Order Number",
            "description": "Partner's idempotency key (unique per partner if set)."
          },
          "quote_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 26,
                "minLength": 26
              },
              {
                "type": "null"
              }
            ],
            "title": "Quote Id",
            "description": "ULID returned from POST /quotes — binds the order to the quoted price."
          },
          "pickup": {
            "$ref": "#/components/schemas/PartnerLocation"
          },
          "dropoff": {
            "$ref": "#/components/schemas/PartnerLocation"
          },
          "package": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/app__schemas__order__PackageInfo"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          }
        },
        "type": "object",
        "required": [
          "pickup",
          "dropoff"
        ],
        "title": "OrderCreate",
        "description": "v1 partner-order creation body.\n\nEither supply `quote_id` (best — partner saw the price up front), or\npickup/dropoff coordinates and we'll re-quote at intake. Both paths\nare guaranteed to use the same pricing engine so the partner can't\narbitrage by skipping the quote.\n\n**Order goods total** for Lynq ``public.orders.total`` comes only from\n``package.declared_value_sar`` when set; otherwise ``total`` defaults to ``0``."
      },
      "OrderCreateResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "partner_order_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Partner Order Number"
          },
          "status": {
            "type": "string",
            "title": "Status",
            "default": "pending"
          },
          "estimated_fee_sar": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estimated Fee Sar"
          },
          "distance_km": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Distance Km"
          },
          "received_at": {
            "type": "string",
            "format": "date-time",
            "title": "Received At"
          },
          "links": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Links"
          }
        },
        "type": "object",
        "required": [
          "id",
          "received_at"
        ],
        "title": "OrderCreateResponse",
        "description": "202 Accepted body. ``id`` is the order ULID."
      },
      "OrderDropoffUpdate": {
        "properties": {
          "dropoff": {
            "$ref": "#/components/schemas/PartnerLocation"
          }
        },
        "type": "object",
        "required": [
          "dropoff"
        ],
        "title": "OrderDropoffUpdate",
        "description": "Partner-initiated dropoff change before pickup."
      },
      "OrderDropoffUpdateResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "partner_order_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Partner Order Number"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "quote_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quote Id"
          },
          "order_total_sar": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Order Total Sar"
          },
          "pickup_lat": {
            "type": "number",
            "title": "Pickup Lat"
          },
          "pickup_lng": {
            "type": "number",
            "title": "Pickup Lng"
          },
          "pickup_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup Address"
          },
          "pickup_short_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup Short Address"
          },
          "pickup_building_no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup Building No"
          },
          "pickup_street": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup Street"
          },
          "pickup_secondary_no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup Secondary No"
          },
          "pickup_district": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup District"
          },
          "pickup_postal_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup Postal Code"
          },
          "pickup_city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup City"
          },
          "pickup_country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup Country"
          },
          "pickup_contact_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup Contact Name"
          },
          "pickup_contact_phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup Contact Phone"
          },
          "delivery_lat": {
            "type": "number",
            "title": "Delivery Lat"
          },
          "delivery_lng": {
            "type": "number",
            "title": "Delivery Lng"
          },
          "delivery_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Address"
          },
          "delivery_short_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Short Address"
          },
          "delivery_building_no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Building No"
          },
          "delivery_street": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Street"
          },
          "delivery_secondary_no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Secondary No"
          },
          "delivery_district": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery District"
          },
          "delivery_postal_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Postal Code"
          },
          "delivery_city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery City"
          },
          "delivery_country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Country"
          },
          "delivery_contact_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Contact Name"
          },
          "delivery_contact_phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Contact Phone"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "delivery_fee_sar": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Fee Sar"
          },
          "distance_km": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Distance Km"
          },
          "breakdown": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Breakdown"
          },
          "courier_eta_minutes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Courier Eta Minutes"
          },
          "courier_eta_computed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Courier Eta Computed At"
          },
          "stop_etas": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/StopEtaOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stop Etas"
          },
          "received_at": {
            "type": "string",
            "format": "date-time",
            "title": "Received At"
          },
          "accepted_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Accepted At"
          },
          "assigned_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assigned At"
          },
          "picked_up_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Picked Up At"
          },
          "delivered_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivered At"
          },
          "cancelled_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cancelled At"
          },
          "failed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Failed At"
          },
          "legacy_external_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Legacy External Id"
          },
          "pickup_proof_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup Proof Url"
          },
          "delivery_proof_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Proof Url"
          },
          "previous_delivery_fee_sar": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous Delivery Fee Sar"
          },
          "previous_distance_km": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous Distance Km"
          }
        },
        "type": "object",
        "required": [
          "id",
          "partner_order_number",
          "status",
          "quote_id",
          "pickup_lat",
          "pickup_lng",
          "pickup_address",
          "pickup_short_address",
          "pickup_building_no",
          "pickup_street",
          "pickup_secondary_no",
          "pickup_district",
          "pickup_postal_code",
          "pickup_city",
          "pickup_country",
          "pickup_contact_name",
          "pickup_contact_phone",
          "delivery_lat",
          "delivery_lng",
          "delivery_address",
          "delivery_short_address",
          "delivery_building_no",
          "delivery_street",
          "delivery_secondary_no",
          "delivery_district",
          "delivery_postal_code",
          "delivery_city",
          "delivery_country",
          "delivery_contact_name",
          "delivery_contact_phone",
          "notes",
          "delivery_fee_sar",
          "distance_km",
          "breakdown",
          "courier_eta_minutes",
          "received_at",
          "accepted_at",
          "assigned_at",
          "picked_up_at",
          "delivered_at",
          "cancelled_at",
          "failed_at",
          "legacy_external_id"
        ],
        "title": "OrderDropoffUpdateResponse"
      },
      "OrderProofResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "delivered_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivered At"
          },
          "pickup_proof_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup Proof Url"
          },
          "delivery_proof_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Proof Url"
          }
        },
        "type": "object",
        "required": [
          "id",
          "status"
        ],
        "title": "OrderProofResponse"
      },
      "OrderProofUrls": {
        "properties": {
          "pickup_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup Url"
          },
          "delivery_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Url"
          }
        },
        "type": "object",
        "title": "OrderProofUrls"
      },
      "OrderResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "partner_order_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Partner Order Number"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "quote_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quote Id"
          },
          "order_total_sar": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Order Total Sar"
          },
          "pickup_lat": {
            "type": "number",
            "title": "Pickup Lat"
          },
          "pickup_lng": {
            "type": "number",
            "title": "Pickup Lng"
          },
          "pickup_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup Address"
          },
          "pickup_short_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup Short Address"
          },
          "pickup_building_no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup Building No"
          },
          "pickup_street": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup Street"
          },
          "pickup_secondary_no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup Secondary No"
          },
          "pickup_district": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup District"
          },
          "pickup_postal_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup Postal Code"
          },
          "pickup_city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup City"
          },
          "pickup_country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup Country"
          },
          "pickup_contact_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup Contact Name"
          },
          "pickup_contact_phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup Contact Phone"
          },
          "delivery_lat": {
            "type": "number",
            "title": "Delivery Lat"
          },
          "delivery_lng": {
            "type": "number",
            "title": "Delivery Lng"
          },
          "delivery_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Address"
          },
          "delivery_short_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Short Address"
          },
          "delivery_building_no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Building No"
          },
          "delivery_street": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Street"
          },
          "delivery_secondary_no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Secondary No"
          },
          "delivery_district": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery District"
          },
          "delivery_postal_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Postal Code"
          },
          "delivery_city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery City"
          },
          "delivery_country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Country"
          },
          "delivery_contact_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Contact Name"
          },
          "delivery_contact_phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Contact Phone"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "delivery_fee_sar": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Fee Sar"
          },
          "distance_km": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Distance Km"
          },
          "breakdown": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Breakdown"
          },
          "courier_eta_minutes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Courier Eta Minutes"
          },
          "courier_eta_computed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Courier Eta Computed At"
          },
          "stop_etas": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/StopEtaOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stop Etas"
          },
          "received_at": {
            "type": "string",
            "format": "date-time",
            "title": "Received At"
          },
          "accepted_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Accepted At"
          },
          "assigned_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assigned At"
          },
          "picked_up_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Picked Up At"
          },
          "delivered_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivered At"
          },
          "cancelled_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cancelled At"
          },
          "failed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Failed At"
          },
          "legacy_external_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Legacy External Id"
          },
          "pickup_proof_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pickup Proof Url"
          },
          "delivery_proof_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Proof Url"
          }
        },
        "type": "object",
        "required": [
          "id",
          "partner_order_number",
          "status",
          "quote_id",
          "pickup_lat",
          "pickup_lng",
          "pickup_address",
          "pickup_short_address",
          "pickup_building_no",
          "pickup_street",
          "pickup_secondary_no",
          "pickup_district",
          "pickup_postal_code",
          "pickup_city",
          "pickup_country",
          "pickup_contact_name",
          "pickup_contact_phone",
          "delivery_lat",
          "delivery_lng",
          "delivery_address",
          "delivery_short_address",
          "delivery_building_no",
          "delivery_street",
          "delivery_secondary_no",
          "delivery_district",
          "delivery_postal_code",
          "delivery_city",
          "delivery_country",
          "delivery_contact_name",
          "delivery_contact_phone",
          "notes",
          "delivery_fee_sar",
          "distance_km",
          "breakdown",
          "courier_eta_minutes",
          "received_at",
          "accepted_at",
          "assigned_at",
          "picked_up_at",
          "delivered_at",
          "cancelled_at",
          "failed_at",
          "legacy_external_id"
        ],
        "title": "OrderResponse",
        "description": "Read view of a worker.orders row."
      },
      "OrderWebhookObject": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "partner_id": {
            "type": "integer",
            "title": "Partner Id"
          },
          "partner_order_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Partner Order Number"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "quote_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quote Id"
          },
          "order_total_sar": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Order Total Sar"
          },
          "proof": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OrderProofUrls"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "id",
          "partner_id",
          "status"
        ],
        "title": "OrderWebhookObject"
      },
      "OrderedStopOut": {
        "properties": {
          "sequence": {
            "type": "integer",
            "title": "Sequence"
          },
          "stop_type": {
            "type": "string",
            "title": "Stop Type"
          },
          "lat": {
            "type": "number",
            "title": "Lat"
          },
          "lng": {
            "type": "number",
            "title": "Lng"
          },
          "short_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Short Address"
          },
          "address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Address"
          },
          "contact_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Name"
          },
          "contact_phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Phone"
          }
        },
        "type": "object",
        "required": [
          "sequence",
          "stop_type",
          "lat",
          "lng"
        ],
        "title": "OrderedStopOut"
      },
      "PartnerLocation": {
        "properties": {
          "lat": {
            "type": "number",
            "maximum": 90.0,
            "minimum": -90.0,
            "title": "Lat"
          },
          "lng": {
            "type": "number",
            "maximum": 180.0,
            "minimum": -180.0,
            "title": "Lng"
          },
          "short_address": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Short Address",
            "description": "Saudi national address short code (e.g. SPL short address). Optional when lat/lng are set."
          },
          "address": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Address",
            "description": "Optional longer formatted address line; defaults to short_address."
          },
          "building_no": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 50
              },
              {
                "type": "null"
              }
            ],
            "title": "Building No"
          },
          "street": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Street"
          },
          "secondary_no": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 50
              },
              {
                "type": "null"
              }
            ],
            "title": "Secondary No"
          },
          "district": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "District"
          },
          "postal_code": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 20
              },
              {
                "type": "null"
              }
            ],
            "title": "Postal Code"
          },
          "city": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ],
            "title": "City"
          },
          "country": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ],
            "title": "Country"
          },
          "contact_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Name"
          },
          "contact_phone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 20
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Phone"
          }
        },
        "type": "object",
        "required": [
          "lat",
          "lng"
        ],
        "title": "PartnerLocation",
        "description": "Pickup or dropoff: lat/lng required; national short code optional at intake.\n\nWhen ``short_address`` is omitted, order-worker reverse-geocodes from\ncoordinates (Google) and derives a short label (plus code or formatted line)."
      },
      "QuoteBreakdown": {
        "properties": {
          "base_fee_sar": {
            "type": "number",
            "title": "Base Fee Sar"
          },
          "included_km": {
            "type": "number",
            "title": "Included Km"
          },
          "extra_km": {
            "type": "number",
            "title": "Extra Km"
          },
          "extra_fee_sar": {
            "type": "number",
            "title": "Extra Fee Sar"
          },
          "total_fee_sar": {
            "type": "number",
            "title": "Total Fee Sar"
          }
        },
        "type": "object",
        "required": [
          "base_fee_sar",
          "included_km",
          "extra_km",
          "extra_fee_sar",
          "total_fee_sar"
        ],
        "title": "QuoteBreakdown",
        "description": "Fee line items returned on quote responses."
      },
      "QuoteCreate": {
        "properties": {
          "pickup": {
            "$ref": "#/components/schemas/GeoPoint"
          },
          "dropoff": {
            "$ref": "#/components/schemas/GeoPoint"
          },
          "vehicle_type": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "title": "Vehicle Type"
          },
          "package": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/app__schemas__quote__PackageInfo"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "pickup",
          "dropoff"
        ],
        "title": "QuoteCreate",
        "description": "Single-pickup, single-dropoff for v1 (matches Lynq's order shape).\nMulti-stop is out of scope until Lynq supports it."
      },
      "QuoteResponse": {
        "properties": {
          "quote_id": {
            "type": "string",
            "title": "Quote Id",
            "description": "ULID, 26 chars"
          },
          "total_sar": {
            "type": "number",
            "title": "Total Sar"
          },
          "distance_km": {
            "type": "number",
            "title": "Distance Km"
          },
          "duration_minutes": {
            "type": "number",
            "title": "Duration Minutes"
          },
          "breakdown": {
            "$ref": "#/components/schemas/QuoteBreakdown"
          },
          "currency": {
            "type": "string",
            "title": "Currency",
            "default": "SAR"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At"
          }
        },
        "type": "object",
        "required": [
          "quote_id",
          "total_sar",
          "distance_km",
          "duration_minutes",
          "breakdown",
          "expires_at"
        ],
        "title": "QuoteResponse"
      },
      "QuoteWebhookObject": {
        "properties": {
          "quote_id": {
            "type": "string",
            "title": "Quote Id"
          },
          "partner_id": {
            "type": "integer",
            "title": "Partner Id"
          },
          "total_sar": {
            "type": "number",
            "title": "Total Sar"
          },
          "distance_km": {
            "type": "number",
            "title": "Distance Km"
          },
          "expires_at": {
            "type": "string",
            "title": "Expires At"
          },
          "vehicle_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vehicle Type"
          }
        },
        "type": "object",
        "required": [
          "quote_id",
          "partner_id",
          "total_sar",
          "distance_km",
          "expires_at"
        ],
        "title": "QuoteWebhookObject"
      },
      "SimulationAdvanceResponse": {
        "properties": {
          "order_id": {
            "type": "string",
            "title": "Order Id",
            "description": "Order ULID."
          },
          "status": {
            "type": "string",
            "title": "Status",
            "description": "Worker order status after this step."
          },
          "event_type": {
            "type": "string",
            "title": "Event Type",
            "description": "Webhook event type applied in this step."
          },
          "step_index": {
            "type": "integer",
            "title": "Step Index",
            "description": "Timeline index after this step."
          },
          "steps_total": {
            "type": "integer",
            "title": "Steps Total",
            "description": "Total steps in the scenario."
          },
          "has_more_steps": {
            "type": "boolean",
            "title": "Has More Steps",
            "description": "Whether another advance call will apply another event."
          },
          "livemode": {
            "type": "boolean",
            "title": "Livemode",
            "description": "Always false for sandbox simulation.",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "order_id",
          "status",
          "event_type",
          "step_index",
          "steps_total",
          "has_more_steps"
        ],
        "title": "SimulationAdvanceResponse"
      },
      "StopEtaOut": {
        "properties": {
          "sequence": {
            "type": "integer",
            "title": "Sequence"
          },
          "stop_type": {
            "type": "string",
            "title": "Stop Type"
          },
          "eta_minutes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Eta Minutes"
          }
        },
        "type": "object",
        "required": [
          "sequence",
          "stop_type"
        ],
        "title": "StopEtaOut"
      },
      "TestOrderSimulationCreate": {
        "properties": {
          "partner_order_number": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Partner Order Number",
            "description": "Partner's idempotency key (unique per partner if set)."
          },
          "quote_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 26,
                "minLength": 26
              },
              {
                "type": "null"
              }
            ],
            "title": "Quote Id",
            "description": "ULID returned from POST /quotes — binds the order to the quoted price."
          },
          "pickup": {
            "$ref": "#/components/schemas/PartnerLocation"
          },
          "dropoff": {
            "$ref": "#/components/schemas/PartnerLocation"
          },
          "package": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/app__schemas__order__PackageInfo"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "scenario": {
            "type": "string",
            "enum": [
              "delivered",
              "cancelled_before_pickup",
              "failed_at_pickup",
              "returned"
            ],
            "title": "Scenario",
            "description": "Webhook timeline to play (sandbox only).",
            "default": "delivered"
          },
          "step_interval_sec": {
            "type": "integer",
            "maximum": 3600.0,
            "minimum": 1.0,
            "title": "Step Interval Sec",
            "description": "Seconds between auto-advance steps when sandbox_simulator runs.",
            "default": 15
          },
          "advance_first_step": {
            "type": "boolean",
            "title": "Advance First Step",
            "description": "If true, apply the first timeline step immediately in the create response.",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "pickup",
          "dropoff"
        ],
        "title": "TestOrderSimulationCreate",
        "description": "Same body as order create, plus a scripted lifecycle scenario."
      },
      "TestOrderSimulationResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "partner_order_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Partner Order Number"
          },
          "status": {
            "type": "string",
            "title": "Status",
            "default": "pending"
          },
          "estimated_fee_sar": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estimated Fee Sar"
          },
          "distance_km": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Distance Km"
          },
          "received_at": {
            "type": "string",
            "format": "date-time",
            "title": "Received At"
          },
          "links": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Links"
          },
          "is_test": {
            "type": "boolean",
            "title": "Is Test",
            "description": "Always true for sandbox simulation orders.",
            "default": true
          },
          "scenario": {
            "type": "string",
            "title": "Scenario",
            "description": "Scripted lifecycle scenario name."
          },
          "step_index": {
            "type": "integer",
            "title": "Step Index",
            "description": "Number of timeline steps already applied.",
            "default": 0
          },
          "steps_total": {
            "type": "integer",
            "title": "Steps Total",
            "description": "Total steps in the scenario."
          },
          "next_event_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Event Type",
            "description": "Next webhook event type, or null when the scenario is complete."
          },
          "livemode": {
            "type": "boolean",
            "title": "Livemode",
            "description": "Always false — outbox webhooks are test deliveries.",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "id",
          "received_at",
          "scenario",
          "steps_total"
        ],
        "title": "TestOrderSimulationResponse"
      },
      "TrackingLocationsObject": {
        "properties": {
          "ts": {
            "type": "integer",
            "title": "Ts",
            "description": "Batch timestamp (unix)"
          },
          "locations": {
            "items": {
              "items": {},
              "type": "array"
            },
            "type": "array",
            "title": "Locations",
            "description": "Rows: [order_ref, courier_ref, lat, lng, heading]",
            "examples": [
              [
                [
                  "01ORDER",
                  "01COURIER",
                  24.7136,
                  46.6753,
                  90.0
                ]
              ]
            ]
          }
        },
        "type": "object",
        "required": [
          "ts",
          "locations"
        ],
        "title": "TrackingLocationsObject"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "WebhookCreate": {
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2048,
            "minLength": 8,
            "title": "Url"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "event_filters": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Event Filters",
            "description": "Empty = receive all catalog events; otherwise only listed types."
          },
          "tracking_interval_sec": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 300.0,
                "minimum": 10.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Tracking Interval Sec",
            "description": "Seconds between live courier location webhook batches when subscribed to tracking.courier_locations. Default 30."
          }
        },
        "type": "object",
        "required": [
          "url"
        ],
        "title": "WebhookCreate"
      },
      "WebhookCreatedResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "partner_id": {
            "type": "integer",
            "title": "Partner Id"
          },
          "url": {
            "type": "string",
            "title": "Url"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "event_filters": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Event Filters"
          },
          "tracking_interval_sec": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tracking Interval Sec"
          },
          "active": {
            "type": "boolean",
            "title": "Active"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "secret": {
            "type": "string",
            "title": "Secret",
            "description": "Shown only on create; store securely."
          }
        },
        "type": "object",
        "required": [
          "id",
          "partner_id",
          "url",
          "description",
          "event_filters",
          "active",
          "created_at",
          "updated_at",
          "secret"
        ],
        "title": "WebhookCreatedResponse",
        "description": "Returned once from POST — includes the signing secret."
      },
      "WebhookDeliveryResponse": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "event_id": {
            "type": "string",
            "title": "Event Id"
          },
          "webhook_id": {
            "type": "string",
            "title": "Webhook Id"
          },
          "outbox_id": {
            "type": "integer",
            "title": "Outbox Id"
          },
          "event_type": {
            "type": "string",
            "title": "Event Type"
          },
          "attempt": {
            "type": "integer",
            "title": "Attempt"
          },
          "attempted_at": {
            "type": "string",
            "format": "date-time",
            "title": "Attempted At"
          },
          "request_url": {
            "type": "string",
            "title": "Request Url"
          },
          "response_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Status"
          },
          "succeeded": {
            "type": "boolean",
            "title": "Succeeded"
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Ms"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          }
        },
        "type": "object",
        "required": [
          "id",
          "event_id",
          "webhook_id",
          "outbox_id",
          "event_type",
          "attempt",
          "attempted_at",
          "request_url",
          "response_status",
          "succeeded",
          "duration_ms",
          "error"
        ],
        "title": "WebhookDeliveryResponse"
      },
      "WebhookEnvelope_order_accepted": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Unique event id (ULID)"
          },
          "object": {
            "type": "string",
            "title": "Object",
            "description": "Always `event`",
            "default": "event"
          },
          "created": {
            "type": "integer",
            "title": "Created",
            "description": "Unix timestamp"
          },
          "livemode": {
            "type": "boolean",
            "title": "Livemode",
            "description": "False on UAT / test deliveries"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "Event type, e.g. order.delivered"
          },
          "data": {
            "additionalProperties": {
              "$ref": "#/components/schemas/OrderWebhookObject"
            },
            "type": "object",
            "title": "Data",
            "description": "Wrapper with `object` payload"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created",
          "livemode",
          "type",
          "data"
        ],
        "title": "WebhookEnvelope_order_accepted",
        "description": "Stripe-style envelope for all outbound webhook deliveries."
      },
      "WebhookEnvelope_order_arrived_at_dropoff": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Unique event id (ULID)"
          },
          "object": {
            "type": "string",
            "title": "Object",
            "description": "Always `event`",
            "default": "event"
          },
          "created": {
            "type": "integer",
            "title": "Created",
            "description": "Unix timestamp"
          },
          "livemode": {
            "type": "boolean",
            "title": "Livemode",
            "description": "False on UAT / test deliveries"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "Event type, e.g. order.delivered"
          },
          "data": {
            "additionalProperties": {
              "$ref": "#/components/schemas/OrderWebhookObject"
            },
            "type": "object",
            "title": "Data",
            "description": "Wrapper with `object` payload"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created",
          "livemode",
          "type",
          "data"
        ],
        "title": "WebhookEnvelope_order_arrived_at_dropoff",
        "description": "Stripe-style envelope for all outbound webhook deliveries."
      },
      "WebhookEnvelope_order_arrived_at_pickup": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Unique event id (ULID)"
          },
          "object": {
            "type": "string",
            "title": "Object",
            "description": "Always `event`",
            "default": "event"
          },
          "created": {
            "type": "integer",
            "title": "Created",
            "description": "Unix timestamp"
          },
          "livemode": {
            "type": "boolean",
            "title": "Livemode",
            "description": "False on UAT / test deliveries"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "Event type, e.g. order.delivered"
          },
          "data": {
            "additionalProperties": {
              "$ref": "#/components/schemas/OrderWebhookObject"
            },
            "type": "object",
            "title": "Data",
            "description": "Wrapper with `object` payload"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created",
          "livemode",
          "type",
          "data"
        ],
        "title": "WebhookEnvelope_order_arrived_at_pickup",
        "description": "Stripe-style envelope for all outbound webhook deliveries."
      },
      "WebhookEnvelope_order_assigned": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Unique event id (ULID)"
          },
          "object": {
            "type": "string",
            "title": "Object",
            "description": "Always `event`",
            "default": "event"
          },
          "created": {
            "type": "integer",
            "title": "Created",
            "description": "Unix timestamp"
          },
          "livemode": {
            "type": "boolean",
            "title": "Livemode",
            "description": "False on UAT / test deliveries"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "Event type, e.g. order.delivered"
          },
          "data": {
            "additionalProperties": {
              "$ref": "#/components/schemas/OrderWebhookObject"
            },
            "type": "object",
            "title": "Data",
            "description": "Wrapper with `object` payload"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created",
          "livemode",
          "type",
          "data"
        ],
        "title": "WebhookEnvelope_order_assigned",
        "description": "Stripe-style envelope for all outbound webhook deliveries."
      },
      "WebhookEnvelope_order_cancelled": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Unique event id (ULID)"
          },
          "object": {
            "type": "string",
            "title": "Object",
            "description": "Always `event`",
            "default": "event"
          },
          "created": {
            "type": "integer",
            "title": "Created",
            "description": "Unix timestamp"
          },
          "livemode": {
            "type": "boolean",
            "title": "Livemode",
            "description": "False on UAT / test deliveries"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "Event type, e.g. order.delivered"
          },
          "data": {
            "additionalProperties": {
              "$ref": "#/components/schemas/OrderWebhookObject"
            },
            "type": "object",
            "title": "Data",
            "description": "Wrapper with `object` payload"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created",
          "livemode",
          "type",
          "data"
        ],
        "title": "WebhookEnvelope_order_cancelled",
        "description": "Stripe-style envelope for all outbound webhook deliveries."
      },
      "WebhookEnvelope_order_courier_assigned": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Unique event id (ULID)"
          },
          "object": {
            "type": "string",
            "title": "Object",
            "description": "Always `event`",
            "default": "event"
          },
          "created": {
            "type": "integer",
            "title": "Created",
            "description": "Unix timestamp"
          },
          "livemode": {
            "type": "boolean",
            "title": "Livemode",
            "description": "False on UAT / test deliveries"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "Event type, e.g. order.delivered"
          },
          "data": {
            "additionalProperties": {
              "$ref": "#/components/schemas/CourierAssignedObject"
            },
            "type": "object",
            "title": "Data",
            "description": "Wrapper with `object` payload"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created",
          "livemode",
          "type",
          "data"
        ],
        "title": "WebhookEnvelope_order_courier_assigned",
        "description": "Stripe-style envelope for all outbound webhook deliveries."
      },
      "WebhookEnvelope_order_delivered": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Unique event id (ULID)"
          },
          "object": {
            "type": "string",
            "title": "Object",
            "description": "Always `event`",
            "default": "event"
          },
          "created": {
            "type": "integer",
            "title": "Created",
            "description": "Unix timestamp"
          },
          "livemode": {
            "type": "boolean",
            "title": "Livemode",
            "description": "False on UAT / test deliveries"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "Event type, e.g. order.delivered"
          },
          "data": {
            "additionalProperties": {
              "$ref": "#/components/schemas/OrderWebhookObject"
            },
            "type": "object",
            "title": "Data",
            "description": "Wrapper with `object` payload"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created",
          "livemode",
          "type",
          "data"
        ],
        "title": "WebhookEnvelope_order_delivered",
        "description": "Stripe-style envelope for all outbound webhook deliveries."
      },
      "WebhookEnvelope_order_dropoff_updated": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Unique event id (ULID)"
          },
          "object": {
            "type": "string",
            "title": "Object",
            "description": "Always `event`",
            "default": "event"
          },
          "created": {
            "type": "integer",
            "title": "Created",
            "description": "Unix timestamp"
          },
          "livemode": {
            "type": "boolean",
            "title": "Livemode",
            "description": "False on UAT / test deliveries"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "Event type, e.g. order.delivered"
          },
          "data": {
            "additionalProperties": {
              "$ref": "#/components/schemas/OrderWebhookObject"
            },
            "type": "object",
            "title": "Data",
            "description": "Wrapper with `object` payload"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created",
          "livemode",
          "type",
          "data"
        ],
        "title": "WebhookEnvelope_order_dropoff_updated",
        "description": "Stripe-style envelope for all outbound webhook deliveries."
      },
      "WebhookEnvelope_order_failed": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Unique event id (ULID)"
          },
          "object": {
            "type": "string",
            "title": "Object",
            "description": "Always `event`",
            "default": "event"
          },
          "created": {
            "type": "integer",
            "title": "Created",
            "description": "Unix timestamp"
          },
          "livemode": {
            "type": "boolean",
            "title": "Livemode",
            "description": "False on UAT / test deliveries"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "Event type, e.g. order.delivered"
          },
          "data": {
            "additionalProperties": {
              "$ref": "#/components/schemas/OrderWebhookObject"
            },
            "type": "object",
            "title": "Data",
            "description": "Wrapper with `object` payload"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created",
          "livemode",
          "type",
          "data"
        ],
        "title": "WebhookEnvelope_order_failed",
        "description": "Stripe-style envelope for all outbound webhook deliveries."
      },
      "WebhookEnvelope_order_in_transit": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Unique event id (ULID)"
          },
          "object": {
            "type": "string",
            "title": "Object",
            "description": "Always `event`",
            "default": "event"
          },
          "created": {
            "type": "integer",
            "title": "Created",
            "description": "Unix timestamp"
          },
          "livemode": {
            "type": "boolean",
            "title": "Livemode",
            "description": "False on UAT / test deliveries"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "Event type, e.g. order.delivered"
          },
          "data": {
            "additionalProperties": {
              "$ref": "#/components/schemas/OrderWebhookObject"
            },
            "type": "object",
            "title": "Data",
            "description": "Wrapper with `object` payload"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created",
          "livemode",
          "type",
          "data"
        ],
        "title": "WebhookEnvelope_order_in_transit",
        "description": "Stripe-style envelope for all outbound webhook deliveries."
      },
      "WebhookEnvelope_order_leg_arrived": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Unique event id (ULID)"
          },
          "object": {
            "type": "string",
            "title": "Object",
            "description": "Always `event`",
            "default": "event"
          },
          "created": {
            "type": "integer",
            "title": "Created",
            "description": "Unix timestamp"
          },
          "livemode": {
            "type": "boolean",
            "title": "Livemode",
            "description": "False on UAT / test deliveries"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "Event type, e.g. order.delivered"
          },
          "data": {
            "additionalProperties": {
              "$ref": "#/components/schemas/OrderWebhookObject"
            },
            "type": "object",
            "title": "Data",
            "description": "Wrapper with `object` payload"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created",
          "livemode",
          "type",
          "data"
        ],
        "title": "WebhookEnvelope_order_leg_arrived",
        "description": "Stripe-style envelope for all outbound webhook deliveries."
      },
      "WebhookEnvelope_order_leg_picked_up": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Unique event id (ULID)"
          },
          "object": {
            "type": "string",
            "title": "Object",
            "description": "Always `event`",
            "default": "event"
          },
          "created": {
            "type": "integer",
            "title": "Created",
            "description": "Unix timestamp"
          },
          "livemode": {
            "type": "boolean",
            "title": "Livemode",
            "description": "False on UAT / test deliveries"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "Event type, e.g. order.delivered"
          },
          "data": {
            "additionalProperties": {
              "$ref": "#/components/schemas/OrderWebhookObject"
            },
            "type": "object",
            "title": "Data",
            "description": "Wrapper with `object` payload"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created",
          "livemode",
          "type",
          "data"
        ],
        "title": "WebhookEnvelope_order_leg_picked_up",
        "description": "Stripe-style envelope for all outbound webhook deliveries."
      },
      "WebhookEnvelope_order_leg_skipped": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Unique event id (ULID)"
          },
          "object": {
            "type": "string",
            "title": "Object",
            "description": "Always `event`",
            "default": "event"
          },
          "created": {
            "type": "integer",
            "title": "Created",
            "description": "Unix timestamp"
          },
          "livemode": {
            "type": "boolean",
            "title": "Livemode",
            "description": "False on UAT / test deliveries"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "Event type, e.g. order.delivered"
          },
          "data": {
            "additionalProperties": {
              "$ref": "#/components/schemas/OrderWebhookObject"
            },
            "type": "object",
            "title": "Data",
            "description": "Wrapper with `object` payload"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created",
          "livemode",
          "type",
          "data"
        ],
        "title": "WebhookEnvelope_order_leg_skipped",
        "description": "Stripe-style envelope for all outbound webhook deliveries."
      },
      "WebhookEnvelope_order_picked_up": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Unique event id (ULID)"
          },
          "object": {
            "type": "string",
            "title": "Object",
            "description": "Always `event`",
            "default": "event"
          },
          "created": {
            "type": "integer",
            "title": "Created",
            "description": "Unix timestamp"
          },
          "livemode": {
            "type": "boolean",
            "title": "Livemode",
            "description": "False on UAT / test deliveries"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "Event type, e.g. order.delivered"
          },
          "data": {
            "additionalProperties": {
              "$ref": "#/components/schemas/OrderWebhookObject"
            },
            "type": "object",
            "title": "Data",
            "description": "Wrapper with `object` payload"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created",
          "livemode",
          "type",
          "data"
        ],
        "title": "WebhookEnvelope_order_picked_up",
        "description": "Stripe-style envelope for all outbound webhook deliveries."
      },
      "WebhookEnvelope_order_received": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Unique event id (ULID)"
          },
          "object": {
            "type": "string",
            "title": "Object",
            "description": "Always `event`",
            "default": "event"
          },
          "created": {
            "type": "integer",
            "title": "Created",
            "description": "Unix timestamp"
          },
          "livemode": {
            "type": "boolean",
            "title": "Livemode",
            "description": "False on UAT / test deliveries"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "Event type, e.g. order.delivered"
          },
          "data": {
            "additionalProperties": {
              "$ref": "#/components/schemas/OrderWebhookObject"
            },
            "type": "object",
            "title": "Data",
            "description": "Wrapper with `object` payload"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created",
          "livemode",
          "type",
          "data"
        ],
        "title": "WebhookEnvelope_order_received",
        "description": "Stripe-style envelope for all outbound webhook deliveries."
      },
      "WebhookEnvelope_order_returned": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Unique event id (ULID)"
          },
          "object": {
            "type": "string",
            "title": "Object",
            "description": "Always `event`",
            "default": "event"
          },
          "created": {
            "type": "integer",
            "title": "Created",
            "description": "Unix timestamp"
          },
          "livemode": {
            "type": "boolean",
            "title": "Livemode",
            "description": "False on UAT / test deliveries"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "Event type, e.g. order.delivered"
          },
          "data": {
            "additionalProperties": {
              "$ref": "#/components/schemas/OrderWebhookObject"
            },
            "type": "object",
            "title": "Data",
            "description": "Wrapper with `object` payload"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created",
          "livemode",
          "type",
          "data"
        ],
        "title": "WebhookEnvelope_order_returned",
        "description": "Stripe-style envelope for all outbound webhook deliveries."
      },
      "WebhookEnvelope_quote_created": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Unique event id (ULID)"
          },
          "object": {
            "type": "string",
            "title": "Object",
            "description": "Always `event`",
            "default": "event"
          },
          "created": {
            "type": "integer",
            "title": "Created",
            "description": "Unix timestamp"
          },
          "livemode": {
            "type": "boolean",
            "title": "Livemode",
            "description": "False on UAT / test deliveries"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "Event type, e.g. order.delivered"
          },
          "data": {
            "additionalProperties": {
              "$ref": "#/components/schemas/QuoteWebhookObject"
            },
            "type": "object",
            "title": "Data",
            "description": "Wrapper with `object` payload"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created",
          "livemode",
          "type",
          "data"
        ],
        "title": "WebhookEnvelope_quote_created",
        "description": "Stripe-style envelope for all outbound webhook deliveries."
      },
      "WebhookEnvelope_tracking_courier_locations": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Unique event id (ULID)"
          },
          "object": {
            "type": "string",
            "title": "Object",
            "description": "Always `event`",
            "default": "event"
          },
          "created": {
            "type": "integer",
            "title": "Created",
            "description": "Unix timestamp"
          },
          "livemode": {
            "type": "boolean",
            "title": "Livemode",
            "description": "False on UAT / test deliveries"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "Event type, e.g. order.delivered"
          },
          "data": {
            "additionalProperties": {
              "$ref": "#/components/schemas/TrackingLocationsObject"
            },
            "type": "object",
            "title": "Data",
            "description": "Wrapper with `object` payload"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created",
          "livemode",
          "type",
          "data"
        ],
        "title": "WebhookEnvelope_tracking_courier_locations",
        "description": "Stripe-style envelope for all outbound webhook deliveries."
      },
      "WebhookEnvelope_webhook_test": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Unique event id (ULID)"
          },
          "object": {
            "type": "string",
            "title": "Object",
            "description": "Always `event`",
            "default": "event"
          },
          "created": {
            "type": "integer",
            "title": "Created",
            "description": "Unix timestamp"
          },
          "livemode": {
            "type": "boolean",
            "title": "Livemode",
            "description": "False on UAT / test deliveries"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "Event type, e.g. order.delivered"
          },
          "data": {
            "additionalProperties": {
              "$ref": "#/components/schemas/WebhookTestObject"
            },
            "type": "object",
            "title": "Data",
            "description": "Wrapper with `object` payload"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created",
          "livemode",
          "type",
          "data"
        ],
        "title": "WebhookEnvelope_webhook_test",
        "description": "Stripe-style envelope for all outbound webhook deliveries."
      },
      "WebhookReplayResponse": {
        "properties": {
          "inserted_outbox_rows": {
            "type": "integer",
            "title": "Inserted Outbox Rows"
          }
        },
        "type": "object",
        "required": [
          "inserted_outbox_rows"
        ],
        "title": "WebhookReplayResponse"
      },
      "WebhookResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "partner_id": {
            "type": "integer",
            "title": "Partner Id"
          },
          "url": {
            "type": "string",
            "title": "Url"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "event_filters": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Event Filters"
          },
          "tracking_interval_sec": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tracking Interval Sec"
          },
          "active": {
            "type": "boolean",
            "title": "Active"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "partner_id",
          "url",
          "description",
          "event_filters",
          "active",
          "created_at",
          "updated_at"
        ],
        "title": "WebhookResponse"
      },
      "WebhookTestObject": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message",
            "default": "Synthetic test event from Lynq order-worker"
          }
        },
        "type": "object",
        "title": "WebhookTestObject"
      },
      "WebhookTestResponse": {
        "properties": {
          "ok": {
            "type": "boolean",
            "title": "Ok"
          },
          "http_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Http Status"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "event_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Event Id"
          }
        },
        "type": "object",
        "required": [
          "ok"
        ],
        "title": "WebhookTestResponse"
      },
      "WebhookUpdate": {
        "properties": {
          "url": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048,
                "minLength": 8
              },
              {
                "type": "null"
              }
            ],
            "title": "Url"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "event_filters": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Event Filters"
          },
          "active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Active"
          },
          "rotate_secret": {
            "type": "boolean",
            "title": "Rotate Secret",
            "default": false
          },
          "tracking_interval_sec": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 300.0,
                "minimum": 10.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Tracking Interval Sec"
          }
        },
        "type": "object",
        "title": "WebhookUpdate"
      },
      "app__schemas__order__PackageInfo": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "weight_kg": {
            "anyOf": [
              {
                "type": "number",
                "exclusiveMinimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Weight Kg"
          },
          "declared_value_sar": {
            "anyOf": [
              {
                "type": "number",
                "exclusiveMinimum": 0.0
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Declared Value Sar"
          }
        },
        "type": "object",
        "title": "PackageInfo"
      },
      "app__schemas__quote__PackageInfo": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "weight_kg": {
            "anyOf": [
              {
                "type": "number",
                "exclusiveMinimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Weight Kg"
          },
          "declared_value_sar": {
            "anyOf": [
              {
                "type": "number",
                "exclusiveMinimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Declared Value Sar"
          }
        },
        "type": "object",
        "title": "PackageInfo"
      }
    },
    "securitySchemes": {
      "X-API-Key": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Partner API key issued by Lynq"
      },
      "X-Client-ID": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Client-ID",
        "description": "Partner client id"
      }
    }
  },
  "tags": [
    {
      "name": "etas",
      "description": "OSRM drive time and distance (no pricing)."
    },
    {
      "name": "quotes",
      "description": "Synchronous pricing before order intake."
    },
    {
      "name": "orders",
      "description": "Order intake (202 Accepted), status, cancel, courier snapshot."
    },
    {
      "name": "sandbox",
      "description": "UAT integration: scripted test orders with `livemode: false` webhooks, no Lynq courier intake. Use to exercise lifecycle and webhook handlers without live ops."
    },
    {
      "name": "webhooks",
      "description": "Webhook subscriptions, test delivery, replay, delivery log."
    }
  ],
  "security": [
    {
      "X-API-Key": [],
      "X-Client-ID": []
    }
  ]
}