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

# Registration

> Registers a domain name under an existing customer account.

**Before registering**, always verify the domain is available using `GET /api/v1/domains/availability`. Attempting to register an unavailable domain will result in a failed order.

**Customer requirement:** The `customer_id` must correspond to an account previously created via `POST /api/v1/customers/signup`. The customer's saved contact details are automatically used as the WHOIS registrant, admin, tech, and billing contacts for the domain.

**Billing:** A billing settlement is performed automatically before the registration is submitted to the registry. If the settlement fails, the registration will not proceed.

**Duration:** You may register for 1–10 years. Some TLDs enforce a minimum registration period — check TLD-specific requirements if registration fails for a short duration.

**On success**, the response includes an `order_id` which is required for subsequent operations such as renewal, DNS management, and privacy protection.



## OpenAPI

````yaml POST /api/v1/domains/register
openapi: 3.1.0
info:
  title: Namify API
  description: >-
    The Namify API gives resellers and platform builders programmatic access to
    domain search, registration, renewal, customer management, and DNS
    configuration — all through a single authenticated REST interface.


    All requests require a bearer token issued from the Namify dashboard
    (Settings > API Key). The API is scoped to your partner account: TLD
    availability, pricing, and order history are all filtered to your configured
    product catalogue.


    **Base URL:** `https://dev.namify.host`


    **Typical integration flow:**

    1. Create a customer account with `POST /api/v1/customers/signup`.

    2. Check domain availability with `GET /api/v1/domains/availability`.

    3. Register the domain with `POST /api/v1/domains/register`.

    4. Activate DNS with `POST /api/v1/dns/activate` and add records as needed.

    5. Renew the domain before expiry with `POST /api/v1/domains/renew`.
  version: 1.0.0
  license:
    name: MIT
servers:
  - url: https://dev.namify.host
security:
  - bearerAuth: []
paths:
  /api/v1/domains/register:
    post:
      tags:
        - Domains
      summary: Register a domain
      description: >-
        Registers a domain name under an existing customer account.


        **Before registering**, always verify the domain is available using `GET
        /api/v1/domains/availability`. Attempting to register an unavailable
        domain will result in a failed order.


        **Customer requirement:** The `customer_id` must correspond to an
        account previously created via `POST /api/v1/customers/signup`. The
        customer's saved contact details are automatically used as the WHOIS
        registrant, admin, tech, and billing contacts for the domain.


        **Billing:** A billing settlement is performed automatically before the
        registration is submitted to the registry. If the settlement fails, the
        registration will not proceed.


        **Duration:** You may register for 1–10 years. Some TLDs enforce a
        minimum registration period — check TLD-specific requirements if
        registration fails for a short duration.


        **On success**, the response includes an `order_id` which is required
        for subsequent operations such as renewal, DNS management, and privacy
        protection.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - customer_id
                - domain_name
                - duration
              properties:
                customer_id:
                  type: integer
                  description: >-
                    ID of the customer under whose account the domain will be
                    registered.
                  example: 85384231
                domain_name:
                  type: string
                  maxLength: 80
                  description: >-
                    Fully qualified domain name to register (e.g.
                    `example.com`).
                  example: example.com
                duration:
                  type: integer
                  minimum: 1
                  maximum: 10
                  description: Registration term in years (1–10).
                  example: 1
            example:
              customer_id: 85384231
              domain_name: example.com
              duration: 1
      responses:
        '200':
          description: Domain registered successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegisterResponse'
              example:
                status: SUCCESS
                message: Domain registered successfully
                order_id: 124680932
        '401':
          description: API key is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorUnauthorized'
        '422':
          description: >-
            Registration failed. Possible causes: `customer_id` does not
            correspond to a known customer; the domain could not be registered
            (e.g. already taken, billing failure).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInvalidOrder'
              examples:
                invalid_customer:
                  summary: Unknown customer ID
                  value:
                    status: ERROR
                    message: Invalid customer ID
                registration_failed:
                  summary: Registration could not be completed
                  value:
                    status: ERROR
                    message: Unable to register domain
components:
  schemas:
    RegisterResponse:
      type: object
      properties:
        status:
          type: string
          example: SUCCESS
        message:
          type: string
          example: Domain registered successfully
        order_id:
          type: integer
          description: >-
            Unique identifier for the new domain order. Store this — it is
            required for renewal, DNS management, and order lookup.
          example: 124680932
    ErrorUnauthorized:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          example: Unauthorized
    ErrorInvalidOrder:
      type: object
      required:
        - status
        - message
      properties:
        status:
          type: string
          example: ERROR
        message:
          type: string
          example: Invalid order ID
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A personal access token. Obtain one from the dashboard under Settings >
        API Key. Include it in the `Authorization` header as `Bearer <token>`.
        Unauthenticated requests to protected routes return `401 Unauthorized`.

````