Errors
Errors use the problem-details format of RFC 9457, media type
application/problem+json, with one extra member, code:
{
"type": "https://developers.golzak.com/domains/v1/errors#insufficient_credit",
"title": "Insufficient credit",
"status": 402,
"code": "insufficient_credit",
"detail": "Top up your Golzak account credit, then retry with a new Idempotency-Key. Nothing was ordered.",
"request_id": "req_01JA7X3M9Q2W8E5R6T7Y8U9I0P"
}
Branch on code. Codes are stable for the whole of v1: never renamed or removed, only added. A code you do not
know is not a bug: handle it by its HTTP status (4xx: show detail, do not retry; 5xx: retry with the same
Idempotency-Key). The same goes for other lists that v1 may extend (domain statuses, pending_reason, operation
types, webhook event types): treat an unknown value as unknown, never as an error. title and
detail are for humans and can change. validation_failed adds errors[], one entry per broken rule, each with
field, code and message.
Retry rule in one line:
429,500,502and network timeouts → retry with the sameIdempotency-Key; every other error → do not retry as is; fix the cause, and send a new key for the corrected request.
Order of checks on a POST
A registration is checked in this order; the first failing step answers, and nothing is ordered:
- API key and IP (
401,403), rate limit (429),Idempotency-Keypresent (428). - Request syntax (
400 invalid_request) and host-name syntax (400 invalid_domain_name). - Extension (
422 tld_manual_only,tld_not_supported), then one label plus the extension (400 invalid_domain_name). - Body rules, holder rules, years, nameservers (
422 validation_failed, all broken rules at once), then422 holder_is_reseller. - Availability (
409 domain_not_available). - Credit (
402 insufficient_credit), then daily cap (403 daily_spend_cap_reached).
All codes
Field error codes in validation_failed
errors[].code |
Meaning |
|---|---|
required |
The field is missing or empty. |
invalid_value |
Not one of the allowed values (e.g. holder.type). |
invalid_format |
Wrong format (phone, country, host name, e-mail), or a control character in text. |
too_long |
Longer than the field's limit (255 characters for most text fields). |
years_not_offered |
years is not in your price table for this operation. |
exceeds_max_validity |
The name would be valid for more than 5 years from today (ANRT decision 02/2024 art. 33.1). |
too_few / too_many |
Nameserver count outside 2 to 5. |
duplicate |
The same nameserver twice. |
The holder-specific messages are listed in Holder rules.