# UK VAT and Price Normaliser (`landlordtools/uk-vat-price-normaliser`) Actor

Batch GBP net, VAT and gross arithmetic using an explicitly supplied rate and exact decimal rounding.

- **URL**: https://apify.com/landlordtools/uk-vat-price-normaliser.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 $2.00 / 1,000 vat calculations

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

## UK VAT and Price Normaliser

Batch GBP net, VAT and gross arithmetic using an explicitly supplied rate and exact decimal rounding.

### Inputs and calculation

Provide a GBP amount as a decimal **string**, `basis` (`net` or `gross`) and an explicit `rate` of 0, 5 or 20. Those rates correspond to the zero, reduced and standard rates listed by GOV.UK.[1](https://www.gov.uk/vat-rates) The Actor does not choose which rate applies to a transaction.

For net input: VAT = amount × rate / 100, rounded to pennies; gross = net + VAT. For gross input: VAT = amount × rate / (100 + rate), rounded to pennies; net = gross − VAT. Exact integer arithmetic rounds ties away from zero. All returned money fields are strings with two decimal places. This is a stated calculation convention, not a claim that every invoice must use this rounding method.

Zero, credit amounts and amounts up to 9,999,999,999.99 in magnitude are accepted. No currency symbols, commas, scientific notation, discounts, quantities or implicit defaults. Each row is one already-totalled line; sum of line-rounded VAT can differ from VAT rounded on an invoice total. Rate 0 is arithmetic only and does not classify exemptions. Historical rates, VAT eligibility, reverse charge, registration checks and tax filing are outside scope. Not legal or tax advice.

### Example

```json
{
  "items": [
    {
      "amount": "120.00",
      "basis": "gross",
      "rate": 20
    }
  ]
}
```

The dataset and local CLI return these rows:

```json
[
  {
    "rowIndex": 0,
    "amount": "120.00",
    "basis": "gross",
    "rate": 20,
    "net": "100.00",
    "vat": "20.00",
    "gross": "120.00",
    "currency": "GBP",
    "rounding": "half-away-from-zero; per row"
  }
]
```

### 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: **$2 per 1,000 stored results** ($0.002 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

Contains public sector information licensed under the Open Government Licence v3.0. GOV.UK makes its content available under OGL except where stated otherwise; see the numbered GOV.UK terms source below. Licence: https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/. No external data is fetched at runtime.

1. [GOV.UK VAT rates](https://www.gov.uk/vat-rates) — accessed 2026-10-03. Open Government Licence v3.0.
2. [GOV.UK terms and conditions](https://www.gov.uk/help/terms-conditions) — accessed 2026-10-03. Open Government Licence v3.0.

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": [
    {
      "amount": "120.00",
      "basis": "gross",
      "rate": 20
    }
  ]
}
```

# 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": [
        {
            "amount": "120.00",
            "basis": "gross",
            "rate": 20
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("landlordtools/uk-vat-price-normaliser").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": [{
            "amount": "120.00",
            "basis": "gross",
            "rate": 20,
        }] }

# Run the Actor and wait for it to finish
run = client.actor("landlordtools/uk-vat-price-normaliser").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": [
    {
      "amount": "120.00",
      "basis": "gross",
      "rate": 20
    }
  ]
}' |
apify call landlordtools/uk-vat-price-normaliser --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,landlordtools/uk-vat-price-normaliser"
        }
    }
}
```

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/u1EVnAeqhSOlMs1uj/builds/HlJtMP7MEJDifMo2k/openapi.json
