Extend Certificate API
Extends the service period of a certificate order in whole years. The fee is deducted from the workspace balance.
Extend only prolongs the order's service period; it does not reissue the certificate or change the expiration date of an already issued certificate. To redeliver or replace the certificate, use the Reissue Certificate API.
Only some products support Extend; please ask support for the exact list. Calls for unsupported products return The current certificate does not support renewal.
Endpoint
POST /api/v1/certificate/extend
Host:
...
Full URL
/api/v1/certificate/extend
Request
Content-Type: application/json
{
"service_id": "o91bZ", // Certificate ID, required, the `service_id` returned when the order was created
"extend_years": 1 // Number of years to extend, optional, an integer from 1-5, defaults to 1 year if omitted
}
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| service_id | string | Yes | - | Certificate ID, the service_id returned by the Create Certificate Order API |
| extend_years | integer | No | 1 | Number of years to extend, an integer from 1-5 |
Fees and Orders
- The extend fee is calculated as "extend years × the number of domains currently included in the certificate", and is deducted from the workspace balance when the call succeeds.
- If the balance is insufficient, the extend fails with
400andmessageset toFailed to extend; top up and retry. - A successful extend generates a paid renewal order, along with a billing record with the remark
EXTEND#<service_id>that can be used for reconciliation. - The extend years must be within the periods supported by the product and the upstream; otherwise the request is rejected. See the error codes for details.
Repeated calls for the same certificate will extend it again and charge again. Do not retry directly after a timeout; first use the Query Certificate API to confirm whether the service period has already been extended.
Response
- response
- errors
HTTP/1.1 200 OK
Content-Type: application/json
{
"success": true,
"data": {
"service_id": "o91bZ", // Same certificate ID as passed in the request
"order_id": "ord_xxxxx", // Order ID on the CA side, provide it when contacting after-sales support
"old_validity_years": 1, // Order service years before the extend
"new_validity_years": 2, // Order service years after the extend
"new_expiration_date": "2028-01-01" // Service period expiration date after the extend
}
}
new_expiration_dateDepending on the product, the format may be YYYY-MM-DD or YYYY-MM-DD HH:mm:ss. If the CA detail query fails, this field is null; in that case, refer to the service period expiration date returned by the Query Certificate API.
HTTP/1.1 400 Bad Request
Content-Type: application/json
{
"success": false,
"message": "Failed to extend"
}
HTTP/1.1 422 Unprocessable Content
Content-Type: application/json
{
"success": false,
"message": "The current certificate does not support renewal"
}
Error Codes
| HTTP Status Code | message | Meaning and Suggested Action |
|---|---|---|
| 400 | Failed to extend | Insufficient balance, or the CA did not return a specific error; check the account balance first, then contact support |
| 400 | Error message returned by the CA | Submission to the CA failed; troubleshoot based on the message content; contact support if there is no useful information |
| 400 | The current product does not support this extend period | extend_years is not within the periods allowed by the product; use a different number of years |
| 400 | The upstream refused to accept an order with this extend period, please contact support | The CA does not accept this number of years; contact support |
| 404 | The certificate is not found, or has been cancelled or refunded | The certificate does not exist, has been cancelled or refunded, or does not belong to the workspace of the current API key |
| 422 | The current certificate does not support renewal | The certificate's product does not support Extend, or the certificate cannot be extended right now (manually locked, being submitted, being refunded, order cancelled, or missing CA order ID) |
| 422 | A renewal is being processed, please try again later | The previous extend for the same certificate has not finished processing; retry later |
| 422 | Parameter validation message | The certificate ID service_id was not provided, or extend_years is not between 1-5; the response also includes errors details |
errors DetailsWhen parameter validation fails (422), in addition to message, an errors field is returned indicating which parameter is invalid:
{
"success": false,
"message": "The extend years must not be greater than 5.",
"errors": {
"extend_years": ["The extend years must not be greater than 5."]
}
}
Prerequisites
Before calling, make sure all of the following conditions are met; otherwise the request will be rejected:
- The certificate's product supports Extend (ask support for the exact list)
- The order exists and has not been cancelled
- The certificate has been submitted to the CA and has a valid CA order ID
- The certificate is not manually locked, being submitted, or being refunded
extend_yearsis within the periods allowed by the product and the upstream- The workspace balance is sufficient to pay the extend fee
To shorten the service period and get a refund, use the Shrink Certificate API.