Polyv Help Center

Help Center

service

Updated: 2023-07-11 15:01:53

1. Query Main Account Billing Statistics

Description

集团账号查询主账号账单
接口地址(仅做说明使用):https://api.polyv.net/live/v4/group/account/billing-daily/list

Call Constraints

  1. API calls are rate-limited. Click here for details. For common call exceptions, click here.

Unit Test

    @Test
    public void testListBilling() throws IOException, NoSuchAlgorithmException {
        GroupListBillingRequest groupListBillingRequest = new GroupListBillingRequest();
        GroupListBillingResponse groupListBillingResponse;
        try {
            groupListBillingRequest.setBillingDate(super.getDate(2023, 05, 01));
            groupListBillingResponse = new GroupServiceImpl().listBilling(groupListBillingRequest);
            Assert.assertNotNull(groupListBillingResponse);
            if (groupListBillingResponse != null) {
                //to do something ......
                log.debug("测试查询主账号账单统计成功 {}", JSON.toJSONString(groupListBillingResponse));
            }
        } catch (PloyvSdkException e) {
            //参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
            log.error(e.getMessage(), e);
            // 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
            throw e;
        } catch (Exception e) {
            log.error("SDK调用异常", e);
            throw e;
        }
    }

Unit Test Description

  1. If the request is correct, a GroupListBillingResponse object is returned. The B-side processes business logic based on this object.

  2. If request parameter validation fails, a PloyvSdkException is thrown. The error message can be found in PloyvSdkException.getMessage(), e.g., [Input parameter [xxx.chat.LivexxxRequest] object validation failed. Failed fields: [pic cannot be empty / msg cannot be empty]].

  3. If a server processing error occurs, a PloyvSdkException is thrown. The error message can be found in PloyvSdkException.getMessage(), e.g., [Polyv request returned data error. Request serial number: 66e7ad29fd04425a84c2b2b562d2025b. Error reason: invalid signature.]

Request Parameter Description

Parameter Name Required Type Description
billingDate true Date Billing period, format yyyyMM, e.g., 202205. The date must be after 202204.
pageSize false Integer Number of items per page. Default is 10, maximum is 1000.
pageNumber false Integer Current page number. Default is 1.

Response Object Description

Parameter Name Type Description
contents Array List of billing information [See BillingInfo Parameter Description for details]
pageSize Integer Number of items displayed per page. Default is 20.
currentPage Integer Current page [Corresponds to the pageNumber field in the API documentation]
totalItems Integer Total number of records
totalPage Integer Total number of pages [Corresponds to the totalPages field in the API documentation]
BillingInfo Parameter Description
Parameter Name Type Description
unionId String Main account group ID
accountPeriod String Billing period
production String Product: Cloud Live / Cloud VOD
category String Usage type: Cloud Live: Viewing minutes / Co-hosting minutes / Low-latency minutes / Director duration; Cloud VOD: Video playback / Storage space
itemConsumed Float Usage amount
itemConsumedUnit String Unit of usage
statAt Date Settlement date (daily), format yyyy-MM-dd
tradeType Integer Transaction type: 1: Usage settlement; 2: Amount settlement; 3: Retroactive adjustment; 4: Refund adjustment

联系客服,在线咨询