declare namespace BusinessActivitiesStatic { interface BusinessActivity { id: number; name: string; default_is_billable?: boolean; default_price_per_hour?: string; account_id?: number; } interface BusinessActivityCreate { name: string; default_is_billable?: boolean; default_price_per_hour?: string; account_id?: number; } interface BusinessActivityOverwrite { name: string; default_is_billable?: boolean; default_price_per_hour?: string; account_id?: number; } enum BusinessActivitySearchParameters { name = "name" } } declare namespace BaseStatic { interface PdfResponse { name: string; size: number; mime: string; content: Buffer; } type SearchCriteria = "=" | "!=" | ">" | "<" | ">=" | "<=" | "equal" | "not_equal" | "greater_than" | "less_than" | "greater_equal" | "less_equal" | "like" | "not_like" | "is_null" | "not_null" | "in" | "not_in"; interface SearchParameter { field: T; value: any; criteria?: SearchCriteria; } interface BaseOptions { limit?: number; offset?: number; order_by?: string; [index: string]: any; } } declare class BaseCrud { protected apiToken: string; protected apiEndpoint: string; protected baseApiUrl: string; constructor(apiToken: string, apiEndpoint: string); /** * Lists the ressource * * @param {BaseStatic.BaseOptions} [options] * @returns {Promise>} * @memberof BaseCrud */ list(options?: BaseStatic.BaseOptions): Promise>; /** * search for resources * * @param {Array>} searchOptions * @param {BaseStatic.BaseOptions} [options] * @returns {Promise>} * @memberof BaseCrud */ search(searchOptions: Array>, options?: BaseStatic.BaseOptions): Promise>; /** * show a specific ressource * * @param {string | number} id * @param {BaseStatic.BaseOptions} [options] * @returns {Promise} * @memberof BaseCrud */ show(id: string | number, options?: BaseStatic.BaseOptions): Promise; /** * create a new ressource * * @param {Full} ressource * @returns {Promise} * @memberof BaseCrud */ create(ressource: Create): Promise; /** * overwrite an existing ressource * * @param {number} id * @param {Overwrite} ressource * @returns {Promise} * @memberof BaseCrud */ overwrite(id: number, ressource: Overwrite): Promise; /** * edit an existing ressource * * @param {number} id * @param {Partial} ressource * @returns {Promise} * @memberof BaseCrud */ edit(id: number, ressource: Partial): Promise; /** * delete an ressource * * @param {string | number} id * @returns {Promise} * @memberof BaseCrud */ delete(id: string | number): Promise; /** * Base request to the api * * @protected * @template T * @param {string} method * @param {string} path * @param {BaseStatic.BaseOptions} [options] * @param {*} [data] * @returns {Promise} * @memberof Bexio */ protected request(method: "DELETE" | "get" | "GET" | "delete" | "head" | "HEAD" | "options" | "OPTIONS" | "post" | "POST" | "put" | "PUT" | "patch" | "PATCH" | "purge" | "PURGE" | "link" | "LINK" | "unlink" | "UNLINK", path: string, options?: BaseStatic.BaseOptions, data?: any): Promise; /** * Generates the querystring out of the options * * @protected * @param {BaseStatic.BaseOptions} [options] * @returns {string} * @memberof Bexio */ protected optionsToQuery(options?: BaseStatic.BaseOptions): string; } declare class ClientServices extends BaseCrud { constructor(apiToken: string); } declare namespace ContactsStatic { interface ContactSmall { id: number; nr: string; contact_type_id: number; name_1: string; name_2: string; salutation_id: number; salutation_form?: number; title_id?: number; birthday?: string; /** @deprecated */ address?: string; street_name?: string; house_number?: string; postcode: string; city: string; country_id: number; mail: string; mail_second: string; phone_fixed: string; phone_fixed_second: string; phone_mobile: string; fax: string; url: string; skype_name: string; remarks: string; language_id?: number; is_lead: boolean; contact_group_ids: string; contact_branch_ids?: string; user_id: number; owner_id: number; updated_at: string; } interface ContactFull extends ContactSmall { profile_image: string; } interface ContactCreate { nr?: string; name_1: string; user_id: number; country_id?: number; owner_id: number; contact_type_id: number; contact_group_ids?: Array; name_2?: string; salutation_id?: number; salutation_form?: number; title_id?: number; birthday?: string; street_name?: string; house_number?: string; address_addition?: string; postcode?: string; city?: string; mail?: string; mail_second?: string; phone_fixed?: string; phone_fixed_second?: string; phone_mobile?: string; fax?: string; url?: string; skype_name?: string; remarks?: string; language_id?: number; contact_branch_ids?: string; } interface ContactOverwrite { nr?: string; name_1: string; user_id: number; country_id?: number; owner_id: number; contact_type_id: number; contact_group_ids?: Array; name_2?: string; salutation_id?: number; salutation_form?: number; title_id?: number; birthday?: string; street_name?: string; house_number?: string; address_addition?: string; postcode?: string; city?: string; mail?: string; mail_second?: string; phone_fixed?: string; phone_fixed_second?: string; phone_mobile?: string; fax?: string; url?: string; skype_name?: string; remarks?: string; language_id?: number; contact_branch_ids?: string; } enum ContactSearchParameters { id = "id", name_1 = "name_1", name_2 = "name_2", nr = "nr", address = "address", mail = "mail", mail_second = "mail_second", postcode = "postcode", city = "city", country_id = "country_id", contact_group_ids = "contact_group_ids", contact_type_id = "contact_type_id", updated_at = "updated_at", user_id = "user_id", phone_fixed = "phone_fixed", phone_mobile = "phone_mobile", fax = "fax" } } declare class Contacts extends BaseCrud { constructor(apiToken: string); } declare namespace ContactTypesStatic { interface ContactType { id: number; name: string; } enum ContactTypeSearchParameters { name = "name" } } declare class ContactTypes extends BaseCrud { constructor(apiToken: string); /** * Not implemented by Bexio yet * * @param {{}} ressource * @returns {Promise} * @memberof ContactTypes */ create(ressource: {}): Promise; /** * Not implemented by Bexio yet * * @param {number} id * @param {{}} ressource * @returns {Promise} * @memberof ContactTypes */ edit(id: number, ressource: {}): Promise; /** * Not implemented by Bexio yet * * @param {number} id * @param {{}} ressource * @returns {Promise} * @memberof ContactTypes */ overwrite(id: number, ressource: {}): Promise; /** * Not implemented by Bexio yet * * @param {number} id * @returns {Promise} * @memberof ContactTypes */ delete(id: number): Promise; } declare namespace ContactSectorsStatic { interface ContactSector { id: number; name: string; } enum ContactSectorSearchParameters { name = "name" } } declare class ContactSectors extends BaseCrud { constructor(apiToken: string); /** * Not implemented by Bexio yet * * @param {{}} ressource * @returns {Promise} * @memberof ContactSectors */ create(ressource: {}): Promise; /** * Not implemented by Bexio yet * * @param {number} id * @param {{}} ressource * @returns {Promise} * @memberof ContactSectors */ edit(id: number, ressource: {}): Promise; /** * Not implemented by Bexio yet * * @param {number} id * @param {{}} ressource * @returns {Promise} * @memberof ContactSectors */ overwrite(id: number, ressource: {}): Promise; /** * Not implemented by Bexio yet * * @param {number} id * @returns {Promise} * @memberof ContactSectors */ delete(id: number): Promise; } declare namespace ContactGroupsStatic { interface ContactGroup { id: number; name: string; } interface ContactGroupCreate { name: string; } enum ContactGroupSearchParameters { name = "name" } } declare class ContactGroups extends BaseCrud { constructor(apiToken: string); /** * Not implemented by Bexio yet * * @param {number} id * @returns {Promise} * @memberof ContactGroups */ delete(id: number): Promise; } declare namespace ContactRelationsStatic { interface ContactRelation { id: number; contact_id: number; contact_sub_id: number; description: string; updated_at: string; } interface ContactRelationOverwrite { contact_id: number; contact_sub_id: number; description: string; } interface ContactRelationCreate { contact_id: number; contact_sub_id: number; description: string; } enum ContactRelationSearchParameters { contact_id = "contact_id", contact_sub_id = "contact_sub_id", updated_at = "updated_at" } } declare class ContactRelations extends BaseCrud { constructor(apiToken: string); } declare namespace ExpensesStatic { interface Expense { id: number; document_nr: string; title?: string; contact_id: number; contact_sub_id?: number; user_id: number; pr_project_id?: number; logopaper_id: number; language_id: number; bank_account_id: number; currency_id: number; mwst_type: number; mwst_is_net: boolean; show_position_taxes: boolean; is_valid_from: string; is_valid_to: string; kb_item_status_id: number; api_reference?: string; total_gross: string; total_net: string; total_taxes: string; total_paid_payments: string; total_remaining_payments: string; viewed_by_client_at?: string; total: string; updated_at: string; taxs: Array; info?: string; allowable_bill: null; account_id?: number; tax_id: number; amount: string; } interface Tax { percentage: number; value: string; } interface ExpenseCreate { user_id: number; contact_id: number; tax_id: number; amount: string; account_id: number; mwst_type: 0 | 1 | 2; } interface ExpenseOverwrite { user_id: number; contact_id: number; tax_id: number; amount: string; account_id: number; mwst_type: 0 | 1 | 2; logopaper_id: number; language_id: number; bank_account_id: number; currency_id: number; nb_decimals_amount: number; nb_decimals_price: number; is_valid_from: number; is_compact_view: boolean; show_position_taxes: boolean; payment_type_id: number; } enum SearchParameters { id = "id", kb_item_status_id = "kb_item_status_id", document_nr = "document_nr", title = "title", contact_id = "contact_id", contact_sub_id = "contact_sub_id", user_id = "user_id", currency_id = "currency_id", total_gross = "total_gross", total_net = "total_net", total = "total", is_valid_from = "is_valid_from", is_valid_to = "is_valid_to", is_valid_until = "is_valid_until", updated_at = "updated_at" } } declare class Expenses extends BaseCrud { constructor(apiToken: string); } declare namespace BillsStatic { interface Bill { id: number; document_nr: string; title: string; contact_id: number; contact_sub_id: number; user_id: number; pr_project_id: number; logopaper_id: number; language_id: number; bank_account_id: number; currency_id: number; header: string; footer: string; total_gross: string; total_net: string; total_taxes: string; total_regards_taxes: string; total_paid_payments: string; total_remaining_payments: string; total: string; total_rounding_difference: number; mwst_type: 0 | 1 | 2; mwst_is_net: boolean; show_position_taxes: boolean; is_valid_from: string; is_valid_to: string; contact_address: string; kb_item_status_id: number; api_reference: string; viewed_by_client_at: string; updated_at: string; taxs: Array; } interface BillFull extends Bill { positions: Array; } interface BillCreate { contact_id: number; user_id: number; api_reference?: string; bank_account_id?: number; contact_address_id?: number; contact_address_manual?: string; contact_sub_id?: number; currency_id?: number; footer?: string; header?: string; is_compact_view?: boolean; is_valid_from?: string; is_valid_to?: string; language_id?: number; logopaper_id?: number; mwst_is_net?: boolean; mwst_type?: 0 | 1 | 2; nb_decimals_amount?: number; nb_decimals_price?: number; payment_type_id?: number; pr_project_id?: number; show_position_taxes?: boolean; terms_of_payment_text?: string; title?: string; viewed_by_client_at?: string; positions: Array; } interface Tax { percentage: number; value: string; } enum SearchParameters { id = "id", kb_item_status_id = "kb_item_status_id", document_nr = "document_nr", title = "title", contact_id = "contact_id", contact_sub_id = "contact_sub_id", user_id = "user_id", currency_id = "currency_id", total_gross = "total_gross", total_net = "total_net", total = "total", is_valid_from = "is_valid_from", is_valid_to = "is_valid_to", is_valid_until = "is_valid_until", updated_at = "updated_at" } interface Position { id: number; type: "KbPositionCustom" | "KbPositionArticle"; amount: string; unit_id?: number; account_id: number; unit_name?: string; tax_id: number; tax_value: string; text: string; unit_price: string; discount_in_percent?: string; position_total: string; pos: string; internal_pos: number; parent_id?: number; is_optional: boolean; } interface PositionCreate { type: "KbPositionCustom" | "KbPositionArticle"; unit_price: string; tax_id: number; amount: string; account_id: number; text?: string; discount_in_percent?: number; unit_id?: number; } interface CustomPositionCreate extends PositionCreate { } interface CustomPosition extends Position { } interface ArticlePositionCreate extends PositionCreate { type: "KbPositionArticle"; article_id: number; } interface ArticlePosition extends Position { type: "KbPositionArticle"; article_id: number; } interface BillOverwrite { contact_id: number; user_id: number; api_reference: string; bank_account_id: number; contact_address_id?: number; contact_address_manual?: string; contact_sub_id: number; currency_id: number; footer: string; header: string; is_valid_from: string; is_valid_to: string; language_id: number; logopaper_id: number; mwst_is_net: boolean; mwst_type: 0 | 1 | 2; show_position_taxes: boolean; title: string; positions: Array; nb_decimals_amount: number; nb_decimals_price: number; is_compact_view: boolean; payment_type_id: number; } interface PositionOverwrite { type: "KbPositionCustom" | "KbPositionArticle"; unit_price: string; tax_id: number; amount: string; account_id: number; text: string; } interface ArticlePositionOverwrite extends PositionOverwrite { type: "KbPositionArticle"; article_id: number; } interface CustomPositionOverwrite extends PositionOverwrite { } } declare namespace PaymentsStatic { interface Payment { id: number; date: string; value: string; bank_account_id?: number; title: string; payment_service_id?: number; is_client_account_redemption: boolean; is_cash_discount: boolean; kb_invoice_id?: number; kb_credit_voucher_id?: number; kb_bill_id: number; kb_credit_voucher_text: string; } interface PaymentCreate { date: string; value: number; bank_account_id?: number; payment_service_id?: number; } } /** * @deprecated Use BillsV4 instead */ declare class Bills extends BaseCrud { constructor(apiToken: string); /** * issue a bill * * @param {number} id * @returns {Promise<{ success: boolean }>} * @memberof Bills */ issue(id: number): Promise<{ success: boolean; }>; /** * revert a bill issue * * @param {number} id * @returns {Promise<{ success: boolean }>} * @memberof Bills */ revertIssue(id: number): Promise<{ success: boolean; }>; /** * List all payments for this bill * * @param {number} billId * @param {BaseStatic.BaseOptions} [options] * @returns {Promise} * @memberof Bills */ listPayments(billId: number, options?: BaseStatic.BaseOptions): Promise; /** * Show a specific payment for this bill * * @param {number} billId * @param {number} paymentId * @param {BaseStatic.BaseOptions} [options] * @returns {Promise} * @memberof Bills */ showPayment(billId: number, paymentId: number, options?: BaseStatic.BaseOptions): Promise; /** * Create a new payment for this bill * * @param {number} billId * @param {PaymentsStatic.PaymentCreate} payment * @returns {Promise} * @memberof Bills */ createPayment(billId: number, payment: PaymentsStatic.PaymentCreate): Promise; /** * delete a specific payment for this bill * * @param {number} billId * @param {number} paymentId * @returns {Promise} * @memberof Bills */ deletePayment(billId: number, paymentId: number): Promise; } declare namespace OrdersStatic { interface OrderSmall { id: number; document_nr: string; title?: string; contact_id: number; contact_sub_id?: number; user_id: number; project_id?: number; logopaper_id: number; language_id: number; bank_account_id: number; currency_id: number; payment_type_id: number; header: string; footer: string; total_gross: string; total_net: string; total_taxes: string; total: string; mwst_type: number; mwst_is_net: boolean; show_position_taxes: boolean; is_valid_from: string; contact_address: string; delivery_address_type: number; delivery_address: string; kb_item_status_id: number; is_recurring: boolean; api_reference?: string; viewed_by_client_at?: string; updated_at: string; taxs: Tax[]; network_link: string; } interface Tax { percentage: number; value: string; } interface OrderFull extends OrderSmall { positions: Array; } interface OrderCreate { user_id: number; contact_id: number; positions: Array; logopaper_id: number; language_id: number; bank_account_id: number; currency_id: number; mwst_type: number; nb_decimals_amount: number; nb_decimals_price: number; is_valid_from: number; is_compact_view: boolean; show_position_taxes: boolean; payment_type_id: number; } interface PositionCreate { type: "KbPositionCustom" | "KbPositionArticle"; unit_price: string; tax_id: number; amount: string; text?: string; discount_in_percent?: number; unit_id?: number; is_optional: boolean; } interface CustomPositionCreate extends PositionCreate { } interface CustomPosition extends Position { } interface ArticlePositionCreate extends PositionCreate { type: "KbPositionArticle"; article_id: number; } interface ArticlePosition extends Position { type: "KbPositionArticle"; article_id: number; } interface Position { id: number; type: "KbPositionArticle" | "KbPositionCustom"; amount: string; unit_id?: number; account_id: number; unit_name?: string; tax_id: number; tax_value: string; text: string; unit_price: string; discount_in_percent?: string; position_total: string; pos: string; internal_pos: number; parent_id?: number; is_optional: boolean; article_id: number; } enum OrderSearchParameters { id = "id", kb_item_status_id = "kb_item_status_id", document_nr = "document_nr", title = "title", contact_id = "contact_id", contact_sub_id = "contact_sub_id", user_id = "user_id", currency_id = "currency_id", total_gross = "total_gross", total_net = "total_net", total = "total", is_valid_from = "is_valid_from", is_valid_to = "is_valid_to", is_valid_until = "is_valid_until", updated_at = "updated_at" } } declare namespace PositionsStatic { type KbDocumentType = "kb_invoice" | "kb_offer" | "kb_order"; interface DefaultPositionCreate { amount: string; amount_reserved: string; amount_open: string; amount_completed: string; unit_id: number; account_id: number; tax_id: number; text: string; unit_price: string; discount_in_percent: string | null; is_optional: boolean; } interface DefaultPosition extends Omit { id: number; unit_name: string; tax_value: string; position_total: string; unit_price: string | null; pos: string; internal_pos: number; type: "KbPositionCustom"; parent_id: number | null; } interface ItemPositionCreate extends DefaultPositionCreate { article_id: number; } interface ItemPosition extends Omit { article_id: number; type: "KbPositionArticle"; } interface TextPositionCreate { text: string; show_pos_nr: boolean; } interface TextPosition extends TextPositionCreate { id: number; pos: string | null; internal_pos: number; is_optional: boolean; type: "KbPositionText"; parent_id: number | null; } } declare class Orders extends BaseCrud { constructor(apiToken: string); /** * Create a default position for an order * * @param {number} orderId * @param {PositionsStatic.DefaultPositionCreate} position * @returns {Promise} * @memberof Orders */ createDefaultPosition(orderId: number, position: PositionsStatic.DefaultPositionCreate): Promise; /** * Create an item position for an order * * @param {number} orderId * @param {PositionsStatic.ItemPositionCreate} position * @returns {Promise} * @memberof Orders */ createItemPosition(orderId: number, position: PositionsStatic.ItemPositionCreate): Promise; /** * Create a text position for an order * * @param {number} orderId * @param {PositionsStatic.TextPositionCreate} position * @returns {Promise} * @memberof Orders */ createTextPosition(orderId: number, position: PositionsStatic.TextPositionCreate): Promise; } declare namespace ProjectsStatic { interface Project { id: number; nr: string; name: string; start_date?: string; end_date?: string; comment: string; pr_state_id: number; pr_project_type_id: number; contact_id: number; contact_sub_id?: number; pr_invoice_type_id?: number; pr_invoice_type_amount: number; pr_budget_type_id?: number; pr_budget_type_amount: number; } interface ProjectCreate { contact_id: number; name: string; pr_project_type_id: number; pr_state_id: number; user_id: number; comment?: string; contact_sub_id?: number; end_date?: string; pr_budget_type_amount?: number; pr_budget_type_id?: number; pr_invoice_type_amount?: number; pr_invoice_type_id?: number; pr_sub_state_id?: number; start_date?: string; } interface ProjectOverwrite { contact_id: number; name: string; pr_project_type_id: number; pr_state_id: number; user_id: number; comment?: string; contact_sub_id?: number; end_date?: string; pr_budget_type_amount?: number; pr_budget_type_id?: number; pr_invoice_type_amount?: number; pr_invoice_type_id?: number; pr_sub_state_id?: number; start_date?: string; } enum ProjectSearchParameters { name = "name", contact_id = "contact_id", pr_state_id = "pr_state_id" } } declare class Projects extends BaseCrud { constructor(apiToken: string); } declare namespace ProjectStatusesStatic { interface ProjectStatus { id: number; name: string; } enum ProjectStatusSearchParameters { text = "text" } } declare class ProjectStatuses extends BaseCrud { constructor(apiToken: string); /** * Not implemented by Bexio yet * * @param {number} id * @param {{}} ressource * @returns {Promise} * @memberof ProjectStatuses */ overwrite(id: number, ressource: {}): Promise; /** * Not implemented by Bexio yet * * @param {number} id * @param {{}} ressource * @returns {Promise} * @memberof ProjectStatuses */ edit(id: number, ressource: {}): Promise; /** * Not implemented by Bexio yet * * @param {{}} ressource * @returns {Promise} * @memberof ProjectStatuses */ create(ressource: {}): Promise; /** * Not implemented by Bexio yet * * @param {number} id * @returns {Promise} * @memberof ProjectStatuses */ delete(id: number): Promise; } declare namespace ProjectTypesStatic { interface ProjectType { id: number; name: string; } enum ProjectTypeSearchParameters { project_type = "project_type" } } declare class ProjectTypes extends BaseCrud { constructor(apiToken: string); /** * Not implemented by Bexio yet * * @param {{}} ressource * @returns {Promise} * @memberof ProjectTypes */ create(ressource: {}): Promise; /** * Not implemented by Bexio yet * * @param {number} id * @param {{}} ressource * @returns {Promise} * @memberof ProjectTypes */ edit(id: number, ressource: {}): Promise; /** * Not implemented by Bexio yet * * @param {number} id * @param {{}} ressource * @returns {Promise} * @memberof ProjectTypes */ overwrite(id: number, ressource: {}): Promise; /** * Not implemented by Bexio yet * * @param {number} id * @returns {Promise} * @memberof ProjectTypes */ delete(id: number): Promise; } declare namespace TimetrackingsStatic { interface TimetrackingsSmall { id: number; user_id: number; status_id?: number; client_service_id: number; text: string; allowable_bill: true; charge?: boolean; contact_id?: number; sub_contact_id?: number; pr_project_id?: number; pr_package_id?: number; pr_milestone_id?: number; travel_time?: number; travel_charge?: boolean; travel_distance?: number; estimated_time?: number; date: string; duration: string; running: boolean; } enum TimetrackingsSearchParameters { id = "id", client_service_id = "client_service_id", contact_id = "contact_id", user_id = "user_id", pr_project_id = "pr_project_id", status_id = "status_id" } interface TimetrackingsFull extends TimetrackingsSmall { tracking: TimetrackingsTrackingRecord; } interface TimetrackingsTrackingRecord { type: "duration" | "range"; date: string; duration: string; } interface TimetrackingsCreate { user_id: number; client_service_id: number; allowable_bill: boolean; tracking: TimetrackingsTrackingRecord; charge?: boolean; contact_id?: number; estimated_time?: string; pr_project_id?: number; pr_package_id?: number; pr_milestone_id?: number; status_id?: number; sub_contact_id?: number; text?: string; } interface TimetrackingsEdit { allowable_bill?: boolean; charge?: number; client_service_id?: number; contact_id?: number; estimated_time?: string; pr_milestone_id?: number; pr_package_id?: number; pr_project_id?: number; status_id?: number; sub_contact_id?: number; text?: string; tracking?: TimetrackingsTrackingRecord; user_id?: number; } } declare class Timetrackings extends BaseCrud { constructor(apiToken: string); /** * Not implemented by Bexio yet * * @param {number} id * @param {{}} ressource * @returns {Promise} * @memberof Timetracking */ overwrite(id: number, ressource: {}): Promise; } declare namespace TimetrackingStatusesStatic { interface TimetrackingStatus { id: number; name: string; } enum TimetrackingStatusesSearchparameters { name = "name" } } declare class TimetrackingStatuses extends BaseCrud { constructor(apiToken: string); /** * Not implemented by Bexio yet * * @param {number} id * @param {{}} ressource * @returns {Promise} * @memberof TimetrackingStatuses */ overwrite(id: number, ressource: {}): Promise; /** * Not implemented by Bexio yet * * @param {number} id * @param {{}} ressource * @returns {Promise} * @memberof TimetrackingStatuses */ edit(id: number, ressource: {}): Promise; /** * Not implemented by Bexio yet * * @param {{}} ressource * @returns {Promise} * @memberof TimetrackingStatuses */ create(ressource: {}): Promise; /** * Not implemented by Bexio yet * * @param {number} id * @returns {Promise} * @memberof TimetrackingStatuses */ delete(id: number): Promise; } declare namespace UsersStatic { interface UserSmall { id: number; nickname?: string; firstname: string; lastname: string; email?: string; color: string; phone_fixed?: string; phone_mobile?: string; is_superadmin: boolean; } interface UserFull extends UserSmall { profile_image: string; } enum UsersSearchparameters { id = "id", nickname = "nickname", firstname = "firstname", lastname = "lastname", color = "color" } } declare class Users extends BaseCrud { constructor(apiToken: string); /** * Not implemented by Bexio yet * * @param {number} id * @param {{}} ressource * @returns {Promise} * @memberof Users */ overwrite(id: number, ressource: {}): Promise; /** * Not implemented by Bexio yet * * @param {number} id * @param {{}} ressource * @returns {Promise} * @memberof Users */ edit(id: number, ressource: {}): Promise; /** * Not implemented by Bexio yet * * @param {{}} ressource * @returns {Promise} * @memberof Users */ create(ressource: {}): Promise; /** * Not implemented by Bexio yet * * @param {number} id * @returns {Promise} * @memberof Users */ delete(id: number): Promise; } declare namespace ItemsStatic { interface Item { id: number; user_id: number; article_type_id: number; contact_id: number; deliverer_code?: string; deliverer_name?: string; deliverer_description?: string; intern_code: string; intern_name: string; intern_description?: string; purchase_price?: number; sale_price?: number; purchase_total?: number; sale_total?: number; currency_id?: number; tax_income_id?: number; tax_id?: number; tax_expense_id?: number; unit_id?: number; is_stock: boolean; stock_id?: number; stock_place_id?: number; stock_nr: number; stock_min_nr: number; stock_reserved_nr: number; stock_available_nr: number; stock_picked_nr: number; stock_disposed_nr: number; stock_ordered_nr: number; width?: number; height?: number; weight?: number; volume?: number; html_text?: string; remarks?: string; delivery_price?: number; article_group_id?: number; } interface ItemCreate { user_id: number; article_type_id: number; contact_id: number; deliverer_code?: string; deliverer_name?: string; deliverer_description?: string; intern_code: string; intern_name: string; intern_description?: string; purchase_price?: number; sale_price?: number; purchase_total?: number; sale_total?: number; currency_id?: number; tax_income_id?: number; tax_id?: number; tax_expense_id?: number; unit_id?: number; is_stock: boolean; stock_id?: number; stock_place_id?: number; stock_nr: number; stock_min_nr: number; stock_reserved_nr: number; stock_available_nr: number; stock_picked_nr: number; stock_disposed_nr: number; stock_ordered_nr: number; width?: number; height?: number; weight?: number; volume?: number; html_text?: string; remarks?: string; delivery_price?: number; article_group_id?: number; } interface ItemOverwrite extends ItemCreate { } enum ItemSearchParameters { id = "id", user_id = "user_id", article_type_id = "article_type_id", contact_id = "contact_id", deliverer_code = "deliverer_code", deliverer_name = "deliverer_name", deliverer_description = "deliverer_description", intern_code = "intern_code", intern_name = "intern_name", intern_description = "intern_description", purchase_price = "purchase_price", sale_price = "sale_price", purchase_total = "purchase_total", sale_total = "sale_total", currency_id = "currency_id", tax_income_id = "tax_income_id", tax_id = "tax_id", tax_expense_id = "tax_expense_id", unit_id = "unit_id", is_stock = "is_stock", stock_id = "stock_id", stock_place_id = "stock_place_id", stock_nr = "stock_nr", stock_min_nr = "stock_min_nr", stock_reserved_nr = "stock_reserved_nr", stock_available_nr = "stock_available_nr", stock_picked_nr = "stock_picked_nr", stock_disposed_nr = "stock_disposed_nr", stock_ordered_nr = "stock_ordered_nr", width = "width", height = "height", weight = "weight", volume = "volume", html_text = "html_text", remarks = "remarks", delivery_price = "delivery_price", article_group_id = "article_group_id" } } declare class Items extends BaseCrud { constructor(apiToken: string); } declare namespace PositionStatic { interface PositionCreate { amount?: string; unit_id?: number; account_id?: number; tax_id?: number; text: string; unit_price?: string; discount_in_percent?: string; type: string; parent_id?: number | null; article_id?: number; show_pos_nr?: boolean; is_percentual?: boolean; value?: string; } interface Position { id: number; type: string; amount: string; unit_id: number; account_id: number; unit_name: string; tax_id: number; tax_value: string; text: string; unit_price: string; discount_in_percent: null; position_total: string; pos: string; internal_pos: number; parent_id: null; is_optional: false; } } declare namespace InvoicesStatic { interface Invoice { id: number; title: string | null; contact_id: number; contact_sub_id: number | null; user_id: number; pr_project_id: number | null; logopaper_id: number; language_id: number; bank_account_id: number; currency_id: number; payment_type_id: number; header: string; footer: string; mwst_type: number; mwst_is_net: boolean; show_position_taxes: boolean; is_valid_from: string; is_valid_to: string; reference: null | string; api_reference: null | string; template_slug: string; positions: PositionStatic.Position[]; document_nr: string; total_gross: string; total_net: string; total_taxes: string; total_received_payments: string; total_credit_vouchers: string; total_remaining_payments: string; total: string; total_rounding_difference: number; contact_address: string; kb_item_status_id: number; viewed_by_client_at: string | null; updated_at: string; esr_id: number; qr_invoice_id: number; taxs: { percentage: string; value: string; }[]; network_link: string | null; } interface InvoiceCreate { title?: string | null; contact_id: number; contact_sub_id?: number | null; user_id: number; pr_project_id?: number | null; logopaper_id?: number; language_id?: number; bank_account_id?: number; currency_id?: number; payment_type_id?: number; header?: string; footer?: string; mwst_type?: number; mwst_is_net?: boolean; show_position_taxes?: boolean; is_valid_from?: string; is_valid_to?: string; reference?: string | null; api_reference?: string | null; template_slug?: string; positions: PositionStatic.PositionCreate[]; } interface InvoiceOverwrite { title?: string | null; contact_id?: number; contact_sub_id?: number | null; user_id?: number; pr_project_id?: number | null; logopaper_id?: number; language_id?: number; bank_account_id?: number; currency_id?: number; payment_type_id?: number; header?: string; footer?: string; mwst_type?: number; mwst_is_net?: boolean; show_position_taxes?: boolean; is_valid_from?: string; is_valid_to?: string; reference?: null; api_reference?: null; template_slug?: string; positions: PositionStatic.PositionCreate[]; } enum InvoiceSearchParameters { id = "id", kb_item_status_id = "kb_item_status_id", document_nr = "document_nr", title = "title", api_reference = "api_reference", contact_id = "contact_id", contact_sub_id = "contact_sub_id", user_id = "user_id", currency_id = "currency_id", total_gross = "total_gross", total_net = "total_net", total = "total", is_valid_from = "is_valid_from", is_valid_to = "is_valid_to", updated_at = "updated_at" } interface InvoiceSend { recipient_email: string; subject: string; message: string; mark_as_open: boolean; attach_pdf?: boolean; } /** * @deprecated Use `InvoiceSend` instead. */ type InvoiceSent = InvoiceSend; interface InvoiceCancelled { success: boolean; } interface InvoiceIssued { success: boolean; } interface InvoiceSentAnswer { success: boolean; } interface Payment { id: number; date: string; value: string; bank_account_id?: number | null; title?: string | null; payment_service_id?: number | null; is_client_account_redemption: boolean; is_cash_discount: boolean; kb_invoice_id?: number | null; kb_credit_voucher_id?: number | null; kb_bill_id?: number | null; kb_credit_voucher_text?: number | null; } enum KB_ITEM_STATUS { Draft = 7, Pending = 8, Paid = 9, Partial = 16, Canceled = 19, Unpaid = 31 } enum MWST_TYPE { INCLUDING_TAXES = 0, EXCLUDING_TAXES = 1, EXEMPT_FROM_TAXES = 2 } enum PAYMENT_SERVICE { PAYPAL = 1, STRIPE = 2, SIX_PAYMENTS = 3 } } declare class Invoices extends BaseCrud { constructor(apiToken: string); /** * Send an invoice by email. * * @param {number} id * @param {Partial} ressource * @returns {Promise} * @memberof Invoices */ send(id: number, ressource: Partial): Promise; /** * @deprecated Use `send` instead. */ sent(id: number, ressource: Partial): Promise; cancel(id: number): Promise; /** * This action returns a pdf document of the invoice. * * @param {number} id * @param {0 | 1} [logopaper] Whether the PDF should be generated using the letterhead, or not. * @returns {Promise} * @memberof Invoices */ showPdf(id: number, logopaper?: 0 | 1): Promise; /** * Issue an invoice. The invoice must be in the draft status. * * @param {number} id * @returns {Promise} * @memberof Invoices */ issue(id: number): Promise; /** * Mark an invoice as sent. * * @param {number} id * @returns {Promise} * @memberof Invoices */ markAsSent(id: number): Promise; /** * revert a Invoice issue * * @param {number} id * @returns {Promise<{ success: boolean }>} * @memberof Invoices */ revertIssue(id: number): Promise<{ success: boolean; }>; /** * Create a payment for an invoice * * @param {number} invoiceId * @param {Date} date * @param {string} value * @param {number} [bank_account_id] * @param {number} [payment_service_id] * @return {*} {Promise} * @memberof Invoices */ createPayment(invoiceId: number, date: Date, value: string, bank_account_id?: number, payment_service_id?: number): Promise; /** * Get a payment for an invoice * * @param {number} invoiceId * @param {number} paymentId * @return {*} {Promise} * @memberof Invoices */ getPayment(invoiceId: number, paymentId: number): Promise; /** * Delete a payment for an invoice * * @param {number} invoiceId * @param {number} paymentId * @return {*} {Promise} * @memberof Invoices */ deletePayment(invoiceId: number, paymentId: number): Promise; /** * Create a default position for an invoice * * @param {number} invoiceId * @param {PositionsStatic.DefaultPositionCreate} position * @returns {Promise} * @memberof Invoices */ createDefaultPosition(invoiceId: number, position: PositionsStatic.DefaultPositionCreate): Promise; /** * Create an item position for an invoice * * @param {number} invoiceId * @param {PositionsStatic.ItemPositionCreate} position * @returns {Promise} * @memberof Invoices */ createItemPosition(invoiceId: number, position: PositionsStatic.ItemPositionCreate): Promise; /** * Create a text position for an invoice * * @param {number} invoiceId * @param {PositionsStatic.TextPositionCreate} position * @returns {Promise} * @memberof Invoices */ createTextPosition(invoiceId: number, position: PositionsStatic.TextPositionCreate): Promise; } declare namespace CurrenciesStatic { interface Currency { id: number; name: string; round_factor: number; } interface CurrencyFull extends Currency { exchange_rate?: number; exchange_rate_id?: number; ratio?: number; exchange_rate_to_ratio?: number; source?: "custom" | "monthly_average"; source_reason?: "monthly_average_provided" | "monthly_average_unavailable" | "monthly_average_unreachable" | "source_custom"; exchange_rate_date?: string; } interface CurrencyCreate { name: string; round_factor: number; } } declare class Currencies extends BaseCrud { constructor(apiToken: string); /** * NOT IMPLEMENTED BY BEXIO YET * * @param {Array>} searchOptions * @param {BaseStatic.BaseOptions} [options] * @returns {Promise>} * @memberof Currencies */ search(searchOptions: Array>, options?: BaseStatic.BaseOptions): Promise>; /** * NOT IMPLEMENTED BY BEXIO YET * * @param {number} id * @param {Overwrite} ressource * @returns {Promise<{}>} * @memberof Currencies */ overwrite(id: number, ressource: CurrenciesStatic.Currency): Promise; /** * NOT IMPLEMENTED BY BEXIO YET * * @param {number} id * @param {Partial<{}>} ressource * @returns {Promise} * @memberof BaseCrud */ edit(id: number, ressource: Partial<{}>): Promise; } declare namespace BillsV4Static { interface Bill { id: string; document_no: string; title?: string; status: BillStatus; firstname_suffix?: string; lastname_company: string; created_at: string; vendor_ref?: string; pending_amount?: number; currency_code: string; net?: number; gross?: number; bill_date: string; due_date: string; overdue: boolean; booking_account_ids: number[]; attachment_ids: string[]; } interface BillFull extends Bill { supplier_id: number; contact_partner_id: number; amount_man: number; amount_calc: number; manual_amount: boolean; exchange_rate: number; base_currency_code: string; item_net: boolean; split_into_line_items: boolean; purchase_order_id?: number; base_currency_amount: number; qr_bill_information?: string; address: Address; line_items: LineItem[]; discounts: Discount[]; payment?: Payment; note?: string; } interface Address { title?: string; salutation?: string; firstname_suffix?: string; lastname_company: string; address_line?: string; postcode?: string; city?: string; country_code?: string; main_contact_id?: number; contact_address_id?: number; type: "PRIVATE" | "COMPANY"; } interface LineItem { position: number; title?: string; tax_id?: number; amount: number; booking_account_id?: number; } interface Discount { position: number; amount: number; } interface Payment { type: PaymentType; bank_account_id?: number; fee?: PaymentFee; execution_date: string; exchange_rate?: number; amount: number; account_no?: string; iban?: string; name?: string; address?: string; street?: string; house_no?: string; postcode?: string; city?: string; country_code?: string; message?: string; booking_text?: string; salary_payment?: boolean; reference_no?: string; } interface BillCreate { supplier_id: number; vendor_ref?: string; title?: string; contact_partner_id: number; bill_date: string; due_date: string; amount_man?: number; amount_calc?: number; manual_amount: boolean; currency_code: string; exchange_rate?: number; base_currency_amount?: number; item_net: boolean; purchase_order_id?: number; qr_bill_information?: string; attachment_ids: string[]; address: Address; line_items: LineItem[]; discounts: Discount[]; payment?: Payment; salary_payment?: boolean; reference_no?: string; note?: string; } interface BillOverwrite { document_no?: string; title?: string; supplier_id: number; vendor_ref?: string; contact_partner_id: number; bill_date: string; due_date: string; amount_man?: number; amount_calc?: number; manual_amount: boolean; currency_code: string; exchange_rate?: number; item_net: boolean; split_into_line_items: boolean; base_currency_amount?: number; attachment_ids: string[]; address: Address; line_items: LineItem[]; discounts: Discount[]; payment?: Payment; } enum SearchParameters { document_no = "document_no", title = "title", vendor_ref = "vendor_ref", currency_code = "currency_code", lastname_company = "lastname_company", firstname_suffix = "firstname_suffix" } enum BillStatusUpdate { DRAFT = "DRAFT", BOOKED = "BOOKED" } enum BillAction { DUPLICATE = "DUPLICATE" } enum BillStatusFilter { DRAFTS = "DRAFTS", TODO = "TODO", PAID = "PAID", OVERDUE = "OVERDUE" } interface ListOptions { limit?: number; page?: number; order?: "asc" | "desc"; sort?: string; search_term?: string; "fields[]"?: string[]; status?: BillStatusFilter; bill_date_start?: string; bill_date_end?: string; due_date_start?: string; due_date_end?: string; vendor_ref?: string; title?: string; currency_code?: string; pending_amount_min?: number; pending_amount_max?: number; vendor?: string; gross_min?: number; gross_max?: number; net_min?: number; net_max?: number; document_no?: string; supplier_id?: number; average_exchange_rate_enabled?: boolean; } enum PaymentType { IBAN = "IBAN", MANUAL = "MANUAL", QR = "QR" } enum PaymentFee { BY_SENDER = "BY_SENDER", BY_RECEIVER = "BY_RECEIVER", BREAKDOWN = "BREAKDOWN", NO_FEE = "NO_FEE" } enum BillStatus { DRAFT = "DRAFT", BOOKED = "BOOKED", PARTIALLY_CREATED = "PARTIALLY_CREATED", CREATED = "CREATED", PARTIALLY_SENT = "PARTIALLY_SENT", SENT = "SENT", PARTIALLY_DOWNLOADED = "PARTIALLY_DOWNLOADED", DOWNLOADED = "DOWNLOADED", PARTIALLY_PAID = "PARTIALLY_PAID", PAID = "PAID", PARTIALLY_FAILED = "PARTIALLY_FAILED", FAILED = "FAILED" } } declare class BillsV4 extends BaseCrud { constructor(apiToken: string); /** * Lists the ressource * * @param {BillsV4Static.ListOptions} [options] * @returns {Promise>} * @memberof BillsV4 */ list(options?: BillsV4Static.ListOptions): Promise>; /** * Not implemented by Bexio yet * * @param {Array>} searchOptions * @param {BaseStatic.BaseOptions} [options] * @returns {Promise} * @memberof BillsV4 */ search(searchOptions: Array>, options?: BaseStatic.BaseOptions): Promise; /** * Update bill status * * @param {string} id * @param {BillsV4Static.BillStatusUpdate} status * @returns {Promise} * @memberof BillsV4 */ updateStatus(id: string, status: BillsV4Static.BillStatusUpdate): Promise; /** * Execute bill action * * @param {string} id * @param {BillsV4Static.BillAction} action * @returns {Promise} * @memberof BillsV4 */ executeAction(id: string, action: BillsV4Static.BillAction): Promise; /** * Validate whether document number is available or not * * @param {string} documentNo * @returns {Promise<{ valid: boolean; next_available_no: string }>} * @memberof BillsV4 */ validateDocumentNumber(documentNo: string): Promise<{ valid: boolean; next_available_no: string; }>; } declare namespace OutgoingPaymentsStatic { /** * Outgoing Payment Status */ enum OutgoingPaymentStatus { DOWNLOADED = "DOWNLOADED", OPEN = "OPEN", RECONCILED = "RECONCILED", CANCELLED = "CANCELLED", UPLOADED = "UPLOADED", REJECTED = "REJECTED" } /** * Outgoing Payment Type */ enum OutgoingPaymentType { IBAN = "IBAN", MANUAL = "MANUAL", CASH_DISCOUNT = "CASH_DISCOUNT", QR = "QR" } /** * Fee Type */ enum FeeType { BY_SENDER = "BY_SENDER", BY_RECEIVER = "BY_RECEIVER", BREAKDOWN = "BREAKDOWN", NO_FEE = "NO_FEE" } /** * Outgoing Payment */ interface OutgoingPayment { id: string; status: OutgoingPaymentStatus | string; created_at: string; bill_id: string; payment_type: OutgoingPaymentType | string; execution_date: string; amount: number; currency_code: string; exchange_rate: number; note?: string; sender_bank_account_id?: number; sender_iban?: string; sender_name?: string; sender_street?: string; sender_house_no?: string; sender_city?: string; sender_postcode?: string; sender_country_code?: string; sender_bc_no?: string; sender_bank_no?: string; sender_bank_name?: string; receiver_iban?: string; receiver_name?: string; receiver_street?: string; receiver_house_no?: string; receiver_city?: string; receiver_postcode?: string; receiver_country_code?: string; receiver_bc_no?: string; receiver_bank_no?: string; receiver_bank_name?: string; fee_type?: FeeType | string; is_salary_payment: boolean; reference_no?: string; message?: string; booking_text?: string; banking_payment_id?: string; banking_payment_entry_id?: string; transaction_id?: string; } /** * Outgoing Payment Create */ interface OutgoingPaymentCreate { bill_id: string; payment_type: OutgoingPaymentType | string; execution_date: string; amount: number; currency_code: string; exchange_rate: number; note?: string; sender_bank_account_id?: number; sender_iban?: string; sender_name?: string; sender_street?: string; sender_house_no?: string; sender_city?: string; sender_postcode?: string; sender_country_code?: string; sender_bc_no?: string; sender_bank_no?: string; sender_bank_name?: string; receiver_iban?: string; receiver_name?: string; receiver_street?: string; receiver_house_no?: string; receiver_city?: string; receiver_postcode?: string; receiver_country_code?: string; receiver_bc_no?: string; receiver_bank_no?: string; receiver_bank_name?: string; fee_type?: FeeType | string; is_salary_payment: boolean; reference_no?: string; message?: string; booking_text?: string; } /** * Outgoing Payment Update */ interface OutgoingPaymentUpdate { payment_id: string; execution_date: string; amount: number; fee_type?: FeeType | string; is_salary_payment: boolean; reference_no?: string | null; message?: string | null; receiver_iban?: string; receiver_name?: string; receiver_street?: string; receiver_house_no?: string; receiver_city?: string; receiver_postcode?: string; receiver_country_code?: string; } /** * List Options */ interface ListOptions { bill_id: string; limit?: number; page?: number; order?: 'asc' | 'desc'; sort?: string; } } declare class OutgoingPayments extends BaseCrud { constructor(apiToken: string); /** * search for resources - Not implemented for OutgoingPayments V4 * * @memberof OutgoingPayments */ search(): Promise; /** * overwrite an existing outgoing payment - Not implemented for OutgoingPayments V4 * * @memberof OutgoingPayments */ overwrite(id: any, ressource: any): Promise; /** * edit an existing outgoing payment - Not implemented for OutgoingPayments V4 * * @memberof OutgoingPayments */ edit(id: any, ressource: any): Promise; /** * delete an existing outgoing payment * * @param {T} id * @returns {Promise} * @memberof OutgoingPayments */ delete(id: T): Promise; /** * cancel an existing outgoing payment * * @param {string} id * @returns {Promise} * @memberof OutgoingPayments */ cancel(id: string): Promise; /** * edit an existing outgoing payment * * @param {OutgoingPaymentsStatic.OutgoingPaymentUpdate} data * @returns {Promise} * @memberof OutgoingPayments */ update(data: OutgoingPaymentsStatic.OutgoingPaymentUpdate): Promise; /** * Lists the outgoing payments * * @param {OutgoingPaymentsStatic.ListOptions} options * @returns {Promise} * @memberof OutgoingPayments */ list(options: OutgoingPaymentsStatic.ListOptions): Promise; /** * create a new outgoing payment * * @param {OutgoingPaymentsStatic.OutgoingPaymentCreate} data * @returns {Promise} * @memberof OutgoingPayments */ create(data: OutgoingPaymentsStatic.OutgoingPaymentCreate): Promise; } declare namespace BankAccountsStatic { interface BankAccount { id: number; name: string; owner: string; owner_address: string; owner_house_number: number | string; owner_zip: number | string; owner_city: string; owner_country_code: string; bc_nr: number | string; bank_name: string; bank_nr: string; bank_account_nr: string; iban_nr: string; currency_id: number; account_id: number; remarks: string; invoice_mode: string; qr_invoice_iban: string; type: string; } interface BankAccountFull extends BankAccount { } } declare class BankAccounts extends BaseCrud { constructor(apiToken: string); /** * NOT IMPLEMENTED BY BEXIO YET * * @param {Array>} searchOptions * @param {BaseStatic.BaseOptions} [options] * @returns {Promise>} * @memberof BankAccounts */ search(searchOptions: Array>, options?: BaseStatic.BaseOptions): Promise>; /** * NOT IMPLEMENTED BY BEXIO YET * * @param {number} id * @param {{}} ressource * @returns {Promise} * @memberof BankAccounts */ overwrite(id: number, ressource: {}): Promise; /** * NOT IMPLEMENTED BY BEXIO YET * * @param {number} id * @param {Partial<{}>} ressource * @returns {Promise} * @memberof BankAccounts */ edit(id: number, ressource: Partial<{}>): Promise; /** * NOT IMPLEMENTED BY BEXIO YET * * @param {{}} ressource * @returns {Promise} * @memberof BankAccounts */ create(ressource: {}): Promise; /** * NOT IMPLEMENTED BY BEXIO YET * * @param {number} id * @returns {Promise} * @memberof BankAccounts */ delete(id: number): Promise; } declare namespace AccountsStatic { interface Account { id: number; uuid: string; account_no: string; name: string; account_type: number; tax_id: number; fibu_account_group_id: number; is_active: boolean; is_locked: boolean; } type SearchParameters = "account_no" | "fibu_account_group_id" | "name" | "account_type"; } declare class Accounts extends BaseCrud { constructor(apiToken: string); /** * show a specific ressource * * @param {string | number} id * @param {BaseStatic.BaseOptions} [options] * @returns {Promise} * @memberof Accounts */ show(id: string | number, options?: BaseStatic.BaseOptions): Promise; /** * create a new ressource * * @param {AccountsStatic.Account} ressource * @returns {Promise} * @memberof Accounts */ create(ressource: AccountsStatic.Account): Promise; /** * overwrite an existing ressource * * @param {number} id * @param {AccountsStatic.Account} ressource * @returns {Promise} * @memberof Accounts */ overwrite(id: number, ressource: AccountsStatic.Account): Promise; /** * edit an existing ressource * * @param {number} id * @param {Partial} ressource * @returns {Promise} * @memberof Accounts */ edit(id: number, ressource: Partial): Promise; /** * delete a ressource * * @param {number} id * @returns {Promise} * @memberof Accounts */ delete(id: number): Promise; } declare namespace ManualEntriesStatic { type ManualEntryType = "manual_single_entry" | "manual_compound_entry" | "manual_group_entry"; interface Entry { id?: number; debit_account_id: number; credit_account_id: number; tax_id?: number; tax_account_id?: number; amount: number; currency_id: number; exchange_rate?: number; text?: string; } interface ManualEntry { id: number; type: ManualEntryType; date: string; reference_nr: string; entries: Entry[]; created_by_user_id: number; edited_by_user_id: number; is_locked: boolean; locked_info?: string; } interface ManualEntryCreate { type: ManualEntryType; date: string; reference_nr?: string; entries: Entry[]; } interface ManualEntryUpdate extends ManualEntryCreate { id: number; } interface ListOptions extends BaseStatic.BaseOptions { } interface SearchParameters { id?: number; date?: string; reference_nr?: string; } } declare class ManualEntries extends BaseCrud { constructor(apiToken: string); /** * Lists the manual entries * * @param {ManualEntriesStatic.ListOptions} [options] * @returns {Promise>} * @memberof ManualEntries */ list(options?: ManualEntriesStatic.ListOptions): Promise>; /** * Not implemented by Bexio yet * * @param {string | number} id * @param {BaseStatic.BaseOptions} [options] * @returns {Promise} * @memberof ManualEntries */ show(id: string | number, options?: BaseStatic.BaseOptions): Promise; /** * Not implemented by Bexio yet * * @param {Array>} searchOptions * @param {BaseStatic.BaseOptions} [options] * @returns {Promise} * @memberof ManualEntries */ search(searchOptions: Array>, options?: BaseStatic.BaseOptions): Promise; /** * Not implemented by Bexio yet * * @param {number} id * @param {Partial} ressource * @returns {Promise} * @memberof ManualEntries */ edit(id: number, ressource: Partial): Promise; /** * Get the next reference number for a manual entry * * @returns {Promise<{ next_ref_nr: string }>} * @memberof ManualEntries */ getNextReferenceNumber(): Promise<{ next_ref_nr: string; }>; } declare namespace TaxesStatic { interface Tax { id: number; uuid: string; name: string; code: string; digit: string; type: 'sales_tax' | 'pre_tax'; account_id: number; tax_settlement_type: string; value: number; net_tax_value: number | null; start_year: number; end_year: number | null; is_active: boolean; display_name: string; start_month: number; end_month: number; } interface TaxOptions extends BaseStatic.BaseOptions { scope?: 'active' | 'inactive'; date?: string; types?: 'sales_tax' | 'pre_tax'; } /** * @deprecated Use TaxOptions instead */ interface SearchParameters extends TaxOptions { } } declare class Taxes extends BaseCrud { constructor(accessToken: string); /** * Lists the taxes * * @param {TaxesStatic.TaxOptions} [options] * @returns {Promise} * @memberof Taxes */ list(options?: TaxesStatic.TaxOptions): Promise; /** * Search for taxes is not implemented in the API. * Use list() with parameters instead. */ search(): Promise; /** * Create a tax is not implemented in the API. */ create(): Promise; /** * Overwrite a tax is not implemented in the API. */ overwrite(): Promise; /** * Edit a tax is not implemented in the API. */ edit(): Promise; } declare namespace CalendarStatic { interface Appointment { id: number; user_id: number; event_start: string; event_end: string; subject: string; place: string; info: null; contact_id: number; sub_contact_id: number; project_id: number; entry_id: number; module_id: number; has_reminder: boolean; remember_type_id: number; remember_time_id: number; is_private: boolean; } enum SearchParameters { event_start = "event_start", event_end = "event_end", contact_id = "contact_id", user_id = "user_id", subject = "subject", place = "place", module_id = "module_id", entry_id = "entry_id" } } declare namespace NotesStatic { interface Note { id?: number; user_id?: number; event_start?: string; subject?: string; info?: string; contact_id?: number; project_id?: number; entry_id?: number; module_id?: number; communication_kind_id?: number; pr_project_id?: number; } enum SearchParameters { event_start = "event_start", contact_id = "contact_id", user_id = "user_id", subject = "subject", module_id = "module_id", entry_id = "entry_id" } } declare namespace SalesOrderManagementStatic { interface Estimate { id?: number; document_nr?: string; title?: string; contact_id: number; contact_sub_id?: number; user_id: number; project_id?: number; logopaper_id?: number; language_id?: number; bank_account_id?: number; currency_id?: number; payment_type_id?: number; header?: string; footer?: string; total_gross?: string; total_net?: string; total_taxes?: string; total?: string; mwst_type?: number; mwst_is_net?: boolean; show_position_taxes?: boolean; is_valid_from?: string; is_valid_until?: string; contact_address?: string; delivery_address_type?: number; delivery_address?: string; kb_item_status_id?: number; api_reference?: string; viewed_by_client_at?: string; kb_terms_of_payment_template_id?: number; show_total?: boolean; updated_at?: string; taxs?: Array; network_link?: string; positions?: Array; } interface Invoice { id?: number; document_nr?: string; title?: string; contact_id?: number; contact_sub_id?: number; user_id?: number; project_id?: number; logopaper_id?: number; language_id?: number; bank_account_id?: number; currency_id?: number; payment_type_id?: number; header?: string; footer?: string; total_gross?: string; total_net?: string; total_taxes?: string; total_received_payments?: string; total_credit_vouchers?: string; total_remaining_payments?: string; total?: string; mwst_type?: number; mwst_is_net?: boolean; show_position_taxes?: boolean; is_valid_from?: string; is_valid_to?: string; contact_address?: string; kb_item_status_id?: number; api_reference?: string; viewed_by_client_at?: string; updated_at?: string; esr_id?: number; taxs?: Array; positions?: Array; network_link?: string; } interface Order { id?: number; document_nr?: string; title?: string; contact_id?: number; contact_sub_id?: number; user_id?: number; project_id?: number; logopaper_id?: number; language_id?: number; bank_account_id?: number; currency_id?: number; payment_type_id?: number; header?: string; footer?: string; total_gross?: string; total_net?: string; total_taxes?: string; total?: string; mwst_type?: number; mwst_is_net?: boolean; show_position_taxes?: boolean; is_valid_from?: string; contact_address?: string; delivery_address_type?: number; delivery_address?: string; kb_item_status_id?: number; is_recurring?: boolean; api_reference?: string; viewed_by_client_at?: string; updated_at?: string; taxs?: Array; positions?: Array; network_link?: string; } interface Delivery { id?: number; document_nr?: string; title?: string; contact_id?: number; contact_sub_id?: number; user_id?: number; logopaper_id?: number; language_id?: number; bank_account_id?: number; currency_id?: number; header?: string; footer?: string; total_gross?: string; total_net?: string; total_taxes?: string; total?: string; mwst_type?: number; mwst_is_net?: boolean; is_valid_from?: string; contact_address?: string; delivery_address_type?: number; delivery_address?: string; kb_item_status_id?: number; api_reference?: string; viewed_by_client_at?: string; updated_at?: string; taxs?: Array; positions?: Array; } interface Comment { id?: number; text?: string; user_id?: number; user_email?: string; user_name?: string; date?: string; is_public?: boolean; image?: string; image_path?: string; } interface Repetition { start: string; end: string; repetition: { type: string; interval: number; schedule: string; }; } interface Tax { percentage: number; value: string; } interface Position { id?: number; type?: string; amount?: string; unit_id?: number; account_id?: number; unit_name?: string; tax_id?: number; tax_value?: string; text?: string; unit_price?: string; discount_in_percent?: string; position_total?: string; pos?: string; internal_pos?: number; parent_id?: number; is_optional?: boolean; article_id?: number; } interface Payment { id: number; date: string; value: string; bank_account_id: number; title: string; payment_service_id: number; is_client_account_redemption: boolean; is_cash_discount: boolean; kb_invoice_id: number; kb_credit_voucher_id: number; kb_bill_id: number; kb_credit_voucher_text: string; } enum EstimateSearchParameters { id = "id", kb_item_status_id = "kb_item_status_id", document_nr = "document_nr", title = "title", contact_id = "contact_id", contact_sub_id = "contact_sub_id", user_id = "user_id", currency_id = "currency_id", total_gross = "total_gross", total_net = "total_net", total = "total", is_valid_from = "is_valid_from", is_valid_to = "is_valid_to", is_valid_until = "is_valid_until", updated_at = "updated_at" } enum CommentSearchParameters { id = "id", user_id = "user_id", text = "text", date = "date", is_public = "is_public" } enum OrderSearchParameters { id = "id", kb_item_status_id = "kb_item_status_id", document_nr = "document_nr", title = "title", contact_id = "contact_id", contact_sub_id = "contact_sub_id", user_id = "user_id", currency_id = "currency_id", total_gross = "total_gross", total_net = "total_net", total = "total", is_valid_from = "is_valid_from", is_valid_to = "is_valid_to", is_valid_until = "is_valid_until", updated_at = "updated_at" } enum InvoiceSearchParameters { id = "id", kb_item_status_id = "kb_item_status_id", document_nr = "document_nr", title = "title", contact_id = "contact_id", contact_sub_id = "contact_sub_id", user_id = "user_id", currency_id = "currency_id", total_gross = "total_gross", total_net = "total_net", total = "total", is_valid_from = "is_valid_from", is_valid_to = "is_valid_to", is_valid_until = "is_valid_until", updated_at = "updated_at" } interface EstimateAcceptDecline { user_id?: number; user_name?: string; user_email?: string; } interface EstimateSend { recipient_email?: string; subject?: string; message?: string; mark_as_open?: boolean; sender?: string; } interface EstimateCopy { contact_id: number; contact_sub_id?: number; is_valid_from?: string; pr_project_id?: number; title?: string; } interface InvoiceCopy { contact_id: number; contact_sub_id?: number; is_valid_from?: string; pr_project_id?: number; title?: string; } interface InvoiceSend { message: string; recipient_email: string; subject: string; mark_as_open?: boolean; sender?: string; } } declare class Bexio { private token; businessActivities: ClientServices; contacts: Contacts; contactTypes: ContactTypes; contactSectors: ContactSectors; contactGroups: ContactGroups; contactRelations: ContactRelations; orders: Orders; expenses: Expenses; billsV4: BillsV4; outgoingPayments: OutgoingPayments; /** * @deprecated Use BillsV4 instead */ bills: Bills; projects: Projects; projectStatuses: ProjectStatuses; projectTypes: ProjectTypes; timetrackings: Timetrackings; timetrackingStatuses: TimetrackingStatuses; users: Users; items: Items; invoices: Invoices; currencies: Currencies; bankAccounts: BankAccounts; accounts: Accounts; manualEntries: ManualEntries; taxes: Taxes; constructor(token: string); } export { AccountsStatic, BankAccountsStatic, Bexio, BillsStatic, BillsV4Static, BusinessActivitiesStatic, CalendarStatic, ContactGroupsStatic, ContactRelationsStatic, ContactSectorsStatic, ContactTypesStatic, ContactsStatic, CurrenciesStatic, ExpensesStatic, InvoicesStatic, ItemsStatic, ManualEntriesStatic, NotesStatic, OrdersStatic, OutgoingPaymentsStatic, PositionStatic, PositionsStatic, ProjectStatusesStatic, ProjectTypesStatic, ProjectsStatic, SalesOrderManagementStatic, TaxesStatic, TimetrackingStatusesStatic, TimetrackingsStatic, UsersStatic, Bexio as default };