# BillingEngine

> Create customers and draft e-invoices, record payments and read your key figures in BillingEngine.

App · 17 actions. Web page: https://docs.lodol.com/docs/integrations/billingengine

## Actions

### Create customer

Add a customer with their address.

**Inputs**

- Company (`company`, text): The company name. A new customer needs a company or a last name.
- First name (`first_name`, text): The contact's first name.
- Last name (`last_name`, text): The contact's last name.
- Email (`email`, text): The email address invoices go to.
- Phone (`phone`, text): A phone number.
- VAT number (`vat_number`, text): The customer's VAT number.
- Buyer reference (`buyer_reference`, text): The buyer reference for e-invoices, such as a Leitweg-ID.
- Customer type (`customer_type`, text): Whether the customer is a business or a consumer. Leave empty for your account's default. One of: `business`, `consumer`.
- Title (`title`, text): An academic or professional title, such as Dr.
- Salutation (`salutation`, text): How to address the customer. One of: `male` (Mr), `female` (Ms), `family`.
- Your own ID (`external_id`, text): The customer's ID in your own system. It must be unique.
- Street (`line_1`, text, required): The first address line.
- Address line 2 (`line_2`, text): The second address line.
- Postal code (`postal_code`, text, required): The postal code.
- City (`city`, text, required): The city.
- Region (`region`, text): The region or state.
- Country (`country`, text, required): The two-letter ISO country code, such as DE.

**Outputs**

- `data` (object): The response from BillingEngine.

**Example output**

```json
{
  "data": {
    "address": {
      "city": "Berlin",
      "country": "DE",
      "line_1": "Hauptstra\u00dfe 1",
      "line_2": "2. OG",
      "postal_code": "10115",
      "region": "Berlin"
    },
    "buyer_reference": "991-12345-67",
    "company": "Muster GmbH",
    "created_at": "2026-11-02T09:15:00Z",
    "customer_type": "business",
    "email": "anna@muster.example",
    "external_id": "crm-4711",
    "first_name": "Anna",
    "id": 12,
    "last_name": "Muster",
    "name": "Muster GmbH",
    "number": "10012",
    "phone": "+49 30 1234567",
    "salutation": "female",
    "title": "Dr.",
    "updated_at": "2026-11-20T14:03:00Z",
    "vat_number": "DE123456789"
  }
}
```

### Create draft invoice

Create a draft invoice for a customer. It stays a draft until you send it in BillingEngine.

**Inputs**

- Customer (`customer_id`, number, required): The customer to invoice.
- Items (`items`, list, required): The invoice's lines, each with a name and a price.
- Invoice date (`date`, date): The invoice date. Leave empty for today.
- Days to pay (`due_days`, number): How many days the customer has to pay. At least 0.
- Opening text (`opening_text`, text): Text shown before the items.
- Closing text (`closing_text`, text): Text shown after the items.
- Service from (`service_period_start_date`, date): The first day of the service period.
- Service to (`service_period_end_date`, date): The last day of the service period.
- Purchase order number (`purchase_order_number`, text): The customer's purchase order number, printed on the invoice.
- Your own ID (`external_id`, text): The invoice's ID in your own system. An ID used before is refused, so a repeat can't create it twice.

**Outputs**

- `data` (object): The response from BillingEngine.

**Example output**

```json
{
  "data": {
    "cancelled": false,
    "closing_text": "Please pay within 14 days.",
    "created_at": "2026-11-21T10:00:00Z",
    "currency": "EUR",
    "customer": {
      "id": 12,
      "name": "Muster GmbH"
    },
    "date": "2026-11-21",
    "delivery_status": "sent",
    "due_date": "2026-12-05",
    "external_id": "order-9001",
    "gross_amount": "642.60",
    "id": 345,
    "items": [
      {
        "article_number": "A-100",
        "description": "On-site workshop",
        "name": "Consulting",
        "number": 1,
        "price": "90.00",
        "quantity": 6.0,
        "tax_rate": 19.0,
        "total": "540.00",
        "unit_code": "HUR"
      }
    ],
    "language": "de",
    "net_amount": "540.00",
    "number": "000041",
    "open_amount": "642.60",
    "opening_text": "Thank you for your order.",
    "prices_include_tax": false,
    "purchase_order_number": "PO-2211",
    "service_period_end_date": "2026-11-30",
    "service_period_start_date": "2026-11-01",
    "status": "open",
    "tax_amount": "102.60",
    "tax_breakdown": [
      {
        "net_amount": "540.00",
        "tax_amount": "102.60",
        "tax_rate": 19.0
      }
    ],
    "type": "invoice",
    "updated_at": "2026-11-21T10:05:00Z",
    "vat_treatment": "standard"
  }
}
```

### Get customer

Get one customer by their ID.

**Inputs**

- Customer (`id`, number, required): The customer to get.

**Outputs**

- `data` (object): The response from BillingEngine.

**Example output**

```json
{
  "data": {
    "address": {
      "city": "Berlin",
      "country": "DE",
      "line_1": "Hauptstra\u00dfe 1",
      "line_2": "2. OG",
      "postal_code": "10115",
      "region": "Berlin"
    },
    "buyer_reference": "991-12345-67",
    "company": "Muster GmbH",
    "created_at": "2026-11-02T09:15:00Z",
    "customer_type": "business",
    "email": "anna@muster.example",
    "external_id": "crm-4711",
    "first_name": "Anna",
    "id": 12,
    "last_name": "Muster",
    "name": "Muster GmbH",
    "number": "10012",
    "phone": "+49 30 1234567",
    "salutation": "female",
    "title": "Dr.",
    "updated_at": "2026-11-20T14:03:00Z",
    "vat_number": "DE123456789"
  }
}
```

### Get invoice

Get one invoice with its items.

**Inputs**

- Invoice ID (`id`, number, required): The ID of the invoice to get.

**Outputs**

- `data` (object): The response from BillingEngine.

**Example output**

```json
{
  "data": {
    "cancelled": false,
    "closing_text": "Please pay within 14 days.",
    "created_at": "2026-11-21T10:00:00Z",
    "currency": "EUR",
    "customer": {
      "id": 12,
      "name": "Muster GmbH"
    },
    "date": "2026-11-21",
    "delivery_status": "sent",
    "due_date": "2026-12-05",
    "external_id": "order-9001",
    "gross_amount": "642.60",
    "id": 345,
    "items": [
      {
        "article_number": "A-100",
        "description": "On-site workshop",
        "name": "Consulting",
        "number": 1,
        "price": "90.00",
        "quantity": 6.0,
        "tax_rate": 19.0,
        "total": "540.00",
        "unit_code": "HUR"
      }
    ],
    "language": "de",
    "net_amount": "540.00",
    "number": "000041",
    "open_amount": "642.60",
    "opening_text": "Thank you for your order.",
    "prices_include_tax": false,
    "purchase_order_number": "PO-2211",
    "service_period_end_date": "2026-11-30",
    "service_period_start_date": "2026-11-01",
    "status": "open",
    "tax_amount": "102.60",
    "tax_breakdown": [
      {
        "net_amount": "540.00",
        "tax_amount": "102.60",
        "tax_rate": 19.0
      }
    ],
    "type": "invoice",
    "updated_at": "2026-11-21T10:05:00Z",
    "vat_treatment": "standard"
  }
}
```

### Get invoiced revenue

Get sent invoices' revenue by invoice date per period, without drafts and cancelled invoices.

**Inputs**

- From (`after`, date): The first day of the range. Leave empty for the start of this year.
- To (`before`, date): The last day of the range. Leave empty for the end of this year.
- Split by (`interval`, text): Show the figures per month, quarter or year. One of: `month`, `quarter`, `year`.

**Outputs**

- `data` (object): The response from BillingEngine.

**Example output**

```json
{
  "data": {
    "after": "2026-01-01",
    "before": "2026-12-31",
    "currency": "EUR",
    "data": [
      {
        "gross": "5355.00",
        "net": "4500.00",
        "period": "2026-11-01"
      }
    ],
    "interval": "month",
    "total": {
      "gross": "64260.00",
      "net": "54000.00"
    }
  }
}
```

### Get open amounts

Get what customers owe today, what of it is overdue and what you've sent reminders for.

**Inputs**: None.

**Outputs**

- `data` (object): The response from BillingEngine.

**Example output**

```json
{
  "data": {
    "as_of": "2026-12-01",
    "currency": "EUR",
    "open": {
      "gross": "3808.00",
      "net": "3200.00"
    },
    "overdue": {
      "gross": "1428.00",
      "net": "1200.00"
    },
    "reminded": {
      "gross": "476.00",
      "net": "400.00"
    }
  }
}
```

### Get profit

Get income, expenses and profit per period, as on your dashboard.

**Inputs**

- From (`after`, date): The first day of the range. Leave empty for the start of this year.
- To (`before`, date): The last day of the range. Leave empty for the end of this year.
- Split by (`interval`, text): Show the figures per month, quarter or year. One of: `month`, `quarter`, `year`.

**Outputs**

- `data` (object): The response from BillingEngine.

**Example output**

```json
{
  "data": {
    "after": "2026-01-01",
    "before": "2026-12-31",
    "currency": "EUR",
    "data": [
      {
        "asset_disposals": {
          "gross": "0.00",
          "net": "0.00"
        },
        "costs": {
          "gross": "407.00",
          "net": "350.00"
        },
        "depreciations": {
          "gross": "50.00",
          "net": "50.00"
        },
        "expenses": {
          "gross": "357.00",
          "net": "300.00"
        },
        "income": {
          "gross": "1190.00",
          "net": "1000.00"
        },
        "payments": {
          "gross": "1071.00",
          "net": "900.00"
        },
        "period": "2026-11-01",
        "profit": {
          "gross": "783.00",
          "net": "650.00"
        },
        "revenues": {
          "gross": "119.00",
          "net": "100.00"
        }
      }
    ],
    "interval": "month",
    "total": {
      "asset_disposals": {
        "gross": "0.00",
        "net": "0.00"
      },
      "costs": {
        "gross": "407.00",
        "net": "350.00"
      },
      "depreciations": {
        "gross": "50.00",
        "net": "50.00"
      },
      "expenses": {
        "gross": "357.00",
        "net": "300.00"
      },
      "income": {
        "gross": "1190.00",
        "net": "1000.00"
      },
      "payments": {
        "gross": "1071.00",
        "net": "900.00"
      },
      "profit": {
        "gross": "783.00",
        "net": "650.00"
      },
      "revenues": {
        "gross": "119.00",
        "net": "100.00"
      }
    }
  }
}
```

### Get VAT balance

Get output tax, input tax and the balance, as in your tax report.

**Inputs**

- From (`after`, date): The first day of the range. Give both days, or neither for the current VAT return period.
- To (`before`, date): The last day of the range. Give both days, or neither for the current VAT return period.

**Outputs**

- `data` (object): The response from BillingEngine.

**Example output**

```json
{
  "data": {
    "after": "2026-10-01",
    "balance": "1450.00",
    "before": "2026-12-31",
    "currency": "EUR",
    "input_tax": "450.00",
    "output_tax": "1900.00",
    "unassigned_bookings": 0
  }
}
```

### List customers

List one page of customers, optionally searched or filtered.

**Inputs**

- Search (`query`, text): Find customers whose company, name or email contains this.
- Your own ID (`external_id`, text): Only the customer with this ID from your own system.
- Changed since (`updated_since`, date and time): Only customers changed at or after this time.
- Page (`page`, number): Which page to read, starting at 1. At least 1.
- Page size (`per_page`, number): How many records a page holds, up to 100. From 1 to 100.

**Outputs**

- `data` (object): The response from BillingEngine.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "address": {
          "city": "Berlin",
          "country": "DE",
          "line_1": "Hauptstra\u00dfe 1",
          "line_2": "2. OG",
          "postal_code": "10115",
          "region": "Berlin"
        },
        "buyer_reference": "991-12345-67",
        "company": "Muster GmbH",
        "created_at": "2026-11-02T09:15:00Z",
        "customer_type": "business",
        "email": "anna@muster.example",
        "external_id": "crm-4711",
        "first_name": "Anna",
        "id": 12,
        "last_name": "Muster",
        "name": "Muster GmbH",
        "number": "10012",
        "phone": "+49 30 1234567",
        "salutation": "female",
        "title": "Dr.",
        "updated_at": "2026-11-20T14:03:00Z",
        "vat_number": "DE123456789"
      }
    ],
    "pagination": {
      "count": 87,
      "page": 1,
      "pages": 4,
      "per_page": 25
    }
  }
}
```

### List expenses per category

List tax deductible expenses per category, largest first.

**Inputs**

- From (`after`, date): The first day of the range. Leave empty for the start of this year.
- To (`before`, date): The last day of the range. Leave empty for the end of this year.
- Page (`page`, number): Which page to read, starting at 1. At least 1.
- Page size (`per_page`, number): How many records a page holds, up to 100. From 1 to 100.

**Outputs**

- `data` (object): The response from BillingEngine.

**Example output**

```json
{
  "data": {
    "after": "2026-01-01",
    "before": "2026-12-31",
    "currency": "EUR",
    "data": [
      {
        "category": {
          "id": 12,
          "name": "Software"
        },
        "gross": "5950.00",
        "net": "5000.00"
      }
    ],
    "pagination": {
      "count": 87,
      "page": 1,
      "pages": 4,
      "per_page": 25
    },
    "total": {
      "gross": "64260.00",
      "net": "54000.00"
    }
  }
}
```

### List income per customer

List payments and cash revenues per customer, largest first.

**Inputs**

- From (`after`, date): The first day of the range. Leave empty for the start of this year.
- To (`before`, date): The last day of the range. Leave empty for the end of this year.
- Page (`page`, number): Which page to read, starting at 1. At least 1.
- Page size (`per_page`, number): How many records a page holds, up to 100. From 1 to 100.

**Outputs**

- `data` (object): The response from BillingEngine.

**Example output**

```json
{
  "data": {
    "after": "2026-01-01",
    "before": "2026-12-31",
    "currency": "EUR",
    "data": [
      {
        "customer": {
          "id": 12,
          "name": "Muster GmbH"
        },
        "gross": "5950.00",
        "net": "5000.00"
      }
    ],
    "pagination": {
      "count": 87,
      "page": 1,
      "pages": 4,
      "per_page": 25
    },
    "total": {
      "gross": "64260.00",
      "net": "54000.00"
    }
  }
}
```

### List invoices

List one page of invoices, newest first, filtered as you choose.

**Inputs**

- Status (`status`, text): Only invoices with this status. One of: `draft`, `open`, `overdue`, `paid`, `uncollectible`, `cancelled`, `cancellation`.
- Type (`type`, text): Only invoices, or only credit notes. One of: `invoice` (Invoices), `credit_note` (Credit notes).
- Customer (`customer_id`, number): Only invoices to this customer.
- Dated on or after (`after`, date): Only invoices dated on or after this day.
- Dated on or before (`before`, date): Only invoices dated on or before this day.
- Invoice number (`number`, text): Only the invoice with this number.
- Your own ID (`external_id`, text): Only the invoice with this ID from your own system.
- Changed since (`updated_since`, date and time): Only invoices changed at or after this time.
- Page (`page`, number): Which page to read, starting at 1. At least 1.
- Page size (`per_page`, number): How many records a page holds, up to 100. From 1 to 100.

**Outputs**

- `data` (object): The response from BillingEngine.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "cancelled": false,
        "created_at": "2026-11-21T10:00:00Z",
        "currency": "EUR",
        "customer": {
          "id": 12,
          "name": "Muster GmbH"
        },
        "date": "2026-11-21",
        "delivery_status": "sent",
        "due_date": "2026-12-05",
        "external_id": "order-9001",
        "gross_amount": "642.60",
        "id": 345,
        "net_amount": "540.00",
        "number": "000041",
        "open_amount": "642.60",
        "prices_include_tax": false,
        "status": "open",
        "tax_amount": "102.60",
        "type": "invoice",
        "updated_at": "2026-11-21T10:05:00Z"
      }
    ],
    "pagination": {
      "count": 87,
      "page": 1,
      "pages": 4,
      "per_page": 25
    }
  }
}
```

### List payments

List one page of payments, newest first.

**Inputs**

- Invoice ID (`invoice_id`, number): Only payments of the invoice with this ID.
- Your own ID (`external_id`, text): Only the payment with this ID from your own system.
- Changed since (`updated_since`, date and time): Only payments changed at or after this time.
- Page (`page`, number): Which page to read, starting at 1. At least 1.
- Page size (`per_page`, number): How many records a page holds, up to 100. From 1 to 100.

**Outputs**

- `data` (object): The response from BillingEngine.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "amount": "642.60",
        "cancelled": false,
        "created_at": "2026-11-25T08:00:00Z",
        "currency": "EUR",
        "customer": {
          "id": 12,
          "name": "Muster GmbH"
        },
        "date": "2026-11-25",
        "external_id": "bank-tx-5531",
        "id": 77,
        "invoice_ids": [
          345
        ],
        "number": "77",
        "payment_method": "transfer",
        "updated_at": "2026-11-25T08:00:00Z"
      }
    ],
    "pagination": {
      "count": 87,
      "page": 1,
      "pages": 4,
      "per_page": 25
    }
  }
}
```

### List sales per article

List the quantity and amount invoiced per article, largest first.

**Inputs**

- From (`after`, date): The first day of the range. Leave empty for the start of this year.
- To (`before`, date): The last day of the range. Leave empty for the end of this year.
- Page (`page`, number): Which page to read, starting at 1. At least 1.
- Page size (`per_page`, number): How many records a page holds, up to 100. From 1 to 100.

**Outputs**

- `data` (object): The response from BillingEngine.

**Example output**

```json
{
  "data": {
    "after": "2026-01-01",
    "before": "2026-12-31",
    "currency": "EUR",
    "data": [
      {
        "article": {
          "id": 12,
          "name": "Consulting hour"
        },
        "gross": "5950.00",
        "net": "5000.00",
        "quantity": "6.0"
      }
    ],
    "pagination": {
      "count": 87,
      "page": 1,
      "pages": 4,
      "per_page": 25
    },
    "total": {
      "gross": "64260.00",
      "net": "54000.00"
    }
  }
}
```

### Record payment

Record a payment against one or more sent, open invoices of the same customer.

**Inputs**

- Amount (`amount`, number, required): The gross amount paid.
- Invoice IDs (`invoice_ids`, list, required): The IDs of the sent, open invoices it pays. They must be the same customer's.
- Date (`date`, date): When it was paid. Leave empty for today.
- Method (`payment_method`, text): How it was paid. One of: `transfer` (Bank transfer), `cash`.
- Your own ID (`external_id`, text): The payment's ID in your own system.

**Outputs**

- `data` (object): The response from BillingEngine.

**Example output**

```json
{
  "data": {
    "amount": "642.60",
    "cancelled": false,
    "created_at": "2026-11-25T08:00:00Z",
    "currency": "EUR",
    "customer": {
      "id": 12,
      "name": "Muster GmbH"
    },
    "date": "2026-11-25",
    "external_id": "bank-tx-5531",
    "id": 77,
    "invoice_ids": [
      345
    ],
    "number": "77",
    "payment_method": "transfer",
    "updated_at": "2026-11-25T08:00:00Z"
  }
}
```

### Update customer

Change a customer's details. Fields you leave empty stay as they are.

**Inputs**

- Customer (`id`, number, required): The customer to change.
- Company (`company`, text): The company name. A new customer needs a company or a last name.
- First name (`first_name`, text): The contact's first name.
- Last name (`last_name`, text): The contact's last name.
- Email (`email`, text): The email address invoices go to.
- Phone (`phone`, text): A phone number.
- VAT number (`vat_number`, text): The customer's VAT number.
- Buyer reference (`buyer_reference`, text): The buyer reference for e-invoices, such as a Leitweg-ID.
- Customer type (`customer_type`, text): Whether the customer is a business or a consumer. Leave empty for your account's default. One of: `business`, `consumer`.
- Title (`title`, text): An academic or professional title, such as Dr.
- Salutation (`salutation`, text): How to address the customer. One of: `male` (Mr), `female` (Ms), `family`.
- Your own ID (`external_id`, text): The customer's ID in your own system. It must be unique.
- Street (`line_1`, text): The first address line.
- Address line 2 (`line_2`, text): The second address line.
- Postal code (`postal_code`, text): The postal code.
- City (`city`, text): The city.
- Region (`region`, text): The region or state.
- Country (`country`, text): The two-letter ISO country code, such as DE.

**Outputs**

- `data` (object): The response from BillingEngine.

**Example output**

```json
{
  "data": {
    "address": {
      "city": "Berlin",
      "country": "DE",
      "line_1": "Hauptstra\u00dfe 1",
      "line_2": "2. OG",
      "postal_code": "10115",
      "region": "Berlin"
    },
    "buyer_reference": "991-12345-67",
    "company": "Muster GmbH",
    "created_at": "2026-11-02T09:15:00Z",
    "customer_type": "business",
    "email": "anna@muster.example",
    "external_id": "crm-4711",
    "first_name": "Anna",
    "id": 12,
    "last_name": "Muster",
    "name": "Muster GmbH",
    "number": "10012",
    "phone": "+49 30 1234567",
    "salutation": "female",
    "title": "Dr.",
    "updated_at": "2026-11-20T14:03:00Z",
    "vat_number": "DE123456789"
  }
}
```

### Update draft invoice

Change a draft invoice. Fields you leave empty stay as they are.

**Inputs**

- Invoice ID (`id`, number, required): The ID of the draft invoice to change.
- Customer (`customer_id`, number): The customer to invoice.
- Items (`items`, list): The invoice's lines, each with a name and a price. They replace all the draft's items.
- Invoice date (`date`, date): The invoice date. Leave empty for today.
- Days to pay (`due_days`, number): How many days the customer has to pay. At least 0.
- Opening text (`opening_text`, text): Text shown before the items.
- Closing text (`closing_text`, text): Text shown after the items.
- Service from (`service_period_start_date`, date): The first day of the service period.
- Service to (`service_period_end_date`, date): The last day of the service period.
- Purchase order number (`purchase_order_number`, text): The customer's purchase order number, printed on the invoice.
- Your own ID (`external_id`, text): The invoice's ID in your own system. An ID used before is refused, so a repeat can't create it twice.

**Outputs**

- `data` (object): The response from BillingEngine.

**Example output**

```json
{
  "data": {
    "cancelled": false,
    "closing_text": "Please pay within 14 days.",
    "created_at": "2026-11-21T10:00:00Z",
    "currency": "EUR",
    "customer": {
      "id": 12,
      "name": "Muster GmbH"
    },
    "date": "2026-11-21",
    "delivery_status": "sent",
    "due_date": "2026-12-05",
    "external_id": "order-9001",
    "gross_amount": "642.60",
    "id": 345,
    "items": [
      {
        "article_number": "A-100",
        "description": "On-site workshop",
        "name": "Consulting",
        "number": 1,
        "price": "90.00",
        "quantity": 6.0,
        "tax_rate": 19.0,
        "total": "540.00",
        "unit_code": "HUR"
      }
    ],
    "language": "de",
    "net_amount": "540.00",
    "number": "000041",
    "open_amount": "642.60",
    "opening_text": "Thank you for your order.",
    "prices_include_tax": false,
    "purchase_order_number": "PO-2211",
    "service_period_end_date": "2026-11-30",
    "service_period_start_date": "2026-11-01",
    "status": "open",
    "tax_amount": "102.60",
    "tax_breakdown": [
      {
        "net_amount": "540.00",
        "tax_amount": "102.60",
        "tax_rate": 19.0
      }
    ],
    "type": "invoice",
    "updated_at": "2026-11-21T10:05:00Z",
    "vat_treatment": "standard"
  }
}
```
