All Products
Search
Document Center

Expenses and Costs:QuerySavingsPlansDeductLog

Last Updated:Oct 28, 2025

Queries the details of savings plan deductions.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

bssapi:QuerySavingsPlansDeductLog

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

InstanceType

string

No

The query type. Valid values:

  • spn: savings plan instance

  • product: deducted cloud service instance

spn

PageSize

integer

No

The number of entries per page.

20

Locale

string

No

The language of the response. Default value: ZH. Valid values: `ZH`: Chinese. `EN`: English.

ZH

PageNum

integer

No

The page number.

1

InstanceId

string

No

The instance ID.

spn-XXXXXXX

StartTime

string

No

The beginning of the time range to query.

2022-01-01 00:00:00

EndTime

string

No

The end of the time range to query.

2022-01-05 00:00:00

Response elements

Parameter

Type

Description

Example

object

The response.

Code

string

The error code.

PARAM_ERROR

Message

string

The error message.

请校验入参正确性

RequestId

string

The request ID.

61293E7A-3406-4447-8620-EC88B0AA66AD

Success

boolean

Indicates whether the request was successful.

true

Data

object

The returned data.

PageNum

integer

The page number of the returned page.

1

PageSize

integer

The number of entries per page.

20

TotalCount

integer

The total number of entries.

20

Items

array<object>

The list of deduction details.

object

The deduction details.

EndTime

string

The end time.

2020-12-01 01:00:00

StartTime

string

The start time.

2020-12-01 00:00:00

SavingsType

string

The type of the savings plan. Valid values:

  • universal: general-purpose

  • ecs: compute-optimized

ecs

UserId

integer

The user ID.

1906589291020438

DiscountRate

string

The discount that is used for the deduction.

0.069

BillModule

string

The deducted billable item.

云服务器配置

InstanceId

string

The ID of the savings plan instance.

spn-xxxxxxx

DeductInstanceId

string

The ID of the deducted cloud service instance.

i-XXXXXXXXX

DeductCommodity

string

The deducted service.

云服务器ECS-按量付费

DeductRate

string

The deduction rate.

1.0

DeductFee

string

The deducted fee, in CNY.

0.52

OwnerId

integer

The ID of the owner.

1906589291020438

BillingCycle

string

The billing cycle.

202312

Region

string

The region of the deducted instance.

cn-shanghai-eu13-a01

InstanceSpec

string

The instance type of the deducted instance.

ecs.g7.xlarge

InstanceTypeFamily

string

The instance family of the deducted instance.

ecs.g7

BillingOfficialPrice

string

The list price of the deducted bill, in CNY.

375.35

DeductedOfficialPrice

string

The list price of the deducted amount, in CNY.

375.37

Examples

Success response

JSON format

{
  "Code": "PARAM_ERROR",
  "Message": "请校验入参正确性",
  "RequestId": "61293E7A-3406-4447-8620-EC88B0AA66AD",
  "Success": true,
  "Data": {
    "PageNum": 1,
    "PageSize": 20,
    "TotalCount": 20,
    "Items": [
      {
        "EndTime": "2020-12-01 01:00:00",
        "StartTime": "2020-12-01 00:00:00",
        "SavingsType": "ecs",
        "UserId": 1906589291020438,
        "DiscountRate": "0.069",
        "BillModule": "云服务器配置",
        "InstanceId": "spn-xxxxxxx",
        "DeductInstanceId": "i-XXXXXXXXX",
        "DeductCommodity": "云服务器ECS-按量付费",
        "DeductRate": "1.0",
        "DeductFee": "0.52",
        "OwnerId": 1906589291020438,
        "BillingCycle": "202312",
        "Region": "cn-shanghai-eu13-a01",
        "InstanceSpec": "ecs.g7.xlarge",
        "InstanceTypeFamily": "ecs.g7",
        "BillingOfficialPrice": "375.35",
        "DeductedOfficialPrice": "375.37"
      }
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidOwner The specified owner does not belong to caller.
400 InvalidParameter The specified request contains invalid parameters.
400 MissingParameter The specified request lacks essential parameters.
400 NotApplicable The specified API is not applicable for the user.
400 NotAuthorized The user is not authorized for the specified API.
500 InternalError An error occurred in the internal server. System exception, please try again

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.