After a customer successfully purchases a product, Alibaba Cloud Marketplace calls this Service Provider Interface (SPI) to create an instance.
-
Return a unique identifier (
instanceId) for each application instance. Alibaba Cloud Marketplace uses this identifier for subsequent operations, such as renewals and expirations. -
We recommend that you use the value of the
orderBizIdparameter as theinstanceId. -
Do not block this call. If the operation is time-consuming, use a queue for buffering, set
instanceId=0, and return immediately. If the operation fails, also setinstanceId=0. Alibaba Cloud Marketplace will retry the call (up to 120 times) until it receives a validinstanceId. -
This call may be invoked multiple times. Ensure that your endpoint is idempotent.
-
For products with extra billing items, the API request includes parameters for these items at the same level as other parameters. The parameter key matches the key you specified when publishing the product, and the value is the customer's selection. For example, if you have two extra billing items with the keys "Count" and "Num", and a customer places an order with Count=2 and Num=3, these parameters and their values are included in the request. You must initialize the service and record these values.
Parameters
|
Parameter |
Required |
Type |
Description |
|
action |
true |
String |
The operation to perform. The value must be |
|
aliUid |
true |
String |
The customer's Alibaba Cloud account ID. |
|
orderBizId |
true |
String |
The Alibaba Cloud Marketplace business instance ID. |
|
orderId |
true |
String |
The Alibaba Cloud Marketplace order ID. |
|
ecsInstanceId |
false |
String |
The Elastic Compute Service (ECS) instance ID. This parameter is required for instances of image-based products. |
|
productCode |
true |
String |
The Alibaba Cloud Marketplace product code. |
|
skuId |
true |
String |
The ID of the product specification. |
|
trial |
true |
Boolean |
Indicates whether the purchase is a trial. |
|
expiredOn |
false |
DateTime |
The time when the instance expires. Format: |
|
template |
false |
String |
The template ID. This parameter applies to template-based website builder products. |
|
token |
true |
String |
The token. |
Response
|
Parameter |
Description |
Required |
Type |
Key |
Key description |
|
instanceId |
The service provider's unique identifier for the instance. |
true |
String |
- |
- |
|
hostInfo |
Host and ICP filing information displayed on the Purchased Services page in the buyer's console. |
false |
JSON |
name |
Hostname |
|
ip |
The IP address of the server. |
||||
|
innerIp |
The private IP address of the server. |
||||
|
username |
The username for the server account. |
||||
|
password |
The password for the server account. |
||||
|
cname |
The CNAME of the server. |
||||
|
tempDomain |
The temporary domain name. |
||||
|
ftpUsername |
The FTP username. |
||||
|
ftpPassword |
The FTP password. |
||||
|
region |
The region information. |
||||
|
beianInfo |
The ICP filing address. |
||||
|
databaseInfo |
The database information. |
||||
|
appInfo |
Application information displayed on the Purchased Services page in the buyer's console. |
false |
JSON |
frontEndUrl |
The front-end URL. |
|
adminUrl |
The management URL. |
||||
|
username |
The administrator username. |
||||
|
password |
The administrator password. |
||||
|
authUrl |
The single sign-on URL. |
||||
|
licenseId |
The license ID. |
||||
|
licenseValidPeriod |
The validity period of the license. |
||||
|
licenseForUserGuide |
The URL of the user guide. |
||||
|
appKey |
The AppKey used for large language model services. |
||||
|
info |
Remarks displayed on the Purchased Services page in the buyer's console. |
false |
JSON |
- |
Custom key-value data. |
Sample request
http://example.aliyundoc.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 can I identify the product and specifications that a customer purchased?
The productCode parameter is the code for the purchased product. You can find this code in the Product Code column on the product management page in the service provider console.
If the product has multiple product specifications, the skuId parameter corresponds to the specification code. You can find this code under product release > product sales information.
For example, on the Product Sales Information page, the specification code for the Enterprise Edition might be yuncode4757500001, and the code for the Flagship Edition might be yuncode4757500002.