使用此端點取得憑證訂單的預估價格。
如果無法判斷估計值,端點會傳回 0
的預估價格。
curl -X POST \
https://www.digicert.com/services/v2/finance/order-pricing \
-H 'Content-Type: application/json' \
-H 'X-DC-DEVKEY: {{api_key}}' \
-d '{
"certificate": {
"dns_names": [
"example.com",
"example.org",
"example.biz",
"test-example.com"
]
},
"validity_years": 2,
"product_name_id": "ssl_multi_domain"
}'
import requests
url = "https://www.digicert.com/services/v2/finance/order-pricing"
payload = "{\n \"certificate\": {\n \t\"dns_names\": [\n \t\t\"example.com\",\n \t\t\"example.org\",\n \t\t\"example.biz\",\n \t\t\"test-example.com\"\n \t]\n },\n \"validity_years\": 2,\n \"product_name_id\": \"ssl_multi_domain\"\n}"
headers = {
'X-DC-DEVKEY': "{{api_key}}",
'Content-Type': "application/json"
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://www.digicert.com/services/v2/finance/order-pricing"
payload := strings.NewReader("{\n \"certificate\": {\n \t\"dns_names\": [\n \t\t\"example.com\",\n \t\t\"example.org\",\n \t\t\"example.biz\",\n \t\t\"test-example.com\"\n \t]\n },\n \"validity_years\": 2,\n \"product_name_id\": \"ssl_multi_domain\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-DC-DEVKEY", "{{api_key}}")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
var request = require("request");
var options = { method: 'POST',
url: 'https://www.digicert.com/services/v2/finance/order-pricing',
headers:
{ 'Content-Type': 'application/json',
'X-DC-DEVKEY': '{{api_key}}' },
body:
{ certificate:
{ dns_names:
[ 'example.com',
'example.org',
'example.biz',
'test-example.com' ] },
validity_years: 2,
product_name_id: 'ssl_multi_domain' },
json: true };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
{
"base_price": 680,
"total_price": 937,
"addons_price": 257,
"addons": [
{
"subtotal": 257,
"product_id": 12,
"units": 1,
"additional_name_price": "257.00"
}
]
}
名稱 | 必填/選填 | 類型 | 說明 |
---|---|---|---|
certificate | 必填 | object | 與要保護安全的網域有關的詳細資料。 |
.. dns_names | 必填 | array | 用憑證保護安全的網域的清單。 |
validity_years | 必填 | int |
有效年數。 允許的值: 1 ,2
|
custom_expiration_date | 選填 | string |
憑證的自訂到期日。 如果包括在內,此參數會覆寫 validity_years 。格式: YYYY-MM-DD
|
is_out_of_contract | 選填 | int |
若是根據合約,請說明是否應傳回合約價格。 允許的值: 0 (合約價格),1 (非合約價格)預設: 0
|
product_name_id | 必填 | string |
要訂購的憑證產品。 請參閱詞彙 — 產品識別碼 |
名稱 | 類型 | 說明 |
---|---|---|
base_price | int | 指定的產品類型的基本費用。 |
total_price | int | 訂單的預估總費用。 |
addons_price | int | 所有增益集的成本。 |
addons | array | 與訂單增益集有關的詳細資料。 |
.. subtotal | int |
增益集成本小計。 用 units 乘以 additional_name_price 來計算。
|
.. product_id | int |
增益集的產品 ID。 可能的值: 12 (其他 SAN)
|
.. units | int | 新增到訂單中的增益集數目。 |
.. additional_name_price | string | 產品增益集的單位費用。 |