使用此端點建立單位訂單。單位訂單允許您購買用於您管理的子帳戶的單位。
若要購買用於子帳戶的單位,子帳戶的定價方法必須設定為 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。 |