Skip to content

Accept or decline a domain renewal

POST /api/v2/domains/{id}/actions/respond-to-renewal

Decline or keep a domain’s unpaid renewal order. Use it when GET /api/v2/domains/{id} shows a pendingRenewalOrder. Declining (accept: false) cancels the renewal order and its invoice. If that order also renews other domains, they get a new renewal invoice. A paid renewal cannot be declined and returns 409 not_cancelable. Accepting (accept: true) changes nothing. The invoice stays open and renewalInvoice links to it. Without an open renewal the call returns 409 no_pending_renewal. Contacts on the account need permission to place orders to decline.

Authentication: An API key with the scope write:domains. Also write:billing: only when declining (accept: false or decision: "decline"). About keys and scopes

Request

Path parameters

idstringrequired
The domain ID (dom_…).

Body

acceptboolean
false declines and cancels the renewal. true keeps it.
decisionstring
The same choice as a word. When both fields are sent, accept wins. One of accept, decline.

Example

POST /api/v2/domains/{id}/actions/respond-to-renewal
curl -X POST "https://cloud.hostup.se/api/v2/domains/dom_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/respond-to-renewal" \
-H "Authorization: Bearer $HOSTUP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"accept": false
}'

Responses

200 The decision was applied.

Response 200
{
"domainId": "dom_01hxa3b4c5d6e7f8g9h0j1k2m3",
"decision": "declined",
"newExpiresAt": null,
"renewalInvoice": null
}
Response fields
domainIdstring
The domain ID (dom_…).
decisionstring
declined: the pending renewal order was cancelled. accepted: the renewal invoice stays open for payment. One of accepted, declined.
newExpiresAtstring or null
Null for both decisions. Reserved for later use.
renewalInvoicenull
The renewal invoice to pay, when the decision leaves one. Null after declined. The renewal order is then cancelled.

Errors

Errors are Problem Details with a stable code. Branch on the code, not on the text.

400Invalid request. The response body is an RFC 7807 Problem Details document.
401Unauthorized. Authentication is required.
403Forbidden. The caller lacks a required scope or does not own the resource.
404Not found. The resource does not exist or is not owned by the caller; code is domain_not_found.
409no_pending_renewal: the domain has no unpaid renewal order. not_cancelable: the renewal is already paid or its invoice could not be checked.
429Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
500Internal error. Retry later or contact support if the issue persists.