Create instance

Updated at:
Copy as MD

After a user purchases a product and the payment is successful, the Alibaba Cloud Marketplace will call this SPI to create an instance.

  • You must return a unique identifier, instanceId, for each instance you create. Alibaba Cloud Marketplace uses this identifier for subsequent instance operations, such as renewal and expiration.

  • We recommend using the value of the orderBizId parameter for the instanceId.

  • Avoid blocking this API call. For time-consuming operations, use an asynchronous queue. In such cases, immediately return the response with instanceId set to 0. If the operation fails, also set instanceId to 0. Alibaba Cloud Marketplace will retry the call up to 120 times until it receives a valid instanceId.

  • This API may be called multiple times for the same request. Ensure that your endpoint is idempotent.

  • For products with additional billable items, the request includes corresponding top-level parameters, at the same level as other existing parameters. The parameter keys match the billable item keys that you specified when you published the product, and the values reflect the user's selections. For example, if an SKU has billable item keys Count and Num, and a user places an order with Count=2 and Num=3, the request will also include these two parameters and their values. You must use these values to initialize the user's service and record them.

Parameters

Parameter

Required

Type

Description

action

true

String

The action to perform. The value must be createInstance.

aliUid

true

String

The unique ID of the Alibaba Cloud account that purchased the product.

orderBizId

true

String

The business ID of the instance in Alibaba Cloud Marketplace.

orderId

true

String

The ID of the order in Alibaba Cloud Marketplace.

ecsInstanceId

false

String

The ID of the ECS instance. This parameter is required for an image product.

productCode

true

String

The code of the product in Alibaba Cloud Marketplace.

skuId

true

String

The SKU ID of the product.

trial

true

Boolean

Specifies whether the purchase is a trial.

expiredOn

false

DateTime

The instance's expiration time in yyyy-MM-dd HH:mm:ss format.

template

false

String

The template ID. This parameter applies to template-based website products.

token

true

String

The security token for verification.

activeOrgId

false

String

Required if your product requires users to bind a unique account identifier.

Response

Parameter

Description

Required

Type

Field

Description

instanceId

The unique ID of the instance, provided by the ISV.

true

String

-

-

hostInfo

Server and ICP filing information displayed on the purchased services page in the Buyer Console.

false

JSON

name

Server name

ip

The server's public IP address.

innerIp

The server's private IP address.

username

The username for the server account.

password

The password for the server account.

cname

The server's CNAME record.

tempDomain

Temporary domain name

ftpUsername

FTP username

ftpPassword

FTP password

region

The region where the server is located.

beianInfo

ICP filing information.

databaseInfo

Database information

appInfo

Application information displayed on the purchased services page in the Buyer Console.

false

JSON

frontEndUrl

Front-end URL

adminUrl

Admin URL

username

Administrator account username

password

Administrator account password

authUrl

The URL for passwordless login.

licenseId

License ID

licenseValidPeriod

License validity period

licenseForUserGuide

URL of the user guide

appKey

The appKey used for a large model or Model Studio.

info

Custom information displayed on the purchased services page in the Buyer Console.

false

JSON

-

Custom key-value data

Sample request

http://isv-endpoint.example.com?
token=097a56e26a93c874140bbcdf403f****&action=createInstance&aliUid=12312****&orderId=100001&orderBizId=1&productCode=cmjj000123&skuId=sku-1
            

Sample response

{
  "instanceId": "1",
  "hostInfo": {
    "name": "linux server",
    "ip": "127.0.0.1",
    "username": "user",
    "password": "user_password"
  },
  "appInfo": {
    "frontEndUrl": "http://example.com/",
    "adminUrl": "http://example.com/admin",
    "username": "admin",
    "password": "admin_password"
  },
  "info": {
    "key1": "my custom info"
  }
}

FAQ

1. When creating an instance, how do I identify the product and SKU that the user purchased?

The productCode parameter is the code for the product that you purchase, which corresponds to the Product Code column on the Service Provider Console Product Management page.

If a product has multiple SKUs, the skuId parameter specifies the purchased SKU. You can find this code on the Product Release page, under the Product Sales Information section.

For example, on the product sales information page, the specification Code for the Enterprise Edition is yuncode4757500001, and the specification Code for the Ultimate Edition is yuncode4757500002.