Billing Integration
ZopNight reconciles its rack-rate cost estimates against your actual cloud invoices by syncing billing data nightly from each connected cloud account. The endpoints on this page let you check sync state, re-trigger a sync, and verify a freshly-connected account.
Why two cost numbers?
Org-Wide Sync Status
/billing/sync-statusReturns sync state for every cloud account in the org. Used by the dashboard's billing health badge.
{
"data": [
{
"cloudAccountID": "ca_abc123",
"provider": "aws",
"lastSyncedAt": "2026-04-29T05:00:00Z",
"status": "ok",
"monthsBackfilled": 13
},
{
"cloudAccountID": "ca_def456",
"provider": "gcp",
"lastSyncedAt": "2026-04-25T05:00:00Z",
"status": "stale",
"message": "Last successful sync was 4 days ago"
}
]
}/billing/verifyTrigger an immediate billing sync across all cloud accounts. Returns a job reference; poll /billing/sync-status until the job completes.
Verify a Single Cloud Account
When a new cloud account is connected, the onboarding wizard runs a verification job: it confirms the billing export is reachable, schemas match, and a sample of recent records lands cleanly. The job is started and polled with the two endpoints below.
/cloud-accounts/{accountID}/billing/verifyStart a billing verification job for a cloud account.
curl -X POST https://zopnight.com/api/cloud-accounts/ca_abc123/billing/verify \
-H "Authorization: Bearer <token>"{
"data": {
"verifyID": "ver_001",
"status": "running"
}
}/cloud-accounts/{accountID}/billing/verify/{verifyID}Poll a verification job's status until it reports succeeded or failed.
{
"data": {
"verifyID": "ver_001",
"status": "succeeded",
"checks": {
"billingExportReachable": true,
"schemaMatches": true,
"sampleRowsParsed": 142
},
"completedAt": "2026-04-29T08:02:30Z"
}
}Historical Backfill
On first connection, ZopNight backfills up to 13 months of billing history if your provider exposes it (AWS Cost & Usage Reports always do; GCP needs the BigQuery billing export enabled; Azure cost exports need to be configured at the subscription level). Backfill is part of the verify job and reports progress via monthsBackfilled in the sync-status response.
See Cloud Accounts for the full onboarding flow including the steps that precede billing verification.