All Products
Search
Document Center

Expenses and Costs:QuerySavingsPlansInstance

Last Updated:Oct 28, 2025

Queries information about your savings plan instances.

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:QuerySavingsPlansInstance

get

*All Resource

*

None

None

Request parameters

Parameter

Type

Required

Description

Example

PageSize

integer

No

The number of entries per page.

20

Locale

string

No

The language of the response.

  • EN: English

  • ZH: Chinese

ZH

PageNum

integer

No

The page number.

1

InstanceId

string

No

The ID of the savings plan instance.

spn-xxxxxxx

StartTime

string

No

The start time. The time is in the yyyy-MM-dd HH:mm:ss format.

2020-01-01 00:00:00

EndTime

string

No

The end time. The time is in the yyyy-MM-dd HH:mm:ss format.

2021-01-01 00:00:00

Tag

array<object>

No

The list of tag elements.

object

No

The tag element.

Key

string

No

The key of the tag.

ecs

Value

string

No

The value of the tag.

001

Status

string

No

The status of the instance. Valid values: NORMAL: The instance is active. RELEASE: The instance is released.

NORMAL

CommodityCode

string

No

The commodity code.

savingplan_common_public_cn

Response elements

Parameter

Type

Description

Example

object

The returned object.

Code

string

The error code.

Success

Message

string

The error message.

Successful

RequestId

string

The ID of the request.

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 returned per page.

20

TotalCount

integer

The total number of entries.

100

Items

array<object>

The list of instance information.

object

The instance information.

Status

string

The current status.

  • NORMAL: The instance is active.

  • LIMIT: The instance is suspended due to an overdue payment.

  • RELEASE: The instance is released.

NORMAL

Cycle

string

The purchased duration.

1:Year

StartTimestamp

integer

The start timestamp.

1663135741039

SavingsType

string

The type of the savings plan.

  • unversal: general-purpose

  • ecs: compute-optimized

ECS

Utilization

string

The total utilization.

1.0

PrepayFee

string

The upfront payment. Unit: CNY.

8760.00

InstanceId

string

The ID of the savings plan instance.

spn-xxxxxxxx

Currency

string

The currency. Valid values: CNY: Chinese Yuan. USD: US Dollar.

CNY

EndTimestamp

integer

The end timestamp.

1663135741039

EndTime

string

The expiration time of the instance. The time is in the yyyy-MM-dd HH:mm:ss format.

2021-01-01 00:00:00

StartTime

string

The effective time of the instance. The time is in the yyyy-MM-dd HH:mm:ss format.

2020-01-01 00:00:00

AllocationStatus

string

The allocation status.

  • unallocated: Not allocated.

  • allocated: Allocating.

  • beAllocated: Allocated to this account.

unallocated

InstanceFamily

string

For a compute-optimized savings plan, this parameter indicates the corresponding instance family or instance family package.

ecs.g6

Region

string

The region.

cn-zhangjiakou-na62-a01

LastBillTotalUsage

string

The total deduction amount in the previous cycle. Unit: CNY.

100.0

LastBillUtilization

string

The utilization in the previous cycle.

0.8

TotalSave

string

The total savings. Unit: CNY.

20.00

PoolValue

string

The commitment. Unit: CNY.

1.00

PayMode

string

The payment type.

  • total: All Upfront

  • half: Partial Upfront

  • zero: No Upfront

total

Tags

array<object>

The list of tag information.

object

The tag element.

Key

string

The tag key.

标签1

Value

string

The tag value.

标签1

DeductCycleType

string

The deduction cycle. HOUR: hourly DAY: daily ONCE: one-time (the total amount decreases over time)

HOUR

RestPoolValue

string

For a flexible savings plan with a monthly or daily commitment, this is the remaining amount in the current cycle. Unit: CNY.

100.0

CommodityCode

string

The commodity code.

savingplan_common_public_cn

CurrentPoolValue

string

For a savings plan with a monthly cycle, this is the commitment for the current cycle. Unit: CNY.

100.0

Examples

Success response

JSON format

{
  "Code": "Success",
  "Message": "Successful",
  "RequestId": "61293E7A-3406-4447-8620-EC88B0AA66AD",
  "Success": true,
  "Data": {
    "PageNum": 1,
    "PageSize": 20,
    "TotalCount": 100,
    "Items": [
      {
        "Status": "NORMAL",
        "Cycle": "1:Year",
        "StartTimestamp": 1663135741039,
        "SavingsType": "ECS",
        "Utilization": "1.0",
        "PrepayFee": "8760.00",
        "InstanceId": "spn-xxxxxxxx",
        "Currency": "CNY",
        "EndTimestamp": 1663135741039,
        "EndTime": "2021-01-01 00:00:00",
        "StartTime": "2020-01-01 00:00:00",
        "AllocationStatus": "unallocated",
        "InstanceFamily": "ecs.g6",
        "Region": "cn-zhangjiakou-na62-a01",
        "LastBillTotalUsage": "100.0",
        "LastBillUtilization": "0.8",
        "TotalSave": "20.00",
        "PoolValue": "1.00",
        "PayMode": "total",
        "Tags": [
          {
            "Key": "标签1",
            "Value": "标签1"
          }
        ],
        "DeductCycleType": "HOUR",
        "RestPoolValue": "100.0",
        "CommodityCode": "savingplan_common_public_cn",
        "CurrentPoolValue": "100.0"
      }
    ]
  }
}

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.