跳到主要内容

证书下单接口

通过 API 采购新证书。

请求

Content-Type: application/json
Content-Length: 1201

{
"unique_id": "azgZqJGX", // 唯一标识符,必填,不能重复,防止代理商一个订单重复提交的参数,用户点击时候传递订单ID过来,避免重复扣费
"product_id": "sslcom_dv_flex", // 产品ID,必填,详情请参考产品列表返回的 `id` 字段
"period": "annually", // 购买时长,必填,支持的期限规格详情请参考产品列表返回的 `support_periods` 字段
"domain_dcv": { // 域名+验证信息,必传,一条域名对应一种验证类型
// 注:
// 1. 通配符不支持 http、https方式验证
// 2. IP地址不支持 dns、邮箱验证
// 3. 多域名的 www 和不带www 算两条的费用
// 4. 用于域名验证的电子邮箱验证不允许传随意邮箱
// 用户名只能是admin@、administrator@、postmaster@、webmaster@ 或 hostmaster@
// 主机名必须是子域名或主域名
"*.example.com": "dns", //⚠️注意:通配符只支持dns或email验证
"example2.com": "http", //⚠️注意:http、https为子域名文件验证必须上传到子域名本身服务下,不支持传主域名或其他域名
"example3.com": "https",
"sub.example4.com": "admin@example4.com" // ⚠️注意:邮箱验证不支持whois邮箱,只支持admin@、administrator@、postmaster@、webmaster@、hostmaster@ + <子域名 或 主域名> 组合的邮箱
},
"csr": "---------BEGIN RSA CERTIFICATE REQUEST---------...", // CSR,必传,⚠️注意:是CSR而非私钥或公钥!若算法RSA必须2048、4096 bits,若算法ECDSA必须P-256、P-384
"contact_email": "subscriber@company.email", // 联系邮箱,必传,用于接收证书验证通知
"renew": 0, // 是否为续费订单,部分CA支持赠送30天功能
"organization": "武当山景区", // 公司名称,如果为`OV`、`EV`、`IV`类型的证书,则必须填写
"organization_unit": "IT", // 公司部门,如果为`OV`、`EV`、`IV`类型的证书,则必须填写
"registered_address_line1": "具体某条街道", // 公司注册地址,如果为`OV`、`EV`、`IV`类型的证书,则必须填写
"serial_no": "31041485234546", // 公司注册号,如果为`OV`、`EV`、`IV`类型的证书,则必须填写
"country": "CN", // 公司注册国家,如果为`OV`、`EV`、`IV`类型的证书,则必须填写
"state": "上海市", // 公司注册省份,如果为`OV`、`EV`、`IV`类型的证书,则必须填写
"city": "上海市", // 公司注册城市,如果为`OV`、`EV`、`IV`类型的证书,则必须填写
"postal_code": "200100", // 公司注册邮编,如果为`OV`、`EV`、`IV`类型的证书,则必须填写
"organization_phone": "021-10000001", // 公司电话,如果为`OV`、`EV`、`IV`类型的证书,则必须填写
"date_of_incorporation": "2019-01-01", // 公司成立日期,如果为`OV`、`EV`、`IV`类型的证书,则必须填写
"contact_name": "张君宝", // 联系人姓名,如果为`OV`、`EV`、`IV`类型的证书,则必须填写
"contact_title": "掌门", // 联系人职位,如果为`OV`、`EV`、`IV`类型的证书,则必须填写
"contact_phone": "13800138000", // 联系人电话,如果为`OV`、`EV`、`IV`类型的证书,则必须填写
"notify_url": "https://system.com/order/6163/callback" // 订单回调地址,用于接收订单状态变更通知,该地址必须能够访问到,具体通知参数请见`通知回调`
}

响应

HTTP/1.1 200 OK

Content-Type: application/json
Content-Length: 1015

{
"success": true,
"message": "OK",
"data": {
"cost": 4208.01, // 下单扣款
"service_id": "o91bZ", // 证书编号,请对接方保存此值到业务数据库(后面获取状态、尝试验证域名、更改验证方式接口均需要此参数来表示请求的哪张证书)
"caid": "358174513", // CA订单号
"status": "pending", // 订单状态,支持 `pending`(申请中)、`issued`(已签发)、`revoked`(已吊销)、`refunded`(已退款)
"cert_pem": null, // 最后一次签发证书的PEM
"ca_pem": null, // 最后一次签发证书链
"not_before": null, // 不早于
"not_after": null, // 不晚于
"has_dcv": true, // 部分厂家(如上海CA)的产品下单不会同时返回DCV讯信,请监听 “回调说明” 的 “status”=“dcv_generated” 事件获得实时最新 DCV 信息
"dcv": {
// DCV验证信息
"*.example.com": {
"type": "dns", // 验证类型,可能为 `dns`、`http`、`https`、`email`
"subdomain": "*", // 子域名
"topleveldomain": "example.com", // 主域名
"status": "valid", // 域名验证状态,可能为 `pending`(验证中,需要用户完成解析、文件上传或Email校验)、`valid`(已验证)、`caa-failure`(CAA校验失败)、`dnssec-failure`(DNSSEC安全验证失败)
"dns": {
// DNS验证信息,如果验证类型为`dns`,则这里会出现`dns`;如果验证类型为`email`,则这里会出现`email`;如果验证类型为`http`或`https`,则这里会出现`http`或`https`。
"type": "cname", // DNS 类型
"hostname": "_310dcbbf4cce62f762a2aaa148d556bd", // DNS 主机名
"fullname": "_310dcbbf4cce62f762a2aaa148d556bd.example.com", // 需要 DNS 解析的完整域名
"value": "698d51a19d8a121ce581499d7b701668.bcbe3365e6ac95ea2c0343a2395834dd.20221122.comodoca.com" // DNS 解析值
}
},
"example2.com": {
"type": "http",
"subdomain": "",
"topleveldomain": "example2.com",
"status": "pending",
"http": {
// HTTP验证信息,如果验证类型为`http`,则这里会出现`http`。
"filename": "310dcbbf4cce62f762a2aaa148d556bd.txt", // HTTP文件名
"filecontent": "698d51a19d8a121ce581499d7b70166820221122\n20221122\ncomodoca.com", // HTTP文件内容
"filepath": ".well-known/pki-validation/", // HTTP文件路径
"filefullpath": ".well-known/pki-validation/310dcbbf4cce62f762a2aaa148d556bd.txt", // HTTP文件完整路径
"url": "http://example2.com/.well-known/pki-validation/310dcbbf4cce62f762a2aaa148d556bd.txt" // HTTP文件URL
}
},
"example3.com": {
"type": "https",
"subdomain": "",
"topleveldomain": "example3.com",
"status": "pending",
"http": {
// HTTPS验证信息,如果验证类型为`https`,则这里会出现`https`。
"filename": "310dcbbf4cce62f762a2aaa148d556bd.txt", // HTTPS文件名
"filecontent": "698d51a19d8a121ce581499d7b70166820221122\n20221122\ncomodoca.com", // HTTPS文件内容
"filepath": ".well-known/pki-validation/", // HTTPS文件路径
"filefullpath": ".well-known/pki-validation/310dcbbf4cce62f762a2aaa148d556bd.txt", // HTTPS文件完整路径
"url": "https://example3.com/.well-known/pki-validation/310dcbbf4cce62f762a2aaa148d556bd.txt" // HTTPS文件URL
}
},
"sub.example4.com": {
"type": "email",
"subdomain": "email",
"topleveldomain": "example4.com",
"status": "pending",
"email": {
// Email验证信息,如果验证类型为`email`,则这里会出现`email`。
"address": "admin@example4.com", // Email地址
"available": [
// 可用的Email地址
"admin@example4.com",
"administrator@example4.com",
"webmaster@example4.com",
"postmaster@example4.com",
"hostmaster@example4.com",
"admin@email.example4.com",
"administrator@sub.example4.com",
"webmaster@sub.example4.com",
"postmaster@sub.example4.com",
"hostmaster@sub.example4.com"
]
}
}
}
}
}