> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rdp.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Register Domain

> Register a domain and pay for it from the account balance.

The domain is registered with WHOIS privacy and a registrar transfer
lock, pointed at the RDP.sh nameservers (`ns1.rdp.sh`, `ns2.rdp.rs`),
and given a DNS zone with default `@` and `www` A records. Pass
`nameservers` to point it elsewhere straight away, or call
`PUT /domains/{domain}/nameservers` later.

Pricing comes from the RDP.sh price list rather than the registrar:
`registration_price * years`, plus 19% VAT unless the account is VAT
exempt. Call `GET /domains/search` first for the exact amount.




## OpenAPI

````yaml post /domains
openapi: 3.1.0
info:
  title: APIFiddle Sample Definition
  version: 0.0.0
  description: Example workspace
servers:
  - url: https://rdp.sh/api/v1
    description: Default production endpoint.
security: []
paths:
  /domains:
    post:
      summary: Register domain
      description: |
        Register a domain and pay for it from the account balance.

        The domain is registered with WHOIS privacy and a registrar transfer
        lock, pointed at the RDP.sh nameservers (`ns1.rdp.sh`, `ns2.rdp.rs`),
        and given a DNS zone with default `@` and `www` A records. Pass
        `nameservers` to point it elsewhere straight away, or call
        `PUT /domains/{domain}/nameservers` later.

        Pricing comes from the RDP.sh price list rather than the registrar:
        `registration_price * years`, plus 19% VAT unless the account is VAT
        exempt. Call `GET /domains/search` first for the exact amount.
      operationId: registerDomain
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - domain
              properties:
                domain:
                  type: string
                  minLength: 3
                  maxLength: 253
                  pattern: ^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?\.[a-zA-Z]{2,}$
                  description: |
                    Domain to register, as one label plus a top-level extension
                    -- `example.com`. Subdomains and second-level extensions
                    such as `.co.uk` are not accepted. The extension must be
                    active in the RDP.sh price list, which
                    `GET /domains/pricing` returns.
                  examples:
                    - example.com
                years:
                  type: integer
                  minimum: 1
                  maximum: 10
                  default: 1
                  description: Registration term in years.
                auto_renew:
                  type: boolean
                  default: false
                  description: |
                    Renew the domain automatically. Auto-renewals are charged to
                    the account balance in the week before expiry.
                nameservers:
                  type: array
                  minItems: 2
                  maxItems: 6
                  items:
                    type: string
                    examples:
                      - ns1.example.net
                      - ns2.example.net
                  description: |
                    Point the domain at your own nameservers instead of the
                    RDP.sh ones. Omit to keep the RDP.sh nameservers and the
                    managed DNS zone. If the switch fails the domain is still
                    registered and the response carries a `warning`.
      responses:
        '201':
          content:
            application/json:
              schema:
                type: object
                title: RegisterDomainCreated
                required:
                  - status
                  - message
                  - invoice_id
                  - amount_charged
                  - years
                  - domain
                properties:
                  status:
                    type: boolean
                    examples:
                      - true
                  message:
                    type: string
                    examples:
                      - Domain registered
                  invoice_id:
                    type: integer
                    description: ID of the balance invoice created for this registration.
                    examples:
                      - 8231
                  amount_charged:
                    type: number
                    description: >-
                      Gross amount deducted from the account balance, VAT
                      included.
                    examples:
                      - 11.9
                  years:
                    type: integer
                    description: Registration term that was purchased.
                    examples:
                      - 1
                  domain:
                    $ref: '#/components/schemas/domain'
                  warning:
                    type: string
                    description: |
                      Present only when the registration succeeded but applying
                      the requested nameservers did not. The domain is
                      registered either way.
          description: |
            The domain was registered and the account balance was charged. In
            rare cases the registration lands but the managed DNS zone does
            not; `dns_records_count` is 0 when that happens and support is
            alerted automatically.
        '400':
          content:
            application/json:
              schema:
                type: object
                title: RegisterDomainInsufficientBalance
                properties:
                  status:
                    type: boolean
                    examples:
                      - false
                  error:
                    type: string
                    examples:
                      - Insufficient balance
                  required:
                    type: number
                    description: Gross amount needed, in EUR.
                    examples:
                      - 11.9
                  available:
                    type: number
                    description: Current account balance, in EUR.
                    examples:
                      - 5
          description: The account balance does not cover the registration.
        '409':
          description: |
            Another registration for the same domain is already in flight.
            Retry once it settles.
        '422':
          description: |
            Validation error, the extension is not supported, the domain is
            already registered on RDP.sh, or the domain is not available.
        '500':
          description: |
            The registrar could not be reached or rejected the order. Nothing is
            charged: a payment taken before the failure is refunded to the
            account balance.
      security:
        - Authorization: []
components:
  schemas:
    domain:
      type: object
      required: []
      properties:
        id:
          type: integer
          examples:
            - 1
        domain_name:
          type: string
          examples:
            - example.com
        status:
          type: string
          description: Domain lifecycle status.
          examples:
            - active
            - suspended
            - transferring
            - expired
        provider:
          type: string
          description: Registrar backing the domain.
          examples:
            - internetbs
            - netim
        auto_renew:
          type: boolean
        whois_privacy:
          type: boolean
        lock_status:
          type: boolean
          description: Whether the registrar transfer lock is enabled.
        use_rdp_nameservers:
          type: boolean
          description: Whether the domain uses RDP.sh-managed nameservers.
        nameservers:
          type: array
          items:
            type: string
          examples:
            - ns1.rdp.sh
            - ns2.rdp.rs
        registration_date:
          type: string
          nullable: true
          examples:
            - '2025-01-01T00:00:00.000000Z'
        expiry_date:
          type: string
          nullable: true
          examples:
            - '2027-01-01T00:00:00.000000Z'
        days_until_expiry:
          type: integer
          nullable: true
          examples:
            - 180
        is_expiring_soon:
          type: boolean
          description: True when the domain expires within 30 days.
        dns_records_count:
          type: integer
          examples:
            - 2
        created_at:
          type: string
          examples:
            - '2025-01-01T00:00:00.000000Z'
      description: Domain object.
  securitySchemes:
    Authorization:
      in: header
      name: Authorization
      type: apiKey

````