Resources & Support



renewal_of_certificate_id so the provider can explicitly treat it as a renewal of the existing certificate.This recipe covers the case where a certificate should not simply be reissued on the same order, but should move into the next contract or billing period as a new order. That is exactly what renewal_of_certificate_id on POST /tls/certificate is for.
The distinction from re-issue matters: re-issue keeps the same certificate id and the same order. An explicit renewal creates a new order with a new certificate id, while still pointing to the previous certificate so the provider can apply any remaining validity.
id of the currently active certificateidRead the currently active certificate so you can document the starting point and use the correct renewal_of_certificate_id.
curl --request GET \
--url 'https://api.regfish.com/tls/certificate/7K9QW3M2ZT8HJ' \
--header 'x-api-key: YOUR_API_KEY'Persist at least:
idcommon_namedns_namescontract_valid_untilvalid_untilstatusCreate the new order through the same endpoint as a first-time order, but add renewal_of_certificate_id.
curl --request POST \
--url 'https://api.regfish.com/tls/certificate' \
--header 'content-type: application/json' \
--header 'x-api-key: YOUR_API_KEY' \
--data '
{
"sku": "RapidSSL",
"common_name": "www.example.com",
"dns_names": ["api.example.com"],
"csr": "-----BEGIN CERTIFICATE REQUEST-----\nMIIC...NEXT...\n-----END CERTIFICATE REQUEST-----",
"dcv_method": "dns-cname-token",
"renewal_of_certificate_id": "7K9QW3M2ZT8HJ",
"validity_days": 199
}
'The response contains a new id. That new certificate id becomes the control value for the rest of the renewal flow.
Remember that validity_days remains the purchased base order validity. After issuance, valid_until is authoritative for the effective lifetime, and renewal_bonus_days may appear once the provider has confirmed any carried-over remaining validity.
Take the validation data from validation.dns_records and apply it for the new order. Even in a renewal flow, do not assume that previous DCV data remains valid automatically.
curl --request POST \
--url 'https://api.regfish.com/dns/rr' \
--header 'content-type: application/json' \
--header 'x-api-key: YOUR_API_KEY' \
--data '
{
"type": "CNAME",
"name": "_dnsauth.example.com",
"data": "0123456789abcdef.dcv.digicert.com.",
"ttl": 300
}
'From here on, monitor the new certificate id, not the previous certificate.
curl --request GET \
--url 'https://api.regfish.com/tls/certificate/9M4TR8C6X2HP7' \
--header 'x-api-key: YOUR_API_KEY'Pay particular attention to:
statusorder_statecontract_valid_untilvalid_untilrenewal_bonus_dayscertificate_pem_availableidOnce the renewal has been issued, download the certificate through the new order and roll it out.
curl --request GET \
--url 'https://api.regfish.com/tls/certificate/9M4TR8C6X2HP7/download/pem' \
--header 'x-api-key: YOUR_API_KEY' \
--output 'certificate-9M4TR8C6X2HP7.pem'After that, update at least:
previous_certificate_id = 7K9QW3M2ZT8HJactive_certificate_id = 9M4TR8C6X2HP7renewed_from_certificate_id = 7K9QW3M2ZT8HJcontract_valid_untilrenewal_bonus_days, if presentvalid_untilid should remain in placeThis flow creates a new certificate order that the provider explicitly treats as a renewal of the previous certificate. That gives you a cleanly documented next contract cycle and keeps the case clearly separated from re-issue on the same order.
The Regfish DNS API is a great solution for developers who want to automate domains and DNS zones. Become part of the community and benefit from DNS automation. The DNS API is available free of charge to every Regfish customer.