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

Read immutable company credit and warning policy revisions

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

GET /api/v1/organizations/{organization}/billing/accounts/{currency}/policy/history

Organization-wide owner/admin or installation administration required, using the same authorization as company balance reads. Workspace-only sessions and company viewers cannot read shared financial policy. No account IDs, payment references or Provider prices. Exact amounts and revisions are decimal strings. Revision-descending keyset pages use one database snapshot per request; separate pages do not share a snapshot. Missing currency account returns 404; missing revision cursor returns 409. Revision zero with empty history denotes an account with no policy writes. This read does not change funds or credit. Cache-Control no-store.

Operation: getCustomerBalancePolicyHistory.

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/accounts/{currency}/policy/history" \
-H "Authorization: Bearer $NIU_BEARER_TOKEN"

Location: path. Required.

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

Location: path. Required.

JSON
{
"type": "string",
"pattern": "^[A-Z]{3}$"
}

Location: query. Optional. Exclusive existing revision cursor.

JSON
{
"type": "string",
"pattern": "^[1-9][0-9]*$"
}

Location: query. Optional.

JSON
{
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 50
}

No request body is declared.

Current revision and history page

Content type: application/json.

JSON
{
"type": "object",
"required": [
"current_revision",
"data",
"next_before"
],
"properties": {
"current_revision": {
"type": "string",
"pattern": "^[0-9]+$"
},
"data": {
"type": "array",
"items": {
"type": "object",
"required": [
"revision",
"credit_limit_nanos",
"warning_threshold_nanos",
"created_at",
"is_current"
],
"properties": {
"revision": {
"type": "string",
"pattern": "^[0-9]+$"
},
"credit_limit_nanos": {
"type": "string",
"pattern": "^[0-9]+$"
},
"warning_threshold_nanos": {
"type": [
"string",
"null"
],
"pattern": "^[0-9]+$"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"is_current": {
"type": "boolean"
}
},
"additionalProperties": false
}
},
"next_before": {
"type": [
"string",
"null"
],
"pattern": "^[1-9][0-9]*$"
}
}
}

Invalid currency, revision or page query

Invalid session

Account absent or company billing access denied

Cursor revision does not exist for this account

Organization-wide owner/admin or installation administration required, using the same authorization as company balance reads. Workspace-only sessions and company viewers cannot read shared financial policy. No account IDs, payment references or Provider prices. Exact amounts and revisions are decimal strings. Revision-descending keyset pages use one database snapshot per request; separate pages do not share a snapshot. Missing currency account returns 404; missing revision cursor returns 409. Revision zero with empty history denotes an account with no policy writes. This read does not change funds or credit. Cache-Control no-store.

Supported scope: implemented