BillingIntroduction

Tencent eSign public API for billing, used to query usage details (sub-customer consumption) under an application.

Authentication

All endpoints require the following header:

Authorization: Bearer <access_token>

access_token is obtained from the OAuth 2.0 authorization server using client_id + client_secret. See the authentication documentation for details.

Scope Requirement

Billing endpoints require the granted OAuth scope to include bill:manage; otherwise the server responds with HTTP 403 + insufficient_scope.

Owner Space Dimension

Each application (client_id) is bound to an OwnerSpaceId (the billing space). The billing endpoints automatically inject the OwnerSpaceId on the server side based on the current application; the caller must not (and is not allowed to) pass this field. Use SpaceId to further filter a specific sub-customer space.

Time Format

Query time parameters StartTime / EndTime use RFC3339 format (a timezone offset is required; UTC is recommended), e.g. 2026-06-01T00:00:00Z. The range must not exceed 31 days. The response field OccurredAt is always returned as an RFC3339 string in UTC (ending with Z), e.g. 2026-06-01T02:23:45Z.

Response Structure

All business API responses return HTTP status 200, with Response.Error.Code distinguishing success from failure:

{
  "Response": {
    "RequestId": "abc123",
    "Error": { "Code": "INVALID_REQUEST", "Message": "invalid time range" },
    "Data": { ... }
  }
}

On success, Error is null and Data contains the business data. On failure, Data is null and Error contains error details.

Error Codes

CodeDescription
INVALID_REQUESTInvalid request parameters (invalid time range, range exceeds limit, etc.)
UNAUTHORIZEDUnauthenticated (missing or invalid token)
FORBIDDENNo permission (e.g. missing bill:manage scope)
INTERNAL_ERRORInternal server error