DescribeTransactionHistory

1. API Description

This API is used to query transaction history. You can query up to 10,000 items.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter Name
Required
Type
Description

pageNum

No

Integer

Number of pages returned.

Default value: 1.

pageSize

No

Integer

Number of items in the current page result.

Maximum value: 10,000.

transactionType

No

Transaction type.

startTime

No

Date

Start time.

The value is one month ago by default. You cannot set a start time earlier than 3 months ago.

endTime

No

Date

End time.

The value is current time by default.

3. Output Parameters

Parameter Name
Type
Description

requestId

String

The unique request ID, which is returned for each request. RequestId is required for locating a problem.

incomeSum

Double

Total income.

expenditureSum

Double

Total spend.

totalCount

Integer

Number of transactions meeting the filtering conditions.

dataSet

Information on transactions.

4. Code Example

Query transaction history.

POST /api/v2/zbc HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: DescribeTransactionHistory
<Common Request Params>

Request:
{
  "endTime": "2023-09-05T14:26:18Z",
  "startTime": "2023-08-05T14:26:18Z",
  "transactionType":["DEDUCTION"],
  "pageSize": 3,
  "pageNum": 1
}

Response:
{
    "requestId": "T960432F9-DB02-420D-813B-B439050075D8",
    "response": {
        "incomeSum": 605.86,
        "requestId": "T960432F9-DB02-420D-813B-B439050075D8",
        "totalCount": 15084,
        "dataSet": [
            {
                "transactionType": "DEDUCTION",
                "uid": "8b2875e7-1340-4a3d-a056-a885c32f25de",
                "amount": 1.38,
                "tradeNo": "f2c7f250-45ed-4734-8e03-e4ab5766da46",
                "orderSn": "967674789101568984",
                "cashBalance": 161.358301,
                "paymentMethod": "ZenPoint",
                "description": "Product: Virtual Machine - Elastic Disk//\nType: ens_ssd/FRA/de-frankfurt-9a - hourly billing",
                "transactionTime": "2023-09-05T13:00:42Z",
                "accountUid": "21205dbb-d08a-4f79-927d-861d47bc66d8",
                "tradeType": "EXPENDITURE"
            },
            {
                "transactionType": "DEDUCTION",
                "uid": "223ec330-0148-4745-a33b-f5264b14aacf",
                "amount": 0.05,
                "tradeNo": "a307e306-634e-4168-9549-2ac9dfaa4a33",
                "orderSn": "967674789101568984",
                "cashBalance": 162.738301,
                "paymentMethod": "ZenPoint",
                "description": "Product: Virtual Machine - Instance Type//\nType: 01.VM.02.019/FRA9A_Shared_6326 - hourly billing",
                "transactionTime": "2023-09-05T13:00:42Z",
                "accountUid": "21205dbb-d08a-4f79-927d-861d47bc66d8",
                "tradeType": "EXPENDITURE"
            },
            {
                "transactionType": "DEDUCTION",
                "uid": "dc143cb6-ea9b-4c3e-9f46-660dace8b1a2",
                "amount": 0.01,
                "tradeNo": "628094dd-f2c0-45b3-b2ca-8144d7eac08f",
                "orderSn": "927099701663115480",
                "cashBalance": 162.788301,
                "paymentMethod": "ZenPoint",
                "description": "Product: Virtual Elastic Disk - Elastic Disk//\nType: ens_ssd/SIN/sg-singapore-3 - hourly billing",
                "transactionTime": "2023-09-05T13:00:40Z",
                "accountUid": "21205dbb-d08a-4f79-927d-861d47bc66d8",
                "tradeType": "EXPENDITURE"
            }
        ],
        "expenditureSum": 7044.32
    }
}

5. Developer Resources

Zenlayer Cloud API 2.0 integrates SDKs to make it easier for you to call APIs. More programming languages will be supported.

6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.​​

HTTP Status Code
Error Code
Description

400

CAN_NOT_GET_THAN_10000

Up to 10,000 items can be queried.

400

TIME_MORE_THAN_3_MONTHS

Start time cannot be earlier than 3 months ago.

Last updated