Usa questo endpoint per creare un ordine unità. Gli ordini unità ti consentono di acquistare le unità per i subaccount che gestisci.
Per acquistare le unità per un subaccount, il metodo di calcolo dei prezzi per il subaccount deve essere impostato su units
. Per ottenre il metodo di calcolo del prezzo per un subaccount, usa l’endpoint Elenca prodotti subaccount.
Per creare un ordine unità, l’opzione per consentire i trasferimenti unità deve essere abilitato per il tuo account. Per scoprire se questa opzione è abilitata per il tuo account, contatta il tuo account manager.
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
}
Nome | Rich/Opz | Tipo | Descrizione |
---|---|---|---|
unit_account_id | obbligatorio | integer |
ID del subaccount per cui acquistare le unità. Per ottenere gli ID per i subaccount che gestisci, usa l'endpoint Elenca subaccount. |
notes | facoltativo | string |
Nota personalizzata da allegare all’ordine. Limite di caratteri: 512 |
bundle | obbligatorio | array | Elenco di uno o più oggetti con le informazioni sulla quantità di unità da ordinare per ciascun tipo di prodotto. |
.. product_name_id | obbligatorio | string |
Identificatore univoco per il prodotto per cui vuoi ordinare le unità. Valori consentiti: Consulta Glossario - Identificatori di prodotto. |
.. units | obbligatorio | integer | Quantità delle unità da ordinare per il prodotto specificato. |
Nome | Tipo | Descrizione |
---|---|---|
id | integer | ID dell’ordine. |