Skip to main content

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.

Supported Products

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
}
ParameterTypeRequiredDefaultDescription
service_idstringYes-Certificate ID, the service_id returned by the Create Certificate Order API
extend_yearsintegerNo1Number 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 400 and message set to Failed 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.
This API Is Not Idempotent

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​

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
}
}
Format of new_expiration_date

Depending 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.

Error Codes​

HTTP Status CodemessageMeaning and Suggested Action
400Failed to extendInsufficient balance, or the CA did not return a specific error; check the account balance first, then contact support
400Error message returned by the CASubmission to the CA failed; troubleshoot based on the message content; contact support if there is no useful information
400The current product does not support this extend periodextend_years is not within the periods allowed by the product; use a different number of years
400The upstream refused to accept an order with this extend period, please contact supportThe CA does not accept this number of years; contact support
404The certificate is not found, or has been cancelled or refundedThe certificate does not exist, has been cancelled or refunded, or does not belong to the workspace of the current API key
422The current certificate does not support renewalThe 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)
422A renewal is being processed, please try again laterThe previous extend for the same certificate has not finished processing; retry later
422Parameter validation messageThe certificate ID service_id was not provided, or extend_years is not between 1-5; the response also includes errors details
422 Responses Include errors Details

When 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:

  1. The certificate's product supports Extend (ask support for the exact list)
  2. The order exists and has not been cancelled
  3. The certificate has been submitted to the CA and has a valid CA order ID
  4. The certificate is not manually locked, being submitted, or being refunded
  5. extend_years is within the periods allowed by the product and the upstream
  6. The workspace balance is sufficient to pay the extend fee

To shorten the service period and get a refund, use the Shrink Certificate API.