Bexio API: A simple guide to get started

A Comprehensive Guide for Swiss Freelancers

Introduction

Hey there, fellow Swiss freelancer! If you're juggling multiple clients, projects, and invoices, you know how crucial efficient business management is. Enter bexio, a popular business software solution designed to simplify your administrative tasks. But did you know that bexio offers an API that can supercharge your freelance operations?

In this comprehensive guide, we'll dive deep into the bexio API, exploring how you can leverage it to automate tasks, integrate with other tools, and ultimately, save time and boost your productivity. Whether you're tech-savvy or just curious, this article is your roadmap to unlocking new efficiencies in your freelance business.

❶ Understanding bexio and Its Relevance to Swiss Freelancers

What is bexio?

bexio is a Swiss-based business software solution aimed at small and medium-sized enterprises (SMEs) and freelancers. It offers a suite of tools for managing contacts, invoicing, accounting and more—all in one place. With bexio you can handle your administrative tasks more efficiently, freeing up more time for what you do best.

  • Localized Features: It’s built with Swiss business practices in mind, including support for Swiss bank-standard QR invoice codes, Swiss VAT (MWST) rates, and data stored in Switzerland.
  • User-Friendly Interface: Even if you are not a developer, bexio’s intuitive design helps you navigate contact management, invoicing, accounting etc.
  • Comprehensive Tools: It covers contacts, invoicing, orders, accounting—even payroll (depending on plan) — which means you might avoid layering multiple tools.

Key features of bexio

Here are some of the high-level capabilities you’ll find inside bexio:

  • Contact Management: store and organise clients / suppliers.
  • Invoicing: generate professional invoices (with Swiss-specific QR code support) for your clients.
  • Accounting: manage your finances with tools that are Swiss-law-compliant.
  • Inventory/Orders: if you deal with products rather than just services, you can track stock and orders.

❷ The bexio API: An Overview

What is an API?

An API (Application Programming Interface) is a set of rules that allows different software systems to talk to each other. Think of it as a translator enabling two tools (your invoicing/accounting system + some other system) to share data and trigger actions programmatically.

The bexio API: Functionalities and Capabilities

The bexio API is a RESTful interface allowing developers to interact with many of bexio’s functionalities — programmatically create/update contacts, generate invoices, pull accounting data, etc.
With the API you can:

  • Automate repetitive tasks (e.g., automatically generate an invoice when a project is marked done)
  • Integrate with other tools you already use (e.g., CRM, e-commerce store, time-tracking tool)
  • Customise features and workflows (adapt the behavior to your specific needs)

Why integrate with the bexio API?

  • Save Time: Reduce or eliminate manual data entry.
  • Reduce Errors: Automation cuts down human-typos and inconsistent data.
  • Boost Productivity: Make your tools work together and let you focus on billable work rather than admin.

❸ Getting Started with the bexio API

Setting Up a bexio Account

Before you can use the API, you'll need a bexio account. If you haven't already, head over to bexio's website and sign up for a trial account. Complete the onboarding process to familiarize yourself with the platform.

Accessing the Developer Portal

Visit the bexio Developer Portal and log in using your bexio credentials. This portal is your hub for all things related to the bexio API, including documentation and support.

Creating an App and Obtaining API Credentials

  • Create a New App: In the developer portal, navigate to the "My Apps" section and create a new app.

  • Set Redirect URL: Ensure you define a valid redirect URL. This is crucial for the OAuth 2.0 authentication process.

  • Obtain Client ID and Secret: After creating your app, you'll receive a Client ID and Client Secret. Keep these credentials secure—they're essential for API access.

❹ Authentication and Authorization

Understanding OAuth 2.0 in the Context of bexio

bexio uses OAuth 2.0, an industry-standard protocol for authorization. It ensures that your application can interact with bexio securely, without exposing your credentials.

Steps to Authenticate with the bexio API:

Initiate Authorization

Direct the user to bexio's authorization URL with your Client ID and requested scopes.

User Grants Access

The user logs in and grants your app permission to access their data.

Receive Authorization Code

Bexio redirects to your specified URL with an authorization code.

Exchange Code for Token

Use the authorization code to request an access token and refresh token from bexio.

Managing Access Tokens and Refresh Tokens

  • Access Tokens: These are short-lived tokens used to authenticate API requests.

  • Refresh Tokens: Use these to obtain new access tokens without requiring user interaction.

Tip: Implement a secure method to store and refresh tokens to maintain uninterrupted API access.

❺ Exploring the bexio API Endpoints

The bexio API offers a wide range of endpoints.
Here are some of the most relevant for freelancers

➥ Contacts Management

Get Contacts

Retrieve a list of your contacts.

Create Contact

Add a new client or supplier.

Update Contact

Modify existing contact information.

➥ Invoicing and Orders

Create Invoice

Generate new invoices programmatically.

List Invoices

Retrieve all invoices, filter by status or date.

Send Invoice

Automate the process of sending invoices to clients.

➥ Products and Inventory

Get Products

Access your list of products or services.

Update Stock Levels

Adjust inventory based on sales or new stock.

➥ Accounting and Financial Data

Fetch Accounts

Retrieve your chart of accounts.

Record Transactions

Post accounting entries directly.

❻ Building Your First Integration

Setting Up Your Development Environment

Choose your preferred programming language and set up your environment. For this guide, we'll use C# as an example.

  • Install Necessary Libraries: For C#, libraries like RestSharp and Newtonsoft.Json are helpful for handling HTTP requests and JSON parsing.

Making Your First API Call

Here's a simple example in C#:

var client = new RestClient("https://api.bexio.com/2.0");
var request = new RestRequest("contact", Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("Authorization", $"Bearer {accessToken}");

IRestResponse response = client.Execute(request);
var contacts = JsonConvert.DeserializeObject<List<Contact>>(response.Content);

Note: Replace accessToken with your actual access token.

Parsing and Handling API Responses

The API responses are in JSON format. Use a JSON parser to convert the responses into usable objects in your code.

Example:

public class Contact
{   public int Id { get; set; }
    public string Name { get; set; }
    // Add other relevant fields}

var contacts = JsonConvert.DeserializeObject<List<Contact>>(response.Content);

❼ Common Use Cases for Freelancers

Automating Invoicing Processes

Imagine generating and sending invoices automatically after completing a project.

  • Create Invoice: Use the API to generate an invoice upon project completion.

  • Send Invoice: Automate the email dispatch to your client.

Syncing Contacts and Client Data

Keep your client information up-to-date across multiple platforms.

  • Update Contacts: When a new client signs up on your website, automatically add them to bexio.

Managing Expenses and Financial Tracking

Stay on top of your finances by automating expense entries.

  • Record Expenses: Use the API to log expenses from other tools or receipt scanning apps.

Table with ideas

If you use this… You can automate this with the bexio API…
Time-Tracking app Create draft invoices in bexio from hours logged.
E-commerce platform (e.g., Shopify) Automatically create a contact in bexio when a new customer places an order.
Receipt scanning app Post new expenses directly into bexio’s accounting module.

❽ Tips and Best Practices

Handling Errors and Exceptions

Always implement error handling to catch and respond to API errors.

if (!response.IsSuccessful)
{
    Console.WriteLine($"API request failed: {response.ErrorMessage}");
    // Handle the error appropriately
}

Rate Limiting and Performance Optimization

  • Respect Rate Limits: bexio may limit the number of API calls. Implement caching where possible.

  • Optimize Calls: Fetch only necessary data to reduce the number of requests.

Security Considerations

  • Secure Storage: Store your API credentials and tokens securely.

  • HTTPS: Always make API calls over HTTPS to encrypt data in transit.

❾ Introducing Magic Heidi: A Tailored Solution for Swiss Freelancers

Overview of Magic Heidi

Magic Heidi is a Swiss-focused invoicing and expense-management app built specifically for freelancers. It boasts features like Swiss QR invoice generation, multi-platform support (iPhone, Android, Mac, Windows, Web) and is designed to be extremely user-friendly.

Comparison with bexio

Feature bexio Magic Heidi
Target audience SMEs & freelancers Freelancers (Swiss)
Complexity Comprehensive, many modules Simplified, focused on essentials
Customisation Extensive Focused on core features (invoicing, expenses)
Platforms Web (desktop) Web + mobile + desktop apps
Integrations/API support Strong (via API) Mainly designed for freelancer workflows

Benefits of Using Magic Heidi for Freelancers

  • Simplicity: You can create your first invoice in 30 seconds or so.
  • Swiss-Specific Features: Automatic QR-code invoices, support for Swiss VAT, multiple currencies and bank accounts.
  • Cross-Platform Availability: Use on mobile or desktop; your data syncs across devices.
  • Dedicated to Freelancers: It’s built with one-person businesses in mind — no unnecessary complexity.

Note for Enterprise customers

Magic Heidi is not a full substitute for bexio if you need advanced SME modules (project management, large inventory, payroll etc). It’s an excellent choice for freelancers who primarily need invoicing + expense tracking with Swiss-compliant features. So position it accordingly: simple, streamlined, and freelancer-friendly—not full enterprise accounting.

❿ How Magic Heidi Integrates (or Doesn’t) with bexio API

While Magic Heidi is a standalone tool and may not offer full bidirectional integration with bexio out of the box, here are potential scenarios:

  • Data Syncing: Export invoices or contacts from Magic Heidi and import into bexio to keep all systems consistent.
  • Expense Management: Use Magic Heidi’s expense-scanning capabilities and push those entries into bexio accounting (if you build a custom workflow) — though you’ll need to check whether Magic Heidi exposes an API or whether you’ll need intermediate steps.
  • Unified Data: By combining bexio (for comprehensive accounting) + Magic Heidi (for streamlined freelancer workflows) you get best of both worlds — but this may require custom setup or manual exports.

FAQ

Conclusion

Managing your freelance business doesn’t have to be a juggling act. With tools like the bexio API, you can automate tasks, integrate your workflows and keep your business moving forward. And if you’re looking for something tailored specifically for Swiss freelancers, Magic Heidi might just be the magic wand you need.

So:

  • Dive into the bexio Developer Portal and documentation.
  • Explore whether no-code integrations or marketplace apps can serve your needs.
  • If you have a unique workflow, consider building a custom integration using the API.
  • If you’re a freelancer looking for simplicity, evaluate Magic Heidi.
  • Whichever route you choose, aim to spend less time on admin — and more time doing the work you love.

Happy freelancing!