跳转到内容

获取订单证书接口 ​

合作商可通过订单号获取该订单下的全部证书。接口按证书期数返回状态、域名、有效期、算法以及完整证书材料。

私钥安全

响应中的 certificate.private_key / certificate.key 包含私钥。请仅在可信服务端调用,不要写入普通业务日志、浏览器缓存或第三方分析系统。

请求信息 ​

项目说明
请求地址https://shop.everyonetrust.com/partner/GetOrderCertificates/
请求方式POST
Content-Typeapplication/json 或 application/x-www-form-urlencoded

请求参数 ​

参数类型必填说明
apikeystring是API 密钥。推荐传 app_id:api_secret,也支持通过 X-API-Key 或 Authorization: Bearer {apikey} 传入。
order_nostring是订单号。也兼容 order_number。

请求示例 ​

bash
curl -X POST "https://shop.everyonetrust.com/partner/GetOrderCertificates/" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: ak_xxxxxxxxxxxxxxxxxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -d '{
    "order_no": "CERT202607041730001234"
  }'

请求域名

请直接请求 shop.everyonetrust.com。旧域名 shop.ywxmz.com 会先重定向到新域名,部分 HTTP 客户端跟随 301/302 时会把 POST 改为 GET 并丢弃请求体,进而收到 405。

响应结构 ​

参数类型说明
codeinteger业务状态码,200 表示成功。
messagestring响应消息。
data.orderobject订单摘要,与“获取订单列表接口”的订单字段一致。
data.order.certificate_countinteger该订单返回的证书记录数。
data.certificatesarray证书详情数组,按期数、创建时间和证书 ID 升序排列。

证书详情字段 ​

参数类型说明
cert_idstring证书唯一 ID。
installment_nointeger当前证书期数。
installments_countinteger订单理论总期数。
parent_cert_idstring/null前一张关联证书 ID。
cert_statusinteger证书状态码。
cert_status_labelstring证书状态名称。
lifecycle_statusstringvalid、expiring、expired、pending、issuing 等有效性状态。
lifecycle_status_labelstring有效性状态中文名称。
order_nostring所属订单号。
order_statusinteger订单状态码。
product_namestring产品名称。
brand_namestring品牌名称。
main_domainstring主域名。
sans_domainsarray附加单域名。
wildcard_domainsarray附加通配符域名。
domainsarray证书覆盖的全部域名。
signature_algorithmstring签名算法。
hash_algorithmstring哈希算法。
key_specstring密钥规格。
serial_numberstring证书序列号。
fingerprint_sha256stringSHA-256 指纹。
issued_atstring/null签发时间,ISO 8601 格式。
valid_fromstring/null有效期开始时间。
valid_tostring/null有效期结束时间。
issue_errorstring/null签发失败原因。
certificateobject证书材料,字段见下表。
has_public_keyboolean是否成功提取公钥。
has_private_keyboolean是否包含私钥。
has_certificateboolean是否包含证书链。
has_csrboolean是否包含 CSR。

证书材料字段 ​

参数说明
public_key从叶子证书提取的 PEM 公钥。
private_keyPEM 私钥。
certificate_chain完整证书链,通常包含叶子证书和中间证书。
certificate_only仅叶子证书,不含中间证书。
intermediate_certificate_only仅中间证书。
csrPEM 格式 CSR。
certificate_leafcertificate_only 的兼容别名。
intermediate_certificateintermediate_certificate_only 的兼容别名。
crtcertificate_chain 的部署别名。
keyprivate_key 的部署别名。
ca_bundleintermediate_certificate_only 的部署别名。

响应示例 ​

json
{
  "code": 200,
  "message": "获取订单证书成功",
  "data": {
    "order": {
      "order_no": "CERT202607041730001234",
      "order_status": 2,
      "order_status_label": "已完成",
      "main_domain": "example.com",
      "installments_count": 2,
      "certificate_count": 2
    },
    "certificates": [
      {
        "cert_id": "4a1d9f70-1d53-4f70-8f4f-1d9f701d5333",
        "installment_no": 1,
        "installments_count": 2,
        "parent_cert_id": null,
        "cert_status": 1,
        "cert_status_label": "签发成功",
        "lifecycle_status": "valid",
        "lifecycle_status_label": "有效",
        "order_no": "CERT202607041730001234",
        "main_domain": "example.com",
        "domains": ["example.com"],
        "issued_at": "2026-07-04T18:00:00+08:00",
        "valid_from": "2026-07-04T18:00:00+08:00",
        "valid_to": "2027-07-04T18:00:00+08:00",
        "certificate": {
          "public_key": "-----BEGIN PUBLIC KEY-----\n...\n-----END PUBLIC KEY-----\n",
          "private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n",
          "certificate_chain": "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----\n",
          "certificate_only": "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----\n",
          "intermediate_certificate_only": "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----\n",
          "csr": "-----BEGIN CERTIFICATE REQUEST-----\n...\n-----END CERTIFICATE REQUEST-----\n"
        },
        "has_public_key": true,
        "has_private_key": true,
        "has_certificate": true,
        "has_csr": true
      }
    ]
  }
}

处理规则 ​

  • 订单必须属于当前 API Key 对应用户,否则返回 404。
  • 接口返回订单下全部未删除证书,包括等待签发、签发失败、吊销和退款状态的记录。
  • 未签发证书可能只有 CSR 或私钥,尚不存在的证书材料字段返回空字符串。
  • 重签可能使同一期出现多张证书,调用方应使用 cert_id 区分。
  • 本接口只读取本地状态,不触发上游 CA 状态同步。

错误码 ​

code说明
400缺少订单号或订单号格式错误。
401API 密钥无效。
403API 密钥关闭、吊销、过期,IP 不在白名单内,或账号被封禁。
404订单不存在或不属于当前 API Key 对应用户。
405请求方式错误。
500服务器错误。

EveryoneTrust SSL 文档中心,帮助你稳定完成 HTTPS 运维。