Skip to main content

[Use case] How to integrate billing into Qobra?

How to structure and integrate billing data in Qobra to ensure accurate and automated commission calculations.

Support Qobra avatar
Written by Support Qobra
Updated over a week ago

In this article :

Understanding How Qobra Calculates Commissions

To properly understand the data model required for invoice integration, it’s essential to understand how Qobra calculates commissions.

Qobra applies at least two filters to your data:

  • User: retrieves all data required to calculate commissions for a given user.

  • Date: retrieves all data relevant to a specific period (e.g., a monthly statement).

The source table used to calculate commissions must contain:

  • A User field

  • A Date field

1 - A user filter and a date filter are applied to the source data table

2- Subset of data filtered by user and date, used by Qobra to calculate commissions for the current period

In addition, the table must be as granular as possible. Only N:1 relationships are supported.

👉Example:

If a CRM Opportunity is linked to multiple invoices (1:N), Qobra cannot determine which invoices to consider.

→ The Opportunity table cannot be used as the source.

However, if an invoice is linked to a single opportunity (N:1), Qobra can identify the corresponding opportunity and enrich the data through a join.

→ The source table can then be the Invoice table.

Defining the Required Data Structure

Most common use case:

Commissions are usually based on invoicing. Since an invoice may include several items (products, services), each with different commission rules, the source table must be the invoice lines table.

☝️Note:The Invoice table cannot be used, as it is linked to multiple lines (1:N).

The invoice lines table must contain the following:

  • Record ID: unique and stable identifier per line, used for history and updates

  • Amount: value associated with the line

  • Currency: string containing the currency code (e.g., USD, EUR)

  • Product/Service type: used to apply the appropriate commission rule

    👉Examples:

    Invoice Line 1: type = Service → Commission = Amount × 3%

    Invoice Line 2: type = Subscription → Commission = Amount × 1%

  • Invoice Status: Paid, Draft, Sent, etc.

  • Payment date: either

    • a “date” field in the invoice line table, or

    • an invoice ID used to join and retrieve the date from the invoice table

  • User: the person to be commissioned (can be retrieved via a join)

  • CRM ID (Account ID, Deal ID, or Line Item ID): needed to link billing data with CRM data when relevant

👉Example:

If Qobra needs to identify the sales rep assigned to a deal, the invoice line must contain the Deal ID or Account ID, allowing a join with the CRM to retrieve the owner.

How to Integrate the Invoice Line Table into Qobra

To connect the invoice line table via API, follow these steps:

  • Export the invoice lines table from your billing system (Excel or CSV)

  • Format the file with a column for each required field listed above

In Qobra:

Did this answer your question?