Skip to Content
TimeWren Docs
Integrations

Billy

Connect Billy, the Danish accounting system, to TimeWren: import contacts, export clients and invoices, and sync payment status.

Billy is a Danish accounting system. The integration needs no setup on the server: each user pastes their own Billy API key. Without a key, nothing Billy-related happens.

What it does

  • Imports Billy contacts as clients. Contacts already imported, or whose CVR number matches an existing client, are skipped.
  • Exports a client to Billy.
  • Exports an invoice to Billy as a draft, approved, or approved and sent by mail. You choose the product, payment terms and whether each time entry is its own line or all entries are combined into one line. The line text is a template.
  • Syncs the payment status back: invoices paid in Billy are marked as paid in TimeWren.

Billy requires a product on every invoice line. Choose a default product in the settings, or let TimeWren create one on the first export. You can choose a separate product for prepaid package hours.

Sending by email

When you choose to approve and send the invoice, TimeWren first shows a confirmation with the recipient, invoice number, amount including VAT, line count and due date as TimeWren calculates them. Billy calculates the final amount with its own VAT settings. If the invoice changes after you open the confirmation, TimeWren refuses to send it and you open the confirmation again.

The same invoice is never exported twice at once. If you click twice, or retry while the export is running, TimeWren refuses the second attempt, so Billy neither creates nor emails the invoice twice.

If Billy does not answer while the email is being sent, or TimeWren is interrupted in the middle of it, TimeWren cannot tell whether the client received the invoice. The invoice page then shows a warning, and the invoice cannot be sent again from TimeWren until you have checked the email status in Billy and marked whether it was sent.

If you delete the invoice in Billy, automatic status sync releases the link in TimeWren, but only when the connected Billy organization is provably the one the invoice was exported to: TimeWren recorded the organization at the export, or, for an invoice exported before that, the client has not changed since the day before the export and the client's contact still exists in the connected organization. Otherwise TimeWren keeps the link. A draft without a link can be exported again.

Server setup

Requirements on the server:

  • ENCRYPTION_KEY must be set. The API key is stored encrypted, and saving fails without the key. See Environment variables.
  • The cron container must be running. It calls /api/cron/invoice-sync every 15 minutes, which is what updates payment status for users who have automatic status sync turned on.

There are no Billy-specific client credentials to register.

Connect as a user

  1. In Billy, create an API key under Settings, Integrations, API.
  2. In TimeWren, open Settings, Integrations and paste the key in the Billy section.
  3. Save, then use Test connection.
  4. Choose the default product and line settings.
  5. Under Default accounting system, choose Billy if it is the one you use, and turn on Automatic status sync if you want payments picked up automatically. You can also run a manual sync from the same page.

Contacts are imported from the Sync page under Integrations. Invoices are exported from the invoice itself.

The key belongs to the user who saved it. In a team, each person who exports uses their own key.

Webhooks (optional)

The endpoint /api/webhooks/billy accepts Billy webhooks and marks an invoice as paid on invoice.paid. Set a secret on the server and configure the same secret in Billy; requests are verified with an HMAC-SHA256 signature in the x-billy-signature header:

BILLY_WEBHOOK_SECRET=a-long-random-string

TimeWren processes byte-identical signed deliveries once while their record is retained (90 days). A failed delivery can be processed again. This includes payment events received before TimeWren has saved the external invoice ID.

The endpoint finds the user by their stored Billy organization id. The web settings do not store it, so for most setups rely on the 15 minute sync above instead of webhooks.

On this page