使用此端点创建单位数量订单。单位数量订单可用于为您管理的子帐户购买单位数量。
如需为子帐户购买单位数量,子帐户的定价方法必须设置为 units
。如需获取子帐户的定价方法,请使用列出子帐户产品端点。
如需创建单位数量订单,必须为帐户启用允许转移单位数量的选项。如需确定是否已经为帐户启用该选项,请联系您的客户经理。
curl --request POST 'https://www.digicert.com/services/v2/units/order' \
--header 'X-DC-DEVKEY: {{api_key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"unit_account_id": {{unit_account_id}},
"notes": "Notes about the order",
"bundle": [
{
"product_name_id": "ssl_securesite_flex",
"units": "5"
},
{
"product_name_id": "ssl_ev_securesite_flex",
"units": "20"
}
]
}'
import requests
url = "https://www.digicert.com/services/v2/units/order"
payload = "{\n \"unit_account_id\": {{unit_account_id}},\n \"notes\": \"For Testing Purpose\",\n \"bundle\": [\n {\n \"product_name_id\": \"ssl_securesite_flex\",\n \"units\": \"5\"\n },\n\t\t{\n \"product_name_id\": \"ssl_ev_securesite_flex\",\n \"units\": \"20\"\n }\n ]\n}"
headers = {
'X-DC-DEVKEY': {{api_key}},
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data = payload)
print(response.text.encode('utf8'))
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://www.digicert.com/services/v2/units/order"
method := "POST"
payload := strings.NewReader("{\n \"unit_account_id\": {{unit_account_id}},\n \"notes\": \"For Testing Purpose\",\n \"bundle\": [\n {\n \"product_name_id\": \"ssl_securesite_flex\",\n \"units\": \"5\"\n },\n {\n \"product_name_id\": \"ssl_ev_securesite_flex\",\n \"units\": \"20\"\n }\n ]\n}")
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
}
req.Header.Add("X-DC-DEVKEY", {{api_key}})
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
fmt.Println(string(body))
}
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://www.digicert.com/services/v2/units/order',
'headers': {
'X-DC-DEVKEY': {{api_key}},
'Content-Type': 'application/json'
},
body: "{\n \"unit_account_id\": {{unit_account_id}},\n \"notes\": \"For Testing Purpose\",\n \"bundle\": [\n {\n \"product_name_id\": \"ssl_securesite_flex\",\n \"units\": \"5\"\n },\n\t\t{\n \"product_name_id\": \"ssl_ev_securesite_flex\",\n \"units\": \"20\"\n }\n ]\n}"
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"id": 1371
}
名称 | 请求/选项 | 类型 | 描述 |
---|---|---|---|
unit_account_id | 必填 | integer |
需要购买单位数量的子帐户 ID。 如需获取您管理的子帐户的 ID,请使用列出子帐户端点。 |
notes | 可选 | string |
需要附加到订单的自定义备注。 字符长度限制:512 |
bundle | 必填 | array | 一个或多个对象的列表,其中含有需要为每个类型的产品订购的单位数量的相关信息。 |
.. product_name_id | 必填 | string |
需要订购单位数量的产品的唯一标识符。 允许的值:请参阅词汇表 - 产品标识符。 |
.. units | 必填 | integer | 要为指定产品订购的单位数量。 |
名称 | 类型 | 描述 |
---|---|---|
id | integer | 订单 ID。 |