Use this endpoint to get price estimates for a voucher order.
curl --request POST 'https://www.digicert.com/services/v2/finance/voucher-pricing' \
--header 'X-DC-DEVKEY: {{api_key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"vouchers": [
{
"product_name_id": "ssl_basic",
"no_of_fqdns": "5",
"no_of_wildcards": "1",
"validity_years": 4,
"quantity": 4
},
{
"product_name_id": "ssl_ev_basic",
"no_of_fqdns": "5",
"validity_years": 4,
"quantity": 4
}
],
"billing_address": {
"country": "US",
"state": "Washington",
"city": "Spokane",
"zip": 90210
}
}'
import requests
url = "https://www.digicert.com/services/v2/finance/voucher-pricing"
payload = "{\r\n \"vouchers\": [\r\n {\r\n \"product_name_id\": \"ssl_basic\",\r\n \"no_of_fqdns\": \"5\",\r\n \"no_of_wildcards\": \"1\",\r\n \"validity_years\": 4,\r\n \"quantity\": 4\r\n },\r\n {\r\n \"product_name_id\": \"ssl_ev_basic\",\r\n \"no_of_fqdns\": \"5\",\r\n \"validity_years\": 4,\r\n \"quantity\": 4 \r\n }\r\n ],\r\n \"billing_address\": {\r\n \"country\": \"US\",\r\n \"state\": \"Washington\",\r\n \"city\": \"Spokane\",\r\n \"zip\": 90210\r\n }\r\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/finance/voucher-pricing"
method := "POST"
payload := strings.NewReader("{
\n \"vouchers\": [
\n {
\n \"product_name_id\": \"ssl_basic\",
\n \"no_of_fqdns\": \"5\",
\n \"no_of_wildcards\": \"1\",
\n \"validity_years\": 4,
\n \"quantity\": 4
\n },
\n {
\n \"product_name_id\": \"ssl_ev_basic\",
\n \"no_of_fqdns\": \"5\",
\n \"validity_years\": 4,
\n \"quantity\": 4
\n }
\n ],
\n \"billing_address\": {
\n \"country\": \"US\",
\n \"state\": \"Washington\",
\n \"city\": \"Spokane\",
\n \"zip\": 90210
\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/finance/voucher-pricing',
'headers': {
'X-DC-DEVKEY': {{api_key}},
'Content-Type': 'application/json'
},
body: JSON.stringify({"vouchers":[{"product_name_id":"ssl_basic","no_of_fqdns":"5","no_of_wildcards":"1","validity_years":4,"quantity":4},{"product_name_id":"ssl_ev_basic","no_of_fqdns":"5","validity_years":4,"quantity":4}],"billing_address":{"country":"US","state":"Washington","city":"Spokane","zip":90210}})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"voucher_prices": [
{
"product_name_id": "ssl_basic",
"no_of_fqdns": 5,
"no_of_wildcards": 1,
"validity_years": 4,
"quantity": 4,
"cost": 20188,
"tax": 1796.73,
"cost_plus_tax": 21984.73
},
{
"product_name_id": "ssl_ev_basic",
"no_of_fqdns": 5,
"validity_years": 4,
"quantity": 4,
"cost": 15048,
"tax": 1339.27,
"cost_plus_tax": 16387.27
}
],
"currency": "USD"
}
{
"errors": [
{
"code": "cannot_set_both_validity_years_and_validity_days_for_voucher",
"message": "Cannot set both validity years and validity days for voucher."
}
]
}
Name | Req/Opt | Type | Description |
---|---|---|---|
vouchers | required | array | List of objects with details about each voucher configuration to request a price estimate for. |
.. product_name_id | required | string |
Name ID of the product. Supported products:
|
.. no_of_fqdns | optional | int |
Number of FQDN SAN slots. Range: 0 -250 . Note that the total number of SANs cannot exceed 250.
|
.. no_of_wildcards | optional | int |
Number of Wildcard SAN slots. Range: 0 -250 . Note that the total number of SANs cannot exceed 250.
|
.. shipping_method | conditional | string |
Shipping method. Required for EV code signing certificates. Not used for other product types. Allowed values: STANDARD or EXPEDITED
|
.. validity_years | conditional | int |
The number of years of order coverage. You must provide a value for validity_years or validity_days .Range: 1 -6 Note: Maximum order validity varies by product. To get the maximum order validity period for a product, use the Product info endpoint. |
.. validity_days | conditional | int |
The number of days of order coverage. You must provide a value for validity_days or validity_years .Note: Maximum order validity varies by product. To get the maximum order validity period for a product, use the Product info endpoint. |
.. quantity | required | int |
Quantity of certificates you want to order with this configuration. Each certificate receives a unique voucher code. Range: 1 -1000
|
billing_address | optional | object |
Billing address details. Used to calculate estimated tax. If not provided, we calculate estimated tax using the billing address associated with the account used to send the request. |
.. country | required | string | Billing country. |
.. city | required | string | Billing city. |
.. state | conditional | string |
Billing state or province. Optional for some countries. |
.. zip | conditional | string |
Zip/postal code. Optional for some countries. |
.. address | optional | string | Billing address. |
.. address2 | optional | string | Continuation of the billing address. |
Name | Type | Definition |
---|---|---|
voucher_prices | array | List of objects with details about each voucher configuration included in the request. |
.. product_name_id | string | Name ID of the product. |
.. no_of_fqdns | int | Number of FQDN SAN slots. |
.. no_of_wildcards | int |
Number of Wildcard SAN slots. Range: 0 -250
|
.. shipping_method | string |
Shipping method. Only returned for EV code signing certificates. |
.. validity_years | int |
The number of years of order coverage. Only returned if you use validity_years to specify order validity in the request.
|
.. validity_days | int |
The number of days of order coverage. Only returned if you use validity_days to specify order validity in the request.
|
.. quantity | int | Quantity of certificates you want to order with this configuration. |
.. cost | float | Estimated cost, excluding tax. |
.. tax | float |
Estimated tax. Returns 0 if an error prevents tax calculation.Note: Estimated tax may change when you place the order. |
.. cost_plus_tax | float | Estimated cost, including tax. |