{
  "openapi": "3.0.3",
  "info": {
    "title": "RDS Client Integration API",
    "version": "2026-11-11",
    "description": "Client-scoped API. Both Basic authentication and X-API-Secret are required except for state/county lookups. No idempotency or webhooks. Response examples are illustrative; report fields vary."
  },
  "servers": [
    {
      "url": "https://YOUR-RDS-HOST/rds-api"
    }
  ],
  "components": {
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      },
      "apiSecret": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Secret"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "error": {
            "type": "string"
          }
        }
      }
    }
  },
  "paths": {
    "/get-states/": {
      "get": {
        "operationId": "get_states",
        "summary": "Get states",
        "description": "List RDS state IDs and abbreviations. The example is abbreviated. Use the live lookup rather than a hardcoded ID list. The database may include a “not state specific” entry; use its returned ID when appropriate, or 0 when not applicable.",
        "security": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "success": true,
                  "states": [
                    {
                      "id": "26",
                      "name": "Missouri",
                      "abbr": "MO"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing authentication",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "HTTPS required or access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Wrong HTTP method",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported JSON content type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid order or upload fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/get-counties/": {
      "get": {
        "operationId": "get_counties",
        "summary": "Get counties",
        "description": "List counties for one RDS state ID. County IDs in examples are illustrative. Retrieve the real ID for the property’s state.",
        "security": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "success": true,
                  "state_id": 26,
                  "counties": [
                    {
                      "id": "1488",
                      "name": "Example County"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing authentication",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "HTTPS required or access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Wrong HTTP method",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported JSON content type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid order or upload fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "state_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "RDS state ID from get-states.",
            "example": 26
          }
        ]
      }
    },
    "/get-order-types/": {
      "get": {
        "operationId": "get_order_types",
        "summary": "Get order types",
        "description": "List active order types for your RDS installation. These are active installation order types, not a guarantee of a client-specific price or service arrangement. Confirm your supported products with RDS.",
        "security": [
          {
            "basicAuth": [],
            "apiSecret": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "success": true,
                  "order_types": [
                    {
                      "id": "2",
                      "name": "Example Search"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing authentication",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "HTTPS required or access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Wrong HTTP method",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported JSON content type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid order or upload fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/get-order-requirements/": {
      "get": {
        "operationId": "get_order_requirements",
        "summary": "Get requirement options",
        "description": "List active requirement options available when creating an order. Use requirements[].rid in add-order’s requirements array. order_types is a retained legacy alias containing the same options. This endpoint lists available options; it does not return one order’s selected requirements.",
        "security": [
          {
            "basicAuth": [],
            "apiSecret": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "success": true,
                  "requirements": [
                    {
                      "rid": "1",
                      "name": "Full document copies"
                    }
                  ],
                  "order_types": [
                    {
                      "rid": "1",
                      "name": "Full document copies"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing authentication",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "HTTPS required or access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Wrong HTTP method",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported JSON content type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid order or upload fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/add-order/": {
      "post": {
        "operationId": "add_order",
        "summary": "Add order",
        "description": "Create one order for the client assigned to the authenticated API user. Success is HTTP 200. Save fullOrderNumber and pass it as order_id on later calls. orderID alone is insufficient. Client, entered-by user, pricing, received time, and initial status are set by RDS. Unknown fields are ignored. Optional strings accept null. Use actual order type/state/county IDs from the lookup endpoints; county_id: 0 in this example represents not applicable. There is no idempotency key or lookup by client_reference: do not blindly retry order creation after a timeout. Reconcile with RDS first to avoid duplicate orders.",
        "security": [
          {
            "basicAuth": [],
            "apiSecret": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "success": true,
                  "orderID": "12345",
                  "fullOrderNumber": "R20261112345"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing authentication",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "HTTPS required or access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Wrong HTTP method",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported JSON content type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid order or upload fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "order_type",
                  "state_id",
                  "county_id"
                ],
                "properties": {
                  "order_type": {
                    "type": "integer",
                    "description": "Positive active ID from get-order-types.",
                    "minimum": 1
                  },
                  "state_id": {
                    "type": "integer",
                    "description": "RDS state ID from get-states; 0 only when not applicable. Not a FIPS code.",
                    "minimum": 0
                  },
                  "county_id": {
                    "type": "integer",
                    "description": "RDS county ID belonging to state_id; 0 only when not applicable.",
                    "minimum": 0
                  },
                  "client_reference": {
                    "type": "string",
                    "description": "Your tracking/reference number. Does not deduplicate submissions.",
                    "nullable": true
                  },
                  "address_line1": {
                    "type": "string",
                    "description": "Property street address.",
                    "nullable": true
                  },
                  "address_line2": {
                    "type": "string",
                    "description": "Suite, apartment, or additional address.",
                    "nullable": true
                  },
                  "city": {
                    "type": "string",
                    "description": "Property city.",
                    "nullable": true
                  },
                  "zip": {
                    "type": "string",
                    "description": "Postal code; keep leading zeros.",
                    "nullable": true
                  },
                  "subdivision": {
                    "type": "string",
                    "description": "Subdivision name.",
                    "nullable": true
                  },
                  "legal_description": {
                    "type": "string",
                    "description": "Property legal description.",
                    "nullable": true
                  },
                  "instructions": {
                    "type": "string",
                    "description": "Document/processing instructions.",
                    "nullable": true
                  },
                  "notes": {
                    "type": "string",
                    "description": "Notes saved on the order.",
                    "nullable": true
                  },
                  "requirements": {
                    "type": "array",
                    "description": "Positive active requirement IDs; e.g. [1, 2]. Empty array means no requirements.",
                    "items": {
                      "type": "integer"
                    }
                  },
                  "parcels": {
                    "type": "array",
                    "description": "Parcel numbers; keep leading zeros; no empty items.",
                    "items": {
                      "type": "string"
                    }
                  },
                  "buyer_first": {
                    "type": "string",
                    "description": "Primary buyer first name.",
                    "nullable": true
                  },
                  "buyer_middle": {
                    "type": "string",
                    "description": "Primary buyer middle name.",
                    "nullable": true
                  },
                  "buyer_last": {
                    "type": "string",
                    "description": "Primary buyer last name.",
                    "nullable": true
                  },
                  "cobuyer_first": {
                    "type": "string",
                    "description": "Co-buyer first name.",
                    "nullable": true
                  },
                  "cobuyer_middle": {
                    "type": "string",
                    "description": "Co-buyer middle name.",
                    "nullable": true
                  },
                  "cobuyer_last": {
                    "type": "string",
                    "description": "Co-buyer last name.",
                    "nullable": true
                  },
                  "seller_first": {
                    "type": "string",
                    "description": "Primary seller first name.",
                    "nullable": true
                  },
                  "seller_middle": {
                    "type": "string",
                    "description": "Primary seller middle name.",
                    "nullable": true
                  },
                  "seller_last": {
                    "type": "string",
                    "description": "Primary seller last name.",
                    "nullable": true
                  },
                  "coseller_first": {
                    "type": "string",
                    "description": "Co-seller first name.",
                    "nullable": true
                  },
                  "coseller_middle": {
                    "type": "string",
                    "description": "Co-seller middle name.",
                    "nullable": true
                  },
                  "coseller_last": {
                    "type": "string",
                    "description": "Co-seller last name.",
                    "nullable": true
                  }
                }
              },
              "example": {
                "order_type": 2,
                "client_reference": "INTEGRATION-TEST-001",
                "address_line1": "123 Example Street",
                "city": "Example City",
                "state_id": 26,
                "county_id": 0,
                "zip": "63040",
                "buyer_first": "Alex",
                "buyer_last": "Example",
                "requirements": [],
                "parcels": [
                  "00012345"
                ]
              }
            }
          }
        }
      }
    },
    "/get-order-status/": {
      "get": {
        "operationId": "get_order_status",
        "summary": "Get order status",
        "description": "Get the current status and sub-status. Status values are installation data, not a fixed public enum. Agree on polling intervals and completion mappings with RDS. Webhooks are not implemented in this package.",
        "security": [
          {
            "basicAuth": [],
            "apiSecret": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "success": true,
                  "order_id": "R20261112345",
                  "status": "Open",
                  "sub_status": "Searching"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing authentication",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "HTTPS required or access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Wrong HTTP method",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported JSON content type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid order or upload fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "order_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Full order number.",
            "example": "R20261112345"
          }
        ]
      }
    },
    "/get-order-eta/": {
      "get": {
        "operationId": "get_order_eta",
        "summary": "Get order ETA",
        "description": "Get status, sub-status, and the current ETA. eta may contain a date, a date and time, or the literal string “ETA not yet available”. For a completed order (internal status 5 / progress 9), eta is omitted and message is “Order is complete. ETA no longer applicable.”",
        "security": [
          {
            "basicAuth": [],
            "apiSecret": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "success": true,
                  "order_id": "R20261112345",
                  "status": "Open",
                  "sub_status": "Searching",
                  "eta": "2026-11-12 15:00:00"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing authentication",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "HTTPS required or access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Wrong HTTP method",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported JSON content type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid order or upload fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "order_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Full order number.",
            "example": "R20261112345"
          }
        ]
      }
    },
    "/get-order-header/": {
      "get": {
        "operationId": "get_order_header",
        "summary": "Get order header",
        "description": "Get company/letterhead, client reference, order type, search details, and property information. searched_by is a display name or an empty string. Company fields are an explicit public subset. This response does not include findings, parcels, selected requirements, or attachments.",
        "security": [
          {
            "basicAuth": [],
            "apiSecret": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "success": true,
                  "order_id": "R20261112345",
                  "company": {
                    "id": 1,
                    "timezone": "America/Chicago",
                    "name": "Example RDS Company",
                    "address": "123 Office Road",
                    "address_2": null,
                    "city": "Example City",
                    "state": "Missouri",
                    "zip": "63040",
                    "phone": "555-0100",
                    "phone_2": null,
                    "fax": null,
                    "fax_2": null,
                    "general_email": "office@example.com",
                    "orders_email": "orders@example.com",
                    "accounting_email": "billing@example.com",
                    "website": "https://example.com",
                    "logo": null
                  },
                  "client": {
                    "name": "Example Client",
                    "reference_number": "INTEGRATION-TEST-001"
                  },
                  "order": {
                    "type": "Example Search",
                    "copies": 0
                  },
                  "search": {
                    "date_searched": null,
                    "effective_date": null,
                    "effective_time": null,
                    "abstractor_notes": null,
                    "searched_by": ""
                  },
                  "property": {
                    "address": "123 Example Street",
                    "address_2": null,
                    "city": "Example City",
                    "state": "Missouri",
                    "zip": "63040",
                    "county": null,
                    "subdivision": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing authentication",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "HTTPS required or access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Wrong HTTP method",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported JSON content type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid order or upload fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "order_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Full order number.",
            "example": "R20261112345"
          }
        ]
      }
    },
    "/get-parties/": {
      "get": {
        "operationId": "get_parties",
        "summary": "Get parties",
        "description": "Get buyer, co-buyer, seller, and co-seller names. Missing party rows return HTTP 404. Individual name fields may be null.",
        "security": [
          {
            "basicAuth": [],
            "apiSecret": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "success": true,
                  "order_id": "R20261112345",
                  "parties": {
                    "party_1_or_buyer_first": "Alex",
                    "party_1_or_buyer_middle": null,
                    "party_1_or_buyer_last": "Example",
                    "party_2_or_co_buyer_first": null,
                    "party_2_or_co_buyer_middle": null,
                    "party_2_or_co_buyer_last": null,
                    "party_3_or_seller_first": null,
                    "party_3_or_seller_middle": null,
                    "party_3_or_seller_last": null,
                    "party_4_or_co_seller_first": null,
                    "party_4_or_co_seller_middle": null,
                    "party_4_or_co_seller_last": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing authentication",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "HTTPS required or access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Wrong HTTP method",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported JSON content type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid order or upload fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "order_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Full order number.",
            "example": "R20261112345"
          }
        ]
      }
    },
    "/get-parcels/": {
      "get": {
        "operationId": "get_parcels",
        "summary": "Get parcels",
        "description": "Get parcel numbers for the order. No matching parcels returns an empty array. Values remain strings.",
        "security": [
          {
            "basicAuth": [],
            "apiSecret": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "success": true,
                  "order_id": "R20261112345",
                  "parcels": [
                    "00012345"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing authentication",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "HTTPS required or access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Wrong HTTP method",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported JSON content type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid order or upload fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "order_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Full order number.",
            "example": "R20261112345"
          }
        ]
      }
    },
    "/get-results/": {
      "get": {
        "operationId": "get_results",
        "summary": "Get results",
        "description": "Get the latest saved report findings, excluding autosaves. HTTP 404 means no saved report is available (or the order is unavailable). This endpoint does not require completed status. Findings and header data can change before completion. asdID identifies the report form; fields vary by form and may be absent, null, empty arrays, or strings. Dates and currency inside findings retain their saved display formatting. Treat nested report text as untrusted content when rendering HTML. search_documents is not provided here.",
        "security": [
          {
            "basicAuth": [],
            "apiSecret": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "success": true,
                  "order_id": "R20261112345",
                  "results": {
                    "asdID": "18",
                    "order": {
                      "pins": [
                        "api-pin-1",
                        "api-pin-2",
                        "api-pin-3"
                      ],
                      "legal": "Legal description..",
                      "address": {
                        "zip": "12345",
                        "city": "Sometown",
                        "state": "Missouri",
                        "county": "St. Louis County",
                        "address1": "123 Street Road",
                        "address2": "Suite 150"
                      },
                      "details": {
                        "orderType": "100 Year Search",
                        "clientName": "Example Client",
                        "rdsOrderNo": "R20261112345",
                        "clientAccountNo": "INTEGRATION-TEST-001"
                      }
                    },
                    "search": {
                      "details": {
                        "names": "Adam Sandler\r\nBob  Barker",
                        "copies": "25",
                        "comments": "This is the abstractor notes.",
                        "searchDate": "03/25/2025",
                        "searchedBy": "Demo 1 Company",
                        "effectiveDate": "03/04/2025"
                      },
                      "deeds": [
                        {
                          "rec": "05/06/2025",
                          "book": "BK123",
                          "page": "PG123",
                          "type": "Warranty Deed",
                          "dated": "05/05/2025",
                          "consid": "$10.00",
                          "ins_no": "12345",
                          "comment": "deed note",
                          "grantee": "Adam and Bob Sandler",
                          "grantor": "John and Jane Doe"
                        },
                        {
                          "rec": "05/13/2025",
                          "book": "BKM123",
                          "page": "PGM753",
                          "type": "Beneficiary Deed",
                          "dated": "05/06/2025",
                          "consid": "$10.00",
                          "ins_no": "321",
                          "grantee": "Walt Disney",
                          "grantor": "Adam and Bob Sandler"
                        }
                      ],
                      "mortgages": [
                        {
                          "amt": "$125,000.00",
                          "ben": "Bob Barker",
                          "bor": "Adam Sandler",
                          "ins": "Mortgage",
                          "mat": "05/29/2045",
                          "rec": "05/07/2025",
                          "book": "BK12345",
                          "mers": "123456",
                          "open": "No",
                          "page": "PG12",
                          "trus": "Shooter McGavin",
                          "dated": "05/07/2025",
                          "ins_no": "1234",
                          "maxamt": "$300,000.00",
                          "comment": "mortgage comment",
                          "originalamt": "$200,000.00",
                          "related": [
                            {
                              "p1": "Primary Party",
                              "p2": "Secondary Party",
                              "rec": "05/07/2025",
                              "book": "BK123",
                              "page": "PG123",
                              "type": "Assignment",
                              "dated": "05/07/2025",
                              "ins_no": "12345",
                              "comment": "Related comment"
                            },
                            {
                              "p1": "Primary",
                              "p2": "Secondary",
                              "rec": "05/06/2025",
                              "book": "BK12",
                              "page": "PG78",
                              "type": "Subordination Agreement",
                              "dated": "05/01/2025",
                              "ins_no": "12345",
                              "comment": "Comment"
                            }
                          ]
                        },
                        {
                          "amt": "$50,000.00",
                          "ben": "Beneficiary",
                          "bor": "Borrower 2",
                          "ins": "Deed of Trust",
                          "mat": "05/31/2035",
                          "rec": "05/08/2025",
                          "book": "bk12",
                          "mers": "987654321",
                          "open": "Yes",
                          "page": "pg45",
                          "trus": "Trustee",
                          "dated": "05/05/2025",
                          "ins_no": "12345",
                          "maxamt": "$150,000.00",
                          "comment": "comment 2",
                          "originalamt": "$100,000.00"
                        }
                      ],
                      "liens": [
                        {
                          "amt": "$100.00",
                          "rec": "05/13/2025",
                          "book": "BK123",
                          "page": "PG456",
                          "type": "Federal Tax Lien",
                          "dated": "05/13/2025",
                          "ins_no": "12345",
                          "comment": "lien note"
                        },
                        {
                          "amt": "$50.00",
                          "rec": "05/04/2025",
                          "book": "BK12",
                          "page": "PG34",
                          "type": "Release of Lien",
                          "dated": "05/04/2025",
                          "ins_no": "98765"
                        }
                      ],
                      "judgment": [
                        {
                          "amt": "$57.58",
                          "rec": "05/07/2025",
                          "book": "BK111",
                          "page": "PG222",
                          "type": "Default Judgment",
                          "dated": "05/01/2025",
                          "ins_no": "112",
                          "comment": "judgment note"
                        }
                      ],
                      "uccs": [
                        {
                          "rec": "05/06/2025",
                          "book": "BK4444",
                          "page": "PG12",
                          "type": "UCC Continuation",
                          "dated": "05/05/2025",
                          "filing": "12345",
                          "ins_no": "12345",
                          "comment": "ucc note",
                          "secured": "Secured party"
                        }
                      ],
                      "bankruptcy": [
                        {
                          "amt": "$113,000.00",
                          "rec": "05/05/2025",
                          "book": "BK1245",
                          "page": "PG8754",
                          "type": "Chapter 13",
                          "dated": "04/01/2025",
                          "ins_no": "12345",
                          "comment": "bankruptcy note"
                        }
                      ],
                      "ccr": [
                        {
                          "rec": "05/07/2025",
                          "book": "bk12",
                          "page": "pg34",
                          "type": "Conditions & Restrictions",
                          "dated": "05/05/2025",
                          "ins_no": "123456",
                          "comment": "note"
                        },
                        {
                          "rec": "05/03/2025",
                          "book": "bk45",
                          "page": "pg67",
                          "type": "Plat Map",
                          "dated": "05/01/2025",
                          "ins_no": "987654",
                          "comment": "note"
                        }
                      ],
                      "misc": [
                        {
                          "rec": "05/02/2025",
                          "book": "Bk123",
                          "page": "Pg456",
                          "type": "misc document",
                          "dated": "05/01/2025",
                          "ins_no": "12345",
                          "comment": "note about misc doc"
                        }
                      ],
                      "miscNotes": "additional info",
                      "city_taxes": [
                        {
                          "amt": "$500.00",
                          "year": "2025",
                          "status": "Unpaid",
                          "comment": "city taxes note",
                          "duedate": "05/06/2025",
                          "paiddate": "05/06/2025"
                        }
                      ],
                      "county_taxes": [
                        {
                          "amt": "$1,000.00",
                          "year": "2025",
                          "status": "Delinquent",
                          "comment": "county tax note",
                          "duedate": "05/06/2025",
                          "paiddate": "05/13/2025"
                        },
                        {
                          "amt": "$2,000.00",
                          "year": "2024",
                          "status": "Paid",
                          "duedate": "05/28/2025",
                          "paiddate": "05/13/2025"
                        }
                      ],
                      "assessments": [
                        {
                          "who": "John Doe",
                          "bldg": "$100.00",
                          "land": "$100.00",
                          "year": "2025",
                          "total": "$300.00",
                          "improv": "$100.00",
                          "comment": "Note about assessments"
                        },
                        {
                          "who": "Jane Doe",
                          "bldg": "$200.00",
                          "land": "$200.00",
                          "year": "2024",
                          "total": "$600.00",
                          "improv": "$200.00",
                          "comment": "Comment about assessment"
                        }
                      ],
                      "procurement": {
                        "procurement-party-1": "Walt Disney",
                        "procurement-borrower": "Adam Sandler",
                        "procurement-co-borrower": "Bob Barker"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing authentication",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "HTTPS required or access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Wrong HTTP method",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported JSON content type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid order or upload fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "order_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Full order number.",
            "example": "R20261112345"
          }
        ]
      }
    },
    "/get-attachments/": {
      "get": {
        "operationId": "get_attachments",
        "summary": "Get attachments",
        "description": "Get attachments marked visible to the client. doc_size is bytes and may be a numeric string. doc_url is a temporary signed download URL. Actual expiry is controlled by RDS storage configuration; do not assume the response notice is an exact expiry timestamp. Fetch fresh links when needed. A failed attachment may contain doc_id and error instead of doc_url; inspect each item.",
        "security": [
          {
            "basicAuth": [],
            "apiSecret": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "success": true,
                  "notice": "All attachments URLs expire within 24 hours",
                  "order_id": "R20261112345",
                  "attachments": [
                    {
                      "doc_id": "1617",
                      "doc_date": "2026-11-11 09:00:00",
                      "doc_size": "68450",
                      "doc_url": "https://storage.example.com/example.pdf?temporary-signature=example"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing authentication",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "HTTPS required or access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Wrong HTTP method",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported JSON content type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid order or upload fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "order_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Full order number.",
            "example": "R20261112345"
          }
        ]
      }
    },
    "/get-results-with-attachments/": {
      "get": {
        "operationId": "get_results_with_attachments",
        "summary": "Get results with attachments",
        "description": "Get saved findings and client-visible attachments in one response. Attachments are nested inside results.attachments. Their keys differ from get-attachments: attachment_id, docsource_id, upload_date, filesize, url. If no saved report exists, the endpoint still returns success with empty/default findings and any available attachments. A corrupt saved report returns HTTP 500. Temporary URLs and per-item errors work as described above.",
        "security": [
          {
            "basicAuth": [],
            "apiSecret": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "success": true,
                  "order_id": "R20261112345",
                  "results": {
                    "asdID": "18",
                    "order": {
                      "pins": [
                        "api-pin-1",
                        "api-pin-2",
                        "api-pin-3"
                      ],
                      "legal": "Legal description..",
                      "address": {
                        "zip": "12345",
                        "city": "Sometown",
                        "state": "Missouri",
                        "county": "St. Louis County",
                        "address1": "123 Street Road",
                        "address2": "Suite 150"
                      },
                      "details": {
                        "orderType": "100 Year Search",
                        "clientName": "Example Client",
                        "rdsOrderNo": "R20261112345",
                        "clientAccountNo": "INTEGRATION-TEST-001"
                      }
                    },
                    "search": {
                      "details": {
                        "names": "Adam Sandler\r\nBob  Barker",
                        "copies": "25",
                        "comments": "This is the abstractor notes.",
                        "searchDate": "03/25/2025",
                        "searchedBy": "Demo 1 Company",
                        "effectiveDate": "03/04/2025"
                      },
                      "deeds": [
                        {
                          "rec": "05/06/2025",
                          "book": "BK123",
                          "page": "PG123",
                          "type": "Warranty Deed",
                          "dated": "05/05/2025",
                          "consid": "$10.00",
                          "ins_no": "12345",
                          "comment": "deed note",
                          "grantee": "Adam and Bob Sandler",
                          "grantor": "John and Jane Doe"
                        },
                        {
                          "rec": "05/13/2025",
                          "book": "BKM123",
                          "page": "PGM753",
                          "type": "Beneficiary Deed",
                          "dated": "05/06/2025",
                          "consid": "$10.00",
                          "ins_no": "321",
                          "grantee": "Walt Disney",
                          "grantor": "Adam and Bob Sandler"
                        }
                      ],
                      "mortgages": [
                        {
                          "amt": "$125,000.00",
                          "ben": "Bob Barker",
                          "bor": "Adam Sandler",
                          "ins": "Mortgage",
                          "mat": "05/29/2045",
                          "rec": "05/07/2025",
                          "book": "BK12345",
                          "mers": "123456",
                          "open": "No",
                          "page": "PG12",
                          "trus": "Shooter McGavin",
                          "dated": "05/07/2025",
                          "ins_no": "1234",
                          "maxamt": "$300,000.00",
                          "comment": "mortgage comment",
                          "originalamt": "$200,000.00",
                          "related": [
                            {
                              "p1": "Primary Party",
                              "p2": "Secondary Party",
                              "rec": "05/07/2025",
                              "book": "BK123",
                              "page": "PG123",
                              "type": "Assignment",
                              "dated": "05/07/2025",
                              "ins_no": "12345",
                              "comment": "Related comment"
                            },
                            {
                              "p1": "Primary",
                              "p2": "Secondary",
                              "rec": "05/06/2025",
                              "book": "BK12",
                              "page": "PG78",
                              "type": "Subordination Agreement",
                              "dated": "05/01/2025",
                              "ins_no": "12345",
                              "comment": "Comment"
                            }
                          ]
                        },
                        {
                          "amt": "$50,000.00",
                          "ben": "Beneficiary",
                          "bor": "Borrower 2",
                          "ins": "Deed of Trust",
                          "mat": "05/31/2035",
                          "rec": "05/08/2025",
                          "book": "bk12",
                          "mers": "987654321",
                          "open": "Yes",
                          "page": "pg45",
                          "trus": "Trustee",
                          "dated": "05/05/2025",
                          "ins_no": "12345",
                          "maxamt": "$150,000.00",
                          "comment": "comment 2",
                          "originalamt": "$100,000.00"
                        }
                      ],
                      "liens": [
                        {
                          "amt": "$100.00",
                          "rec": "05/13/2025",
                          "book": "BK123",
                          "page": "PG456",
                          "type": "Federal Tax Lien",
                          "dated": "05/13/2025",
                          "ins_no": "12345",
                          "comment": "lien note"
                        },
                        {
                          "amt": "$50.00",
                          "rec": "05/04/2025",
                          "book": "BK12",
                          "page": "PG34",
                          "type": "Release of Lien",
                          "dated": "05/04/2025",
                          "ins_no": "98765"
                        }
                      ],
                      "judgment": [
                        {
                          "amt": "$57.58",
                          "rec": "05/07/2025",
                          "book": "BK111",
                          "page": "PG222",
                          "type": "Default Judgment",
                          "dated": "05/01/2025",
                          "ins_no": "112",
                          "comment": "judgment note"
                        }
                      ],
                      "uccs": [
                        {
                          "rec": "05/06/2025",
                          "book": "BK4444",
                          "page": "PG12",
                          "type": "UCC Continuation",
                          "dated": "05/05/2025",
                          "filing": "12345",
                          "ins_no": "12345",
                          "comment": "ucc note",
                          "secured": "Secured party"
                        }
                      ],
                      "bankruptcy": [
                        {
                          "amt": "$113,000.00",
                          "rec": "05/05/2025",
                          "book": "BK1245",
                          "page": "PG8754",
                          "type": "Chapter 13",
                          "dated": "04/01/2025",
                          "ins_no": "12345",
                          "comment": "bankruptcy note"
                        }
                      ],
                      "ccr": [
                        {
                          "rec": "05/07/2025",
                          "book": "bk12",
                          "page": "pg34",
                          "type": "Conditions & Restrictions",
                          "dated": "05/05/2025",
                          "ins_no": "123456",
                          "comment": "note"
                        },
                        {
                          "rec": "05/03/2025",
                          "book": "bk45",
                          "page": "pg67",
                          "type": "Plat Map",
                          "dated": "05/01/2025",
                          "ins_no": "987654",
                          "comment": "note"
                        }
                      ],
                      "misc": [
                        {
                          "rec": "05/02/2025",
                          "book": "Bk123",
                          "page": "Pg456",
                          "type": "misc document",
                          "dated": "05/01/2025",
                          "ins_no": "12345",
                          "comment": "note about misc doc"
                        }
                      ],
                      "miscNotes": "additional info",
                      "city_taxes": [
                        {
                          "amt": "$500.00",
                          "year": "2025",
                          "status": "Unpaid",
                          "comment": "city taxes note",
                          "duedate": "05/06/2025",
                          "paiddate": "05/06/2025"
                        }
                      ],
                      "county_taxes": [
                        {
                          "amt": "$1,000.00",
                          "year": "2025",
                          "status": "Delinquent",
                          "comment": "county tax note",
                          "duedate": "05/06/2025",
                          "paiddate": "05/13/2025"
                        },
                        {
                          "amt": "$2,000.00",
                          "year": "2024",
                          "status": "Paid",
                          "duedate": "05/28/2025",
                          "paiddate": "05/13/2025"
                        }
                      ],
                      "assessments": [
                        {
                          "who": "John Doe",
                          "bldg": "$100.00",
                          "land": "$100.00",
                          "year": "2025",
                          "total": "$300.00",
                          "improv": "$100.00",
                          "comment": "Note about assessments"
                        },
                        {
                          "who": "Jane Doe",
                          "bldg": "$200.00",
                          "land": "$200.00",
                          "year": "2024",
                          "total": "$600.00",
                          "improv": "$200.00",
                          "comment": "Comment about assessment"
                        }
                      ],
                      "procurement": {
                        "procurement-party-1": "Walt Disney",
                        "procurement-borrower": "Adam Sandler",
                        "procurement-co-borrower": "Bob Barker"
                      }
                    },
                    "attachments": [
                      {
                        "attachment_id": "1617",
                        "docsource_id": null,
                        "upload_date": "2026-11-11 09:00:00",
                        "filesize": "68450",
                        "url": "https://storage.example.com/example.pdf?temporary-signature=example"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing authentication",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "HTTPS required or access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Wrong HTTP method",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported JSON content type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid order or upload fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "order_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Full order number.",
            "example": "R20261112345"
          }
        ]
      }
    },
    "/push-attachments/": {
      "post": {
        "operationId": "push_attachments",
        "summary": "Upload PDF attachment",
        "description": "Upload one PDF to an existing order. Send multipart/form-data with required order_id (full order number) and file (one PDF). Let your HTTP client set Content-Type and its multipart boundary. The file must have a .pdf extension and PDF MIME type. PHP/web-server upload and request limits apply; confirm the configured limit with RDS. file_url identifies a private object; obtain a signed download URL from get-attachments rather than treating file_url as a public download link. Uploads are not idempotent; reconcile uncertain outcomes before retrying.",
        "security": [
          {
            "basicAuth": [],
            "apiSecret": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "success": true,
                  "message": "File uploaded successfully",
                  "file_url": "https://storage.example.com/private/example.pdf"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing authentication",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "HTTPS required or access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Wrong HTTP method",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported JSON content type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid order or upload fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "order_id",
                  "file"
                ],
                "properties": {
                  "order_id": {
                    "type": "string",
                    "example": "R20261112345"
                  },
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "PDF file"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/get-invoice-details/": {
      "get": {
        "operationId": "get_invoice_details",
        "summary": "Get invoice details",
        "description": "Get invoice information for a completed order. Requires internal order status 5 / progress 9. HTTP 404 can mean the order is not complete or the invoice is unavailable. There is no endpoint here to discover invoice IDs; RDS must provide them. service_price and copies_unit_price come from current order pricing, not a complete historical invoice ledger. This response does not provide invoice totals, tax, discounts, balances, or a PDF. Do not reconstruct an authoritative invoice total from it.",
        "security": [
          {
            "basicAuth": [],
            "apiSecret": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "success": true,
                  "invoice": {
                    "invoice_id": 123,
                    "order_ref": "R20261112345",
                    "invoice_date": "2026-11-11",
                    "memo": null,
                    "service_qty": 1,
                    "service_price": "250.00",
                    "copies_quantity": 25,
                    "copies_unit_price": "1.00",
                    "line_items": [
                      {
                        "lineItemDescription": "Delivery",
                        "lineItemQty": "1",
                        "lineItemAmount": "14.00"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing authentication",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "HTTPS required or access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Wrong HTTP method",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported JSON content type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid order or upload fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "order_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Full order number.",
            "example": "R20261112345"
          },
          {
            "name": "invoice_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Positive invoice ID supplied by RDS.",
            "example": 123
          }
        ]
      }
    }
  }
}
