Updated on 2025-05-29 GMT+08:00

Purchasing an SSL Certificate

Function

This API is used to purchase an SSL certificate.

URI

POST /v3/scm/certificates/buy

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

It can be obtained by calling the IAM API. The value of X-Subject-Token in the response header is the user token.

Minimum: 32

Maximum: 2097152

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

cert_brand

Yes

String

Certificate authority. The options are as follows:

  • GEOTRUST

  • GLOBALSIGN

  • SYMANTEC

  • CFCA

  • TRUSTASIA

  • VTRUS

Minimum: 0

Maximum: 32

cert_type

Yes

String

Certificate type. The options are as follows:

  • DV_SSL_CERT

  • DV_SSL_CERT_BASIC

  • EV_SSL_CERT

  • EV_SSL_CERT_PRO

  • OV_SSL_CERT

  • OV_SSL_CERT_PRO

Minimum: 0

Maximum: 32

domain_type

Yes

String

Domain name type. The options are as follows:

  • SINGLE_DOMAIN: single domain name.

  • MULTI_DOMAIN: multi-domain name type.

  • WILDCARD: wildcard domain name.

Minimum: 0

Maximum: 32

effective_time

Yes

Integer

Certificate validity period, in years.

Minimum: 1

Maximum: 3

domain_numbers

Yes

Integer

Number of domain names.

  • If domain_type is set to SINGLE_DOMAIN or WILDCARD, the value is 1.

  • If domain_type is set to MULTI_DOMAIN, the value ranges from 2 to 100.

Minimum: 1

Maximum: 100

order_number

Yes

Integer

Number of purchased certificates. The value ranges from 1 to 100.

Minimum: 1

Maximum: 100

agree_privacy_protection

Yes

Boolean

Whether to agree to the privacy agreement. The value can only be true.

  • true: agree

  • false: disagree

primary_domain_type

No

String

Primary domain name type in multiple domain names. The value can be:

  • SINGLE_DOMAIN: primary single domain name

  • WILDCARD_DOMAIN: primary wildcard domain name

Minimum: 0

Maximum: 63

single_domain_number

No

Integer

Number of additional single domain names.

Minimum: 1

Maximum: 100

wildcard_domain_number

No

Integer

Number of additional wildcard domain names.

Minimum: 1

Maximum: 100

is_auto_pay

No

Boolean

Whether to enable auto payment.

  • true: enable

  • false: disable

order_id

No

String

Order ID. Used only in combined purchase scenarios.

Minimum: 0

Maximum: 63

tags

No

Array of ScsResourceTag objects

Tags.

Array Length: 0 - 10

Table 3 ScsResourceTag

Parameter

Mandatory

Type

Description

key

No

String

Tag key.

Minimum: 0

Maximum: 128

value

No

String

Tag value.

Minimum: 0

Maximum: 255

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

order_id

String

Order ID.

Minimum: 0

Maximum: 63

cert

Array of CertDetail objects

For details, see parameter description of the CertDetail field.

Array Length: 0 - 1000

Table 5 CertDetail

Parameter

Type

Description

cert_id

String

Certificate ID.

Minimum: 16

Maximum: 16

Status code: 401

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code returned for an error request.

Minimum: 3

Maximum: 36

error_msg

String

Error information returned for an error request.

Minimum: 0

Maximum: 1024

Status code: 403

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code returned for an error request.

Minimum: 3

Maximum: 36

error_msg

String

Error information returned for an error request.

Minimum: 0

Maximum: 1024

Status code: 500

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code returned for an error request.

Minimum: 3

Maximum: 36

error_msg

String

Error information returned for an error request.

Minimum: 0

Maximum: 1024

Example Requests

{
  "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 Responses

Status code: 200

Normal return.

{
  "order_id" : "CS1803192259ROA8U",
  "cert" : [ {
    "cert_id" : "scs1481110651012"
  } ]
}

Status code: 401

Authentication failed.

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

Status code: 403

Access denied.

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

Status code: 500

Failed to complete the request because of an internal server error.

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

Status Codes

Status Code

Description

200

Normal return.

401

Authentication failed.

403

Access denied.

404

Access page not found.

500

Failed to complete the request because of an internal server error.

Error Codes

See Error Codes.