Certificado de assinatura de código do pedido

POST
https://www.digicert.com/services/v2/order/certificate/{{code_signing_certificate_id}}

This page describes products with the code_signing_certificate group name (see Glossary – Product identifiers).

Use this endpoint to submit a code signing certificate request order using code_signing or code_signing_ev as the code_signing_certificate_id.

cURL
curl -X POST \
  'https://www.digicert.com/services/v2/order/certificate/{{code_signing_certificate_id}}' \
  -H 'Content-Type: application/json' \
  -H 'X-DC-DEVKEY: {{api_key}}' \
  -d '{
  "certificate": {
    "server_platform": {
      "id": 52
    },
    "signature_hash": "sha256"
  },
  "cs_provisioning_method": "ship_token",
  "validity_years": 1,
  "comments": "Message for the approver",
  "skip_approval": true,
  "organization": {
    "id": 123456
  },
  "ship_info": {
    "name": "Erin Guerra",
    "addr1": "360 Taylor Street",
    "addr2": "Floor 74",
    "city": "Richmond",
    "state": "va",
    "zip": "69662",
    "country": "us",
    "method": "EXPEDITED"
  },
  "auto_renew": 1,
  "custom_renewal_message": "Renew this please.",
  "custom_fields": [
    {
      "metadata_id": 12,
      "value": "123456"
    }
  ],
  "payment_method": "balance"
}'
Python
import requests

url = "https://www.digicert.com/services/v2/order/certificate/{{code_signing_certificate_id}}"

payload = "{\n  \"certificate\": {\n    \"server_platform\": {\n      \"id\": 52\n    },\n    \"signature_hash\": \"sha256\"\n  },\n  \"cs_provisioning_method\": \"ship_token\",\n  \"validity_years\": 1,\n  \"comments\": \"Message for the approver\",\n  \"skip_approval\": true,\n  \"organization\": {\n    \"id\": 123456\n  },\n  \"container\": {\n    \"id\": 654321\n  },\n  \"ship_info\": {\n    \"name\": \"Erin Guerra\",\n    \"addr1\": \"360 Taylor Street\",\n    \"addr2\": \"Floor 74\",\n    \"city\": \"Richmond\",\n    \"state\": \"va\",\n    \"zip\": \"69662\",\n    \"country\": \"us\",\n    \"method\": \"EXPEDITED\"\n  },\n  \"auto_renew\": 1,\n  \"custom_renewal_message\": \"Renew this please.\",\n  \"custom_fields\": [\n    {\n      \"metadata_id\": 12,\n      \"value\": \"123456\"\n    }\n  ],\n  \"payment_method\": \"balance\"\n}"
headers = {
    'X-DC-DEVKEY': "{{api_key}}",
    'Content-Type': "application/json"
    }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
Go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://www.digicert.com/services/v2/order/certificate/{{code_signing_certificate_id}}"

	payload := strings.NewReader("{\n  \"certificate\": {\n    \"server_platform\": {\n      \"id\": 52\n    },\n    \"signature_hash\": \"sha256\"\n  },\n  \"cs_provisioning_method\": \"ship_token\",\n  \"validity_years\": 1,\n  \"comments\": \"Message for the approver\",\n  \"skip_approval\": true,\n  \"organization\": {\n    \"id\": 123456\n  },\n  \"container\": {\n    \"id\": 654321\n  },\n  \"ship_info\": {\n    \"name\": \"Erin Guerra\",\n    \"addr1\": \"360 Taylor Street\",\n    \"addr2\": \"Floor 74\",\n    \"city\": \"Richmond\",\n    \"state\": \"va\",\n    \"zip\": \"69662\",\n    \"country\": \"us\",\n    \"method\": \"EXPEDITED\"\n  },\n  \"auto_renew\": 1,\n  \"custom_renewal_message\": \"Renew this please.\",\n  \"custom_fields\": [\n    {\n      \"metadata_id\": 12,\n      \"value\": \"123456\"\n    }\n  ],\n  \"payment_method\": \"balance\"\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))

}
NodeJS
var request = require("request");

var options = { method: 'POST',
  url: 'https://www.digicert.com/services/v2/order/certificate/{{code_signing_certificate_id}}',
  headers: 
   { 'Content-Type': 'application/json',
     'X-DC-DEVKEY': '{{api_key}}' },
  body: 
   { certificate: 
      { server_platform: { id: 52 },
        signature_hash: 'sha256' },
     cs_provisioning_method: 'ship_token',
     validity_years: 1,
     comments: 'Message for the approver',
     skip_approval: true,
     organization: { id: 123456 },
     container: { id: 654321 },
     ship_info: 
      { name: 'Erin Guerra',
        addr1: '360 Taylor Street',
        addr2: 'Floor 74',
        city: 'Richmond',
        state: 'va',
        zip: '69662',
        country: 'us',
        method: 'EXPEDITED' },
     auto_renew: 1,
     custom_renewal_message: 'Renew this please.',
     custom_fields: [ { metadata_id: 12, value: '123456' } ],
     payment_method: 'balance' },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
201 Created (one-step approval)
{
    "id": 112233,
    "requests": [
        {
            "id": 113,
            "status": "pending"
        }
    ]
}
201 Created (two-step approval)
{
    "id": 112233,
    "requests": [
        {
            "id": 113,
            "status": "submitted"
        }
    ]
}
201 Created (auto approval)
{
    "id": 112233,
    "requests": [
        {
            "id": 113,
            "status": "approved"
        }
    ],
    "certificate_id": 113
}

Request parameters

Parameters with an asterisk (*) are used only for EV code signing orders.

Name Req/Opt Type Description
certificate required object Certificate details.
.. csr optional* string Certificate signing request (CSR).
Notes:
• Not required for any EV code signing certificates.
*Required if server_platform.id value is 55 (Sun Java).
• The Services API does not extract information from the CSR to fill in the details of a certificate request. You must provide values for all relevant request parameters, including organization.id. If you are requesting a certificate for an organization without an existing ID, you must provide values for all required parameters of the organization object.
.. signature_hash required string Hash algorithm used to signing the certificate.
Allowed values: sha256
.. server_platform optional object Server platform type.
Default: -1 (other)
.. .. id required int Server platform ID.
See Glossary – Server platforms
.. organization_units optional array Department in your organization associated with the certificate.
auto_renew optional int Number of times the certificate should renew automatically.
additional_emails optional array Additional email addresses to receive certificate notification emails (e.g., certificate issuance, duplicate certificate, certificate renewals, etc.).
renewal_of_order_id optional int If order is a renewal, enter the previous order's ID.
skip_approval optional bool Specify if the order should skip the approval step and be immediately submitted for validation and issued when complete.
Default: false
organization required object Object with information about the organization to associate with the request. You can associate the request with an existing organization, or you can create a new organization when you submit the order request.

To associate the request with an existing organization, pass the ID of the organization as the value of organization.id in the body of your request. To create a new organization, include the details of the organization in the organization object. For more information about the structure and required parameters of the organization object, see the Create organization documentation.

Important: When you create an order without providing an organization ID, we check the organizations that already exist in your account to avoid creating a duplicate organization. If the details you provide in the request match the details of an existing organization, we associate the order with the existing organization instead of creating a new one. To override this behavior and force the request to create a new organization, set the organization.skip_duplicate_org_check parameter to true in the body of your request.
.. id required* int The ID of an existing organization to associate with the order. To get the ID of organizations in your account, use the List organizations endpoint.
*Not required if you are creating a new organization with your request.
.. skip_duplicate_org_check optional bool Use true to skip the check for duplicate organizations in your account. When you skip this check, you force the request to create a new organization, regardless of whether the details you provide in the request match the details of an organization that already exists in your account.
Default: false
container optional object If needed, specify the container the order should be placed under.
.. id required int Container ID.
validity_years required int Number of years the certificate is valid.
Allowed values: 1, 2, 3
cs_provisioning_method* required string For EV code signing certificates, specify how you want to receive the token.
See Glossary – CS provisioning methods
ship_info* optional object For EV code signing certificates, specify the shipping address for the token.
.. name required string Name of the recipient.
.. addr1 required string Shipping address for the token.
.. addr2 optional string
.. city required string Shipping city.
.. state required string Shipping state.
.. zip required string Shipping postal code.
.. country required string Shipping country.
.. method required string Shipping priority for the token.
Allowed values: STANDARD, EXPEDITED (incurs added cost)
custom_fields optional* object Account-specific custom fields.
*Whether or not these fields are required depends on your custom field settings.
.. metadata_id required int Custom field ID.
.. value required string Value for the custom field.
Data validation type depends on your custom field settings.
payment_method optional string Specify the payment method to use.
Allowed values: balance, card, profile
Default: balance

Response parameters

Name Type Description
id int Order ID.
organization object Container for new organization details.
Only returned if a new organization was created with the order.
.. id int Organization ID for the new organization.
requests array Contains information about the request.
.. id int Request ID.
.. status string Request status.
Possible values: pending, submitted, approved, rejected
certificate_id int Certificate ID.
Returned if request status is approved.