# JP Invoice Check - Japanese Qualified Invoice Checker (MCP) (`nexus-tools/jp-invoice-check-apify`) Actor

Check a Japanese qualified invoice (適格請求書) before you pay or send it: the six required items, the T-number format and check digit, reduced-rate marks, and consumption tax rounded once per rate (not per line). MCP server for AI agents. $2 per 1,000 checks; bad input is free.

- **URL**: https://apify.com/nexus-tools/jp-invoice-check-apify.md
- **Developed by:** [NEXUS tools](https://apify.com/nexus-tools) (community)
- **Features:** 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 invoice checked

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/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

## JP Invoice Check — Japanese qualified invoice checker for AI agents (MCP)

Checks a Japanese qualified invoice (適格請求書) before an agent sends or accepts it:

- the six items the National Tax Agency requires (issuer name + registration number, date, description with reduced-rate marks, total per tax rate, tax per tax rate, buyer name)
- consumption tax rounded **once per invoice per rate**, not per line. Summing per-line rounded tax is a common agent mistake; the checker returns it as a named error (code, field, English and Japanese message)
- the format and check digit of the registration number (T + 13 digits). It does not look up whether the number is currently registered.

Deterministic. Python standard library only. The invoice is not stored or sent anywhere.

### Connect (MCP, streamable HTTP)

This Actor runs in Standby mode. Use the MCP URL that Apify shows on this Actor's page (Standby URL + `/mcp`) with your Apify API token, in any MCP client that supports remote servers.

Tools:

| Tool | What it does | Charged |
|---|---|---|
| `jp_invoice_check` | Full check of one invoice (`role`: `issue` for invoices you send, `receive` for a supplier's) | yes, event `invoice-checked` |
| `jp_invoice_tax` | Tax for one rate on one invoice (floor / half_up / ceil, exclusive / inclusive) | no |
| `jp_invoice_registration_number` | Normalize and check a registration number | no |
| `jp_invoice_checker_info` | Version and sha256 of the checking code | no |

Only successful `jp_invoice_check` calls are charged. Errors and the other tools are free.

### Run it as a normal Actor run (batch)

Put invoices in the `invoices` input (JSON list) and start a normal run from Console, the API or a schedule.
Each invoice becomes one dataset item with `ok`, the named errors and warnings (English and Japanese), and the checker version.
With no invoices, one built-in sample is checked and **not charged** (this is also what Apify's daily test runs).
Each checked invoice from your input is one `invoice-checked` event ($2.00 / 1,000). A bad input fails the run before anything is charged.

Example result item (shortened):

```json
{"ok": false, "errors": [{"level": "error", "code": "E_TAX_MISMATCH", "field": "totals[10].tax", "message": "10% tax 205 does not match: expected 199 (floor), 200 (half_up), 200 (ceil).", "message_ja": "10%の税額 205 が合いません。正しくは 199(floor), 200(half_up), 200(ceil)。"}], "warnings": [], "index": 1, "sample": false}
```

### Run it yourself for free

The same checker is open source (MIT): https://github.com/japan-ai-tools/jp-invoice-check

```
pip install jp-invoice-check        # stdio MCP server: jp-invoice-check
python -m jpinvoice.http_server     # MCP over HTTP on 127.0.0.1:8765/mcp (from the GitHub source)
```

### Network

The only outgoing call is Apify's own charge API (`POST https://api.apify.com/v2/actor-runs/{runId}/charge`, https://docs.apify.com/api/v2/post-charge-run), made from inside the Apify run after a successful `jp_invoice_check`. It sends the event name, the count (1) and Apify's request id, never the invoice. Outside Apify (no `ACTOR_RUN_ID` / `APIFY_TOKEN`) nothing is sent anywhere. No web pages are fetched.

### Limits

- It checks the invoice you send it. It does not read PDFs or images; pass the fields as JSON.
- It is a checking tool, not tax advice. Rules: National Tax Agency leaflet on qualified invoices (https://www.nta.go.jp/publication/pamph/shohi/shohizei_11.pdf).

***

### 日本語

AIエージェントが請求書を出す前・受け取る前に、適格請求書の記載事項6つと「税率ごとに1回」の端数処理を検査する MCP サーバーです。品目ごとに丸めた税を足す誤りを、名前つきで返します。登録番号は形と検査用数字だけを確かめます(登録の有無は照会しません)。

- 課金されるのは `jp_invoice_check` が成功したときだけ(イベント名 `invoice-checked`)。ほかの道具とエラーは無料です
- 同じ道具は GitHub と PyPI で無料(MIT)。自分のPCで動かせます
- 税の助言ではありません

# Actor input Schema

## `invoices` (type: `array`):

A list of invoices (JSON). Each one: issuer {name, registration_number}, date, buyer {name}, price_basis (exclusive|inclusive), items \[{description, amount, rate, reduced}], totals \[{rate, amount, tax}]. Leave empty to check one built-in sample (not charged). Up to 1,000 per run; each checked invoice is one `invoice-checked` event.

## `role` (type: `string`):

issue = invoices you send; receive = invoices from a supplier.

## Actor input object example

```json
{
  "invoices": [
    {
      "issuer": {
        "name": "株式会社サンプル商事",
        "registration_number": "T7123456789012"
      },
      "date": "2026-10-28",
      "buyer": {
        "name": "株式会社テスト"
      },
      "price_basis": "exclusive",
      "items": [
        {
          "description": "コピー用紙",
          "amount": 1999,
          "rate": 10
        },
        {
          "description": "※ お茶",
          "amount": 1234,
          "rate": 8,
          "reduced": true
        }
      ],
      "totals": [
        {
          "rate": 10,
          "amount": 1999,
          "tax": 199
        },
        {
          "rate": 8,
          "amount": 1234,
          "tax": 98
        }
      ]
    }
  ],
  "role": "issue"
}
```

# Actor output Schema

## `results` (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 = {
    "invoices": [
        {
            "issuer": {
                "name": "株式会社サンプル商事",
                "registration_number": "T7123456789012"
            },
            "date": "2026-10-28",
            "buyer": {
                "name": "株式会社テスト"
            },
            "price_basis": "exclusive",
            "items": [
                {
                    "description": "コピー用紙",
                    "amount": 1999,
                    "rate": 10
                },
                {
                    "description": "※ お茶",
                    "amount": 1234,
                    "rate": 8,
                    "reduced": true
                }
            ],
            "totals": [
                {
                    "rate": 10,
                    "amount": 1999,
                    "tax": 199
                },
                {
                    "rate": 8,
                    "amount": 1234,
                    "tax": 98
                }
            ]
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("nexus-tools/jp-invoice-check-apify").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 = { "invoices": [{
            "issuer": {
                "name": "株式会社サンプル商事",
                "registration_number": "T7123456789012",
            },
            "date": "2026-10-28",
            "buyer": { "name": "株式会社テスト" },
            "price_basis": "exclusive",
            "items": [
                {
                    "description": "コピー用紙",
                    "amount": 1999,
                    "rate": 10,
                },
                {
                    "description": "※ お茶",
                    "amount": 1234,
                    "rate": 8,
                    "reduced": True,
                },
            ],
            "totals": [
                {
                    "rate": 10,
                    "amount": 1999,
                    "tax": 199,
                },
                {
                    "rate": 8,
                    "amount": 1234,
                    "tax": 98,
                },
            ],
        }] }

# Run the Actor and wait for it to finish
run = client.actor("nexus-tools/jp-invoice-check-apify").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 '{
  "invoices": [
    {
      "issuer": {
        "name": "株式会社サンプル商事",
        "registration_number": "T7123456789012"
      },
      "date": "2026-10-28",
      "buyer": {
        "name": "株式会社テスト"
      },
      "price_basis": "exclusive",
      "items": [
        {
          "description": "コピー用紙",
          "amount": 1999,
          "rate": 10
        },
        {
          "description": "※ お茶",
          "amount": 1234,
          "rate": 8,
          "reduced": true
        }
      ],
      "totals": [
        {
          "rate": 10,
          "amount": 1999,
          "tax": 199
        },
        {
          "rate": 8,
          "amount": 1234,
          "tax": 98
        }
      ]
    }
  ]
}' |
apify call nexus-tools/jp-invoice-check-apify --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nexus-tools/jp-invoice-check-apify"
        }
    }
}
```

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/5mlLqnyKfeEcfDjtE/builds/n9WmD2452DvgRVBpl/openapi.json
