This project is not covered by Drupal’s security advisory policy.

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.

Supporting organizations: 
Development

Project information

  • caution Minimally maintained
    Maintainers monitor issues, but fast responses are not guaranteed.
  • caution Maintenance fixes only
    Considered feature-complete by its maintainers.
  • Project categories: Integrations
  • chart icon15 sites report using this module
  • Created by benferch on , updated
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.

Releases