All Products
Search
Document Center

Platform For AI:CreateProductOrders

Last Updated:Oct 17, 2025

Purchases products. This operation supports pay-as-you-go purchases of DataWorks, OSS, PAI, and MaxCompute.

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

pai:CreateOrder

create

*All Resource

*

None None

Request syntax

POST /api/v1/productorders HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The purchase request.

AutoPay

boolean

No

Specifies whether to automatically pay for all products listed in the Products parameter.

  • true: Enables automatic payment.

  • false: Disables automatic payment.

true

Products

array<object>

No

The list of products to purchase.

array<object>

No

The product to purchase.

AutoRenew

boolean

No

Specifies whether to enable auto-renewal.

  • true: Enables auto-renewal.

  • false: Disables auto-renewal.

Valid values:

  • true :

    true

  • false :

    false

true

ProductCode

string

No

The product code. The following codes are supported:

  • DataWorks_share: The pay-as-you-go DataWorks product.

  • MaxCompute_share: The pay-as-you-go MaxCompute product.

  • PAI_share: The pay-as-you-go PAI product.

  • OSS_share: The pay-as-you-go OSS product.

Valid values:

  • MaxCompute_share :

    MaxCompute_share

  • OSS_share :

    OSS_share

  • DataWorks_share :

    DataWorks_share

  • PAI_share :

    PAI_share

DataWorks_share

ChargeType

string

No

The billing method. Currently, only POSTPAY is supported.

Valid values:

  • POSTPAY :

    POSTPAY

POSTPAY

OrderType

string

No

The order type. Currently, only BUY is supported.

Valid values:

  • BUY :

    BUY

BUY

PricingCycle

string

No

The billing cycle. The following values are supported:

  • Month: Monthly billing. Only DataWorks_share supports this value.

  • Hour: Hourly billing. Only OSS_share and MaxCompute_share support this value.

Valid values:

  • Month :

    Month

  • Hour :

    Hour

Month

Duration

integer

No

The subscription duration. This parameter is used with PricingCycle. Currently, only a value of 1 is supported.

1

InstanceProperties

array<object>

No

The list of instance properties.

  • DataWorks_share: [ { "Code": "region", "Value": "cn-shanghai" } ]

  • OSS_share: [ { "Code": "commodity_type", "Value": "oss", "Name": "Object Storage Service" }, { "Code": "ord_time", "Value": "1:Hour", "Name": "1 Hour" } ]

  • PAI_share: None

  • MaxCompute_share for accounts in mainland China: [ { "Code": "region", "Value": "cn-hangzhou" }, { "Code": "odps_specification_type", "Value": "OdpsStandard" }, { "Code": "ord_time", "Value": "1:Hour" } ]

  • MaxCompute_share for accounts outside mainland China: [ { "Code": "region", "Value": "cn-hangzhou" }, { "Code": "ord_time", "Value": "1:Hour" } ]

object

No

The instance property information.

Code

string

No

The code of the instance property.

commodity_type

Name

string

No

The name of the instance property.

对象存储OSS

Value

string

No

The value of the instance property.

oss

Response elements

Element

Type

Description

Example

object

The response struct.

RequestId

string

The request ID.

ksdjf-jksd-*****slkdjf

OrderId

string

The ID of the purchase order.

210292536260646

Message

string

The message returned for the purchase.

正常

BuyProductRequestId

string

The ID of the product purchase request.

3ed6a882-0d85-4dd8-ad36-cd8d74ab9fdb

ProductIds

array

string

Examples

Success response

JSON format

{
  "RequestId": "ksdjf-jksd-*****slkdjf",
  "OrderId": "210292536260646",
  "Message": "正常",
  "BuyProductRequestId": "3ed6a882-0d85-4dd8-ad36-cd8d74ab9fdb",
  "ProductIds": [
    ""
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.