# BRAINIAC Stablecoin Payment Reconciliation API

> BRAINIAC Stablecoin Payment Reconciliation API 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-13).

Reconciles a list of on-chain stablecoin payments against invoices, reporting matched, unmatched, overpaid, underpaid, and outstanding amounts.

## Facts

- Endpoint: POST https://www.brainiac.software/api/v1/crypto-payments/stablecoin-payment-reconcile?utm_source=zero.xyz
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/brainiac-stablecoin-payment-reconciliation-api-33952a90
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ZEVrUO3lEzJpJMKQsc9zG

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-stablecoin-payment-reconciliation-api-33952a90 -d '<json body>'
```

Example prompt: Reconcile these invoices against the payments I have: invoice INV-100 expects 1,000,000 USDC units from recipient 0x1111...1111 on Base (chain 8453, 6 decimals), and I received two payments of 600,000 and 300,000 units — allow partial payments and use a tolerance of 1%.

## When to prefer this

Use this endpoint when you need to reconcile a known set of on-chain stablecoin payments against structured invoices without reading from the chain directly — ideal when you already have payment records (from blockchain indexers, wallets, or logs) and want to compute settlement status, partial payment aggregation, and outstanding balances in a single call. Prefer this over manual arithmetic or general-purpose code execution when dealing with multi-payment, multi-invoice scenarios requiring tolerance rules and partial payment handling.

## Known failure modes

- Invoice or payment missing required fields (id, amount, decimals, token, chainId, recipient) returns validation error
- Mismatched token addresses or chain IDs between invoice and payment cause payments to go unmatched
- invoiceId not set on payment and associateUnlabeledPayments is 'none' leaves payments unmatched
- More than 40 invoices or 100 payments exceeds array limits and returns schema error
- Invalid Ethereum address format (not 0x + 40 hex chars) causes input rejection
- Amount precision or decimals mismatch leads to incorrect outstanding calculations

## How this service works

Reconcile caller-supplied stablecoin payment records against invoices. Compares amounts, token, recipient, and chain ID, and reports underpayments, overpayments, duplicate transaction hashes, and payments that are not linked to an invoice. reconciliation_status is matched, underpaid, overpaid, duplicate, mismatched, or incomplete. Amounts are integers in smallest units. No chain is queried, and a transaction hash is not treated as confirmation that funds arrived.

## Output

Returns a reconciliation report with per-invoice status (matched, underpaid, overpaid, outstanding), matched and unmatched payment lists with applied amounts, aggregate received and outstanding totals, finding codes with severity levels (e.g. 'underpaid', 'not_associated'), and a limitations section clarifying the off-chain nature of the computation.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "rules": {
   "type": "object",
   "properties": {
    "tolerance": {
     "type": "string"
    },
    "allowPartial": {
     "type": "boolean"
    },
    "associateUnlabeledPayments": {
     "enum": [
      "none",
      "single_invoice"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "invoices": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "id",
     "amount",
     "decimals",
     "token",
     "chainId",
     "recipient"
    ],
    "properties": {
     "id": {
      "type": "string",
      "maxLength": 80,
      "minLength": 1
     },
     "token": {
      "type": "string",
      "pattern": "^0x[0-9a-fA-F]{40}$"
     },
     "amount": {
      "type": "string"
     },
     "chainId": {
      "type": "integer",
      "maximum": 2147483647,
      "exclusiveMinimum": 0
     },
     "decimals": {
      "type": "integer",
      "maximum": 36,
      "minimum": 0
     },
     "recipient": {
      "type": "string",
      "pattern": "^0x[0-9a-fA-F]{40}$"
     },
     "tolerance": {
      "type": "string"
     }
    },
    "additionalProperties": false
   },
   "maxItems": 40,
   "minItems": 1
  },
  "payments": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "amount",
     "decimals",
     "token",
     "chainId",
     "recipient"
    ],
    "properties": {
     "id": {
      "type": "string",
      "maxLength": 80,
      "minLength": 1
     },
     "token": {
      "type": "string",
      "pattern": "^0x[0-9a-fA-F]{40}$"
     },
     "amount": {
      "type": "string"
     },
     "chainId": {
      "type": "integer",
      "maximum": 2147483647,
      "exclusiveMinimum": 0
     },
     "decimals": {
      "type": "integer",
      "maximum": 36,
      "minimum": 0
     },
     "invoiceId": {
      "type": "string",
      "maxLength": 80,
      "minLength": 1
     },
     "recipient": {
      "type": "string",
      "pattern": "^0x[0-9a-fA-F]{40}$"
     },
     "timestamp": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,3})?Z$"
     },
     "transactionHash": {
      "type": "string",
      "pattern": "^0x[0-9a-fA-F]{64}$"
     }
    },
    "additionalProperties": false
   },
   "maxItems": 100
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "findings": [
   {
    "code": "not_associated",
    "detail": "A payment has no invoice id, so it was not applied.",
    "severity": "medium"
   },
   {
    "code": "underpaid",
    "detail": "Invoice INV-100 received 900000 of 1000000 in its smallest units.",
    "severity": "medium",
    "invoice_id": "INV-100"
   }
  ],
  "invoices": [
   {
    "invoice_id": "INV-100",
    "expected_amount": "1000000",
    "received_amount": "900000",
    "outstanding_amount": "100000",
    "reconciliation_status": "underpaid"
   }
  ],
  "limitations": [
   "Only the invoice and payment records in this request were compared. No balance or transaction was read from a chain.",
   "A transaction hash is not confirmation that funds arrived or that the transfer is final.",
   "Amounts are integers in each record's smallest unit. They are scaled by the supplied decimals with integer arithmetic.",
   "A payment is applied to an invoice only when invoiceId matches, or when associateUnlabeledPayments is single_invoice and the request contains one invoice.",
   "Partial payments are added together unless rules.allowPartial is false.",
   "Timestamps were not checked against a block time."
  ],
  "expected_amount": "1000000",
  "received_amount": "900000",
  "matched_payments": [
   {
    "token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
    "amount": "600000",
    "chain_id": 8453,
    "decimals": 6,
    "recipient": "0x1111111111111111111111111111111111111111",
    "timestamp": "2026-11-05T12:00:00.000Z",
    "invoice_id": "INV-100",
    "payment_id": "p1",
    "applied_amount": "600000",
    "transaction_hash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
   },
   {
    "token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
    "amount": "300000",
    "chain_id": 8453,
    "decimals": 6,
    "recipient": "0x1111111111111111111111111111111111111111",
    "invoice_id": "INV-100",
    "payment_id": "p2",
    "applied_amount": "300000",
    "transaction_hash": "0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
   }
  ],
  "outstanding_amount": "100000",
  "unmatched_payments": [
   {
    "token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
    "amount": "1000000",
    "reason": "not_associated",
    "chain_id": 8453,
    "decimals": 6,
    "recipient": "0x2222222222222222222222222222222222222222",
    "payment_id": "p3",
    "transaction_hash": "0xcccccccccccccccccccccccccccccccccccccccccccccccccc
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/brainiac-stablecoin-payment-reconciliation-api-33952a90/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)
