# BRAINIAC Commercial Invoice Validator

> BRAINIAC Commercial Invoice Validator is a paid API for AI agents from www.brainiac.software, paid per call via x402, $0.05/call, status unknown (last checked 2026-11-17).

Validates and cross-checks a freight commercial invoice document against shipment data, flagging inconsistencies in parties, line items, HS codes, amounts, and trade terms.

## Facts

- Endpoint: POST https://www.brainiac.software/api/v1/freight-customs/commercial-invoice-validate?utm_source=zero.xyz
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-17
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/brainiac-commercial-invoice-validator-8dbe8b49
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_4_r8ElT_fC7H1Z6oBZ_eU

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability brainiac-commercial-invoice-validator-8dbe8b49 -d '<json body>'
```

Example prompt: Can you check this commercial invoice PDF for consistency — validate the line items, HS codes, parties, and total amount against the shipment data: seller is Harbor Ink LLC, buyer is Northwind Paper Ltd, 100 pcs of cotton t-shirts at £12 each under HS code 6109100010, GBP currency, incoterm CIF?

## When to prefer this

Use this endpoint when you need to verify internal consistency of a commercial invoice and cross-check it against known shipment data before customs filing or carrier submission. It is purpose-built for freight trade document validation rather than general OCR or document parsing. Prefer it when you need structured findings, calculated vs stated totals, and trade-specific field extraction (HS codes, incoterms, parties by role) in a single call without setting up an account.

## Known failure modes

- File too large or unsupported media type — returns validation error
- Invoice document is unreadable or corrupt PDF — may return empty parsed fields
- Truncated base64 input — schema minLength/maxLength violations
- Missing required 'description' on line items — schema rejection
- Ambiguous or non-standard invoice layout may reduce parsing accuracy
- Currency code not matching ISO 3-letter pattern — schema rejection
- More than 80 line items submitted — rejected by schema maxItems

## How this service works

Pay-per-call APIs for AI agents: OFAC sanctions screening, compliance checks, token security, and Base chain data via x402. No account. Fixed USDC price. MCP-ready.

## Output

Returns a JSON object with the parsed invoice fields (line items, parties, currency, incoterm, dates, totals), a 'status' field (e.g. 'consistent' or indicating issues), a 'findings' array listing any detected discrepancies or errors, a 'calculatedAmount' vs 'totalAmount' comparison, flags for whether a customs declaration was submitted or shipment was booked, and a 'limitations' list clarifying what was and wasn't checked.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "file": {
   "type": "object",
   "required": [
    "mediaType",
    "fileBase64"
   ],
   "properties": {
    "filename": {
     "type": "string",
     "maxLength": 180,
     "minLength": 1
    },
    "mediaType": {
     "enum": [
      "application/pdf",
      "text/plain"
     ],
     "type": "string"
    },
    "fileBase64": {
     "type": "string",
     "maxLength": 12000000,
     "minLength": 1
    }
   },
   "additionalProperties": false
  },
  "text": {
   "type": "string",
   "maxLength": 200000,
   "minLength": 1
  },
  "shipment": {
   "type": "object",
   "properties": {
    "lines": {
     "type": "array",
     "items": {
      "type": "object",
      "required": [
       "description"
      ],
      "properties": {
       "unit": {
        "type": "string",
        "maxLength": 20,
        "minLength": 1
       },
       "amount": {
        "type": "number",
        "maximum": 1000000000000,
        "minimum": 0
       },
       "hsCode": {
        "type": "string",
        "maxLength": 14,
        "minLength": 4
       },
       "packages": {
        "type": "integer",
        "maximum": 1000000,
        "minimum": 0
       },
       "quantity": {
        "type": "number",
        "maximum": 1000000000,
        "exclusiveMinimum": 0
       },
       "volumeM3": {
        "type": "number",
        "maximum": 1000000,
        "minimum": 0
       },
       "unitPrice": {
        "type": "number",
        "maximum": 1000000000000,
        "minimum": 0
       },
       "description": {
        "type": "string",
        "maxLength": 300,
        "minLength": 1
       },
       "netWeightKg": {
        "type": "number",
        "maximum": 1000000000,
        "minimum": 0
       },
       "grossWeightKg": {
        "type": "number",
        "maximum": 1000000000,
        "minimum": 0
       }
      },
      "additionalProperties": false
     },
     "maxItems": 80
    },
    "vessel": {
     "type": "string",
     "maxLength": 120,
     "minLength": 1
    },
    "voyage": {
     "type": "string",
     "maxLength": 40,
     "minLength": 1
    },
    "parties": {
     "type": "array",
     "items": {
      "type": "object",
      "required": [
       "role",
       "name"
      ],
      "properties": {
       "name": {
        "type": "string",
        "maxLength": 200,
        "minLength": 1
       },
       "role": {
        "enum": [
         "seller",
         "exporter",
         "buyer",
         "importer
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "lines": [
   {
    "unit": "pcs",
    "amount": 1200,
    "hsCode": "6109100010",
    "packages": null,
    "quantity": 100,
    "volumeM3": null,
    "unitPrice": 12,
    "description": "Cotton t-shirts",
    "netWeightKg": 40,
    "grossWeightKg": 46
   }
  ],
  "status": "consistent",
  "vessel": "",
  "voyage": "",
  "parties": [
   {
    "name": "Harbor Ink LLC",
    "role": "seller",
    "address": ""
   },
   {
    "name": "Northwind Paper Ltd",
    "role": "buyer",
    "address": ""
   }
  ],
  "currency": "GBP",
  "findings": [],
  "incoterm": "",
  "checkedAt": "2026-11-02T19:00:00.000Z",
  "reference": "",
  "namedPlace": "",
  "invoiceDate": "",
  "limitations": [
   "No customs declaration was submitted and no shipment was booked.",
   "Duty rates, restrictions, sanctions status, and country-specific requirements are not invented.",
   "An HS code candidate is not a customs classification.",
   "Only the documents and shipment fields in this request are compared."
  ],
  "totalAmount": 1200,
  "documentType": "commercial_invoice",
  "incotermYear": "",
  "invoiceNumber": "CI-1001",
  "originCountry": "",
  "portOfLoading": "",
  "totalPackages": null,
  "totalVolumeM3": null,
  "shipmentBooked": false,
  "containerNumber": "",
  "portOfDischarge": "",
  "calculatedAmount": 1200,
  "totalNetWeightKg": null,
  "billOfLadingNumber": "",
  "destinationCountry": "",
  "totalGrossWeightKg": null,
  "declarationSubmitted": false
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/brainiac-commercial-invoice-validator-8dbe8b49/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from www.brainiac.software](https://www.zero.xyz/host/www.brainiac.software/llms.txt)
