CreateProductOrders

Updated at:

Purchases products. Currently, only pay-as-you-go DataWorks, OSS, PAI, and MaxCompute are supported.

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 automatic payment is enabled for all products specified in the Products parameter. Valid values:

  • true: Enables automatic payment.

  • false: Disables automatic payment.

true

Products

array<object>

No

The list of products to purchase, separated by commas.

array<object>

No

The product to purchase.

AutoRenew

boolean

No

Specifies whether to enable auto-renewal. Valid values:

  • true: Enables auto-renewal.

  • false: Disables auto-renewal.

Valid values:

  • false :

    false

  • true :

    true

true

ProductCode

string

No

The product code. Valid values:

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

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

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

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

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 pricing unit. Valid values:

  • Month: billed by month. Only DataWorks_share supports Month.

  • Hour: billed by hour. Only OSS_share and MaxCompute_share support Hour.

Valid values:

  • Month :

    Month

  • Hour :

    Hour

Month

Duration

integer

No

The purchase duration. This parameter is used together with PricingCycle. Currently, only 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 (OSS)" }, { "Code": "ord_time", "Value": "1:Hour", "Name": "1 Hour" } ]

  • PAI_share: None

  • MaxCompute_share for the Chinese site: [ { "Code": "region", "Value": "cn-hangzhou" }, { "Code": "odps_specification_type", "Value": "OdpsStandard" }, { "Code": "ord_time", "Value": "1:Hour" } ]

  • MaxCompute_share for the international site: [ { "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.

Object Storage Service (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.

Normal

BuyProductRequestId

string

The ID of the product purchase request.

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

ProductIds

array

The list of IDs of the successfully purchased products.

string

The ID of the successfully purchased product.

PAI_share

Examples

Success response

JSON format

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

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.