百度智能云

All Product Document

          Finance

          Monthly Resource Bill

          GetResourceMonthBill Interface

          Interface description

          Obtain resource monthly bill details in pages.
          The master account in Financial Management of Enterprises Organizations can query the bill details of sub-accounts.
          Sub-accounts added to the financial circle will block amounts other than vouchers. To initiate this request, the sub-user needs to have the administrator permission of Identity and Access Management or the policy management permission of FCFullControlPolicy Identity and Access Management.
          Interface request frequency limit by default: 20 times/sec.

          Permission description

          The request initiator needs to have a valid AccessKeyID and SecretAccessKey to initiate a request. Please see Authentication Certification.

          Notes

          If there is no user authentication information in the request (that is, anonymous access), return 403 Forbidden, with error message: AccessDenied.

          Request structure

           GET /v{version}/bill/resource/month?month={month}&productType={productType}&serviceType={serviceType}&queryAccountId={queryAccountId}&pageNo={pageNo}&pageSize={pageSize} HTTP/1.1 
           Host: billing.baidubce.com 
           ContentType: application/json
           Authorization: authorization string

          Request header

          There are no other special headers except the public headers.

          Request parameter

          Name Type Parameter position Description Required or not
          month String Query parameter Query month of the bill, in the format yyyy-MM, for example: 2019-02 Required
          productType String Query parameter Billing Type: prepay/postpay, which means pay before/pay after respectively Required
          serviceType String Query parameter Product type, for example: BCC, BOS, etc. Optional
          queryAccountId String Query parameter Query the account ID. Only the master account of enterprises & organizations can query the sub-account bills added to the financial circle. Other query scenarios will prompt AccessDenied. Optional
          pageNo int Query parameter Number of pages for query, the default is 1 Optional
          pageSize int Query parameter The maximum quantity contained in each page. The maximum quantity usually does not exceed 100. The default is 20. Optional

          Response header fields

          There are no other special headers except the public headers.

          Response parameter

          Name Type Description
          billMonth String Mark the month of the bill, in the format yyyy-MM
          accountId String When the current account is not a financial circle sub-account, return to the accountId of the current account; when it is a financial circle sub-account, return to the accountId of the master account of the current account
          loginName String When the current account is not a financial circle sub-account, return to the login name of the current account; when it is a financial circle sub-account, return to the login name of the master account of the current account
          subAccountId String When the current account is not a financial circle sub-account, return to "/"; when it is a financial circle sub-account, return to the accountId of the current account
          subLoginName String When the current account is not a financial circle sub-account, return to "/"; when it is a financial circle sub-account, return to the login name of the current account
          ouName String When the current account is not a financial circle sub-account, return to "/"; when it is a financial circle sub-account, return to the unit name of the organizational unit where the current account is located
          pageNo Integer Pagination query number
          pageSize Integer Page size of pagination query
          totalCount Integer Total entries of the current query condition
          bills List <ResourceMonthInstanceBill> Resource monthly bill list

          Request example

          Note: A maximum of 100 bills are returned for a single request.

          GET / HTTP/1.1
          Host: billing.baidubce.com
          Date: Wed, 06 Apr 2016 06:34:40 GMT
          Authorization: AuthorizationString

          Response example

           HTTP/1.1 200 OK
           x-bce-request-id: d4591fcf-025b-46bc-81eb-91ddda4e27bc
           Server: BWS
           Date: Tue, 09 Apr 2019 11:01:10 GMT
           Content-Type: application/json;charset=UTF-8 
           {
               "billMonth":"2019-02",
               "accountId":"xxx",
               "loginName":"xxx",
               "subAccountId":"/",
               "subLoginName":"/",
               "ouName":"/",
               "pageNo":1,
               "pageSize":20,
               "totalCount":1,
               "bills":[
                       {
                       "vendor": "Baidu AI Cloud", 
                       "accountId":"xxx",
                       "serviceType":"SCS",
                       "serviceTypeName": "Simple cache service", 
                       "productType":"postpay",
                       "region":"bj",
                       "instanceId":"30749",
                       "orderId":"/",
                       "orderType":"/",
                       "orderTypeDesc":"/",
                       "orderPurchaseTime":"2018-01-07T07:10:24.000Z",
                       "startTime":"2019-01-31T16:00:00.000Z",
                       "endTime":"2019-02-28T15:59:59.000Z",
                       "configurationCH": "Capacity: 1G", 
                       "tag":"tag:value",
                       "duration":"/",
                       "chargeItem":"RunningTimeMinutes",
                       "chargeItemDesc": "Running time", 
                       "amount":"35909",
                       "amountUnit": "Minutes", 
                       "unitPrice": "0.003333 CNY/min", 
                       "pricingUnit": "Minutes", 
                       "discountUnit":"100.00",
                       "tex":6,
                       "originPrice":119.68,
                       "financePrice":119.68,
                       "cash":119.68,
                       "rebate":0,
                       "creditCost":0,
                       "creditRefund":0,
                       "debt":0,
                       "noPaidPrice":0,
                       "voucherPrice":0,
                       "discountvoucherPrice":0,
                       "discountPrice":0,
                       "sysGold":0
                       }
                 ]
           }

          Note: Naming rule for JSON request response item is lower camel case.

          Previous
          Access Control
          Next
          Appendix