# SaaS Subscription Proration Audit

> SaaS Subscription Proration Audit is a paid API for AI agents from rooke-token-risk-pilot.rookepoole.workers.dev, paid per call via x402, $9/call, status unknown (last checked 2026-10-12).

Verifies that a SaaS subscription mid-cycle proration invoice matches the mathematically expected credits and charges given the before/after plan items and timing.

## Facts

- Endpoint: POST https://rooke-token-risk-pilot.rookepoole.workers.dev/v1/x402/subscription-proration-audit?utm_source=zero.xyz
- Price: $9/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/saas-subscription-proration-audit-d7497e1a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_aOXAAPJ3opAZGmLs-BUtH

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 saas-subscription-proration-audit-d7497e1a -d '<json body>'
```

Example prompt: Can you audit the proration on invoice in_42 for subscription sub_42? The billing period is 2024-03-01 to 2024-03-31, the plan change took effect on 2024-03-17, the before item was price_basic at qty 1 for 10000 minor units and the after item is price_pro at qty 1 for 20000 minor units, proration behavior is CREATE_PRORATIONS, the invoice shows a charge of 10323 and a credit of 5161, and I want to allow a tolerance of 1 minor unit.

## When to prefer this

Choose this endpoint when you need a deterministic, math-grounded audit of a SaaS subscription proration invoice — especially for mid-cycle plan upgrades, downgrades, or quantity changes — and want a structured verdict with variance breakdown, risk flags, and a tamper-evident report hash. Prefer this over manual calculation or generic reconciliation tools when you need per-item proration line visibility and a machine-readable recommended disposition suitable for autonomous finance workflows.

## Known failure modes

- Invalid or missing required fields (subscriptionId, billingPeriodStart, billingPeriodEnd, etc.) return a 400 validation error
- Currency code not matching ISO 4217 three-letter format causes rejection
- billingPeriodEnd before billingPeriodStart causes a logic error
- More than 200 before or after items triggers a schema violation
- Payment of $9 USDC via x402 required — missing or failed payment returns 402
- Caller-supplied facts are not independently verified, so CALLER_SUPPLIED_SUBSCRIPTION_AND_INVOICE_FACTS_NOT_AUTHENTICATED evidence gap is always present

## How this service works

Public static preview plus paid token controls, risk consensus, AI security, webhook reliability, developer security, schedule risk, decision analysis, API release compatibility, accounts-payable reconciliation, e-commerce return eligibility, SaaS subscription-proration, sales-commission reconciliation, parcel-charge reconciliation, SLA service-credit reconciliation, advertising spend-and-fee audit, contract-renewal audit, workforce timecard reconciliation, hotel booking-commission reconciliation, and warehouse cycle-count adjustment reconciliation products for autonomous agents.

## Output

Returns a structured audit report with a verdict (e.g. MATCHED_WITHIN_TOLERANCE or a mismatch code), the expected vs. observed charge, credit, and net amounts in minor currency units, item-level variances, any risk flags, evidence gaps (such as unverified caller-supplied facts), claim boundary flags, individual calculated proration lines, a recommended disposition, and a SHA-256 report hash for audit trail purposes.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "policy": {
   "type": "object",
   "required": [
    "toleranceMinor"
   ],
   "properties": {
    "toleranceMinor": {
     "type": "integer",
     "maximum": 1000000,
     "minimum": 0
    }
   },
   "additionalProperties": false
  },
  "invoice": {
   "type": "object",
   "required": [
    "invoiceId",
    "observedCreditMinor",
    "observedChargeMinor",
    "observedNetMinor"
   ],
   "properties": {
    "invoiceId": {
     "type": "string",
     "maxLength": 120,
     "minLength": 1
    },
    "observedNetMinor": {
     "type": "integer",
     "maximum": 9007199254740991,
     "minimum": -9007199254740991
    },
    "observedChargeMinor": {
     "type": "integer",
     "maximum": 9007199254740991,
     "minimum": 0
    },
    "observedCreditMinor": {
     "type": "integer",
     "maximum": 9007199254740991,
     "minimum": 0
    }
   },
   "additionalProperties": false
  },
  "subscription": {
   "type": "object",
   "required": [
    "subscriptionId",
    "currency",
    "billingPeriodStart",
    "billingPeriodEnd",
    "changeEffectiveAt",
    "latestInvoicePaid",
    "prorationBehavior",
    "beforeItems",
    "afterItems"
   ],
   "properties": {
    "currency": {
     "type": "string",
     "pattern": "^[A-Z]{3}$"
    },
    "afterItems": {
     "type": "array",
     "items": {
      "type": "object",
      "required": [
       "subscriptionItemId",
       "priceId",
       "quantity",
       "prorationUnitAmountMinor"
      ],
      "properties": {
       "priceId": {
        "type": "string",
        "maxLength": 120,
        "minLength": 1
       },
       "quantity": {
        "type": "integer",
        "maximum": 1000000,
        "minimum": 0
       },
       "subscriptionItemId": {
        "type": "string",
        "maxLength": 120,
        "minLength": 1
       },
       "prorationUnitAmountMinor": {
        "type": "integer",
        "maximum": 9007199254740991,
        "minimum": 0
       }
      },
      "additionalProperties": false
     },
     "maxItems": 200
    },
    "beforeItems": {
     "type": "array",
     "items": {
      "type": "object",
      "required": [
       "subscriptionItemId",
       "priceId",
       "quantity",
       "prorationUnitAmountMinor"
      ],
      "properties": {
       "priceId": {
        "type": "string",
        "maxLength": 120,
        "minLength": 1
       },
       "quantity": {
        "type": "integer",
        "maximum": 1000000,
        "minimum": 0
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "timing": {
   "periodMilliseconds": 2678400000,
   "remainingMilliseconds": 1382400000
  },
  "summary": {
   "toleranceMinor": 1,
   "changedItemCount": 1,
   "latestInvoicePaid": true,
   "unchangedItemCount": 0
  },
  "verdict": "MATCHED_WITHIN_TOLERANCE",
  "currency": "USD",
  "expected": {
   "netMinor": 5162,
   "chargeMinor": 10323,
   "creditMinor": 5161
  },
  "observed": {
   "netMinor": 5162,
   "chargeMinor": 10323,
   "creditMinor": 5161
  },
  "invoiceId": "in_42",
  "riskFlags": [],
  "variances": {
   "netMinor": 0,
   "chargeMinor": 0,
   "creditMinor": 0,
   "observedArithmeticMinor": 0
  },
  "reportHash": "sha256-hex",
  "evidenceGaps": [
   "CALLER_SUPPLIED_SUBSCRIPTION_AND_INVOICE_FACTS_NOT_AUTHENTICATED"
  ],
  "claimBoundary": {
   "chargeAttempted": false,
   "invoiceModified": false,
   "billingPlatformStateVerified": false
  },
  "schemaVersion": "SUBSCRIPTION_PRORATION_AUDIT_V1",
  "subscriptionId": "sub_42",
  "calculatedLines": [],
  "prorationBehavior": "CREATE_PRORATIONS",
  "requestCommitment": "sha256-hex",
  "calculatedIfEnabled": {
   "netMinor": 5162,
   "chargeMinor": 10323,
   "creditMinor": 5161
  },
  "recommendedDisposition": "MATCHED_NO_ACTION"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/saas-subscription-proration-audit-d7497e1a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from rooke-token-risk-pilot.rookepoole.workers.dev](https://www.zero.xyz/host/rooke-token-risk-pilot.rookepoole.workers.dev/llms.txt)
