Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Zefix

10 sites No security coverage Drupal 8–11
View on drupal.org

This module integrates Drupal websites with Switzerland's official commercial register database (ZEFIX). It allows searching for companies, retrieving their details, accessing legal forms, and querying official gazette publications.

Zefix

A Drupal module that provides API integration for the Central Business Name Index (ZEFIX) of Switzerland.

Description

The Zefix module enables Drupal sites to integrate with Switzerland's official commercial register database through the ZEFIX REST API. ZEFIX is the centralized online database of the Swiss Commercial Register, containing vital legal and economic information about companies domiciled in Switzerland.

Features

  • Company Search: Search for companies registered in the commercial register by various parameters
  • Company Details: Retrieve detailed company information by UID, CHID, or EHRAID
  • SOGC Integration: Access Swiss Official Gazette of Commerce (SOGC) publications
  • Legal Forms: Query available legal forms for Swiss companies
  • Registry Information: Access registry of commerce data
  • Community Data: Retrieve community-based company information
  • Date-based Queries: Search companies by registration or modification dates
  • Environment Support: Configurable test and production environment endpoints

Requirements

  • Drupal 8.8+ (compatible with Drupal 8, 9, 10, and 11)
  • Valid ZEFIX API credentials (username and password)
  • cURL extension for PHP

Installation

composer require drupal/zefix

Manual Installation

  1. Download the module and place it in your modules/contrib directory
  2. Enable the module: drush en zefix

Configuration

  1. Navigate to Administration > Configuration > System > Zefix API Configuration (/admin/config/system/zefix)
  2. Configure the following settings:
    • Environment: Choose between Test or Production
    • User: Your ZEFIX API username
    • Password: Your ZEFIX API password

API Services

The module provides several services for interacting with the ZEFIX API:

$search_service = \Drupal::service('zefix.search');
$results = $search_service->search($search_parameters);

Company Details by UID

$uid_service = \Drupal::service('zefix.showUID');
$company = $uid_service->showUID('CHE-123456789');

SOGC Publications

$sogc_service = \Drupal::service('zefix.get');
$publication = $sogc_service->get('publication_id');

Other Available Services

  • zefix.showCHID - Get company details by CHID
  • zefix.showEhraid - Get company details by EHRAID
  • zefix.community - Community-related queries
  • zefix.legalForm - Legal form information
  • zefix.registryOfCommerce - Registry of commerce data
  • zefix.byDate - Date-based company queries
  • zefix.byBfsCommunityId - BFS community-based queries

API Endpoints

The module connects to the official ZEFIX REST API:

  • Test Environment: https://www.zefixintg.admin.ch/ZefixPublicREST/api/v1/
  • Production Environment: https://www.zefix.admin.ch/ZefixPublicREST/api/v1/

Usage Examples

$search_service = \Drupal::service('zefix.search');
$search_data = [
  'name' => 'Example Company',
  'activeOnly' => true
];
$results = $search_service->search($search_data);

Get Company by UID

$uid_service = \Drupal::service('zefix.showUID');
$company_details = $uid_service->showUID('CHE-123456789');

Error Handling

All services include error handling and logging. Failed API requests are logged to the Drupal watchdog with the 'zefix' channel. Check your site's logs for debugging API connection issues.

Permissions

The module defines the following permission:

  • Administer zefix configuration: Required to access the configuration form

API Documentation

For detailed information about the ZEFIX API endpoints and parameters, refer to the official API documentation:

Support

Acknowledgements

This module was initially developed by Effective Bytes and funded by GS1 Switzerland.

License

This project is licensed under the GPL-2.0-or-later license.

Contributing

Contributions are welcome! Please follow Drupal coding standards and submit patches through the project's issue queue.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Oct 2024
Latest release
7 months ago
Releases (12 mo)
1 ▼ from 2
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
1.0.3 Stable 8–11 Jan 17, 2026
1.0.2 Stable 8–11 Aug 15, 2025
1.0.1 Stable 8–10 Oct 18, 2024