## GET /api/v2/domains/availability

**Check domain availability**

Check one domain name and return the same availability contract used by checkout. Use this before creating a domain order: `actions.canRegister` tells whether registration is possible, `actions.canTransfer` tells whether transfer is possible, and `registryRequirements` lists the fields the order body must include for the TLD. Use `supportedRegisterYears` and `supportedTransferYears` as the allowed period lists for this availability result; do not infer extra years from the TLD name or from generic 1-10 year assumptions.

### Related Endpoints

- `POST /api/v2/domains/availability`: Check bulk domain availability
- `GET /api/v2/products/domains/{tld}`: Get TLD pricing and registry requirements
- `POST /api/v2/orders/preview`: Preview an order

### Headers

- `Accept`: application/json
- No authorization header required.

### Parameters

- `name` (query, string, required): Full domain name to check, including the TLD. Example: `example.se`
- `locale` (query, string): Optional locale hint for registry-requirement labels and reasons. Example: `en`

### Request Example

```bash
curl -X GET "https://cloud.hostup.se/api/v2/domains/availability?name=example.se" \
  -H "Accept: application/json"
```

### Response Schema

- `name` (string, optional): Checked domain name in lowercase. Example: `example.se`
- `available` (boolean, optional): True when the domain can be registered right now. Example: `true`
- `reason` (string,null, optional): Customer-facing reason when the domain is not available for registration. Example: `null`
- `actions` (object, optional)
- `actions.canRegister` (object, required)
- `actions.canRegister.allowed` (boolean, required) Example: `true`
- `actions.canRegister.reason` (string,null, required) Example: `null`
- `actions.canRegister.code` (string,null, optional): Machine-readable reason code when an action is blocked. Example: `pending_order`
- `actions.canTransfer` (object, required)
- `actions.canTransfer.allowed` (boolean, required) Example: `true`
- `actions.canTransfer.reason` (string,null, required) Example: `null`
- `actions.canTransfer.code` (string,null, optional): Machine-readable reason code when an action is blocked. Example: `pending_order`
- `billing` (object | null, optional): Default registration billing summary. `null` means the availability check did not return a usable registration price.
- `billing.amount` (number, required) Example: `99`
- `billing.currencyCode` (string, required) Example: `SEK`
- `billing.billingCycle` (string, required) Example: `annually`
- `currencyCode` (string, optional): ISO-4217 currency for `renewalAmount` and other top-level price fields. Mirrors `billing.currencyCode` when billing is present. Example: `SEK`
- `premium` (boolean, optional): True when the registry classifies the name as premium. Example: `false`
- `requiresRegistrarFeeAcceptance` (boolean, optional): True when the order must explicitly accept additional registrar fees. Example: `false`
- `eppRequired` (boolean, optional): True when transfers for this result require an authorization code. Example: `true`
- `renewalAmount` (number,null, optional): Default one-year renewal amount in `currencyCode` when exposed by the catalog. Example: `169`
- `supportedRegisterYears` (array<integer>, optional): Registration periods currently supported for this result. Only use years present in this array. Example: `[1,2,3,5]`
- `supportedTransferYears` (array<integer>, optional): Transfer periods currently supported for this result. A free transfer can still be represented as a supported year. Example: `[1]`
- `existingDomainId` (string,null, optional): Public domain ID when the authenticated caller already owns this name; otherwise `null`. Example: `null`
- `existingDomainServiceStatus` (string,null, optional): Existing service status for a caller-owned domain, when present. Example: `null`
- `registryRequirements` (object, optional): Server-derived registration and transfer requirements for this TLD. Do not reimplement TLD rules in clients.
- `registryRequirements.registration` (array<object>, required)
- `registryRequirements.registration[].key` (string, required) Example: `eppCode`
  Allowed values: eppCode, phoneNumber, registrationIdentifier, companyRegistrationNumber, birthDate, registrantCountry, registrantType, useDomicile, acceptedTerms, nameservers
- `registryRequirements.registration[].label` (string, required) Example: `Authorization code`
- `registryRequirements.registration[].required` (boolean, required) Example: `true`
- `registryRequirements.registration[].appliesTo` (string, required) Example: `transfer`
  Allowed values: register, transfer, both
- `registryRequirements.registration[].registrantType` (string, required) Example: `any`
  Allowed values: any, private, organisation
- `registryRequirements.registration[].allowedCountryCodes` (array,null, optional) Example: `null`
- `registryRequirements.registration[].allowedRegistrantTypes` (array,null, optional) Example: `null`
- `registryRequirements.registration[].alternativeRequirementKey` (string,null, optional) Example: `null`
- `registryRequirements.registration[].acceptedTermsKey` (string,null, optional) Example: `se_registration_terms`
- `registryRequirements.registration[].reason` (string, required) Example: `An authorization code is required to transfer this domain.`
- `registryRequirements.transfer` (array<object>, required)
- `registryRequirements.transfer[].key` (string, required) Example: `eppCode`
  Allowed values: eppCode, phoneNumber, registrationIdentifier, companyRegistrationNumber, birthDate, registrantCountry, registrantType, useDomicile, acceptedTerms, nameservers
- `registryRequirements.transfer[].label` (string, required) Example: `Authorization code`
- `registryRequirements.transfer[].required` (boolean, required) Example: `true`
- `registryRequirements.transfer[].appliesTo` (string, required) Example: `transfer`
  Allowed values: register, transfer, both
- `registryRequirements.transfer[].registrantType` (string, required) Example: `any`
  Allowed values: any, private, organisation
- `registryRequirements.transfer[].allowedCountryCodes` (array,null, optional) Example: `null`
- `registryRequirements.transfer[].allowedRegistrantTypes` (array,null, optional) Example: `null`
- `registryRequirements.transfer[].alternativeRequirementKey` (string,null, optional) Example: `null`
- `registryRequirements.transfer[].acceptedTermsKey` (string,null, optional) Example: `se_registration_terms`
- `registryRequirements.transfer[].reason` (string, required) Example: `An authorization code is required to transfer this domain.`
- `registryRequirements.countryEligibility` (object, required)

### Responses

#### 200 - Availability result for the requested domain.
```json
{
  "name": "example.se",
  "available": true,
  "reason": null,
  "actions": {
    "canRegister": {
      "allowed": true,
      "reason": null
    },
    "canTransfer": {
      "allowed": false,
      "reason": "Domain is available for registration, not transfer."
    }
  },
  "billing": {
    "amount": 99,
    "currencyCode": "SEK",
    "billingCycle": "annually"
  },
  "currencyCode": "SEK",
  "premium": false,
  "requiresRegistrarFeeAcceptance": false,
  "eppRequired": true,
  "renewalAmount": 169,
  "supportedRegisterYears": [
    1,
    2,
    3,
    5
  ],
  "supportedTransferYears": [
    1
  ],
  "existingDomainId": null,
  "existingDomainServiceStatus": null,
  "registryRequirements": {
    "registration": [
      {
        "key": "phoneNumber",
        "label": "Phone number",
        "required": true,
        "appliesTo": "register",
        "registrantType": "any",
        "allowedCountryCodes": null,
        "allowedRegistrantTypes": null,
        "alternativeRequirementKey": null,
        "acceptedTermsKey": null,
        "reason": ".se and .nu domains require a registrant phone number before the order can be submitted."
      },
      {
        "key": "registrationIdentifier",
        "label": "Personal identity number or organization number",
        "required": true,
        "appliesTo": "register",
        "registrantType": "any",
        "allowedCountryCodes": null,
        "allowedRegistrantTypes": null,
        "alternativeRequirementKey": null,
        "acceptedTermsKey": null,
        "reason": ".se and .nu domains require a personal identity number or organization number for the registrant."
      },
      {
        "key": "acceptedTerms",
        "label": ".se registration terms",
        "required": true,
        "appliesTo": "register",
        "registrantType": "any",
        "allowedCountryCodes": null,
        "allowedRegistrantTypes": null,
        "alternativeRequirementKey": null,
        "acceptedTermsKey": "se_registration_terms",
        "reason": ".se domain registrations require acceptance of the registry registration terms before the order can be submitted."
      }
    ],
    "transfer": [
      {
        "key": "phoneNumber",
        "label": "Phone number",
        "required": true,
        "appliesTo": "transfer",
        "registrantType": "any",
        "allowedCountryCodes": null,
        "allowedRegistrantTypes": null,
        "alternativeRequirementKey": null,
        "acceptedTermsKey": null,
        "reason": ".se and .nu domains require a registrant phone number before the order can be submitted."
      },
      {
        "key": "registrationIdentifier",
        "label": "Personal identity number or organization number",
        "required": true,
        "appliesTo": "transfer",
        "registrantType": "any",
        "allowedCountryCodes": null,
        "allowedRegistrantTypes": null,
        "alternativeRequirementKey": null,
        "acceptedTermsKey": null,
        "reason": ".se and .nu domains require a personal identity number or organization number for the registrant."
      },
      {
        "key": "eppCode",
        "label": "Authorization code",
        "required": true,
        "appliesTo": "transfer",
        "registrantType": "any",
        "allowedCountryCodes": null,
        "allowedRegistrantTypes": null,
        "alternativeRequirementKey": null,
        "acceptedTermsKey": null,
        "reason": "Transfers for this domain extension require an authorization code from the current provider."
      }
    ],
    "countryEligibility": {
      "required": false,
      "allowedCountryCodes": null,
      "reason": null
    }
  }
}
```

#### 400 - Invalid request. The response body is an RFC 7807 Problem Details document.
```json
{
  "type": "https://developer.hostup.se/errors/invalid_request",
  "title": "Invalid request",
  "status": 400,
  "detail": "The request body failed validation.",
  "code": "invalid_request",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z",
  "errors": [
    {
      "pointer": "/items/0/domainName",
      "detail": "`domainName` is required.",
      "code": "invalid_request"
    }
  ]
}
```

#### 404 - Not found. The resource does not exist or is not owned by the caller.
```json
{
  "type": "https://developer.hostup.se/errors/not_found",
  "title": "Not found",
  "status": 404,
  "detail": "The requested resource could not be found.",
  "code": "not_found",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 429 - Rate limited. Retry after the limit resets. 429 responses include `Retry-After` seconds plus `X-RateLimit-*` headers.
```json
{
  "type": "https://developer.hostup.se/errors/rate_limit_exceeded",
  "title": "Too many requests",
  "status": 429,
  "detail": "Too many requests. Retry after the limit resets.",
  "code": "rate_limit_exceeded",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 500 - Internal error. Retry later or contact support if the issue persists.
```json
{
  "type": "https://developer.hostup.se/errors/internal_error",
  "title": "Internal server error",
  "status": 500,
  "detail": "An unexpected error occurred. Retry later or contact support if the issue persists.",
  "code": "internal_error",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```
