Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Revenue Integrity API

Reconcile contracts, usage, invoices, payments and ledger state; detect revenue leakage and generate repair plans.

Revenue Integrity landing page

Production API: https://revenueintegrity-api.com

Get a free API key · Documentation · Pricing · Status

Free tier: 5 reconciliations/month. No card required. Paid plans from $499/month.

Quickstart

Request a key. The token arrives by email; exchange it for the key, which is shown once.

curl -X POST https://revenueintegrity-api.com/v1/keys \
  -H 'content-type: application/json' \
  -d '{"email": "you@example.com"}'

Then call the API:

curl -X POST https://revenueintegrity-api.com/v1/reconciliations \
  -H "Authorization: Bearer $KEY" \
  -H 'content-type: application/json' \
  -d @ledger.json

Endpoints

Revenue Integrity API reference, with a live playground for every endpoint

Every endpoint below has a runnable playground on the documentation page.

Endpoint Auth Description
GET /health public Liveness and deployed version
GET / public Service index — endpoints, auth and error format
POST /v1/reconciliations API key Reconcile one billing period
POST /v1/demo/reconcile public Public demo — reconcile a small ledger without a key
GET /v1/sandbox/example public A worked example payload you can POST straight back
POST /v1/checkout public Start a hosted Square checkout for a paid tier
POST /v1/keys public Request a free sandbox API key (sends a verification email)
GET /v1/keys API key List your API keys for this API
POST /v1/keys/claim public Exchange an emailed claim token for the API key
POST /v1/keys/{id}/revoke API key Revoke one of your API keys
POST /v1/keys/{id}/rotate API key Replace one of your API keys with a new secret
GET /v1/usage API key Your consumption and remaining allowance for this period
GET /v1/subscription API key Your current plan, billing window and available changes (dashboard session required)
POST /v1/subscription/plan API key Upgrade or downgrade to another plan (dashboard session required)
POST /v1/subscription/cancel API key Cancel this plan and end metered access (dashboard session required)
GET /v1/invoices API key Every invoice issued against this account, newest first (dashboard session required)
GET /v1/payments API key Every payment attempted against this account and how it went (dashboard session required)

The full machine-readable contract is openapi.json, generated from the deployed route table rather than maintained by hand. A Postman collection is included.

SDKs

Pythonsdk/python

from revenue_integrity import RevenueIntegrity

client = RevenueIntegrity()                 # reads REVENUE_INTEGRITY_API_KEY

res = client.reconcile({
    "periodLabel": "2026-08",
    "contract": [{"sku": "api-calls", "ratePerUnitMicro": 27,
                  "includedUnits": 100_000, "minimumCommitmentMinor": 50_000}],
    "usage": [{"sku": "api-calls", "quantity": 1_250_000}],
    "invoices": [{"invoiceId": "INV-1001", "sku": "api-calls",
                  "quantity": 1_000_000, "amountMinor": 2_430}],
    "payments": [{"invoiceId": "INV-1001", "amountMinor": 1_000}],
})

print(res["recoverableMinor"], "minor units recoverable")

for f in res["findings"]:
    # code is a stable enum; summary is prose and may change.
    print(f["severity"], f["code"], f["sku"], f["impactMinor"], f["summary"])

TypeScriptsdk/typescript

import { RevenueIntegrity } from './revenue-integrity.js'

const client = new RevenueIntegrity()       // reads REVENUE_INTEGRITY_API_KEY

const res = await client.reconcile({
  periodLabel: '2026-08',
  contract: [{ sku: 'api-calls', ratePerUnitMicro: 27,
               includedUnits: 100_000, minimumCommitmentMinor: 50_000 }],
  usage:    [{ sku: 'api-calls', quantity: 1_250_000 }],
  invoices: [{ invoiceId: 'INV-1001', sku: 'api-calls',
               quantity: 1_000_000, amountMinor: 2_430 }],
  payments: [{ invoiceId: 'INV-1001', amountMinor: 1_000 }],
})

console.log(res.recoverableMinor, 'minor units recoverable')

for (const f of res.findings) {
  // Branch on `code`; `summary` is prose and may change.
  console.log(f.severity, f.code, f.sku, f.impactMinor, f.summary)
}

Errors

Every failure returns the same shape. Branch on code, which is a stable enum; message is for humans and may change.

{"error": {"code": "invalid_api_key", "message": "...", "requestId": "0f3c8b12-…"}}

requestId appears on every response and in the x-request-id header. Quote it in any support request.

Support

Open an issue in this repository, or see the contact route at https://revenueintegrity-api.com/docs.

About

Reconcile contracts, usage, invoices, payments and ledger state; detect revenue leakage and generate repair plans.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages