// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../core/resource'; import * as SearchAPI from './search'; import * as InsolvencyAPI from './insolvency'; import { APIPromise } from '../core/api-promise'; import { RequestOptions } from '../internal/request-options'; export class Search extends APIResource { /** * Autocomplete company search */ autocompleteCompaniesV1( query: SearchAutocompleteCompaniesV1Params, options?: RequestOptions, ): APIPromise { return this._client.get('/v1/autocomplete/company', { query, ...options }); } /** * Search for companies */ findCompaniesV1(body: SearchFindCompaniesV1Params, options?: RequestOptions): APIPromise { return this._client.post('/v1/search/company', { body, ...options }); } /** * Search for insolvency proceedings */ findInsolvenciesV1( body: SearchFindInsolvenciesV1Params, options?: RequestOptions, ): APIPromise { return this._client.post('/v1/search/insolvency', { body, ...options }); } /** * Search for people */ findPersonV1( body: SearchFindPersonV1Params, options?: RequestOptions, ): APIPromise { return this._client.post('/v1/search/person', { body, ...options }); } /** * Find company by website URL */ lookupCompanyByURL( query: SearchLookupCompanyByURLParams, options?: RequestOptions, ): APIPromise { return this._client.get('/v0/search/lookup', { query, ...options }); } } /** * Legal form of the company. Common German legal forms: * * - gmbh: Gesellschaft mit beschränkter Haftung (Limited Liability Company) * - ag: Aktiengesellschaft (Stock Corporation) * - ug: Unternehmergesellschaft (Entrepreneurial Company with limited liability) * - ohg: Offene Handelsgesellschaft (General Partnership) * - kg: Kommanditgesellschaft (Limited Partnership) * - ev: Eingetragener Verein (Registered Association) */ export type CompanyLegalForm = | 'ag' | 'eg' | 'ek' | 'ev' | 'ewiv' | 'foreign' | 'gbr' | 'ggmbh' | 'gmbh' | 'kg' | 'kgaa' | 'unknown' | 'llp' | 'municipal' | 'ohg' | 'se' | 'ug'; /** * Type of company register where the entity is recorded. Common types: * * - HRB: Commercial Register B (limited liability companies, stock corporations) * - HRA: Commercial Register A (partnerships, sole proprietorships) * - PR: Partnership Register * - GnR: Cooperative Register * - VR: Association Register */ export type CompanyRegisterType = 'HRB' | 'HRA' | 'PR' | 'GnR' | 'VR'; export interface CompanySearch { pagination: Pagination; /** * List of companies matching the search criteria. */ results: Array; } export interface CompanySearchResponseItem { /** * Company status - true if active, false if inactive. */ active: boolean; /** * Current registered address of the company, taken from the search index. */ address: CompanySearchResponseItem.Address | null; /** * Unique company identifier. Example: DE-HRB-F1103-267645 */ company_id: string; /** * Country where the company is registered using ISO 3166-1 alpha-2 code. Example: * "DE" for Germany */ country: string | null; /** * Legal form of the company. Example: "gmbh" for Gesellschaft mit beschränkter * Haftung */ legal_form: CompanyLegalForm; /** * Official registered company name. Example: "Max Mustermann GmbH" */ name: string; /** * Current official business purpose of the company, taken from the search index. */ purpose: string | null; /** * Court where the company is registered. Example: "Berlin (Charlottenburg)" */ register_court: string; /** * Registration number in the company register. Example: "230633" */ register_number: string; /** * Type of company register. Example: "HRB" for Commercial Register B */ register_type: CompanyRegisterType; } export namespace CompanySearchResponseItem { /** * Current registered address of the company, taken from the search index. */ export interface Address { /** * City or locality name. Example: "Berlin" */ city: string; /** * Country of the address using ISO 3166-1 alpha-2 code. Example: "DE" for Germany */ country: string; /** * Complete address formatted as a single string. Example: "Musterstraße 1, 10117 * Berlin" */ formatted_value: string; /** * Additional address information such as c/o or attention line. Example: "c/o Max * Mustermann" */ extra?: string; /** * Postal or ZIP code. Example: "10117" */ postal_code?: string; /** * Street name and number. Example: "Musterstraße 1" */ street?: string; } } export interface Pagination { /** * Current page number. */ page: number; /** * Number of results per page. */ per_page: number; /** * Total number of pages. */ total_pages: number; /** * Total number of results. */ total_results: number; } /** * Filter by field. The property sets `value`, `values`, `keywords` and `min`/`max` * are mutually exclusive. Dates must be YYYY-MM-DD. */ export interface SearchFilterBase { keywords?: Array; max?: string; min?: string; value?: string; values?: Array; } export interface SearchRequestPagination { /** * Page number to return. */ page?: number; /** * Number of results per page. */ per_page?: number; } export interface SearchAutocompleteCompaniesV1Response { /** * List of companies matching the search criteria. */ results: Array; } export interface SearchFindInsolvenciesV1Response { pagination: Pagination; /** * List of insolvency proceedings matching the search criteria. */ results: Array; } export namespace SearchFindInsolvenciesV1Response { export interface Result { /** * Unique insolvency proceeding identifier. */ id: string; /** * Kind of administration ordered for the proceeding. */ administration_kind: InsolvencyAPI.InsolvencyAdministrationKind | null; /** * Name of the insolvency administrator. */ administrator_name: string | null; /** * Case number of the proceeding at the insolvency court. Example: "36a IN 2792/24" */ case_number: string; /** * City of the debtor. Example: "Berlin" */ city: string | null; /** * Date the proceeding was closed. Format: ISO 8601 (YYYY-MM-DD) */ closed_at: string | null; /** * Unique company identifier of the debtor, if the debtor could be matched to a * registered company. Example: DE-HRB-F1103-267645 */ company_id: string | null; /** * Insolvency court handling the proceeding. Example: "Charlottenburg" */ court: string; /** * Current status of the proceeding. */ current_status: InsolvencyAPI.InsolvencyStatus; /** * Kind of debtor the proceeding concerns. * * - legal_person: legal entities (companies, associations, etc.) * - natural_person: private individuals */ debtor_kind: InsolvencyAPI.InsolvencyDebtorKind | null; /** * Legal form of the debtor, if the debtor is a company. Example: "gmbh" */ debtor_legal_form: string | null; /** * Name of the debtor. Example: "Max Mustermann GmbH" */ debtor_name: string; /** * Whether the proceeding is currently open. */ has_open_insolvency: boolean; /** * Grounds for the insolvency, e.g. "illiquidity", "over_indebtedness". */ insolvency_grounds: Array | null; /** * Date of the most recent event in the proceeding. Format: ISO 8601 (YYYY-MM-DD) */ last_event_at: string | null; /** * Date the proceeding was opened. Format: ISO 8601 (YYYY-MM-DD) */ opened_at: string | null; /** * Unique person identifier of the debtor, if the debtor could be matched to a * person. */ person_id: string | null; /** * Kind of insolvency proceeding. */ proceeding_kind: InsolvencyAPI.InsolvencyProceedingKind | null; } } export interface SearchFindPersonV1Response { pagination: Pagination; /** * List of people matching the search criteria. */ results: Array; } export namespace SearchFindPersonV1Response { export interface Result { /** * Unique person identifier. Example: 1234-5678-9012-345678901234 */ id: string; /** * Person status - true if active, false if inactive. */ active: boolean; /** * City of the person. Example: "Berlin" */ city: string | null; /** * Date of birth of the person. Format: ISO 8601 (YYYY-MM-DD) Example: "1990-01-01" */ date_of_birth: string; /** * Name of the person. Example: "Max Mustermann" */ name: string; } } export interface SearchLookupCompanyByURLResponse { /** * Unique company identifier. Example: DE-HRB-F1103-267645 */ company_id: string; /** * Email address of the company. Example: "info@maxmustermann.de" */ email?: string; /** * Phone number of the company. Example: "+49 123 456 789" */ phone?: string; /** * Value Added Tax identification number. Example: "DE123456789" */ vat_id?: string; } export interface SearchAutocompleteCompaniesV1Params { /** * Text search query to find companies by name. Example: "Descartes Technologies * UG" */ query: string; } export interface SearchFindCompaniesV1Params { /** * Filters to filter companies. */ filters?: Array; /** * Location to filter companies. */ location?: SearchFindCompaniesV1Params.Location; /** * Pagination parameters. */ pagination?: SearchRequestPagination; /** * Search query to filter companies. */ query?: SearchFindCompaniesV1Params.Query; } export namespace SearchFindCompaniesV1Params { /** * Filter by field. The property sets `value`, `values`, `keywords` and `min`/`max` * are mutually exclusive. Dates must be YYYY-MM-DD. */ export interface Filter extends SearchAPI.SearchFilterBase { field: | 'status' | 'legal_form' | 'register_number' | 'register_court' | 'register_type' | 'city' | 'active' | 'incorporated_at' | 'zip' | 'address' | 'balance_sheet_total' | 'revenue' | 'cash' | 'employees' | 'equity' | 'real_estate' | 'materials' | 'pension_provisions' | 'salaries' | 'taxes' | 'other_taxes' | 'commission_income' | 'commission_expense' | 'liabilities' | 'capital_reserves' | 'active_accruals' | 'passive_accruals' | 'fixed_assets' | 'current_assets' | 'receivables' | 'trade_receivables' | 'inventory' | 'provisions' | 'bank_debt' | 'trade_payables' | 'tangible_assets' | 'financial_assets' | 'retained_earnings' | 'profit_carryforward' | 'other_provisions' | 'shareholder_liabilities' | 'operating_depreciation' | 'financial_depreciation' | 'other_operating_income' | 'interest_income' | 'interest_expense' | 'other_liabilities' | 'financial_debt' | 'intangible_assets' | 'other_operating_expenses' | 'affiliated_liabilities' | 'net_income' | 'parent_net_income' | 'income_before_tax' | 'income_after_tax' | 'ebit' | 'ebitda' | 'industry_codes' | 'capital_amount' | 'capital_currency' | 'number_of_owners' | 'has_sole_owner' | 'has_representative_owner' | 'is_family_owned' | 'youngest_owner_age' | 'purpose' | 'has_lei' | 'lei' | 'had_insolvency' | 'has_open_insolvency' | 'insolvency_stage' | 'insolvency_opened_at'; } /** * Location to filter companies. */ export interface Location { /** * Latitude to filter on. */ latitude: number; /** * Longitude to filter on. */ longitude: number; /** * Radius in kilometers to filter on. Example: 10 */ radius?: number; } /** * Search query to filter companies. */ export interface Query { /** * Search query to filter companies. */ value: string; } } export interface SearchFindInsolvenciesV1Params { /** * Filters to filter insolvency proceedings. */ filters?: Array; /** * Pagination parameters. */ pagination?: SearchRequestPagination; /** * Search query to filter insolvency proceedings. */ query?: SearchFindInsolvenciesV1Params.Query; } export namespace SearchFindInsolvenciesV1Params { /** * Filter by field. The property sets `value`, `values`, `keywords` and `min`/`max` * are mutually exclusive. Dates must be YYYY-MM-DD. */ export interface Filter extends SearchAPI.SearchFilterBase { /** * Field of the insolvency proceeding to filter on. Date fields (opened_at, * closed_at, last_event_at, claims_filing_deadline) support min/max ranges with * values in the format YYYY-MM-DD. */ field: | 'debtor_kind' | 'debtor_legal_form' | 'court' | 'city' | 'current_status' | 'has_open_insolvency' | 'proceeding_kind' | 'administration_kind' | 'insolvency_grounds' | 'opened_at' | 'closed_at' | 'last_event_at' | 'claims_filing_deadline' | 'company_id' | 'person_id'; } /** * Search query to filter insolvency proceedings. */ export interface Query { /** * Search query to filter insolvency proceedings. Matches against debtor name, case * number, administrator name and court. */ value: string; } } export interface SearchFindPersonV1Params { /** * Filters to filter people. */ filters?: Array; /** * Pagination parameters. */ pagination?: SearchRequestPagination; /** * Search query to filter people. */ query?: SearchFindPersonV1Params.Query; } export namespace SearchFindPersonV1Params { /** * Filter by field. The property sets `value`, `values`, `keywords` and `min`/`max` * are mutually exclusive. Dates must be YYYY-MM-DD. */ export interface Filter extends SearchAPI.SearchFilterBase { field: 'date_of_birth' | 'city' | 'active'; } /** * Search query to filter people. */ export interface Query { /** * Search query to filter people. */ value: string; } } export interface SearchLookupCompanyByURLParams { /** * Website URL to search for. Example: "https://openregister.de" */ url: string; } export declare namespace Search { export { type CompanyLegalForm as CompanyLegalForm, type CompanyRegisterType as CompanyRegisterType, type CompanySearch as CompanySearch, type CompanySearchResponseItem as CompanySearchResponseItem, type Pagination as Pagination, type SearchFilterBase as SearchFilterBase, type SearchRequestPagination as SearchRequestPagination, type SearchAutocompleteCompaniesV1Response as SearchAutocompleteCompaniesV1Response, type SearchFindInsolvenciesV1Response as SearchFindInsolvenciesV1Response, type SearchFindPersonV1Response as SearchFindPersonV1Response, type SearchLookupCompanyByURLResponse as SearchLookupCompanyByURLResponse, type SearchAutocompleteCompaniesV1Params as SearchAutocompleteCompaniesV1Params, type SearchFindCompaniesV1Params as SearchFindCompaniesV1Params, type SearchFindInsolvenciesV1Params as SearchFindInsolvenciesV1Params, type SearchFindPersonV1Params as SearchFindPersonV1Params, type SearchLookupCompanyByURLParams as SearchLookupCompanyByURLParams, }; }