Invopop’s Chargebee app lets you import invoices and credit notes from Chargebee and process them with a workflow in Invopop. This allows you to automatically transform, process and publish your invoices and credit notes to comply with local regulations and integrate with other systems.

How it works

Once set up, the app listens to events from Chargebee. When an invoice is generated (i.e. created and not in the pending state) or when a credit note is created, the app will create a new GOBL invoice and add it to your Invopop account. It will then create a job to process the GOBL invoice using the workflow of your choice.

How to set up

This guide assumes that you already have a Chargebee account configured. Otherwise, please refer to the Chargebee documentation on how to do this.

1. Enter supplier details

First, you need to set up a supplier in Invopop, containing your business details. In the console, go to “Contacts” > “Suppliers” and click on “New supplier”, an add your details (name, tax code, address, etc.). The required data and extensions depend on the tax regime. Please do not hesitate to contact Invopop support for assistance.

Note that when generating invoices, the app will merge the supplier information in Invopop with the business profile data in Chargebee when issuing the invoice, giving precedence to the data from Chargebee.

2. Prepare a workflow

Now, you need to set up the workflow in Invopop to process the invoices imported from Chargebee. Go to “Configure” > “Workflows” in the Invopop console and create a workflow.

The workflow should include the steps to convert and publish invoices as local regulations require. You can also add steps for any other automation you want to perform, such as emailing the invoices or storing them in a cloud service.

Be sure to add a “Sync with Chargebee” step at the end of the workflow to report back to Chargebee once the document has been processed.

3. Connect the Chargebee app

You are now ready to connect and configure the Chargebee app itself. Go to “Configure” > “apps” in the Invopop console. Then click on “Connect” and “Configure”. You’ll see a form with the following fields:

  • Chargebee Site: The identifier of your Chargebee site. You can find it in the URL when you log in to Chargebee.
  • Chargebee API Key: The API key used to access Chargebee. Go to “Settings” > “Configure Chargebee” > “API Keys” in the Chargebee UI to create one.
  • Supplier: The supplier who will be issuing the invoices. You can select the one you created earlier.
  • Workflow: The workflow that will process the invoices. You can select the one you created earlier.
  • Ignore Chargebee’s invoice codes: If true, the app will ignore the invoice numbers set by Chargebee and let the workflow assign them instead.

Some countries require specific codes set on tax-exempt invoices. If you’re in one of these countries, you’ll see the following fields:

  • Exemption Code (Generic): The local code to be used by default on tax-exempt invoices.
  • Exemption Code (Exports): The local code to be used by default on tax-exempt invoices for exports.
  • Exemption Code (Reverse Charge): The local code to be used by default on tax-exempt invoices for reverse charge.

Please note that those are the default exemption codes that will be set depending on the Chargebe exemption reason. If you need specific codes used for specific tax-exempt items, item prices, subscriptions or customers, you can assign them as extensions.

4. Set up a webhook

After saving the configuration, the page will provide a URL to set up a webhook in Chargebee and trigger the import process. To do this, go to “Settings” > “Configure Chargebee” > “Webhooks” and create a new webhook with the provided URL.

5. Enter extension data

To generate valid invoices, most tax regimes require the issuer to provide custom data specific to that regime. GOBL supports this through extensions. Please refer to the specific regime documentation to determine which extensions are used in your regime.

You can enter the extension values in Chargebee by setting custom fields or metadata in the following entities: Customer, Plan Item, Plan Item Price, Action Item, Action Item Price, Charge Item, Charge Item Price, and Subscription.

If you want to use metadata, make sure that each metadata key matches the extension name. For example, to set the customer’s mx-cfdi-fiscal-regime extension, you could go to the customer’s JSON metadata to something like:

  "mx-cfdi-fiscal-regime": "601"

In the case of custom fields, you must first create them in “Settings” > “Configure Chargebee” > “Custom Fields” and make sure that each field’s API name maps to an extension name. For example, to set the mx-cfdi-fiscal-regime the custom field API name must be cf_mx_cfdi_fiscal_regime.

Setup is complete

You are now ready to start importing invoices and credit notes from Chargebee. The app will automatically create GOBL invoices and add them to your Invopop account. The invoices will then be processed using the workflow you set up.