# Integrating with Invoiced

[Prerequisites](#prerequisites)

[Invoiced Setup](#invoiced-setup)\
[Add Webhook URL](#step-1-add-webhook-url)\
[Create an API Key](#step-2-create-an-api-key)

### Prerequisites <a href="#prerequisites" id="prerequisites"></a>

To connect Invoiced to Drivetrain, you need:

* An active Invoiced production account
* Admin privileges on Invoiced

### Invoiced Setup <a href="#invoiced-setup" id="invoiced-setup"></a>

Drivetrain uses Fivetran to integrate with Invoiced, you have to add a webhook URL and create an API key to complete this Integration. In this guide, you will find detailed steps on how to add both items.

### Step 1: Add Webhook URL

1. Log in to your [Invoiced account](https://app.invoiced.com/login) account and on the navigation menu click on **Settings**
2. On the Integrations tile, click on **Developers**

<figure><img src="/files/UhSJUq6ey88747nx1IsN" alt=""><figcaption></figcaption></figure>

3. Click **Integrations** > **New Webhook**.
4. Reach out to Drivetrain's Data Integration Manager or Customer Success Manager for webhook URL.
5. Set the **Enabled** toggle to **ON**
6. In the Enabled Events section, select **Select events**.
7. Select the following events:
   * **credit\_note.deleted**
   * **customer.deleted**
   * **estimate.deleted**
   * **invoice.deleted**
   * **note.deleted**
   * **payment.deleted**
   * **subscription.deleted**
   * **task.deleted**
8. Click **Save**.

<figure><img src="/files/wD0BVhoBPj5qiU2zw9BY" alt=""><figcaption></figcaption></figure>

#### Step 2: Create an API key <a href="#step-2-create-an-api-key" id="step-2-create-an-api-key"></a>

1. Go back to Invoiced home page, and on the navigation menu, click **Settings**.
2. On the Integrations tile, click on **Developers**
3. Click **API Keys** > **New API Key**.
4. Make a note of the API Key.

{% hint style="info" %}
That’s it! Share the API key with your data integrations manager or customer success manager so they can get started!
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://integrations.drivetrain.ai/integration-guide/integrate-with-drivetrain/billing-and-invoicing/integrating-with-invoiced.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
