WritersLogic Verifiable AI Agent Hub Invoice Audit API

The Invoice Audit API from WritersLogic Verifiable AI Agent Hub — 1 operation(s) for invoice audit.

GitHub OpenAPI

Operations 1

POST /api/v1/invoice-audit Invoice arithmetic audit: line extensions, discounts, supplied tax, totals… #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/writerslogic-com:writerslogic-com-invoice-audit-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

writerslogic-com-invoice-audit-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: WritersLogic Verifiable AI Agent Hub Invoice Audit API
  version: 2.0.0
  description: Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.
  contact:
    name: WritersLogic
    url: https://writerslogic.com/agents
    email: agents@writerslogic.com
servers:
- url: https://agents.writerslogic.com
tags:
- name: Invoice Audit
paths:
  /api/v1/invoice-audit:
    post:
      operationId: invoice_audit
      summary: 'Invoice arithmetic audit: line extensions, discounts, supplied tax, totals…'
      description: 'Recomputes up to 500 invoice lines in exact decimal arithmetic and compares them with the stated amounts, for an agent about to approve, pay or reconcile an invoice. Checks: quantity x unit price less discount equals the line amount; tax is taken as supplied (tax amounts are summed, never looked up) and, where a rate is given, tax equals rate x line amount under the declared rounding scope (per line, or per rate on the invoice); subtotal, discount total, tax total and grand total equal the sums. Each mismatch names the JSON path, the rule, the expected and actual minor units and the signed drift. Does not decide tax rates or jurisdictions, does not check vendor identity or purchase-order terms, and totals not stated are not checked.


        Price: 0.005 USDC on Base (x402).'
      x-x402-price-usdc: '0.005'
      x-x402-amount: '5000'
      x-payment-info:
        protocols:
        - x402
        price:
          mode: fixed
          currency: USD
          amount: '0.005'
      x-audience: business
      x-sample-url: https://agents.writerslogic.com/api/v1/samples/invoice-audit
      security:
      - x402: []
      - apiKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
              - lines
              properties:
                lines:
                  type: array
                  minItems: 1
                  maxItems: 500
                  items:
                    type: object
                    required:
                    - quantity
                    - unitPrice
                    - amount
                    properties:
                      id:
                        type: string
                        maxLength: 80
                      quantity:
                        type: string
                        pattern: ^-?\d{1,15}(\.\d{1,12})?$
                        maxLength: 30
                        description: 'Decimal string such as "-12.50" (up to 15 integer and 12 fraction digits). JSON numbers are not accepted: they are binary floats.'
                      unitPrice:
                        type: string
                        pattern: ^-?\d{1,15}(\.\d{1,12})?$
                        maxLength: 30
                        description: Price per unit in major units; sub-cent precision allowed.
                      amount:
                        type: string
                        pattern: ^-?\d{1,15}(\.\d{1,12})?$
                        maxLength: 30
                        description: Stated net line amount after the line discount.
                      discount:
                        type: string
                        pattern: ^-?\d{1,15}(\.\d{1,12})?$
                        maxLength: 30
                        description: Line discount as a positive amount in major units.
                      taxRate:
                        type: string
                        pattern: ^-?\d{1,15}(\.\d{1,12})?$
                        maxLength: 30
                        description: 'Tax rate in percent, e.g. "7.5". With taxAmount it is checked. A non-zero rate without taxAmount cannot be checked: the result is unknown, and no tax is inferred.'
                      taxAmount:
                        type: string
                        pattern: ^-?\d{1,15}(\.\d{1,12})?$
                        maxLength: 30
                        description: Tax on this line as supplied.
                    additionalProperties: false
                stated:
                  type: object
                  properties:
                    subtotal:
                      type: string
                      pattern: ^-?\d{1,15}(\.\d{1,12})?$
                      maxLength: 30
                      description: 'Decimal string such as "-12.50" (up to 15 integer and 12 fraction digits). JSON numbers are not accepted: they are binary floats.'
                    discountTotal:
                      type: string
                      pattern: ^-?\d{1,15}(\.\d{1,12})?$
                      maxLength: 30
                      description: Sum of line discounts.
                    taxTotal:
                      type: string
                      pattern: ^-?\d{1,15}(\.\d{1,12})?$
                      maxLength: 30
                      description: 'Decimal string such as "-12.50" (up to 15 integer and 12 fraction digits). JSON numbers are not accepted: they are binary floats.'
                    total:
                      type: string
                      pattern: ^-?\d{1,15}(\.\d{1,12})?$
                      maxLength: 30
                      description: Grand total; checked against subtotal + taxTotal.
                  additionalProperties: false
                currency:
                  type: string
                  pattern: ^[A-Z]{3}$
                  description: ISO 4217 alphabetic code, upper case.
                exponent:
                  type: integer
                  minimum: 0
                  maximum: 8
                rounding:
                  type: string
                  enum:
                  - half-up
                  - half-down
                  - half-even
                  - up
                  - down
                  - ceiling
                  - floor
                  description: 'Default half-up. half-up: ties away from zero. half-down: ties toward zero. half-even: ties to the even neighbour. up: away from zero. down: toward zero. ceiling: toward +infinity. floor: toward -infinity.'
                taxRounding:
                  type: string
                  enum:
                  - line
                  - invoice
                  description: 'line (default): each line''s tax is rounded on its own. invoice: tax is rounded once per distinct rate on the sum of the line amounts, and compared with the supplied tax sum for that rate.'
                toleranceMinor:
                  type: integer
                  minimum: 0
                  maximum: 1000
                  description: Largest absolute drift in minor units still treated as a match. Default 0.
            example:
              currency: USD
              lines:
              - id: A
                quantity: '3'
                unitPrice: '19.99'
                amount: '59.97'
                taxRate: '8'
                taxAmount: '4.80'
              - id: B
                quantity: '2'
                unitPrice: '5.005'
                amount: '10.01'
                taxRate: '8'
                taxAmount: '0.80'
              stated:
                subtotal: '69.98'
                taxTotal: '5.60'
                total: '75.58'
      responses:
        '200':
          description: Paid result with provenance
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      status:
                        type: string
                        enum:
                        - pass
                        - fail
                        - unknown
                        - unsupported
                        description: 'pass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass.'
                      mismatches:
                        type: array
                        items:
                          type: object
                          properties:
                            path:
                              type: string
                            rule:
                              type: string
                            expectedMinor:
                              type: integer
                            actualMinor:
                              type: integer
                            driftMinor:
                              type: integer
                              description: actual minus expected.
                          description: Integers are exact below 10^15 minor units; a mismatch beyond that is reported only as a minor-out-of-range witness carrying exact decimal strings.
                      checksRun:
                        type: array
                        items:
                          type: string
                      computed:
                        type: object
                        properties:
                          subtotal:
                            type: string
                          discountTotal:
                            type: string
                          taxTotal:
                            type: string
                          total:
                            type: string
                          exponent:
                            type: integer
                      netDriftMinor:
                        type: integer
                        description: Sum of signed drifts over all mismatches; absent when the sum is beyond 10^15 minor units (a minor-out-of-range witness carries it as a string).
                      witnesses:
                        type: array
                        items:
                          type: object
                          properties:
                            ruleId:
                              type: string
                            detail:
                              type: string
                            path:
                              type: string
                              description: JSON pointer or dotted path into the input.
                            offset:
                              type: integer
                            index:
                              type: integer
                            expected:
                              description: What the rule required.
                            actual:
                              description: What the input had.
                      versions:
                        type: object
                        description: Every semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile).
                      limits:
                        type: array
                        items:
                          type: string
                      deterministic:
                        type: boolean
                        description: 'Always true: pure code, no model.'
                  _provenance:
                    type: object
                    description: C2PA-aligned manifest and W3C VC 2.0 (eddsa-jcs-2022) issued by the hub DID; verify at POST /api/v1/verify-provenance
                required:
                - data
                - _provenance
        '400':
          description: Invalid request (no payment consumed)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
        '401':
          description: Invalid X-API-KEY
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
        '402':
          description: Payment required or invalid
          content:
            application/json:
              schema:
                type: object
                description: x402 v2 PaymentRequired (also base64 in the PAYMENT-REQUIRED header)
                properties:
                  x402Version:
                    type: integer
                  error:
                    type: string
                  code:
                    type: string
                  resource:
                    type: object
                  accepts:
                    type: array
                    items:
                      type: object
                  extensions:
                    type: object
        '502':
          description: Upstream failure; the payment is released or not settled
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
      tags:
      - Invoice Audit
components:
  securitySchemes:
    x402:
      type: apiKey
      in: header
      name: PAYMENT-SIGNATURE
      description: x402 v2 payment payload (base64) sent after a 402 challenge
    apiKey:
      type: apiKey
      in: header
      name: X-API-KEY