v3

latestOpenAPI 3.1.0raw.githubusercontent.com2026-03-174712.4 KB
Contracts
Schema
Audit

Audit a contract computation

Execute a contract computation with given inputs and return the results.

post/api/v1/contracts/{contract_id}/audit

Path parameters

contract_idstring required

Request body

scope_namestring nullable

The scope to execute. If not provided, uses the contract's main scope.

inputsobject required

Input values for the computation. Keys are field names, values match the expected types.

Example request

{
  "inputs": {
    "claim": {
      "days_supply": 30,
      "ndc11": "12345678901",
      "quantity": 30,
      "therapeutic_class": "Specialty"
    },
    "contract_terms": {
      "base_rebate_pct": 0.15,
      "specialty_bonus_pct": 0.05
    }
  },
  "scope_name": "RebateCalculation"
}

Response

Successful Response

successboolean required

Whether the computation succeeded

contract_idstring required

The contract that was audited

scope_executedstring required

The scope that was executed

inputs_providedobject required

The inputs that were provided

outputsobject required

The computed output values from the main scope

all_scopesobject

All variable values organized by scope (for detailed audit trail)

errorstring nullable

Error message if computation failed

execution_time_msinteger nullable

Execution time in milliseconds

Example response

{
  "all_scopes": {
    "RebateCalculation": {
      "claim": {
        "ndc11": "12345678901"
      },
      "total_rebate": "$150.00"
    }
  },
  "contract_id": "cdoc_abc123",
  "execution_time_ms": 45,
  "inputs_provided": {
    "claim": {
      "ndc11": "12345678901",
      "quantity": 30
    }
  },
  "outputs": {
    "rebate_pct": "0.20",
    "total_rebate": "$150.00"
  },
  "scope_executed": "RebateCalculation",
  "success": true
}
All 4 operations