# Invoice Terms Date Helper (`landlordtools/invoice-terms-date-helper`) Actor

Batch explicit net-day and end-of-month invoice dates, with date-only ageing and optional weekend rolling.

- **URL**: https://apify.com/landlordtools/invoice-terms-date-helper.md
- **Developed by:** [LandlordTools](https://apify.com/landlordtools) (community)
- **Categories:** Business, Developer tools
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 invoice date results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Invoice Terms Date Helper

Not legal or tax advice.

Batch explicit net-day and end-of-month invoice dates, with date-only ageing and optional weekend rolling.

### Inputs and calculation

For each row, supply `invoiceDate` and `asOfDate` as real YYYY-MM-DD dates (years 1000–9999), an explicit `term` and `days` (integer 0–3660). No default date is taken from the clock.

`net-days` adds calendar days to the invoice date, excluding the starting date when days is positive. `end-of-month-plus-days` first selects the final date of the invoice month, then adds calendar days. These are the Actor’s explicit conventions; they do not interpret a contract or infer what free-text terms mean. Zero days means the base date itself.

`weekendRoll` is `none` by default. `following-monday` moves a Saturday or Sunday result to Monday; bank holidays are **not** considered. Due dates outside the supported year range are rejected.

Results include the base date, unadjusted and adjusted due dates, signed `daysUntilDue` (negative after the due date), non-negative `daysOverdue`, and `status` (`not-due`, `due-today`, `overdue`). Ageing compares calendar dates only and assumes no settlement information. It is not a statement that money remains unpaid. No interest, statutory deadlines, notice periods or legal entitlement are calculated. No invoice contents or customer details are accepted.

### Example

```json
{
  "items": [
    {
      "invoiceDate": "2026-01-15",
      "asOfDate": "2026-03-03",
      "term": "end-of-month-plus-days",
      "days": 30,
      "weekendRoll": "following-monday"
    }
  ]
}
```

The dataset and local CLI return these rows:

```json
[
  {
    "rowIndex": 0,
    "invoiceDate": "2026-01-15",
    "asOfDate": "2026-03-03",
    "term": "end-of-month-plus-days",
    "days": 30,
    "weekendRoll": "following-monday",
    "baseDate": "2026-01-31",
    "unadjustedDueDate": "2026-03-02",
    "dueDate": "2026-03-02",
    "daysUntilDue": -1,
    "daysOverdue": 1,
    "status": "overdue"
  }
]
```

### Batch and output behaviour

Supply 1–10,000 items. Unknown fields are rejected. Validation finishes for the whole batch before storage or billing. One invalid row fails the run with its zero-based index; input values are not included in the error. Duplicate rows are preserved and each stored row counts as a result. `rowIndex` preserves input order.

The Apify dataset holds results. The key-value store record `OUTPUT` contains `requestedCount`, `storedCount`, `truncated` and `results`. A configured charge limit may shorten the dataset; OUTPUT includes only those saved rows. Start a fresh run after an interruption: a non-empty dataset is rejected to prevent duplicate billing. Storage and billing are not a single transaction; infrastructure failures can leave partial storage or a charge requiring platform review.

### Local use and tests

```text
node cli.js examples/input.json
node tests/run.js
```

These commands need only Node and use no network or SDK installation. The deployment target is Node 22. `main.js` uses the Apify SDK for platform storage and billing. The container installs the declared dependency during a future build.

### Pricing suggestion

Suggested pay-per-event price: **$1 per 1,000 stored results** ($0.001 per `result-item` event). No custom start fee. This is a proposed configuration, not active pricing. The manager must configure the exact event name and price in Apify before any release. The SDK call uses `Actor.pushData(results, "result-item")`; do not also add a separate charge for those rows. [Apify billing documentation](https://docs.apify.com/sdk/js/docs/concepts/pay-per-event) (accessed 2026-10-03).

### Sources and data licences

No external dataset is used or redistributed. The cited API documentation is a reference for the workflow only. Calendar arithmetic is implemented locally.

1. [Stripe invoice API: due-date fields](https://docs.stripe.com/api/invoices/object) — accessed 2026-10-03. Reference only; no Stripe data or text bundled.

AI-generated software draft for LandlordTools; manager review required before release.

# Actor input Schema

## `items` (type: `array`):

See README for field semantics and limits.

## Actor input object example

```json
{
  "items": [
    {
      "invoiceDate": "2026-01-15",
      "asOfDate": "2026-03-03",
      "term": "end-of-month-plus-days",
      "days": 30,
      "weekendRoll": "following-monday"
    }
  ]
}
```

# Actor output Schema

## `result` (type: `string`):

No description

## `output` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "items": [
        {
            "invoiceDate": "2026-01-15",
            "asOfDate": "2026-03-03",
            "term": "end-of-month-plus-days",
            "days": 30,
            "weekendRoll": "following-monday"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("landlordtools/invoice-terms-date-helper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "items": [{
            "invoiceDate": "2026-01-15",
            "asOfDate": "2026-03-03",
            "term": "end-of-month-plus-days",
            "days": 30,
            "weekendRoll": "following-monday",
        }] }

# Run the Actor and wait for it to finish
run = client.actor("landlordtools/invoice-terms-date-helper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "items": [
    {
      "invoiceDate": "2026-01-15",
      "asOfDate": "2026-03-03",
      "term": "end-of-month-plus-days",
      "days": 30,
      "weekendRoll": "following-monday"
    }
  ]
}' |
apify call landlordtools/invoice-terms-date-helper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,landlordtools/invoice-terms-date-helper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/dRaaRvDOzVlECIZg2/builds/8vkIjvCYydxCEN6Cz/openapi.json
