Skip to content

HINTERLAND-software/lambda.billing-api

Repository files navigation

lambda.billing-api

This lambda fetches time entries with the label billable of Toggl, aggregates the data, sets the tasks to billed and creates draft invoices with Debitoor.

Environment variables

# Settings for the billing task
export TOGGL_API_TOKEN="<toggl_api_token>"
export DEBITOOR_API_TOKEN="<debitoor_api_token>"

Payload

{
  // Should invoices be created
  "dryRun": true,
  "setBilled": false,
  // Optional - run for a specific range
  "range": {
    "month": 8,
    "year": 2020,
    "from": "ISODATE",
    "to": "ISODATE"
  },
  // Optional - run only for specific customers
  "customerWhitelist": [
      "ACME"
  ],
  // Optional - skip for specific customers
  "customerBlacklist": [
      "EMCA"
  ],
  // Optional - run only for entries with specific labels
  "labelWhitelist": [
    "billable"
  ],
  // Optional - skip for entries with specific labels
  "labelBlacklist": [
    "billed"
  ]
}

TODO

  • CiCd
  • Tests
  • E2E Tests
  • development deploy
  • production deploy