Skip to content
Niu DocsNiu 牛元文档
Dashboard控制台

Compare customer charge records with prepaid ledger debits

Generated from the checked-in source. Do not edit this reference by hand.

GET /api/v1/organizations/{organization}/billing/charge-reconciliation

Organization-wide owner/admin or installation read access required. One database snapshot compares prepaid-bound text and media charges against original charge entries per currency. Refunds do not reduce original charge matching. Reports counts and exact decimal amounts only, with no internal identifiers or Provider prices. Zero counts on an empty account do not establish financial readiness. This is read-only and does not verify external payment settlement, recalculate prices, reconcile legacy invoices or repair discrepancies. Pending settlement can appear as a discrepancy; use a later observation to distinguish an in-flight write from a persistent mismatch.

Operation: getCustomerChargeReconciliation.

Use the credential and permission scope described above. Each object below is an alternative; schemes within one object are required together.

JSON
[
{
"bearerAuth": []
}
]

Set NIU_ORIGIN to your installation origin (without /v1). Replace path, query and header placeholders with the required values. Query examples use curl 7.87 or newer to encode values with --url-query. Use the credential scope described above; a bearer token must have the authority required by this operation.

Shell
curl --fail-with-body -X GET "$NIU_ORIGIN/api/v1/organizations/{organization}/billing/charge-reconciliation" \
-H "Authorization: Bearer $NIU_BEARER_TOKEN"

Location: path. Required.

JSON
{
"type": "string",
"format": "uuid"
}

No request body is declared.

Per-currency observations

Content type: application/json.

JSON
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"required": [
"currency",
"observed_at",
"charge_records",
"completed_unaccrued_attempts",
"expected_charge_nanos",
"posted_charge_nanos",
"missing_charge_entries",
"mismatched_charge_entries",
"unexpected_charge_entries",
"duplicate_charge_sources",
"settled_open_reservations"
],
"properties": {
"currency": {
"type": "string",
"pattern": "^[A-Z]{3}$"
},
"observed_at": {
"type": "string",
"format": "date-time"
},
"charge_records": {
"type": "string",
"pattern": "^[0-9]+$"
},
"completed_unaccrued_attempts": {
"type": "string",
"pattern": "^[0-9]+$",
"description": "Completed prepaid-bound attempts without a text or media charge record. May await usage or financial recovery; not an amount, corruption finding or authorization to retry inference."
},
"expected_charge_nanos": {
"type": "string",
"pattern": "^[0-9]+$"
},
"posted_charge_nanos": {
"type": "string",
"pattern": "^[0-9]+$"
},
"missing_charge_entries": {
"type": "string",
"pattern": "^[0-9]+$"
},
"mismatched_charge_entries": {
"type": "string",
"pattern": "^[0-9]+$"
},
"unexpected_charge_entries": {
"type": "string",
"pattern": "^[0-9]+$"
},
"duplicate_charge_sources": {
"type": "string",
"pattern": "^[0-9]+$"
},
"settled_open_reservations": {
"type": "string",
"pattern": "^[0-9]+$"
}
}
}
}
}
}

Missing or invalid administration credentials

Company billing scope unavailable to this principal

Storage unavailable

Organization-wide owner/admin or installation read access required. One database snapshot compares prepaid-bound text and media charges against original charge entries per currency. Refunds do not reduce original charge matching. Reports counts and exact decimal amounts only, with no internal identifiers or Provider prices. Zero counts on an empty account do not establish financial readiness. This is read-only and does not verify external payment settlement, recalculate prices, reconcile legacy invoices or repair discrepancies. Pending settlement can appear as a discrepancy; use a later observation to distinguish an in-flight write from a persistent mismatch.

Supported scope: implemented