使用此端点获取证书订单的估计价格。
如果无法确定估计值,则该端点返回 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 x additional_name_price 。
|
.. product_id | int |
附加项的产品编号。 可能的值: 12 (附加 SAN)
|
.. units | int | 添加到订单的附加项的数量。 |
.. additional_name_price | string | 产品附加项的单位费用。 |