Updated on 2022-08-09 GMT+08:00

Purchasing an SSL Certificate

Function

This API is used to purchase an SSL certificate.

The request parameter agree_privacy_protection must be set to true. Otherwise, the certificate purchase application cannot be submitted.

URI

  • URI format

    POST /v2/{project_id}/scm/cert/purchase

  • Parameters

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID.

Request

Request parameters

Parameter

Mandatory

Type

Description

cert_brand

Yes

String

Certificate brand.

For example: GLOBALSIGN

cert_type

Yes

String

Certificate type. Options:

  • DV_SSL_CERT
  • DV_SSL_CERT_BASIC
  • EV_SSL_CERT
  • EV_SSL_CERT_PRO
  • OV_SSL_CERT
  • OV_SSL_CERT_PRO

domain_type

Yes

String

Domain name type. Options:

  • SINGLE_DOMAIN: single-domain name type.
  • MULTI_DOMAIN: multi-domain name type.
  • WILDCARD: wildcard domain name type.

effective_time

Yes

Integer

Certificate validity period, in years. Options:

  • 1: Purchase a certificate with a validity period of one year.
  • 2: Purchase a certificate with a validity period of two years.

domain_numbers

Yes

Integer

Number of domain names.

  • If domain_type is set to SINGLE_DOMAIN or WILDCARD, the value of domain_numbers is 1.
  • If domain_type is set to MULTI_DOMAIN, the value of domain_numbers ranges from 2 to 100.

order_number

Yes

Integer

Number of purchased certificates. Value range: 1-1000.

agree_privacy_protection

Yes

Boolean

Whether to agree with the privacy statement.

  • true: Agree with the privacy statement.
  • false: Disagree with the privacy statement.

You can purchase a certificate only when this parameter is set to true.

Response

Response parameters

Parameter

Mandatory

Type

Description

order_id

Yes

String

Order ID.

cert

Yes

Array of cert objects

Certificate list. For details, see Table 1.

Table 1 cert

Parameter

Mandatory

Type

Description

cert_id

Yes

String

Certificate ID.

Example

The following describes how to purchase a multi-domain OV certificate issued by GlobalSign. Assume that the domain quantity is 5, and the validity period is one year.

  • Example request
    { 
     "cert_brand":"GLOBALSIGN", 
     "cert_type":"OV_SSL_CERT ", 
     "domain_type":"MULTI_DOMAIN", 
     "effective_time": 1, 
     "domain_numbers": 5, 
     "order_number": 1, 
     "agree_privacy_protection":true, 
     }
  • Example response
    {  
    "order_id": "CS1803192259ROA8U" 
    "cert": [{ 
             "cert_id": "scs1481110651012", 
           }] 
    }

    or

    { 
       "error_code": "SCM.XXXX",  
       "error_msg": "XXXX"   
     }

Status Codes

Table 2 lists the normal status code returned by the API.
Table 2 Status code

Status Code

Status

Description

200

OK

Request processed successfully.

For details about error code, see Error Codes