openapi: 3.0.0
info:
  title: ATW API - OpenAPI 3.0
  contact:
    email: support@atw.co.hu
  version: 1.0.0
servers:
  - url: https://atw.hu/api
    description: Production

tags:
  - name: User
  - name: Customers
  - name: VPS
  - name: Webhosting
  - name: Prepay
  - name: Domains
  - name: Tasks
  - name: Datacenter
  - name: Plans
  - name: Services
  - name: Invoices
  - name: Payment methods
  - name: Payments
  - name: Emails
  - name: Stripe

paths:
  /users/nomail:
    post:
      tags:
      - User
      summary: Register a new user (without email confirmation)
      description: Create a new user account without requiring email verification
      operationId: registerUser
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterRequest'
            example:
              full_name: John Doe
              phone_number: "+36.12345678"
              username: john.doe@example.com
              password: "secret123"
      responses:
        '200':
          description: User registered successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegisterResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /users/{username}/pin:
    get:
      tags:
      - User
      summary: Get user PIN
      description: Get the 6-digit PIN code for the user, used by support staff to identify a client.
      operationId: getPin
      security:
        - XToken: []
      parameters:
        - name: username
          in: path
          description: username (email)
          required: true
          schema:
            type: string
            example: john.doe@example.com
      responses:
        '200':
          description: PIN retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPinResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /users/{username}/log:
    get:
      tags:
      - User
      summary: Get user API logs
      description: Get a paginated list of API logs for the specified user.
      operationId: indexUserLog
      security:
        - XToken: []
      parameters:
        - name: username
          in: path
          description: username (email)
          required: true
          schema:
            type: string
            example: john.doe@example.com
        - $ref: '#/components/parameters/IndexFilter'
        - $ref: '#/components/parameters/IndexOrder'
        - $ref: '#/components/parameters/IndexLimit'
        - $ref: '#/components/parameters/IndexOffset'
      responses:
        '200':
          description: Logs retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexUserLogResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /users/{username}/customers:
    get:
      tags:
      - Customers
      summary: List user's customers
      description: Get a paginated list of customers belonging to the specified user.
      operationId: indexCustomers
      security:
        - XToken: []
      parameters:
        - name: username
          in: path
          description: username (email)
          required: true
          schema:
            type: string
            example: john.doe@example.com
        - $ref: '#/components/parameters/IndexFilter'
        - $ref: '#/components/parameters/IndexOrder'
        - $ref: '#/components/parameters/IndexLimit'
        - $ref: '#/components/parameters/IndexOffset'
      responses:
        '200':
          description: Customers retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexCustomersResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

    post:
      tags:
      - Customers
      summary: Create a customer
      description: Create a customer profile which is representing a a real life person, or a company. Everything is billed with this customer in mind, the address the tax number and everything is sourced from here, which makes it crucial to insert the right information. Make sure you read the examples on what valuesto give.
      operationId: createCustomer
      security:
        - XToken: []
      parameters:
        - name: username
          in: path
          description: username (email)
          required: true
          schema:
            type: string
            example: john.doe@example.com
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreCustomerRequest'
            example:
              type: PRIVATE
              name: John Doe
              ident: "1990-05-17"
              invoice_country: HU
              invoice_zip: "1138"
              invoice_city: Budapest
              invoice_street: Main St 1.
              invoice_language: hu
              payment_method: BANKTRANSFER
      responses:
        '200':
          description: Customer created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoreCustomerResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedTotp'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /users/{username}/datacenter_devices:
    get:
      tags:
      - Datacenter
      summary: List user's datacenter devices
      description: Get a list of datacenter devices accessible by the specified user.
      operationId: indexDatacenterDevices
      security:
        - XToken: []
      parameters:
        - name: username
          in: path
          description: username (email)
          required: true
          schema:
            type: string
            example: john.doe@example.com
        - $ref: '#/components/parameters/IndexFilter'
        - $ref: '#/components/parameters/IndexOrder'
        - $ref: '#/components/parameters/IndexLimit'
        - $ref: '#/components/parameters/IndexOffset'
      responses:
        '200':
          description: Datacenter devices retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexDatacenterDevicesResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /users/{user}/tokens:
    get:
      tags:
      - User
      summary: List tokens
      description: List the user's active authentication tokens. Requires HTTP Basic Auth. If the user has TOTP enabled, the `totp_code` must be supplied. Expired tokens are not returned.
      operationId: listTokens
      security:
        - BasicAuth: []
      parameters:
        - name: user
          in: path
          description: User email address
          required: true
          schema:
            type: string
            example: john.doe@example.com
      responses:
        '200':
          description: Tokens retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexUserTokensResponse'
              example:
                code: 200
                message: Request successfully completed
                response:
                  data:
                    - id: 306331
                      user_id: 1
                      username: john.doe@example.com
                      token: 1A2b3C4d5E6f7G8h9I0j1K2l3M4n5O6p
                      created_at: '2026-07-23 10:12:27'
                      updated_at: '2026-07-23 11:05:10'
                      expires_at: '2026-07-30 10:12:27'
                      ip: 127.0.0.1
                      user_agent: Mozilla/5.0
                  count: 1
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      tags:
      - User
      summary: Create a token
      description: Create a new authentication token for the user. Requires HTTP Basic Auth. If the user has TOTP enabled, the totp_code must be supplied. By default, tokens expire after 7 days. Use expires_after_days to set a custom expiration or "never" for non-expiring tokens.
      operationId: createToken
      security:
        - BasicAuth: []
      parameters:
        - name: user
          in: path
          description: User email address
          required: true
          schema:
            type: string
            example: john.doe@example.com
        - name: expires_after_days
          in: query
          description: Number of days until the token expires. Defaults to 7. Use "never" for non-expiring tokens. Must be a positive integer.
          required: false
          schema:
            type: string
            pattern: '^(\d+|never)$'
            example: "7"
        - name: totp_code
          in: query
          description: TOTP code required when the user has two-factor authentication enabled and is authenticating via password
          required: false
          schema:
            type: string
            example: "123456"
      responses:
        '200':
          description: Token created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateTokenResponse'
              example:
                code: 200
                message: Token created
                response:
                  token: aB3dE5fG7hI9jK1lM3nO5pQ7rS9tU1vW
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'

    delete:
      tags:
      - User
      summary: Destroy all tokens
      description: Delete all authentication tokens for the user, effectively logging them out from all sessions.
      operationId: destroyAllTokens
      security:
        - BasicAuth: []
      parameters:
        - name: user
          in: path
          description: User email address
          required: true
          schema:
            type: string
            example: john.doe@example.com
        - name: totp_code
          in: query
          description: TOTP code required when the user has two-factor authentication enabled and is authenticating via password
          required: false
          schema:
            type: string
            example: "123456"
      responses:
        '200':
          description: All tokens destroyed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DestroyAllTokensResponse'
              example:
                code: 200
                message: All tokens for this user removed
                response:
                  username: john.doe@example.com
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /users/{username}/totp:
    post:
      tags:
      - User
      summary: Set up TOTP
      description: Set up two-factor authentication (TOTP) for the user. Requires HTTP Basic Auth. The request body must include the TOTP secret (16 characters) and a valid TOTP code generated from that secret.
      operationId: setTotp
      security:
        - BasicAuth: []
      parameters:
        - name: username
          in: path
          description: username (email)
          required: true
          schema:
            type: string
            example: john.doe@example.com
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetTotpRequest'
            example:
              new_totp_secret: "JBSWY3DPEHPK3PXP"
              new_totp_code: "123456"
      responses:
        '200':
          description: TOTP set up successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SetTotpResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/InternalServerError'

    delete:
      tags:
      - User
      summary: Disable TOTP
      description: Disable two-factor authentication (TOTP) for the user. Requires HTTP Basic Auth. If the user has TOTP enabled, the totp_code must be supplied.
      operationId: deleteTotp
      security:
        - BasicAuth: []
      parameters:
        - name: username
          in: path
          description: username (email)
          required: true
          schema:
            type: string
            example: john.doe@example.com
        - name: totp_code
          in: query
          description: TOTP code required when the user has two-factor authentication enabled and is authenticating via password
          required: false
          schema:
            type: string
            example: "123456"
      responses:
        '200':
          description: TOTP disabled successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteTotpResponse'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /users/{username}/customers/{customer_id}:
    get:
      tags:
      - Customers
      summary: Get a user's customer
      description: Get a customer record accessible to the specified user. The response includes the customer and its related `users` collection. Authorization is based on access to `customer_id`; this route returns the same payload shape as `/customers/{customer_id}` while remaining nested under the user route.
      operationId: showUserCustomer
      security:
        - XToken: []
      parameters:
        - name: username
          in: path
          description: username (email)
          required: true
          schema:
            type: string
            example: john.doe@example.com
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
      responses:
        '200':
          description: Customer retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetCustomerResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/datacenter/devices:
    get:
      tags:
      - Datacenter
      summary: List customer's datacenter devices
      operationId: indexCustomerDatacenterDevices
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer whose devices to list
          required: true
          schema:
            type: integer
            example: 1
        - $ref: '#/components/parameters/IndexFilter'
        - $ref: '#/components/parameters/IndexOrder'
        - $ref: '#/components/parameters/IndexLimit'
        - $ref: '#/components/parameters/IndexOffset'
      responses:
        '200':
          description: Datacenter devices retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexDatacenterDevicesResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/datacenter/devices/{id}:
    get:
      tags:
      - Datacenter
      summary: Get a customer's datacenter device
      operationId: showDatacenterDevice
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: id
          in: path
          description: ID of the datacenter device
          required: true
          schema:
            type: integer
            example: 1
      responses:
        '200':
          description: Datacenter device retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowDatacenterDeviceResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

    put:
      tags:
      - Datacenter
      summary: Update a customer's datacenter device
      operationId: updateDatacenterDevice
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: id
          in: path
          description: ID of the datacenter device
          required: true
          schema:
            type: integer
            example: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDatacenterDeviceRequest'
            example:
              user_info: Updated device info
      responses:
        '200':
          description: Datacenter device updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateDatacenterDeviceResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/summary:
    get:
      tags:
      - Customers
      summary: Get customer summary
      operationId: customerSummary
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
      responses:
        '200':
          description: Customer summary retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerSummaryResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/tasks:
    get:
      tags:
      - Tasks
      summary: List customer tasks
      operationId: indexCustomerTasks
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - $ref: '#/components/parameters/IndexFilter'
        - $ref: '#/components/parameters/IndexOrder'
        - $ref: '#/components/parameters/IndexLimit'
        - $ref: '#/components/parameters/IndexOffset'
      responses:
        '200':
          description: Customer tasks retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexCustomerTasksResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/tasks/{task_id}:
    get:
      tags:
      - Tasks
      summary: Get a task
      operationId: showTask
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: task_id
          in: path
          description: ID of the task
          required: true
          schema:
            type: integer
            example: 1
      responses:
        '200':
          description: Task retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowTaskResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

    put:
      tags:
      - Tasks
      summary: Update a task
      operationId: updateTask
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: task_id
          in: path
          description: ID of the task
          required: true
          schema:
            type: integer
            example: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTaskRequest'
            example:
              result: cancel
      responses:
        '200':
          description: Task updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateTaskResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/services:
    get:
      tags:
      - Services
      summary: List customer services
      operationId: indexCustomerServices
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - $ref: '#/components/parameters/IndexFilter'
        - $ref: '#/components/parameters/IndexOrder'
        - $ref: '#/components/parameters/IndexLimit'
        - $ref: '#/components/parameters/IndexOffset'
      responses:
        '200':
          description: Services retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexCustomerServicesResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/services/{service}:
    get:
      tags:
      - Services
      summary: Get a service
      operationId: showService
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: service
          in: path
          description: ID of the service
          required: true
          schema:
            type: integer
            example: 1001
      responses:
        '200':
          description: Service retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowServiceResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

    put:
      tags:
      - Services
      summary: Update a service
      operationId: updateService
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: service
          in: path
          description: ID of the service
          required: true
          schema:
            type: integer
            example: 1001
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateServiceRequest'
            example:
              auto_renew: 1
              paymentmethod: stripe
      responses:
        '200':
          description: Service updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateServiceResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

    delete:
      tags:
      - Services
      summary: Delete a service
      description: Delete a service or cancel a pending service order. Deletion may be blocked when the service still has linked resources or unpaid items.
      operationId: destroyService
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: service
          in: path
          description: ID of the service
          required: true
          schema:
            type: integer
            example: 1001
      responses:
        '200':
          description: Service deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteServiceResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/services/{service}/valid_items:
    get:
      tags:
      - Services
      summary: Get service valid items
      operationId: showServiceValidItems
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: service
          in: path
          description: ID of the service
          required: true
          schema:
            type: integer
            example: 1001
      responses:
        '200':
          description: Service valid items retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowServiceValidItemsResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}:
    get:
      tags:
      - Customers
      summary: Get customer
      description: Retrieve a single customer the authenticated caller has access to. The response includes the customer record and the linked users who currently have access to it.
      operationId: showCustomer
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
      responses:
        '200':
          description: Customer retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetCustomerResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    put:
      tags:
      - Customers
      summary: Update a customer
      description: Update a customer record.
      operationId: updateCustomer
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer to update
          required: true
          schema:
            type: integer
            example: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCustomerRequest'
            example:
              name: John Doe
              invoice_country: HU
              invoice_zip: "1138"
              invoice_city: Budapest
              invoice_street: Main St 1.
              invoice_language: hu
              payment_method: BANKTRANSFER
      responses:
        '200':
          description: Customer updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateCustomerResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/domains:
    get:
      tags:
      - Domains
      summary: List customer domains
      description: List the domains that belong to the specified customer.
      operationId: indexCustomerDomains
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer whose domains to list
          required: true
          schema:
            type: integer
            example: 1
        - $ref: '#/components/parameters/IndexFilter'
        - $ref: '#/components/parameters/IndexOrder'
        - $ref: '#/components/parameters/IndexLimit'
        - $ref: '#/components/parameters/IndexOffset'
      responses:
        '200':
          description: Domains retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexCustomerDomainsResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      tags:
      - Domains
      summary: Create a customer domain
      description: Create a domain for the specified customer. For normal registrations and transfers this also links the supplied contacts, creates or activates the related billing service, and starts the registration process. If `prepay_task_id` is supplied, it must refer to a paid prepaid domain order that is ready to be completed.
      operationId: createCustomerDomain
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer the domain will belong to
          required: true
          schema:
            type: integer
            example: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDomainRequest'
            example:
              domain: example.hu
              registration_type: transfer
              contacts_owner: 501
              prepay_task_id: 9876
              nameserver: ns1.atw.hu
              auth_code: AUTH-CODE-123
      responses:
        '200':
          description: Domain created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateDomainResponse'
        '400':
          description: Validation failure or domain business-rule error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateDomainBadRequestResponse'
              examples:
                MissingTransferAuthCode:
                  summary: Transfer without auth code
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        auth_code:
                          - code: validation.required
                            message: The auth code field is required.
                AlreadyTaken:
                  summary: Domain has already been taken
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: already_taken

                PrepayTaskNotReady:
                  summary: Prepay task exists but cannot be used yet
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: prepay_task_not_ready
                      message: The supplied prepay task is not ready for domain registration yet.
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/domains/{domain_id}:
    delete:
      tags:
      - Domains
      summary: Delete a domain
      description: Delete a domain belonging to the specified customer.
      operationId: deleteDomain
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: domain_id
          in: path
          description: ID of the domain
          required: true
          schema:
            type: integer
            example: 9001
      responses:
        '200':
          description: Domain deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteDomainResponse'
              example:
                code: 200
                message: Record successfully removed
                response:
                  data: true
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    get:
      tags:
      - Domains
      summary: Get a domain
      description: Retrieve a single domain belonging to the specified customer. The response includes the domain record together with the linked billing service, linked contacts, and DNS zone metadata when a zone exists for the domain.
      operationId: showDomain
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: domain_id
          in: path
          description: ID of the domain
          required: true
          schema:
            type: integer
            example: 9001
      responses:
        '200':
          description: Domain retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowDomainResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

    put:
      tags:
      - Domains
      summary: Update a domain
      operationId: updateDomain
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: domain_id
          in: path
          description: ID of the domain
          required: true
          schema:
            type: integer
            example: 9001
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDomainRequest'
            example:
              nameserver: ns2.example.hu
      responses:
        '200':
          description: Domain updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateDomainResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/domains/{domain_id}/records:
    get:
      tags:
      - Domains
      summary: List domain DNS records
      description: >
        Lists DNS records for the specified domain. When `domain_id` is `'default'`,
        the default zone records are returned (only `record`, `type`, `value` fields).
      operationId: indexDomainRecords
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: domain_id
          in: path
          description: ID of the domain, or `'default'` to list the default zone records
          required: true
          schema:
            type: string
            example: "9001"
        - $ref: '#/components/parameters/IndexFilter'
        - $ref: '#/components/parameters/IndexOrder'
        - $ref: '#/components/parameters/IndexLimit'
        - $ref: '#/components/parameters/IndexOffset'
      responses:
        '200':
          description: Domain DNS records retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexDomainRecordsResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

    post:
      tags:
      - Domains
      summary: Create a domain DNS record
      description: >
        Create a DNS record for the specified domain.
        The `domain` field is auto-populated from the `domain_id` parameter.
      operationId: storeDomainRecord
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: domain_id
          in: path
          description: ID of the domain
          required: true
          schema:
            type: integer
            example: 9001
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreDomainRecordRequest'
            example:
              record: www
              type: A
              value: "192.168.1.1"
      responses:
        '200':
          description: DNS record created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowDomainRecordResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

    put:
      tags:
      - Domains
      summary: Replace all domain DNS records
      description: >
        Replaces all existing DNS records for the domain with records parsed from a DNS zone file.
        SOA and apex NS records are skipped. If any record is invalid, the whole replacement request is rejected.
      operationId: replaceDomainRecords
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: domain_id
          in: path
          description: ID of the domain
          required: true
          schema:
            type: integer
            example: 9001
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReplaceDomainRecordsRequest'
            example:
              zone: |
                $TTL 3600
                @ IN SOA ns1.atw.hu. hostmaster.example.hu. (1 3600 1800 604800 3600)
                @ IN NS ns1.atw.hu.
                www IN A 192.168.1.1
      responses:
        '200':
          description: Domain DNS records replaced successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReplaceDomainRecordsResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/domains/{domain_id}/records/{id}:
    get:
      tags:
      - Domains
      summary: Get a domain DNS record
      description: >
        Gets a single DNS record by ID for the specified domain.
      operationId: showDomainRecordById
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: domain_id
          in: path
          description: ID of the domain
          required: true
          schema:
            type: integer
            example: 9001
        - name: id
          in: path
          description: ID of the DNS record
          required: true
          schema:
            type: integer
            example: 1
      responses:
        '200':
          description: DNS record retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowDomainRecordResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

    put:
      tags:
      - Domains
      summary: Update a domain DNS record
      description: >
        Updates a DNS record by ID. Only `ttl` and `value` can be updated;
        `record` and `type` are immutable.
      operationId: updateDomainRecord
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: domain_id
          in: path
          description: ID of the domain
          required: true
          schema:
            type: integer
            example: 9001
        - name: id
          in: path
          description: ID of the DNS record
          required: true
          schema:
            type: integer
            example: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDomainRecordRequest'
            example:
              ttl: 3600
              value: "192.168.1.2"
      responses:
        '200':
          description: DNS record updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowDomainRecordResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

    delete:
      tags:
      - Domains
      summary: Delete a domain DNS record
      description: >
        Deletes a DNS record by ID.
      operationId: deleteDomainRecord
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: domain_id
          in: path
          description: ID of the domain
          required: true
          schema:
            type: integer
            example: 9001
        - name: id
          in: path
          description: ID of the DNS record
          required: true
          schema:
            type: integer
            example: 1
      responses:
        '200':
          description: DNS record deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteDomainRecordResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/domains/{domain_id}/zone_info:
    get:
      tags:
      - Domains
      summary: Get domain zone info
      description: >
        Gets the DNS zone metadata for the specified domain.
      operationId: showDomainZoneInfo
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: domain_id
          in: path
          description: ID of the domain
          required: true
          schema:
            type: integer
            example: 9001
      responses:
        '200':
          description: Domain zone info retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowDomainZoneInfoResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

    put:
      tags:
      - Domains
      summary: Update domain zone info
      description: >
        Updates DNS zone metadata for the specified domain.
        Setting `alias: no` removes the alias and copies default zone SOA values.
        Setting `alias: default` aliases to the default template zone.
        Setting `last_saved_at: now` increments the SOA serial.
      operationId: updateDomainZoneInfo
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: domain_id
          in: path
          description: ID of the domain
          required: true
          schema:
            type: integer
            example: 9001
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDomainZoneInfoRequest'
            example:
              alias: no
              last_saved_at: now
      responses:
        '200':
          description: Domain zone info updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowDomainZoneInfoResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

    post:
      tags:
      - Domains
      summary: Create domain zone info
      description: >
        Creates a DNS zone info entry for the specified domain.
        The `domain` field is auto-populated from the `domain_id`.
      operationId: storeDomainZoneInfo
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: domain_id
          in: path
          description: ID of the domain
          required: true
          schema:
            type: integer
            example: 9001
      responses:
        '200':
          description: Domain zone info created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoreDomainZoneInfoResponse'
        '400':
          $ref: '#/components/responses/UpdateDomainZoneInfoErrors'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/domains/{domain_id}/tasks:
    get:
      tags:
      - Domains
      summary: List domain tasks
      operationId: indexDomainTasks
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: domain_id
          in: path
          description: ID of the domain
          required: true
          schema:
            type: integer
            example: 9001
        - $ref: '#/components/parameters/IndexFilter'
        - $ref: '#/components/parameters/IndexOrder'
        - $ref: '#/components/parameters/IndexLimit'
        - $ref: '#/components/parameters/IndexOffset'
      responses:
        '200':
          description: Domain tasks retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexDomainTasksResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/domains/prices:
    get:
      tags:
      - Domains
      summary: List domain prices
      operationId: indexDomainPrices
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - $ref: '#/components/parameters/IndexFilter'
        - $ref: '#/components/parameters/IndexOrder'
        - $ref: '#/components/parameters/IndexLimit'
        - $ref: '#/components/parameters/IndexOffset'
      responses:
        '200':
          description: Domain prices retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexDomainPricesResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/domains-prepay:
    post:
      tags:
      - Domains
      - Prepay
      summary: Create a prepaid domain order
      description: Create a prepaid domain order and its first invoice item. On success the endpoint returns the created pending service. The endpoint accepts both the nested `domain` + `service` request body and the flat request body.
      operationId: createCustomerDomainPrepay
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer placing the prepaid domain order
          required: true
          schema:
            type: integer
            example: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
             $ref: '#/components/schemas/CreateDomainPrepayEnvelopeRequest'
      responses:
        '200':
          description: Prepaid domain order created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateDomainPrepayResponse'
        '400':
          description: Validation failure or domain pricing/business-rule error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateDomainPrepayBadRequestResponse'
              examples:
                MissingCurrency:
                  summary: Missing currency in the pricing request
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        currency:
                          - code: validation.required
                            message: The currency field is required.
                InvalidDomain:
                  summary: Unsupported or unmappable suffix
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: invalid_domain
                      message: The requested domain name uses an extension that is not supported for this pricing request.
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/contacts:
    get:
      tags:
      - Domains
      summary: List customer contacts
      description: Lists all contacts for the specified customer.
      operationId: indexContacts
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
      responses:
        '200':
          description: Contacts retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexContactsResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

    post:
      tags:
      - Domains
      summary: Create a contact
      description: >
        Creates a new contact for the specified customer.
      operationId: storeContact
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreContactRequest'
            example:
              contact_type: LEGAL
              name: Example Kft.
              ident: "12345678-1-12"
              country: HU
              language: hu
              zip_code: "1138"
              city: Budapest
              street: Main St
              contact: John Doe
              email: john.doe@example.com
              phone_number: "+36.12345678"
      responses:
        '200':
          description: Contact created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoreContactResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/contacts/{contact}:
    get:
      tags:
      - Domains
      summary: Get a contact
      description: >
        Gets a single contact by ID. Includes the linked domains relation.
      operationId: showContact
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: contact
          in: path
          description: ID of the contact
          required: true
          schema:
            type: integer
            example: 501
      responses:
        '200':
          description: Contact retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowContactResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

    put:
      tags:
      - Domains
      summary: Update a contact
      description: >
        Updates a contact. Partial updates are supported — only provided fields
        are validated and updated.
      operationId: updateContact
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: contact
          in: path
          description: ID of the contact
          required: true
          schema:
            type: integer
            example: 501
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateContactRequest'
            example:
              name: Updated Kft.
              email: updated@example.com
      responses:
        '200':
          description: Contact updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateContactResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

    delete:
      tags:
      - Domains
      summary: Delete a contact
      description: >
        Deletes a contact by ID.
      operationId: deleteContact
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: contact
          in: path
          description: ID of the contact
          required: true
          schema:
            type: integer
            example: 501
      responses:
        '200':
          description: Contact deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteContactResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/emails:
    get:
      tags:
      - Emails
      summary: List customer emails
      operationId: indexEmails
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
      responses:
        '200':
          description: Emails retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexEmailsResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

    post:
      tags:
      - Emails
      summary: Create an email
      operationId: storeEmail
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreEmailRequest'
            example:
              username: user@example.com
              quota_b: 100000000
              password: secret123
      responses:
        '200':
          description: Email created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoreEmailResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/emails/{email}:
    delete:
      tags:
      - Emails
      summary: Delete an email
      operationId: deleteEmail
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: email
          in: path
          description: Username (email address) of the email to delete
          required: true
          schema:
            type: string
            example: user@example.com
      responses:
        '200':
          description: Email deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteEmailResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

    get:
      tags:
      - Emails
      summary: Get an email
      operationId: showEmail
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: email
          in: path
          description: Username (email address) of the email
          required: true
          schema:
            type: string
            example: user@example.com
      responses:
        '200':
          description: Email retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowEmailResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

    put:
      tags:
      - Emails
      summary: Update an email
      operationId: updateEmail
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: email
          in: path
          description: Username (email address) of the email to update
          required: true
          schema:
            type: string
            example: user@example.com
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateEmailRequest'
            example:
              quota_b: 200000000
              password: newpass123
      responses:
        '200':
          description: Email updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateEmailResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/emails/{email}/quota:
    get:
      tags:
      - Emails
      summary: Get email quota usage
      operationId: showEmailQuota
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: email
          in: path
          description: Username (email address) of the email
          required: true
          schema:
            type: string
            example: user@example.com
      responses:
        '200':
          description: Quota retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowEmailQuotaResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
          '500':
            $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/emails/{email}/vacations:
    get:
      tags:
      - Emails
      summary: List email vacations
      operationId: indexEmailVacations
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: email
          in: path
          description: Username (email address) to filter vacations by
          required: true
          schema:
            type: string
            example: user@example.com
      responses:
        '200':
          description: Vacations retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexEmailVacationsResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

    post:
      tags:
      - Emails
      summary: Create an email vacation
      operationId: storeEmailVacation
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: email
          in: path
          description: Username (email address) of the email
          required: true
          schema:
            type: string
            example: user@example.com
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreEmailVacationRequest'
            example:
              message: I'm on vacation
              start_at: '2026-07-16 12:00:00'
              end_at: '2026-07-30 12:00:00'
      responses:
        '200':
          description: Vacation created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoreEmailVacationResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/emails/{email}/vacations/{vacation}:
    delete:
      tags:
      - Emails
      summary: Delete an email vacation
      operationId: deleteEmailVacation
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: email
          in: path
          description: Username (email address) of the email
          required: true
          schema:
            type: string
            example: user@example.com
        - name: vacation
          in: path
          description: ID of the vacation to delete
          required: true
          schema:
            type: integer
            example: 1
      responses:
        '200':
          description: Vacation deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteEmailVacationResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

    get:
      tags:
      - Emails
      summary: Get an email vacation
      operationId: showEmailVacation
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: email
          in: path
          description: Username (email address) of the email
          required: true
          schema:
            type: string
            example: user@example.com
        - name: vacation
          in: path
          description: ID of the vacation
          required: true
          schema:
            type: integer
            example: 1
      responses:
        '200':
          description: Vacation retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowEmailVacationResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

    put:
      tags:
      - Emails
      summary: Update an email vacation
      operationId: updateEmailVacation
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: email
          in: path
          description: Username (email address) of the email
          required: true
          schema:
            type: string
            example: user@example.com
        - name: vacation
          in: path
          description: ID of the vacation to update
          required: true
          schema:
            type: integer
            example: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateEmailVacationRequest'
            example:
              message: I'm on vacation
              start_at: '2026-07-16 12:00:00'
              end_at: '2026-07-30 12:00:00'
      responses:
        '200':
          description: Vacation updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateEmailVacationResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
          '500':
            $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/emailaliases:
    get:
      tags:
      - Emails
      summary: List email aliases
      operationId: indexEmailAliases
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
      responses:
        '200':
          description: Email aliases retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexEmailAliasesResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

    post:
      tags:
      - Emails
      summary: Create an email alias
      description: Create a new alias for a domain the customer can manage. The alias `address` must be unique and belong to an authorized hosted domain. The `target` must be one or more comma-separated email addresses.
      operationId: storeEmailAlias
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreEmailAliasRequest'
            example:
              address: user@example.com
              target: dest@example.com
      responses:
        '200':
          description: Email alias created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoreEmailAliasResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/emailaliases/{email}:
    get:
      tags:
      - Emails
      summary: Get an email alias
      description: Get a single email alias by its alias address.
      operationId: showEmailAlias
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: email
          in: path
          description: Alias address of the email alias
          required: true
          schema:
            type: string
            example: user@example.com
      responses:
        '200':
          description: Email alias retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowEmailAliasResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

    put:
      tags:
      - Emails
      summary: Update an email alias
      description: Update the target recipients for an existing email alias.
      operationId: updateEmailAlias
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: email
          in: path
          description: Alias address of the email alias to update
          required: true
          schema:
            type: string
            example: user@example.com
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreEmailAliasRequest'
            example:
              address: user@example.com
              target: dest@example.com,backup@example.com
      responses:
        '200':
          description: Email alias updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoreEmailAliasResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

    delete:
      tags:
      - Emails
      summary: Delete an email alias
      operationId: deleteEmailAlias
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: email
          in: path
          description: Alias address of the email alias to delete
          required: true
          schema:
            type: string
            example: user@example.com
      responses:
        '200':
          description: Email alias deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteEmailAliasResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/webhostings:
    get:
      tags:
      - Webhosting
      summary: List customer webhostings
      description: List webhosting accounts that belong to the customer. Each entry includes the linked billing service when available.
      operationId: indexWebhostings
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - $ref: '#/components/parameters/IndexFilter'
        - $ref: '#/components/parameters/IndexOrder'
        - $ref: '#/components/parameters/IndexLimit'
        - $ref: '#/components/parameters/IndexOffset'
      responses:
        '200':
          description: Webhostings retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexWebhostingsResponse'
              examples:
                default:
                  summary: Customer webhosting list
                  value:
                    code: 200
                    message: Request successfully completed
                    response:
                      count: 1
                      data:
                        - id: 104767
                          server: ns1.example.test
                          user: exampleuser
                          username: exampleuser
                          domain: example.hu
                          state: active
                          service_id: 53173
                          disk_quota_kb: 2000000
                          sql_quota_kb: 4099000
                          email_quota_mb: 2500
                          domain_limit: 1
                          datashare_limit: 25
                          created_at: '2019-09-05 11:58:38'
                          service:
                            id: 53173
                            customer_id: 1
                            product_id: CUSTOM-12-WH
                            product_group: webhosting
                            state: active
                            price: 2490
                            vat: 27
                            invoice_interval_months: 12
                            price_currency: HUF
                            invoice_currency: HUF
                            started_on: '2026-07-01'
                            invoiced_until: '2027-06-30'
                            paid_until: '2027-06-30'
                            last_paid: '2026-07-01'
                            comment: example webhosting
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

    post:
      tags:
      - Webhosting
      summary: Create a webhosting account
      description: Create a new webhosting account for the customer.
      operationId: storeWebhosting
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreWebhostingRequest'
            example:
              disk_quota_kb: 2000000
              sql_quota_kb: 4099000
              email_quota_mb: 2500
              password: secret123
              domain: example.com
      responses:
        '200':
          description: Webhosting account created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoreWebhostingResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/webhostings/prepay:
    post:
      tags:
      - Webhosting
      - Prepay
      summary: Create a prepaid webhosting order
      description: Create a prepaid webhosting order and its first invoice item. The returned service remains in `paymentpending` state until the generated invoice item is invoiced and paid.
      operationId: createCustomerWebhostingPrepay
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer placing the prepaid webhosting order
          required: true
          schema:
            type: integer
            example: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhostingPrepayRequest'
            example:
              webhosting:
                username: tesztelek1
                disk_quota_kb: 2000000
                sql_quota_kb: 1000000
                email_quota_mb: 2000
                datashare_limit: 200
                domain_limit: 50
              wh_create_options: {}
              service:
                currency: HUF
                invoice_interval_months: 12
              order: {}
      responses:
        '200':
          description: Prepaid webhosting order created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateWebhostingPrepayResponse'
        '400':
          description: Validation failure or prepaid webhosting request-shape error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                InvalidJson:
                  summary: Invalid JSON body
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: invalid json Syntax error
                UnknownFields:
                  summary: Unknown top-level fields
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: unknown fields extra
                MissingKey:
                  summary: Missing required top-level key
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: missing service
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/webhostings/{whuser}:
    get:
      tags:
      - Webhosting
      summary: Get a webhosting account
      description: Get one webhosting account with its hosted domains, linked billing service, and current disk usage.
      operationId: getWebhosting
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account to retrieve
          required: true
          schema:
            type: integer
            example: 104767
      responses:
        '200':
          description: Webhosting account retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowWebhostingResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    put:
      tags:
      - Webhosting
      summary: Update a webhosting account
      description: Update one webhosting account. Only the submitted fields are changed.
      operationId: updateWebhosting
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account to update
          required: true
          schema:
            type: integer
            example: 104767
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreWebhostingRequest'
            example:
              disk_quota_kb: 2500000
              sql_quota_kb: 5000000
              email_quota_mb: 3000
              ip_allowed: HU,AT
              webexec: false
      responses:
        '200':
          description: Webhosting account updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoreWebhostingResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    delete:
      tags:
      - Webhosting
      summary: Delete a webhosting account
      description: Delete a webhosting account and its linked billing service. Related hosted databases, mailboxes, aliases, and vacations are also removed.
      operationId: deleteWebhosting
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account to delete
          required: true
          schema:
            type: integer
            example: 104767
      responses:
        '200':
          description: Webhosting account deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteWebhostingResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/webhostings/{whuser}/backups:
    get:
      tags:
      - Webhosting
      summary: List available webhosting backups
      description: List available backup dates for one webhosting account. Only backups on or after the account creation date are returned.
      operationId: listWebhostingBackups
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
      responses:
        '200':
          description: Backup dates retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListWebhostingBackupsResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/webhostings/{whuser}/backups/{date}:
    get:
      tags:
      - Webhosting
      summary: Get a webhosting backup
      description: Retrieve one webhosting backup for the selected backup date. The date must be one of the values returned by the backup list endpoint for the same webhosting account.
      operationId: getWebhostingBackup
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
        - name: date
          in: path
          description: Backup date returned by the backup list endpoint
          required: true
          schema:
            type: string
            format: date
            example: '2026-07-20'
      responses:
        '200':
          description: Backup retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetWebhostingBackupResponse'
        '400':
          description: Backup date is not available for the selected webhosting account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                InvalidBackupDate:
                  summary: Backup date is not available
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: invalid_backup_date
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    put:
      tags:
      - Webhosting
      summary: Get a webhosting backup
      operationId: getWebhostingBackupViaPut
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
        - name: date
          in: path
          description: Backup date returned by the backup list endpoint
          required: true
          schema:
            type: string
            format: date
            example: '2026-07-20'
      responses:
        '200':
          description: Backup retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetWebhostingBackupResponse'
        '400':
          description: Backup date is not available for the selected webhosting account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                InvalidBackupDate:
                  summary: Backup date is not available
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: invalid_backup_date
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/webhostings/{whuser}/ftp_logs:
    get:
      tags:
      - Webhosting
      summary: List webhosting FTP logs
      description: List FTP upload and delete events for one webhosting account.
      operationId: listWebhostingFtpLogs
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
      responses:
        '200':
          description: FTP log entries retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexWebhostingFtpLogsResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/vps:
    get:
      tags:
      - VPS
      summary: List customer VPS instances
      description: List VPS instances belonging to the customer. The index eagerly loads the linked billing service for each VPS.
      operationId: listCustomerVps
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - $ref: '#/components/parameters/IndexFilter'
        - $ref: '#/components/parameters/IndexOrder'
        - $ref: '#/components/parameters/IndexLimit'
        - $ref: '#/components/parameters/IndexOffset'
      responses:
        '200':
          description: VPS instances retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexVpsResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      tags:
      - VPS
      summary: Create a VPS instance
      description: Create a VPS instance.
      operationId: createCustomerVps
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreVpsRequest'
            example:
              service_invoice_interval_months: 1
              service_currency: HUF
              ram_size_mb: 1024
              cpu_count: 4
              ssd_size_gb: 100
              hdd_size_gb: 500
      responses:
        '200':
          description: VPS instance created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoreVpsResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/vps/prepay:
    post:
      tags:
      - VPS
      - Prepay
      summary: Create a prepaid VPS order
      description: Create a prepaid VPS order and its first invoice item. You will need to find the correct InvoiceItem using the `indexCustomerInvoiceItems` route which correlates with this services id then create a invoice and pay it to get the service started.
      operationId: createCustomerVpsPrepay
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer placing the prepaid VPS order
          required: true
          schema:
            type: integer
            example: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateVpsPrepayRequest'
            example:
              vps:
                cpu_model: Broadwell
                cpu_count: 2
                ram_size_mb: 4096
                ssd_size_gb: 50
                hdd_size_gb: 0
                extra_ip_count: 0
              vps_create_options:
                os: debian-12
              service:
                invoice_interval_months: 12
                currency: HUF
                pkg_version: '5'
              order: {}
      responses:
        '200':
          description: Prepaid VPS order created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateVpsPrepayResponse'
        '400':
          description: Validation failure or prepaid VPS request-shape error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                InvalidJson:
                  summary: Invalid JSON body
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: invalid json Syntax error
                UnknownFields:
                  summary: Unknown top-level fields
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: unknown fields extra
                MissingKey:
                  summary: Missing required top-level key
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: missing service
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/vps/{vpsid}:
    get:
      tags:
      - VPS
      summary: Get a VPS instance
      description: Get one VPS instance with its linked billing service, disks, interfaces, and assigned addresses.
      operationId: getCustomerVps
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: vpsid
          in: path
          description: ID of the VPS instance to retrieve
          required: true
          schema:
            type: integer
            example: 101
      responses:
        '200':
          description: VPS instance retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowVpsResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    put:
      tags:
      - VPS
      summary: Update a VPS instance
      description: Update one VPS instance. Only the submitted fields are changed.
      operationId: updateCustomerVps
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: vpsid
          in: path
          description: ID of the VPS instance to update
          required: true
          schema:
            type: integer
            example: 101
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreVpsRequest'
            example:
              ram_size_mb: 2048
              cpu_count: 4
              ssd_size_gb: 120
              hdd_size_gb: 500
              custom_name: Example VPS
      responses:
        '200':
          description: VPS instance updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoreVpsResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    delete:
      tags:
      - VPS
      summary: Delete a VPS instance
      description: Delete a VPS instance. This only works while the VPS is in `OFF` state. On success the VPS and its related disks, interfaces, assigned IP addresses, and linked billing service are removed.
      operationId: deleteCustomerVps
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: vpsid
          in: path
          description: ID of the VPS instance to delete
          required: true
          schema:
            type: integer
            example: 101
      responses:
        '200':
          description: VPS instance deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteVpsResponse'
        '400':
          description: VPS must be stopped before deletion
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                ServerNotOff:
                  summary: VPS must be stopped first
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: server_not_off
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/vps/{vpsid}/image:
    post:
      tags:
      - VPS
      summary: Set the VPS image
      description: Set the selected image for a VPS instance. The `image` value should be one of the names returned by the VPS image listing endpoints such as `GET /customers/{customer_id}/vps/{vpsid}/images` or the global `/vps/images` catalog.
      operationId: updateVpsImage
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: vpsid
          in: path
          description: ID of the VPS instance
          required: true
          schema:
            type: integer
            example: 101
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateVpsImageRequest'
            example:
              image: debian-12
      responses:
        '200':
          description: VPS image updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateVpsImageResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/vps/{vpsid}/images:
    get:
      tags:
      - VPS
      summary: List available VPS images
      description: List the VPS images that can be selected for the VPS image update route.
      operationId: listVpsImages
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: vpsid
          in: path
          description: ID of the VPS instance
          required: true
          schema:
            type: integer
            example: 101
      responses:
        '200':
          description: VPS images retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListVpsImagesResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/vps/{vpsid}/vnc:
    post:
      tags:
      - VPS
      summary: Create VPS console access data
      description: Create temporary console access data for a VPS instance.
      operationId: createVpsVNCToken
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: vpsid
          in: path
          description: ID of the VPS instance
          required: true
          schema:
            type: integer
            example: 101
      responses:
        '200':
          description: Console access data created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateVpsVncResponse'
        '400':
          description: VMware VPS host lookup failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                VpsHostMissing:
                  summary: VMware host missing
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: vps_host_missing
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/vps/{vpsid}/disks:
    get:
      tags:
      - VPS
      summary: List VPS disks
      description: List disks belonging to the selected VPS instance.
      operationId: listVpsDisks
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: vpsid
          in: path
          description: ID of the VPS instance
          required: true
          schema:
            type: integer
            example: 101
      responses:
        '200':
          description: VPS disks retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexVpsDisksResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      tags:
      - VPS
      summary: Create a VPS disk
      description: Create a new disk for the selected VPS instance.
      operationId: createVpsDisk
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: vpsid
          in: path
          description: ID of the VPS instance
          required: true
          schema:
            type: integer
            example: 101
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreVpsDiskRequest'
            example:
              name: vps101-ssd-1
              size_mib: 51200
              type: ssd
              sla: high
              bus: virtio
              boot: Y
      responses:
        '200':
          description: VPS disk created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoreVpsDiskResponse'
        '400':
          description: Validation failure or VPS disk business-rule error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                MissingName:
                  summary: Disk name is required
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        name:
                          - code: validation.required
                            message: The name field is required.
                IdeNotSupportedOnQ35:
                  summary: IDE bus is not supported on q35 machines
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: ide_not_supported_on_q35
                SnapshotMustBeSameSizeAsParent:
                  summary: Snapshot size differs from parent disk
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: snapshot_must_be_same_size_as_parent
                SnapshotMustBeSameSlaAsParent:
                  summary: Snapshot SLA differs from parent disk
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: snapshot_must_be_same_sla_as_parent
                SnapshotMustBeSameTypeAsParent:
                  summary: Snapshot type differs from parent disk
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: snapshot_must_be_same_type_as_parent
                DiskOverQuota:
                  summary: Total disk size exceeds VPS quota
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: disk_over_quota
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/vps/{vpsid}/disks/{diskid}:
    get:
      tags:
      - VPS
      summary: Get a VPS disk
      description: Show information about a single disk belonging to the selected VPS instance.
      operationId: getVpsDisk
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: vpsid
          in: path
          description: ID of the VPS instance
          required: true
          schema:
            type: integer
            example: 101
        - name: diskid
          in: path
          description: ID of the disk
          required: true
          schema:
            type: integer
            example: 501
      responses:
        '200':
          description: VPS disk retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowVpsDiskResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    put:
      tags:
      - VPS
      summary: Update a VPS disk
      description: Update a disk belonging to the selected VPS instance. The disk size can only be increased, not reduced.
      operationId: updateVpsDisk
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: vpsid
          in: path
          description: ID of the VPS instance
          required: true
          schema:
            type: integer
            example: 101
        - name: diskid
          in: path
          description: ID of the disk
          required: true
          schema:
            type: integer
            example: 501
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateVpsDiskRequest'
            example:
              size_mib: 102400
              boot: Y
      responses:
        '200':
          description: VPS disk updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoreVpsDiskResponse'
        '400':
          description: Validation failure or VPS disk business-rule error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                DiskShrink:
                  summary: Disk size cannot be reduced
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        size_mib:
                          - code: validation.disk_shrink
                            message: Disks can not be shrunk.
                NameCannotBeModified:
                  summary: Disk name is immutable after creation
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        name:
                          - code: validation.cannot_be_modified
                            message: The name field cannot be modified.
                HasSnapshots:
                  summary: Disk size cannot be changed while snapshots exist
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: has_snapshots
                IdeNotSupportedOnQ35:
                  summary: IDE bus is not supported on q35 machines
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: ide_not_supported_on_q35
                DiskOverQuota:
                  summary: Total disk size exceeds VPS quota
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: disk_over_quota
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    delete:
      tags:
      - VPS
      summary: Delete a VPS disk
      description: Remove a disk from the selected VPS instance. Regular disks can only be removed while the VPS is in the `OFF` state.
      operationId: deleteVpsDisk
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: vpsid
          in: path
          description: ID of the VPS instance
          required: true
          schema:
            type: integer
            example: 101
        - name: diskid
          in: path
          description: ID of the disk
          required: true
          schema:
            type: integer
            example: 501
      responses:
        '200':
          description: VPS disk deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteVpsDiskResponse'
        '400':
          description: The selected VPS must be stopped before deleting a regular disk
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                ServerNotOff:
                  summary: VPS must be stopped first
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: server_not_off
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/vps/{vpsid}/interfaces:
    get:
      tags:
      - VPS
      summary: List VPS interfaces
      description: List network interfaces belonging to the selected VPS instance.
      operationId: listVpsInterfaces
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: vpsid
          in: path
          description: ID of the VPS instance
          required: true
          schema:
            type: integer
            example: 101
      responses:
        '200':
          description: VPS interfaces retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexVpsInterfacesResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/vps/{vpsid}/interfaces/{interfaceid}:
    get:
      tags:
      - VPS
      summary: Get a VPS interface
      description: Show information about a single network interface belonging to the selected VPS instance.
      operationId: getVpsInterface
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: vpsid
          in: path
          description: ID of the VPS instance
          required: true
          schema:
            type: integer
            example: 101
        - name: interfaceid
          in: path
          description: ID of the interface
          required: true
          schema:
            type: integer
            example: 901
      responses:
        '200':
          description: VPS interface retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowVpsInterfaceResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    put:
      tags:
      - VPS
      summary: Update a VPS interface
      description: Update a network interface belonging to the selected VPS instance.
      operationId: updateVpsInterface
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: vpsid
          in: path
          description: ID of the VPS instance
          required: true
          schema:
            type: integer
            example: 101
        - name: interfaceid
          in: path
          description: ID of the interface
          required: true
          schema:
            type: integer
            example: 901
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateVpsInterfaceRequest'
            example:
              hw_model: virtio
      responses:
        '200':
          description: VPS interface updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateVpsInterfaceResponse'
        '400':
          description: Validation failure for interface update
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                InvalidHwModel:
                  summary: Unsupported NIC model
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        hw_model:
                          - code: validation.in
                            message: The selected hw model is invalid.
                NameRequiresSuperuser:
                  summary: Field cannot be changed here
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        name:
                          - code: validation.superuser
                            message: No privilege.
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/vps/{vpsid}/interfaces/{interfaceid}/stat:
    get:
      tags:
      - VPS
      summary: Get VPS interface traffic statistics
      description: Query traffic statistics for a single VPS interface.
      operationId: getVpsInterfaceStats
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: vpsid
          in: path
          description: ID of the VPS instance
          required: true
          schema:
            type: integer
            example: 101
        - name: interfaceid
          in: path
          description: ID of the interface
          required: true
          schema:
            type: integer
            example: 901
        - name: type
          in: query
          description: Statistic series to query.
          required: true
          schema:
            type: string
            enum:
              - packets
              - bytes
            example: bytes
        - name: from
          in: query
          description: Inclusive lower timestamp bound as a Unix timestamp in seconds.
          required: true
          schema:
            type: integer
            example: 1721552400
        - name: to
          in: query
          description: Exclusive upper timestamp bound as a Unix timestamp in seconds.
          required: true
          schema:
            type: integer
            example: 1721556000
      responses:
        '200':
          description: VPS interface statistics retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetVpsInterfaceStatsResponse'
        '400':
          description: Validation failure for the query parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                MissingType:
                  summary: Metric type is required
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        type:
                          - code: validation.required
                            message: The type field is required.
                InvalidType:
                  summary: Metric type must be packets or bytes
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        type:
                          - code: validation.in
                            message: The selected type is invalid.
                InvalidFrom:
                  summary: From must be an integer timestamp
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        from:
                          - code: validation.integer
                            message: The from must be an integer.
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/vps/{vpsid}/tasks:
    get:
      tags:
      - VPS
      summary: List VPS tasks
      description: List tasks belonging to the selected VPS instance.
      operationId: listVpsTasks
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: vpsid
          in: path
          description: ID of the VPS instance
          required: true
          schema:
            type: integer
            example: 101
        - $ref: '#/components/parameters/IndexFilter'
        - $ref: '#/components/parameters/IndexOrder'
        - $ref: '#/components/parameters/IndexLimit'
        - $ref: '#/components/parameters/IndexOffset'
      responses:
        '200':
          description: VPS tasks retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexVpsTasksResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      tags:
      - VPS
      summary: Create a VPS task
      description: Queue or execute a command for the selected VPS instance. Supported commands are `install`, `poweron`, `poweroff`, `shutdown`, `reboot`, and `recovery`. Install tasks may additionally require `password`, `os`, and optionally `systemdisk`.
      operationId: createVpsTask
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: vpsid
          in: path
          description: ID of the VPS instance
          required: true
          schema:
            type: integer
            example: 101
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreVpsTaskRequest'
            example:
              command: install
              password: StrongPass123
              os: debian-12
              systemdisk: 501
      responses:
        '200':
          description: VPS task created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoreVpsTaskResponse'
        '400':
          description: Validation failure or VPS task business-rule error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                MissingCommand:
                  summary: Command is required
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        command:
                          - code: validation.required
                            message: The command field is required.
                InvalidCommand:
                  summary: Unsupported task command
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        command:
                          - code: validation.in
                            message: The selected command is invalid.
                DisabledService:
                  summary: VPS service is disabled
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: disabled_service
                ContactSupport:
                  summary: VMware reinstall must be handled manually
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: contact_support
                ServerNotOff:
                  summary: VPS must be off for install, poweron, or recovery
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: server_not_off
                NoPassword:
                  summary: Install requires a password
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: no_password
                NoOs:
                  summary: Install requires an operating system image
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: no_os
                SystemDiskDoesNotBelongToVps:
                  summary: Selected system disk belongs to another VPS
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: system_disk_does_not_belong_to_vps
                NoVpsDisks:
                  summary: Power-on or recovery requires at least one disk
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: no_vps_disks
                ServerNotOn:
                  summary: Shutdown or poweroff requires the VPS to be running
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: server_not_on
                AlreadyStopping:
                  summary: Shutdown was already requested
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: already_stopping
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/vps/{vpsid}/tasks/{id}:
    get:
      tags:
      - VPS
      summary: Get a VPS task
      description: Show a single task belonging to the selected VPS instance.
      operationId: getVpsTask
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: vpsid
          in: path
          description: ID of the VPS instance
          required: true
          schema:
            type: integer
            example: 101
        - name: id
          in: path
          description: ID of the VPS task
          required: true
          schema:
            type: integer
            example: 701
      responses:
        '200':
          description: VPS task retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowVpsTaskResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/webhostings/{whuser}/domains:
    get:
      tags:
      - Webhosting
      summary: List webhosting domains
      description: List domains attached to the selected webhosting account.
      operationId: listWebhostingDomains
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
        - $ref: '#/components/parameters/IndexFilter'
        - $ref: '#/components/parameters/IndexOrder'
        - $ref: '#/components/parameters/IndexLimit'
        - $ref: '#/components/parameters/IndexOffset'
      responses:
        '200':
          description: Webhosting domains retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexWebhostingDomainsResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      tags:
      - Webhosting
      summary: Create a webhosting domain
      description: Add a hosted domain to the selected webhosting account.
      operationId: createWebhostingDomain
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreWebhostingDomainRequest'
            example:
              domain: blog.example.com
              path: /www/blog/
              php_version: '8.2'
      responses:
        '200':
          description: Webhosting domain created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoreWebhostingDomainResponse'
        '400':
          description: Validation failure or hosted-domain business-rule error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                MissingDomain:
                  summary: Domain is required
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        domain:
                          - code: validation.required
                            message: The domain field is required.
                InvalidPhpVersion:
                  summary: Unsupported PHP version
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        php_version:
                          - code: validation.invalid_version
                            message: Invalid version.
                InvalidPrivateKey:
                  summary: DKIM private key is invalid
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        dkim_private:
                          - code: validation.invalid_private_key
                            message: validation.invalid_private_key
                NoPrivilege:
                  summary: Customer cannot attach this domain
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        domain:
                          - code: validation.no_privilege
                            message: validation.no_privilege
                LimitExceeded:
                  summary: Webhosting domain limit exceeded
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        domain:
                          - code: validation.limit_exceeded
                            message: Limit exceeded.
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/webhostings/{whuser}/domains/{domain}:
    get:
      tags:
      - Webhosting
      summary: Get a webhosting domain
      description: Show a single hosted domain belonging to the selected webhosting account.
      operationId: getWebhostingDomain
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
        - name: domain
          in: path
          description: Hosted domain name
          required: true
          schema:
            type: string
            example: blog.example.com
      responses:
        '200':
          description: Webhosting domain retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowWebhostingDomainResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    put:
      tags:
      - Webhosting
      summary: Update a webhosting domain
      description: Update mutable settings of a hosted domain belonging to the selected webhosting account.
      operationId: updateWebhostingDomain
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
        - name: domain
          in: path
          description: Hosted domain name
          required: true
          schema:
            type: string
            example: blog.example.com
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWebhostingDomainRequest'
            example:
              path: /www/blog/
              php_version: '8.1'
      responses:
        '200':
          description: Webhosting domain updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoreWebhostingDomainResponse'
        '400':
          description: Validation failure for hosted-domain update
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                InvalidPhpVersion:
                  summary: Unsupported PHP version
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        php_version:
                          - code: validation.invalid_version
                            message: Invalid version.
                InvalidPrivateKey:
                  summary: DKIM private key is invalid
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        dkim_private:
                          - code: validation.invalid_private_key
                            message: validation.invalid_private_key
                UsernameRequiresSuperuser:
                  summary: Field cannot be changed here
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        username:
                          - code: validation.superuser
                            message: No privilege.
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    delete:
      tags:
      - Webhosting
      summary: Delete a webhosting domain
      description: Remove a hosted domain from the selected webhosting account.
      operationId: deleteWebhostingDomain
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
        - name: domain
          in: path
          description: Hosted domain name
          required: true
          schema:
            type: string
            example: blog.example.com
      responses:
        '200':
          description: Webhosting domain deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteWebhostingDomainResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/webhostings/{whuser}/domains/{domain}/software:
    put:
      tags:
      - Webhosting
      summary: Install software on a webhosting domain
      description: Install application software into the selected hosted domain path. The response includes the created database name and final URL.
      operationId: installWebhostingDomainSoftware
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
        - name: domain
          in: path
          description: Hosted domain name
          required: true
          schema:
            type: string
            example: blog.example.com
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InstallWebhostingDomainSoftwareRequest'
            example:
              password: StrongPass123
              path: /blog
              software: wordpress
      responses:
        '200':
          description: Software installed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InstallWebhostingDomainSoftwareResponse'
        '400':
          description: Validation failure or software-install business-rule error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                MissingPassword:
                  summary: Password is required
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        password:
                          - code: validation.required
                            message: The password field is required.
                InvalidPath:
                  summary: Install path format is invalid
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        path:
                          - code: validation.regex
                            message: The path format is invalid.
                InvalidSoftware:
                  summary: Unsupported software package
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        software:
                          - code: validation.in
                            message: The selected software is invalid.
                SqlQuotaExceeded:
                  summary: SQL quota is already exceeded
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: sql quota exceeded
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/webhostings/{whuser}/domains/{domain}/certificate:
    get:
      tags:
      - Webhosting
      summary: Get a webhosting domain certificate
      description: Return the currently stored TLS certificate chain and expiry timestamp for the selected hosted domain.
      operationId: getWebhostingDomainCertificate
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
        - name: domain
          in: path
          description: Hosted domain name
          required: true
          schema:
            type: string
            example: blog.example.com
      responses:
        '200':
          description: Certificate retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowWebhostingDomainCertificateResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    put:
      tags:
      - Webhosting
      summary: Update a webhosting domain certificate
      description: Store a custom TLS certificate chain and private key for the selected hosted domain. If the certificate also covers `www.{domain}`, the same certificate is stored for that hostname too.
      operationId: updateWebhostingDomainCertificate
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
        - name: domain
          in: path
          description: Hosted domain name
          required: true
          schema:
            type: string
            example: blog.example.com
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWebhostingDomainCertificateRequest'
            example:
              key: "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"
              certificate: "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----"
      responses:
        '200':
          description: Certificate updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateWebhostingDomainCertificateResponse'
        '400':
          description: Certificate validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                InvalidCertificate:
                  summary: Certificate PEM cannot be parsed
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: invalid certificate
                BadKey:
                  summary: Private key does not match the certificate
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: bad_key
                CertificateNotYetValid:
                  summary: Certificate validity period has not started yet
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: certificate_not_yet_valid
                CertificateExpired:
                  summary: Certificate is already expired
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: certificate_expired
                CertificateDoesNotMatchDomain:
                  summary: Certificate does not cover the selected domain
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: certificate does not match domain
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/webhostings/{whuser}/databases:
    get:
      tags:
      - Webhosting
      summary: List webhosting databases
      description: List databases belonging to the selected webhosting account.
      operationId: listWebhostingDatabases
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
        - $ref: '#/components/parameters/IndexFilter'
        - $ref: '#/components/parameters/IndexOrder'
        - $ref: '#/components/parameters/IndexLimit'
        - $ref: '#/components/parameters/IndexOffset'
      responses:
        '200':
          description: Webhosting databases retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexWebhostingDatabasesResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      tags:
      - Webhosting
      summary: Create a webhosting database
      description: Create a database for the selected webhosting account. The database name must either equal the webhosting username or start with `{username}_`.
      operationId: createWebhostingDatabase
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreWebhostingDatabaseRequest'
            example:
              database: userteszt_wordpress0
              password: StrongPass123
      responses:
        '200':
          description: Webhosting database created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoreWebhostingDatabaseResponse'
        '400':
          description: Validation failure or webhosting database business-rule error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                MissingDatabase:
                  summary: Database name is required
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        database:
                          - code: validation.required
                            message: The database field is required.
                InvalidDatabaseName:
                  summary: Database name must match the webhosting username prefix rule
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        database:
                          - code: validation.invalid_database_name
                            message: database must be in the form of username_something
                SqlQuotaExceeded:
                  summary: SQL quota is already exceeded
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: sql quota exceeded
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/webhostings/{whuser}/databases/{database}:
    get:
      tags:
      - Webhosting
      summary: Get a webhosting database
      description: Get a single database belonging to the selected webhosting account.
      operationId: getWebhostingDatabase
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
        - name: database
          in: path
          description: Database name
          required: true
          schema:
            type: string
            example: userteszt_wordpress0
      responses:
        '200':
          description: Webhosting database retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowWebhostingDatabaseResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    put:
      tags:
      - Webhosting
      summary: Update a webhosting database
      description: Update mutable settings for a database belonging to the selected webhosting account. On the customer route this is effectively used for password changes.
      operationId: updateWebhostingDatabase
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
        - name: database
          in: path
          description: Database name
          required: true
          schema:
            type: string
            example: userteszt_wordpress0
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWebhostingDatabaseRequest'
            example:
              password: StrongerPass123
      responses:
        '200':
          description: Webhosting database updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoreWebhostingDatabaseResponse'
        '400':
          description: Validation failure for webhosting database update
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                PasswordTooShort:
                  summary: Password must be at least 8 characters
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        password:
                          - code: validation.min.string
                            message: The password must be at least 8 characters.
                SqlserverRequiresSuperuser:
                  summary: Field cannot be changed here
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        sqlserver:
                          - code: validation.superuser
                            message: No privilege.
                WriteEnabledRequiresSuperuser:
                  summary: Field cannot be changed here
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        write_enabled:
                          - code: validation.superuser
                            message: No privilege.
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    delete:
      tags:
      - Webhosting
      summary: Delete a webhosting database
      description: Delete a database belonging to the selected webhosting account. Databases whose names do not contain an underscore cannot be deleted through this customer route.
      operationId: deleteWebhostingDatabase
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
        - name: database
          in: path
          description: Database name
          required: true
          schema:
            type: string
            example: userteszt_wordpress0
      responses:
        '200':
          description: Webhosting database deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteWebhostingDatabaseResponse'
        '400':
          description: Webhosting database business-rule error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                DatabaseWithoutUnderscoreCannotBeDeleted:
                  summary: Base database names without an underscore are protected
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: database_without_underscore_cannot_be_deleted
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/plans/{type}/custom:
    get:
      tags:
      - Plans
      summary: Get custom plan price
      description: Calculate a custom price for the selected plan type. The JSON request body must match the schema for the selected `type`. The response echoes the resolved request under `response.request` and includes the computed pricing fields alongside the type-specific plan details.
      operationId: getCustomPlanPrice
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: type
          in: path
          description: Plan type to get custom pricing for
          required: true
          schema:
            type: string
            enum:
              - vs
              - wh
              - custom-wh
              - wordpress-wh
              - cpanel-wh
              - dedicated-wh
              - hwrent
              - ip
              - backup
              - domain
              - rack_unit
              - ddos
              - smtp
              - ssl
              - internet
              - electricity
              - sh
            example: vs
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/VsProductRequest'
                - $ref: '#/components/schemas/WhProductRequest'
                - $ref: '#/components/schemas/CustomWhProductRequest'
                - $ref: '#/components/schemas/WordpressWhProductRequest'
                - $ref: '#/components/schemas/CpanelWhProductRequest'
                - $ref: '#/components/schemas/DedicatedWhProductRequest'
                - $ref: '#/components/schemas/HwrentProductRequest'
                - $ref: '#/components/schemas/IpProductRequest'
                - $ref: '#/components/schemas/BackupProductRequest'
                - $ref: '#/components/schemas/DomainProductRequest'
                - $ref: '#/components/schemas/RackUnitProductRequest'
                - $ref: '#/components/schemas/DdosProductRequest'
                - $ref: '#/components/schemas/SmtpProductRequest'
                - $ref: '#/components/schemas/SslProductRequest'
                - $ref: '#/components/schemas/InternetProductRequest'
                - $ref: '#/components/schemas/ElectricityProductRequest'
                - $ref: '#/components/schemas/ServerHostingProductRequest'
      responses:
        '200':
          description: Custom plan price retrieved successfully. The exact `response` payload shape depends on the selected plan type.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomPlanPriceResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /customers/{customer_id}/invoice_items:
    get:
      tags:
      - Invoices
      summary: List unissued invoice items
      operationId: indexCustomerInvoiceItems
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - $ref: '#/components/parameters/IndexFilter'
        - $ref: '#/components/parameters/IndexOrder'
        - $ref: '#/components/parameters/IndexLimit'
        - $ref: '#/components/parameters/IndexOffset'
      responses:
        '200':
          description: Invoice items retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexCustomerInvoiceItemsResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/balances:
    get:
      tags:
      - Customers
      summary: List customer balances
      operationId: getCustomerBalances
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
      responses:
        '200':
          description: Balances retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalanceIndexResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/balances/{currency}:
    get:
      tags:
      - Customers
      summary: List customer balances for a currency
      operationId: getCustomerBalanceByCurrency
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: currency
          in: path
          description: Currency code to filter by
          required: true
          schema:
            type: string
            enum:
              - HUF
              - EUR
              - USD
              - CREDIT-HUF
              - CREDIT-EUR
              - CREDIT-USD
            example: HUF
      responses:
        '200':
          description: Balances retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalanceIndexResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/invoices:
    get:
      tags:
      - Invoices
      summary: List customer invoices
      operationId: indexCustomerInvoices
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - $ref: '#/components/parameters/IndexFilter'
        - $ref: '#/components/parameters/IndexOrder'
        - $ref: '#/components/parameters/IndexLimit'
        - $ref: '#/components/parameters/IndexOffset'
      responses:
        '200':
          description: Invoices retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexCustomerInvoicesResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

    post:
      tags:
      - Invoices
      summary: Create an invoice
      operationId: createInvoice
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateInvoiceRequest'
            example:
              invoice_item_ids:
                - 1
                - 2
      responses:
        '200':
          description: Invoice created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateInvoiceResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/invoices/pay:
    post:
      tags:
      - Invoices
      summary: Pay invoices via external gateway
      description: >-
        Pay selected invoices using the specified payment method. `success_url`
        and `fail_url` are required for all methods except `credit`.
        Alternatively, an invoice can be paid by sending `PUT
        /customers/{customer_id}/invoices/{invoice}` with `invoice_state:
        paid`, which uses the customer's refunds.
      operationId: payInvoices
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/PayInvoiceCreditRequest'
                - $ref: '#/components/schemas/PayInvoiceStripeRequest'
                - $ref: '#/components/schemas/PayInvoiceCoingateRequest'
                - $ref: '#/components/schemas/PayInvoiceSimplepayRequest'
                - $ref: '#/components/schemas/PayInvoicePaypalRequest'
      responses:
        '200':
          description: Payment processed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayInvoiceResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/invoices/{invoice}:
    get:
      tags:
      - Invoices
      summary: Get an invoice
      description: Retrieve one invoice or proforma belonging to the selected customer. The response uses the mapped invoice field names and includes the loaded `items` relation.
      operationId: showInvoice
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: invoice
          in: path
          description: ID of the invoice
          required: true
          schema:
            type: integer
            example: 265272
      responses:
        '200':
          description: Invoice retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowInvoiceResponse'
              examples:
                default:
                  summary: Invoice with items
                  value:
                    code: 200
                    message: Request successfully completed
                    response:
                      id: 265272
                      customer_id: 1
                      invoice_id: 'A2026/00001'
                      proforma_id: null
                      invoice_state: issued
                      proforma_state: null
                      total_price: 3162.30
                      proforma_issue_date: null
                      proforma_payment_deadline: null
                      invoice_issue_date: '2026-07-17'
                      invoice_payment_deadline: '2026-07-25'
                      paid_on_date: null
                      fulfillment_date: '2026-07-17'
                      description: Invoice for July 2026
                      currency: HUF
                      payment_method: BANKTRANSFER
                      tax_number: '12345678-1-12'
                      invoice_name: John Doe Billing
                      invoice_country: HU
                      invoice_zip: '1138'
                      invoice_city: Budapest
                      invoice_street: 'Main St 1.'
                      post_country: HU
                      post_street: 'Main St 1.'
                      storno_state: normal
                      company: ATW
                      eproforma_state: null
                      einvoice_state: N
                      state: unpaid
                      is_invoice: true
                      invoice_number: 'A2026/00001'
                      deadline: '2026-07-25'
                      created_at: '2026-07-17 10:15:00'
                      updated_at: '2026-07-17 10:20:00'
                      items:
                        - id: 9001
                          customer_id: 1
                          invoice_id: 265272
                          service_id: 65054
                          product_id: VPS-CUSTOM
                          description: Example VPS monthly fee
                          net_price: 2490
                          currency: HUF
                          vat: 27
                          quantity: 1
                          unit: piece
                          started_on: '2026-07-17'
                          ended_on: '2026-08-16'
                          company: ATW
                          created_at: '2026-07-17 10:15:00'
                          updated_at: '2026-07-17 10:15:00'
                        - id: 9002
                          customer_id: 1
                          invoice_id: 265272
                          service_id: null
                          product_id: ADMIN
                          description: Administration fee
                          net_price: 0
                          currency: HUF
                          vat: 27
                          quantity: 1
                          unit: piece
                          started_on: null
                          ended_on: null
                          company: ATW
                          created_at: '2026-07-17 10:15:00'
                          updated_at: '2026-07-17 10:15:00'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    put:
      tags:
      - Invoices
      summary: Update an invoice
      operationId: updateInvoice
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: invoice
          in: path
          description: ID of the invoice
          required: true
          schema:
            type: integer
            example: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateInvoiceRequest'
            example:
              invoice_state: paid
      responses:
        '200':
          description: Invoice updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateInvoiceResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/invoices/{invoice}/split:
    post:
      tags:
      - Invoices
      summary: Split an invoice
      operationId: splitInvoice
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: invoice
          in: path
          description: ID of the invoice
          required: true
          schema:
            type: integer
            example: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SplitInvoiceRequest'
            example:
              invoice_item_ids:
                - 1
                - 2
      responses:
        '200':
          description: Invoice split successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SplitInvoiceResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/invoices/{invoice}/download:
    get:
      tags:
      - Invoices
      summary: Download invoice PDF
      description: >
        Downloads the invoice or proforma as a PDF file.
        The filename is `invoice_id.pdf` for invoices or `proforma_id.pdf` for proforma invoices.
      operationId: downloadInvoice
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: invoice
          in: path
          description: ID of the invoice
          required: true
          schema:
            type: integer
            example: 1
      responses:
        '200':
          description: Invoice PDF downloaded successfully
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/invoices/{invoice}/items:
    get:
      tags:
      - Invoices
      summary: List invoice items
      description: >
        Lists all invoice items belonging to the specified invoice.
      operationId: indexInvoiceItems
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: invoice
          in: path
          description: ID of the invoice
          required: true
          schema:
            type: integer
            example: 1
      responses:
        '200':
          description: Invoice items retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexInvoiceItemsResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
           $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/invoices/{invoice}/items/{id}:
    get:
      tags:
      - Invoices
      summary: Get an invoice item
      description: >
        Gets a single invoice item by ID.
      operationId: showInvoiceItem
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: invoice
          in: path
          description: ID of the invoice
          required: true
          schema:
            type: integer
            example: 1
        - name: id
          in: path
          description: ID of the invoice item
          required: true
          schema:
            type: integer
            example: 1
      responses:
        '200':
          description: Invoice item retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowInvoiceItemResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/paymentmethods:
    get:
      tags:
      - Payment Methods
      summary: List customer payment methods
      description: >
        Lists all payment methods for the specified customer.
      operationId: indexPaymentMethods
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - $ref: '#/components/parameters/IndexFilter'
        - $ref: '#/components/parameters/IndexOrder'
        - $ref: '#/components/parameters/IndexLimit'
        - $ref: '#/components/parameters/IndexOffset'
      responses:
        '200':
          description: Payment methods retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexPaymentMethodsResponse'
              example:
                code: 200
                message: Request successfully completed
                response:
                  data:
                    - id: 1
                      customer_id: 1
                      priority: 0
                      is_default: true
                      provider: stripe
                      provider_id: pm_1Q2W3E4R5T6Y
                      expiry: '2026-12-31'
                      identifier: '**** **** **** 4242'
                      description: Main company card
                      status: active
                      created_at: '2026-07-17 10:15:00'
                      updated_at: '2026-07-17 10:20:00'
                    - id: 2
                      customer_id: 1
                      priority: 1
                      is_default: false
                      provider: paypal
                      provider_id: null
                      expiry: null
                      identifier: billing@example.com
                      description: Backup PayPal account
                      status: active
                      created_at: '2026-07-17 10:16:00'
                      updated_at: '2026-07-17 10:21:00'
                  count: 2
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/paymentmethods/{id}:
    get:
      tags:
      - Payment Methods
      summary: Get a payment method
      description: >
        Gets a single payment method by ID for the specified customer.
      operationId: showPaymentMethod
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: id
          in: path
          description: ID of the payment method
          required: true
          schema:
            type: integer
            example: 1
      responses:
        '200':
          description: Payment method retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowPaymentMethodResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

    put:
      tags:
      - Payment Methods
      summary: Update a payment method
      description: >
        Updates a payment method by ID. When `is_default` is set to `1`,
        other payment methods for the same customer are automatically unset as default.
      operationId: updatePaymentMethod
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: id
          in: path
          description: ID of the payment method
          required: true
          schema:
            type: integer
            example: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePaymentMethodRequest'
            example:
              is_default: true
              description: My card ending in 4242
      responses:
        '200':
          description: Payment method updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowPaymentMethodResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

    delete:
      tags:
      - Payment Methods
      summary: Delete a payment method
      description: >
        Deletes a payment method by ID for the specified customer.
      operationId: deletePaymentMethod
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: id
          in: path
          description: ID of the payment method
          required: true
          schema:
            type: integer
            example: 1
      responses:
        '200':
          description: Payment method deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeletePaymentMethodResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/payments:
    get:
      tags:
      - Payments
      summary: List customer payments
      operationId: indexCustomerPayments
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - $ref: '#/components/parameters/IndexFilter'
        - $ref: '#/components/parameters/IndexOrder'
        - $ref: '#/components/parameters/IndexLimit'
        - $ref: '#/components/parameters/IndexOffset'
      responses:
        '200':
          description: Payments retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexCustomerPaymentsResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /users:
    post:
      tags:
      - User
      summary: Register a new user
      description: Create a new user account.
      operationId: createUser
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterRequest'
            example:
              full_name: John Doe
              phone_number: "+36.12345678"
              username: john.doe@example.com
              password: "secret123"
              language: HU
      responses:
        '200':
          description: User registered successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegisterResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /users/{user}/activate:
    post:
      tags:
      - User
      summary: Activate a user
      description: Activate a pending signup by submitting the email-confirmation code together with the new account password.
      operationId: activateUser
      parameters:
        - name: user
          in: path
          description: User email address to activate
          required: true
          schema:
            type: string
            format: email
            example: john.doe@example.com
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActivateUserRequest'
            example:
              code: "123456"
              password: "secret123"
      responses:
        '200':
          description: User activated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActivateUserResponse'
              example:
                code: 200
                message: Request successfully completed
                response: []
        '400':
          description: Activation validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                InvalidActivationCode:
                  summary: Activation code is invalid or expired
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        code:
                          - code: invalid_activation_code
                            message: The selected code is invalid.
                MissingPassword:
                  summary: Password is required
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        password:
                          - code: validation.required
                            message: The password field is required.
        '500':
          $ref: '#/components/responses/InternalServerError'
  /users/{user}/code/{code}:
    get:
      tags:
      - User
      summary: Check activation code
      description: Check whether the supplied activation code is valid for the specified user.
      operationId: checkUserCode
      parameters:
        - name: user
          in: path
          description: User email address
          required: true
          schema:
            type: string
            format: email
            example: john.doe@example.com
        - name: code
          in: path
          description: Activation code to verify
          required: true
          schema:
            type: string
            example: "123456"
      responses:
        '200':
          description: Activation code is valid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckUserCodeResponse'
              example:
                code: 200
                message: Request successfully completed
                response: []
        '400':
          description: Activation code is invalid or expired
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckUserCodeBadRequestResponse'
              example:
                code: 400
                message: Bad request
                response:
                  code: bad_code
                  message: The supplied activation code is invalid.
        '500':
          $ref: '#/components/responses/InternalServerError'

  /users/{user}/recovery:
    post:
      tags:
      - User
      summary: Request password recovery
      description: Request password recovery for the selected user.
      operationId: createUserRecovery
      parameters:
        - name: user
          in: path
          description: User email address
          required: true
          schema:
            type: string
            format: email
            example: nobody@localhost
      responses:
        '200':
          description: Password-recovery request accepted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateUserRecoveryResponse'
              example:
                code: 200
                message: Request successfully completed
                response: []
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /users/{user}/recovery/{recovery}:
    put:
      tags:
      - User
      summary: Complete a password-recovery update
      description: Validate the supplied recovery code for the selected user, then update that account. This route is typically used to set a new password during password recovery.
      operationId: updateUserRecovery
      parameters:
        - name: user
          in: path
          description: User email address
          required: true
          schema:
            type: string
            example: nobody@localhost
        - name: recovery
          in: path
          description: Recovery code previously issued for the user
          required: true
          schema:
            type: string
            example: ABCDEFGH1234
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateUserRequest'
            example:
              password: recopaxyz123
      responses:
        '200':
          description: User updated successfully through recovery
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateUserResponse'
              example:
                code: 200
                message: Data updated successfully
                response:
                  updated:
                    - password
                  data:
                    id: 6
                    username: nobody@localhost
                    full_name: Nobody
                    phone_number: +36.16000289
                    language: hu
                    state: ACTIVE
                    created_at: '2026-07-17 10:15:00'
                    updated_at: '2026-08-06 10:20:00'
                    role: user
        '400':
          description: Recovery update failed because the recovery code was invalid or the submitted user data did not pass validation
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/BadRequestResponse'
                  - $ref: '#/components/schemas/UserRecoveryInvalidCodeResponse'
              examples:
                InvalidCode:
                  summary: Recovery code is invalid
                  value:
                    code: 400
                    message: Bad request
                    response:
                      error: invalid code
                ValidationError:
                  summary: Password is missing
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        password:
                          - code: validation.required
                            message: Required.
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /users/{username}/exists:
    get:
      tags:
      - User
      summary: Check whether a user exists
      description: Public route that checks whether the specified user exists and returns its current account state.
      operationId: existsUser
      parameters:
        - name: username
          in: path
          description: User email address
          required: true
          schema:
            type: string
            format: email
            example: john.doe@example.com
      responses:
        '200':
          description: User existence check completed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserExistsResponse'
              example:
                code: 200
                message: Request successfully completed
                response:
                  state: ACTIVE
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /domains/prices:
    get:
      tags:
      - Domains
      summary: List public domain prices
      description: List public domain price-list entries from the default price group. The endpoint returns `domain_price_list` together with the optional linked registrar/TLD metadata in `regdata`. Supports the standard filter, ordering, and pagination query parameters.
      operationId: indexPublicDomainPrices
      parameters:
        - $ref: '#/components/parameters/IndexFilter'
        - $ref: '#/components/parameters/IndexOrder'
        - $ref: '#/components/parameters/IndexLimit'
        - $ref: '#/components/parameters/IndexOffset'
      responses:
        '200':
          description: Public domain prices retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexDomainPricesResponse'
              examples:
                default:
                  summary: Public domain price list
                  value:
                    code: 200
                    message: Request successfully completed
                    response:
                      count: 2
                      data:
                        - id: 101
                          prgroup: 0
                          suffix: hu
                          reg_price: "3490.00"
                          renew_price: "3490.00"
                          transfer_price: "3490.00"
                          karanten_price: "14990.00"
                          ochg_price: "0.00"
                          cc: HUF
                          regdata:
                            id: 12
                            tld: hu
                            min_reg_time: 1
                            grace_period: 45
                            redemption_period: 0
                            contact_types: "owner:1:1 tech:1:1 admin:1:1"
                            currency: HUF
                            register_price: "3490.00"
                            renew_pricex: "3490.00"
                            transfer_pricex: "3490.00"
                            quarantine_price: "14990.00"
                            min_registration_years: 1
                            max_registration_years: 10
                        - id: 102
                          prgroup: 0
                          suffix: com
                          reg_price: "4990.00"
                          renew_price: "5490.00"
                          transfer_price: "4990.00"
                          karanten_price: "24990.00"
                          ochg_price: "0.00"
                          cc: HUF
                          regdata:
                            id: 18
                            tld: com
                            min_reg_time: 1
                            grace_period: 30
                            redemption_period: 30
                            contact_types: null
                            currency: HUF
                            register_price: "4990.00"
                            renew_pricex: "5490.00"
                            transfer_pricex: "4990.00"
                            quarantine_price: "24990.00"
                            min_registration_years: 1
                            max_registration_years: 10
        '500':
          $ref: '#/components/responses/InternalServerError'

  /domains/{domainname}:
    get:
      tags:
      - Domains
      summary: Check domain availability
      description: >
        Check which registration-related operations are currently available for
        a domain name. This is a public route and does not require
        authentication.

        The response can include `new`, `transfer`, and `ns2only`. Values for
        `new` and `transfer` are usually booleans. When the external
        availability state cannot be confirmed, the route can return `"maybe"`
        for those fields instead.
      operationId: checkDomainAvailability
      parameters:
        - name: domainname
          in: path
          description: Domain name to check
          required: true
          schema:
            type: string
            pattern: '^[a-z0-9.-]+$'
            example: example.hu
      responses:
        '200':
          description: Domain availability retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DomainAvailabilityResponse'
              examples:
                FreeDomain:
                  summary: Domain is available for a new registration
                  value:
                    code: 200
                    message: Request successfully completed
                    response:
                      data:
                        new: true
                        transfer: false
                RegisteredDomain:
                  summary: Domain is registered and can be transferred
                  value:
                    code: 200
                    message: Request successfully completed
                    response:
                      data:
                        new: false
                        transfer: true
                        ns2only: true
                UncertainState:
                  summary: External availability state could not be confirmed
                  value:
                    code: 200
                    message: Request successfully completed
                    response:
                      data:
                        new: maybe
                        transfer: maybe
        '400':
          description: Invalid domain syntax
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DomainAvailabilityBadRequestResponse'
              examples:
                InvalidDomainSyntax:
                  summary: Unsupported domain name format
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors: Domain syntax error
        '500':
          $ref: '#/components/responses/InternalServerError'

  /service_inventory:
    get:
      tags:
      - Services
      summary: List service inventory
      description: List public service inventory entries. Domain inventory entries are excluded.
      operationId: indexServiceInventory
      parameters:
        - $ref: '#/components/parameters/IndexFilter'
        - $ref: '#/components/parameters/IndexOrder'
        - $ref: '#/components/parameters/IndexLimit'
        - $ref: '#/components/parameters/IndexOffset'
      responses:
        '200':
          description: Service inventory retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexServiceInventoryResponse'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /service_inventory/{id}:
    get:
      tags:
      - Services
      summary: Get a service inventory item
      description: Get one public service inventory entry by its numeric ID.
      operationId: showServiceInventory
      parameters:
        - name: id
          in: path
          description: Numeric ID of the service inventory entry
          required: true
          schema:
            type: integer
            example: 1
      responses:
        '200':
          description: Service inventory item retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowServiceInventoryResponse'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /plans/{type}/custom:
    get:
      tags:
      - Plans
      summary: Get custom plan price
      description: Calculate a custom price for the selected plan type using the public/default VAT context. The JSON request body must match the schema for the selected `type`. The response echoes the resolved request under `response.request` and includes the computed pricing fields alongside the type-specific plan details.
      operationId: getPublicCustomPlanPrice
      parameters:
        - name: type
          in: path
          description: Plan type to get custom pricing for
          required: true
          schema:
            type: string
            enum:
              - vs
              - wh
              - custom-wh
              - wordpress-wh
              - cpanel-wh
              - dedicated-wh
              - hwrent
              - ip
              - backup
              - domain
              - rack_unit
              - ddos
              - smtp
              - ssl
              - internet
              - electricity
              - sh
            example: vs
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/VsProductRequest'
                - $ref: '#/components/schemas/WhProductRequest'
                - $ref: '#/components/schemas/CustomWhProductRequest'
                - $ref: '#/components/schemas/WordpressWhProductRequest'
                - $ref: '#/components/schemas/CpanelWhProductRequest'
                - $ref: '#/components/schemas/DedicatedWhProductRequest'
                - $ref: '#/components/schemas/HwrentProductRequest'
                - $ref: '#/components/schemas/IpProductRequest'
                - $ref: '#/components/schemas/BackupProductRequest'
                - $ref: '#/components/schemas/DomainProductRequest'
                - $ref: '#/components/schemas/RackUnitProductRequest'
                - $ref: '#/components/schemas/DdosProductRequest'
                - $ref: '#/components/schemas/SmtpProductRequest'
                - $ref: '#/components/schemas/SslProductRequest'
                - $ref: '#/components/schemas/InternetProductRequest'
                - $ref: '#/components/schemas/ElectricityProductRequest'
                - $ref: '#/components/schemas/ServerHostingProductRequest'
      responses:
        '200':
          description: Custom plan price retrieved successfully. The exact `response` payload shape depends on the selected plan type.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomPlanPriceResponse'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /plans/{type}/info:
    get:
      tags:
      - Plans
      summary: Get public plan type info
      description: Get type-specific metadata for the selected plan family using the public route.
      operationId: getPublicPlanInfo
      parameters:
        - name: type
          in: path
          description: Plan type to get info for
          required: true
          schema:
            type: string
            enum:
              - vs
              - wh
              - dedicated-wh
              - wordpress-wh
              - cpanel-wh
              - hwrent
              - electricity
              - rack_unit
              - sh
            example: vs
        - name: category
          in: query
          description: Optional hardware-rental category filter. Only used for `type=hwrent`.
          required: false
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
              enum:
                - featured
                - other
      responses:
        '200':
          description: Plan info retrieved successfully. The exact `response` payload shape depends on the selected plan type.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicPlanInfoResponse'
              examples:
                vs:
                  summary: VPS plan metadata
                  value:
                    code: 200
                    message: Request successfully completed
                    response:
                      images:
                        - id: 552789
                          name: debian-12
                          full_name: Debian 12
                          method: "cloudinit"
                          admin_user: root
                          min_disk_mib: 10240
                          created_at: '2026-07-16 12:55:38'
                          updated_at: '2026-07-16 12:55:38'
                      limits:
                        cpu_count:
                          min: 1
                          max: 16
                        ssd_size_gb:
                          min: 10
                          max: 5000
                        hdd_size_gb:
                          min: 0
                          max: 20000
                        ram_size_mb:
                          min: 1024
                          max: 131072
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /email_confirm_request:
    post:
      tags:
      - User
      summary: Request an email confirmation code
      description: Request an email confirmation code for the supplied email address and language.
      operationId: createEmailConfirmRequest
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmailConfirmRequest'
            example:
              username: john.doe@example.com
              lang: hu
      responses:
        '200':
          description: Email confirmation request accepted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailConfirmRequestResponse'
              example:
                code: 200
                message: Request successfully completed
                response: []
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/InternalServerError'
    put:
      tags:
      - User
      summary: Verify an email confirmation code
      description: Validate the supplied email address and confirmation code.
      operationId: verifyEmailConfirmRequest
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmailConfirmVerifyRequest'
            example:
              username: john.doe@example.com
              code: ABCDEFGH12345678
      responses:
        '200':
          description: Email confirmation code verified successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailConfirmVerifyResponse'
              example:
                code: 200
                message: Request successfully completed
                response: []
        '400':
          description: Email confirmation code is invalid or the request body did not pass validation
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/BadRequestResponse'
                  - $ref: '#/components/schemas/EmailConfirmVerifyBadRequestResponse'
              examples:
                InvalidCode:
                  summary: Confirmation code is invalid
                  value:
                    code: 400
                    message: Bad request
                    response: []
                ValidationError:
                  summary: Username is missing
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        username:
                          - code: validation.required
                            message: Required.
        '500':
          $ref: '#/components/responses/InternalServerError'

  /vps/images:
    get:
      tags:
      - VPS
      summary: List available VPS images
      description: List all publicly selectable VPS images with their display names and minimum disk requirements.
      operationId: listPublicVpsImages
      responses:
        '200':
          description: VPS images retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListVpsImagesResponse'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /pricelist/domain/tld:
    get:
      tags:
      - Domains
      summary: List public domain TLD prices
      description: Retrieve the public base price list for domain TLDs. This endpoint returns only top-level and second-level public suffixes from the default price group, with registration, renewal, transfer, and quarantine prices in the source currency.
      operationId: listPublicDomainTldPrices
      responses:
        '200':
          description: Public domain TLD prices retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListPublicDomainTldPricesResponse'
              examples:
                default:
                  summary: Public domain TLD price list
                  value:
                    code: 200
                    message: Request successfully completed
                    response:
                      data:
                        - tld: "5g.in"
                          register_price: "2120.00"
                          renewal_price: "2544.00"
                          transfer_price: "2120.00"
                          quarantine_price: "7872.00"
                          currency: "HUF"
                        - tld: "abogado"
                          register_price: "8200.00"
                          renewal_price: "9840.00"
                          transfer_price: "8200.00"
                          quarantine_price: "27504.00"
                          currency: "HUF"
                        - tld: "ac"
                          register_price: "22200.00"
                          renewal_price: "22200.00"
                          transfer_price: "22200.00"
                          quarantine_price: "0.00"
                          currency: "HUF"
        '500':
          $ref: '#/components/responses/InternalServerError'

  /companies/{country}/{vatnr}:
    get:
      tags:
      - Customers
      summary: Look up company invoice data by VAT number
      description: >
        Look up invoice details for a company by VAT number. Use `country=eu`
        with a full EU VAT number including its country prefix, or `country=hu`
        with a Hungarian tax number in dashed format.
      operationId: showCompanyByVat
      parameters:
        - name: country
          in: path
          description: Lookup backend. `eu` validates an EU VAT number, `hu` validates a Hungarian tax number.
          required: true
          schema:
            type: string
            enum:
              - eu
              - hu
            example: eu
        - name: vatnr
          in: path
          description: >
            VAT number to validate. For `country=eu`, send the full EU VAT number
            including the country prefix, for example `SK2021959555`. For
            `country=hu`, send the Hungarian tax number in dashed format, for
            example `13471868-2-41`.
          required: true
          schema:
            type: string
            example: SK2021959555
      responses:
        '200':
          description: Company VAT data retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowCompanyByVatResponse'
              examples:
                EuVatLookup:
                  summary: EU VAT lookup
                  value:
                    code: 200
                    message: Request successfully completed
                    response:
                      data:
                        ident: SK2021959555
                        invoice_country: SK
                        name: Fallback State Kft.
                HuVatLookup:
                  summary: Hungarian VAT lookup
                  value:
                    code: 200
                    message: Request successfully completed
                    response:
                      data:
                        ident: 13471868-2-41
                        invoice_country: HU
                        name: Command VAT Kft.
        '400':
          $ref: '#/components/responses/CompanyVatLookupBadRequest'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /free/users/secret/{secret}:
    get:
      tags:
      - FreeHosting
      summary: Get a free-hosting user by secret
      description: Resolve a free-hosting user by its public secret token and return the full free-hosting. If the current state starts with `ertesitve` or is empty, the route also updates the state to `megnezte` and refreshes `state_update`.
      operationId: showFreeUserBySecret
      parameters:
        - name: secret
          in: path
          description: Public secret token of the free-hosting user
          required: true
          schema:
            type: string
            example: 8jK2mN4pQ6rS8tUv
      responses:
        '200':
          description: Free-hosting user retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowFreeUserSecretResponse'
              example:
                code: 200
                message: Request successfully completed
                response:
                  username: freeuser1
                  email: freeuser1@example.com
                  page_name: Example free page
                  category: altalanos
                  ftp_last_login_at: '2026-07-20 09:15:00'
                  adfree_expiration: '2026-12-31'
                  registered_at: '2026-06-15'
                  mail_sent: 0
                  mail_quota: 100
                  disk_quota_kb: 200000
                  allowed: 1
                  state: megnezte
                  state_update: '2026-08-06 10:20:00'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    delete:
      tags:
      - FreeHosting
      summary: Mark a free-hosting user for deletion by secret
      description: Resolve a free-hosting user by its public secret token and mark it for deletion. The route updates the user's state to `delete` unless the current state is `created` or begins with `copied`, in which case it fails with `cant_delete`.
      operationId: deleteFreeUserBySecret
      parameters:
        - name: secret
          in: path
          description: Public secret token of the free-hosting user
          required: true
          schema:
            type: string
            example: 8jK2mN4pQ6rS8tUv
      responses:
        '200':
          description: Free-hosting user marked for deletion successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteFreeUserSecretResponse'
              example:
                code: 200
                message: Request successfully completed
                response:
                  username: freeuser1
                  email: freeuser1@example.com
                  page_name: Example free page
                  category: altalanos
                  ftp_last_login_at: '2026-07-20 09:15:00'
                  adfree_expiration: '2026-12-31'
                  registered_at: '2026-06-15'
                  mail_sent: 0
                  mail_quota: 100
                  disk_quota_kb: 200000
                  allowed: 1
                  state: delete
                  state_update: '2026-08-06 10:20:00'
        '400':
          description: Free-hosting user cannot be marked for deletion in the current state
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              example:
                code: 400
                message: Bad request
                response:
                  code: cant_delete
                  message: The requested free-hosting user cannot be deleted in its current state.
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /users/{user}:
    put:
      tags:
      - User
      summary: Update a user
      description: Update the selected user via HTTP Basic Auth. If the username changes, existing API tokens are deleted. If the user has TOTP enabled, supply `totp_code` with the request.
      operationId: updateUser
      security:
        - BasicAuth: []
      parameters:
        - name: user
          in: path
          description: User email address
          required: true
          schema:
            type: string
            example: john.doe@example.com
        - name: totp_code
          in: query
          description: TOTP code required when the user has two-factor authentication enabled and is authenticating via password
          required: false
          schema:
            type: string
            example: '123456'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateUserRequest'
            examples:
              FullProfileUpdate:
                summary: Update multiple user fields
                value:
                  full_name: Jane Doe
                  phone_number: +36.87654321
                  username: jane.doe@example.com
                  password: newpass123
                  language: EN
      responses:
        '200':
          description: User updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateUserResponse'
              examples:
                default:
                  summary: User updated
                  value:
                    code: 200
                    message: Data updated successfully
                    response:
                      updated:
                        - full_name
                        - phone_number
                        - language
                      data:
                        id: 1
                        username: john.doe@example.com
                        full_name: Jane Doe
                        phone_number: +36.87654321
                        language: en
                        state: ACTIVE
                        created_at: '2026-07-17 10:15:00'
                        updated_at: '2026-08-06 10:20:00'
                        role: user
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/UnauthorizedTotp'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /session:
    get:
      tags:
      - User
      summary: Get current session snapshot
      description: Return a compact snapshot of the currently authenticated user session, including legacy name fields, the authenticated username, role, phone number, and the list of customers currently accessible to the caller.
      operationId: getSession
      security:
        - XToken: []
      responses:
        '200':
          description: Session snapshot retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSessionResponse'
              examples:
                default:
                  summary: Current session data
                  value:
                    code: 200
                    message: Request successfully completed
                    response:
                      data:
                        first_name: John
                        last_name: Doe
                        name: John Doe
                        role: user
                        phone_number: +36.16000289
                        username: john.doe@example.com
                        customers:
                          - id: 1
                            name: John Doe
                          - id: 7
                            name: Example Kft.
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /users/{username}:
    get:
      tags:
      - User
      summary: Get a user
      description: Get a single user by username together with the customers linked to that user.
      operationId: showUser
      security:
        - XToken: []
      parameters:
        - name: username
          in: path
          description: username (email)
          required: true
          schema:
            type: string
            example: john.doe@example.com
      responses:
        '200':
          description: User retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetUserResponse'
              examples:
                default:
                  summary: User with linked customers
                  value:
                    code: 200
                    message: Request successfully completed
                    response:
                      data:
                        id: 6
                        username: john.doe@example.com
                        pincode_created_at: '2026-07-16 12:55:43'
                        pincode: '012345'
                        language: hu
                        full_name: John Doe
                        phone_number: '+36.12345678'
                        last_activity_at: '2026-08-04 09:15:00'
                        created_at: '2026-07-16 12:55:38'
                        activated_on: '2026-07-16 12:55:38'
                        state: ACTIVE
                        role: user
                        customer:
                          - id: 1
                            type: PRIVATE
                            name: John Doe
                            email: john.doe@example.com
                            state: ACTIVE
                            country: HU
                            city: Budapest
                            zip: '1111'
                            address: Example utca 1.
                            currency: HUF
                            language: hu
                            created_at: '2026-07-16 12:55:40'
                            updated_at: '2026-07-16 12:55:40'
                            pivot:
                              user_id: 6
                              customer_id: 1
                              role: owner
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /users/{user}/tokens/{token}:
    get:
      tags:
      - User
      summary: Get a token
      description: Get a single active authentication token session for the user.
      operationId: showToken
      security:
        - XToken: []
      parameters:
        - name: user
          in: path
          description: User email address
          required: true
          schema:
            type: string
            example: john.doe@example.com
        - name: token
          in: path
          description: Authentication token to retrieve
          required: true
          schema:
            type: string
            example: 1A2b3C4d5E6f7G8h9I0j1K2l3M4n5O6p
      responses:
        '200':
          description: Token retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowUserTokenResponse'
              example:
                code: 200
                message: Request successfully completed
                response:
                  data:
                    id: 306331
                    user_id: 1
                    username: john.doe@example.com
                    token: 1A2b3C4d5E6f7G8h9I0j1K2l3M4n5O6p
                    created_at: '2026-07-23 10:12:27'
                    updated_at: '2026-07-23 11:05:10'
                    expires_at: '2026-07-30 10:12:27'
                    ip: 127.0.0.1
                    user_agent: Mozilla/5.0
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    delete:
      tags:
      - User
      summary: Delete a token
      description: Delete a specific authentication token for the user.
      operationId: deleteToken
      security:
        - BasicAuth: []
      parameters:
        - name: user
          in: path
          description: User email address
          required: true
          schema:
            type: string
            example: john.doe@example.com
        - name: token
          in: path
          description: Authentication token to remove
          required: true
          schema:
            type: string
            example: 1A2b3C4d5E6f7G8h9I0j1K2l3M4n5O6p
      responses:
        '200':
          description: Token removed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteTokenResponse'
              example:
                code: 200
                message: Token successfully removed
                response:
                  token: 1A2b3C4d5E6f7G8h9I0j1K2l3M4n5O6p
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /users/{username}/log/{id}:
    get:
      tags:
      - User
      summary: Get a user API log entry
      description: Get a single API log entry belonging to the specified user.
      operationId: showUserLog
      security:
        - XToken: []
      parameters:
        - name: username
          in: path
          description: username (email)
          required: true
          schema:
            type: string
            example: john.doe@example.com
        - name: id
          in: path
          description: ID of the API log entry
          required: true
          schema:
            type: integer
            example: 101
      responses:
        '200':
          description: User API log entry retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowUserLogResponse'
              examples:
                default:
                  summary: User log entry
                  value:
                    code: 200
                    message: Request successfully completed
                    response:
                      data:
                        id: 101
                        ip: "203.0.113.10"
                        user_id: 6
                        customer_id: 33
                        method: GET
                        uri: "/customers/33/domains"
                        request: null
                        response_code: 200
                        response_message: Request successfully completed
                        response_data: "{\"count\":1}"
                        # superuser: 0
                        created_at: "2026-07-22 09:15:00"
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/log:
    get:
      tags:
      - Customers
      summary: List customer API logs
      description: Get a paginated list of API log entries associated with the specified customer.
      operationId: indexCustomerLog
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - $ref: '#/components/parameters/IndexFilter'
        - $ref: '#/components/parameters/IndexOrder'
        - $ref: '#/components/parameters/IndexLimit'
        - $ref: '#/components/parameters/IndexOffset'
      responses:
        '200':
          description: Customer API logs retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexCustomerLogResponse'
              examples:
                default:
                  summary: Customer log list
                  value:
                    code: 200
                    message: Request successfully completed
                    response:
                      count: 2
                      data:
                        - id: 101
                          ip: "203.0.113.10"
                          user_id: 6
                          customer_id: 33
                          method: GET
                          uri: "/customers/33/log"
                          request: null
                          response_code: 200
                          response_message: Request successfully completed
                          response_data: null
                          superuser: 0
                          model: null
                          model_id: null
                          created_at: "2026-07-29 09:15:12"
                          updated_at: "2026-07-29 09:15:12"
                        - id: 102
                          ip: "203.0.113.10"
                          user_id: 6
                          customer_id: 33
                          method: POST
                          uri: "/customers/33/domains"
                          request: "{\"domain\":\"example.hu\",\"registration_type\":\"new\"}"
                          response_code: 200
                          response_message: Request successfully completed
                          response_data: "{\"data\":{\"id\":9001}}"
                          superuser: 0
                          model: Domain
                          model_id: 9001
                          created_at: "2026-07-29 09:16:03"
                          updated_at: "2026-07-29 09:16:03"
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/log/{id}:
    get:
      tags:
      - Customers
      summary: Get customer API log entry
      description: Retrieve a single API log entry associated with the specified customer.
      operationId: showCustomerLog
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: id
          in: path
          description: ID of the API log entry
          required: true
          schema:
            type: integer
            example: 101
      responses:
        '200':
          description: Customer API log entry retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowCustomerLogResponse'
              examples:
                default:
                  summary: Customer log entry
                  value:
                    code: 200
                    message: Request successfully completed
                    response:
                      data:
                        id: 101
                        ip: "203.0.113.10"
                        user_id: 6
                        customer_id: 33
                        method: GET
                        uri: "/customers/33/log"
                        request: null
                        response_code: 200
                        response_message: Request successfully completed
                        response_data: null
                        superuser: 0
                        model: null
                        model_id: null
                        created_at: "2026-07-29 09:15:12"
                        updated_at: "2026-07-29 09:15:12"
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/search:
    get:
      tags:
      - Customers
      summary: Search within one customer
      description: Search contacts, domains, services, and invoice items visible under the specified customer. The result is grouped by entity type under `response.data`.
      operationId: customerSearch
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: q
          in: query
          description: Search term matched with `LIKE` against the supported fields for each entity type.
          required: false
          schema:
            type: string
            example: example
        - name: type
          in: query
          description: Optional list of result groups to include. If omitted, all supported groups are searched.
          required: false
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
              enum:
                - contact
                - domain
                - service
                - invoice_item
      responses:
        '200':
          description: Search results retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerSearchResponse'
              examples:
                default:
                  summary: Mixed customer search results
                  value:
                    code: 200
                    message: Request successfully completed
                    response:
                      data:
                        contact:
                          - id: 501
                            customer_id: 1
                            contact_type: LEGAL
                            name: Example Kft.
                            ident: 12345678-1-12
                            language: hu
                            country: HU
                            zip_code: '1138'
                            city: Budapest
                            street: Main St 1.
                            contact: John Doe
                            email: contact@example.hu
                            phone_number: "+36.12345678"
                            fax_number: null
                            added: '2026-07-17 10:15:00'
                            modified_at: '2026-07-17 10:20:00'
                        domain:
                          - id: 9001
                            service_id: 1001
                            customer_id: 1
                            domain: example.hu
                            domain_utf8: example.hu
                            state: REGISZTRALVA
                            customer:
                              id: 1
                              type: PRIVATE
                              name: John Doe
                        service:
                          - id: 1001
                            customer_id: 1
                            product_id: DOMAIN-HU-1Y
                            state: active
                            info: example.hu domain registration
                            customer:
                              id: 1
                              type: PRIVATE
                              name: John Doe
                        invoice_item:
                          - id: 77
                            customer_id: 1
                            invoice_id: 88
                            service_id: 1001
                            product_id: DOMAIN-HU-1Y
                            description: example.hu domain registration
                            net_price: 2490
                            currency: HUF
                            vat: 27
                            quantity: 1
                            unit: piece
                            start_date: '2026-07-17'
                            end_date: '2027-07-16'
                            invoice:
                              id: 88
                              customer_id: 1
                              invoice_id: A2026/00088
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /customers/{customer_id}/services/{service}/next_item:
    put:
      tags:
      - Services
      - Invoices
      summary: Create the next renewal invoice item
      description: Using the service's current invoice_period_months, createa an InvoiceItem for that given period. Creating a invoice with that item and paying it will extend the services lifetime.
      operationId: createNextServiceInvoiceItem
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: service
          in: path
          description: ID of the service to renew
          required: true
          schema:
            type: integer
            example: 1001
      responses:
        '200':
          description: Renewal invoice item created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowInvoiceItemResponse'
              examples:
                default:
                  summary: Next renewal item created
                  value:
                    code: 200
                    message: Request successfully completed
                    response:
                      data:
                        id: 9003
                        customer_id: 1
                        invoice_id: null
                        service_id: 1001
                        product_id: VPS-CUSTOM
                        description: Example VPS (203.0.113.42)
                        net_price: 2490
                        currency: HUF
                        vat: 27
                        quantity: 1
                        unit: month
                        start_date: '2026-08-17'
                        end_date: '2026-09-16'
                        state: normal
                        discount_amount: 0
                        is_issued: unissued
                        created_at: '2026-07-29 10:15:00'
                        updated_at: '2026-07-29 10:15:00'
        '400':
          description: Renewal item creation failed because the service cannot be priced for the next period
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                PriceNotSetForCustom:
                  summary: Service pricing is missing
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: price_not_set_for_custom
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/invoices/{invoice}/fix_vat:
    post:
      tags:
      - Invoices
      summary: Recalculate proforma VAT state
      description: Re-check the selected proforma against the current customer VAT status and update the proforma VAT rule and item VAT values accordingly. This route only works for proformas; issued invoices cannot be recalculated through this endpoint.
      operationId: fixInvoiceVat
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 406
        - name: invoice
          in: path
          description: ID of the proforma invoice to recalculate
          required: true
          schema:
            type: integer
            example: 265272
      responses:
        '200':
          description: Proforma VAT recalculated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FixInvoiceVatResponse'
              examples:
                default:
                  summary: VAT rule corrected after re-check
                  value:
                    code: 200
                    message: Request successfully completed
                    response:
                      id: 265272
                      customer_id: 406
                      invoice_id: null
                      proforma_id: '123456'
                      invoice_state: null
                      proforma_state: issued
                      total_price: 1000
                      proforma_issue_date: '2026-08-06'
                      proforma_payment_deadline: '2026-08-14'
                      invoice_issue_date: null
                      invoice_payment_deadline: null
                      paid_on_date: null
                      fulfillment_date: null
                      description: Example proforma
                      currency: HUF
                      payment_method: BANKTRANSFER
                      tax_number: SK2021959555
                      invoice_name: VAT Fix API Kft.
                      invoice_country: SK
                      invoice_zip: '929 01'
                      invoice_city: Dunajska Streda
                      invoice_street: Fout 1
                      post_country: null
                      post_street: null
                      storno_state: normal
                      company: ATW
                      eproforma_state: Y
                      einvoice_state: WAITING
                      state: unpaid
                      is_invoice: false
                      invoice_number: '123456'
                      deadline: '2026-08-14'
                      created_at: '2026-08-06 10:15:00'
                      updated_at: '2026-08-06 10:20:00'
        '400':
          description: VAT fix failed because the selected record is already an issued invoice
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                InvoiceNotProforma:
                  summary: Only proformas can be recalculated
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: invoice_not_proforma
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /customers/{customer_id}/cpanel:
    get:
      tags:
      - Webhosting
      summary: List cPanel
      description: List the customer's cPanels. The endpoint returns the stored cPanel connection details together with the linked billing service and an inferred `type` derived from the backing server.
      operationId: IndexCpanel
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - $ref: '#/components/parameters/IndexFilter'
        - $ref: '#/components/parameters/IndexOrder'
        - $ref: '#/components/parameters/IndexLimit'
        - $ref: '#/components/parameters/IndexOffset'
      responses:
        '200':
          description: cPanels retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexCpanelResponse'
              examples:
                default:
                  summary: Customer cPanel list
                  value:
                    code: 200
                    message: Request successfully completed
                    response:
                      count: 1
                      data:
                        - id: 104767
                          service_id: 1001
                          server: server.example.com
                          username: exampleuser
                          ip: 192.0.2.10
                          ns1: ns1.example.test
                          ns2: ns2.example.test
                          created_at: '2026-07-01 12:00:00'
                          updated_at: '2026-07-10 08:30:00'
                          type: directadmin
                          service:
                            id: 1001
                            customer_id: 1
                            product_id: CUSTOM-01-01-VS
                            product_group: webhosting
                            state: active
                            price: 2490
                            vat: 27
                            invoice_interval_months: 12
                            price_currency: HUF
                            invoice_currency: HUF
                            started_on: '2026-07-01'
                            invoiced_until: '2027-06-30'
                            paid_until: '2027-06-30'
                            last_paid: '2026-07-01'
                            comment: cPanel hosting
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/cpanel/{id}:
    get:
      tags:
      - Webhosting
      summary: Get cPanel
      description: Get a single cPanels belonging to the selected customer. The endpoint returns the stored cPanel connection details together with the linked billing service and an inferred `type` derived from the backing server.
      operationId: ShowCpanel
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: id
          in: path
          description: ID of the cPanel
          required: true
          schema:
            type: integer
            example: 104767
      responses:
        '200':
          description: cPanel retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowCpanelResponse'
              examples:
                default:
                  summary: Customer cPanel
                  value:
                    code: 200
                    message: Request successfully completed
                    response:
                      id: 104767
                      service_id: 1001
                      server: server.example.com
                      username: exampleuser
                      ip: 192.0.2.10
                      ns1: ns1.example.test
                      ns2: ns2.example.test
                      created_at: '2026-07-01 12:00:00'
                      updated_at: '2026-07-10 08:30:00'
                      type: directadmin
                      service:
                        id: 1001
                        customer_id: 1
                        product_id: CUSTOM-01-01-VS
                        product_group: webhosting
                        state: active
                        price: 2490
                        vat: 27
                        invoice_interval_months: 12
                        price_currency: HUF
                        invoice_currency: HUF
                        started_on: '2026-07-01'
                        invoiced_until: '2027-06-30'
                        paid_until: '2027-06-30'
                        last_paid: '2026-07-01'
                        comment: cPanel hosting
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/cpanel/{id}/session:
    post:
      tags:
      - Webhosting
      summary: Create cPanel session
      description: Create a one-time login URL for the selected cPanel. Depending on the backing server, the endpoint creates either a DirectAdmin session URL or a cPanel session URL and returns it in the same response shape.
      operationId: CreateCpanelSession
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: id
          in: path
          description: ID of the cPanel
          required: true
          schema:
            type: integer
            example: 104767
      responses:
        '200':
          description: Control-panel session URL created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCpanelSessionResponse'
              examples:
                cpanel:
                  summary: cPanel session URL
                  value:
                    code: 200
                    message: Request successfully completed
                    response:
                      url: https://cp01.hosting.example:2083/cpsess1234567890/login/?session=abcdef
                directadmin:
                  summary: DirectAdmin session URL
                  value:
                    code: 200
                    message: Request successfully completed
                    response:
                      url: https://da01.hosting.example:2222/CMD_LOGIN?SESSION_ID=abcdef123456
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/webhostings/{whuser}/databases/{database}/backups:
    get:
      tags:
      - Webhosting
      summary: List webhosting database backups
      description: List available backup dates for one webhosting database. Only backups on or after the related webhosting account creation date are returned.
      operationId: listWebhostingDatabaseBackups
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
        - name: database
          in: path
          description: Database name
          required: true
          schema:
            type: string
            example: userteszt_wordpress0
      responses:
        '200':
          description: Available database backup dates retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListWebhostingBackupsResponse'
              examples:
                default:
                  summary: Available database backup dates
                  value:
                    code: 200
                    message: Request successfully completed
                    response:
                      - '2026-08-03'
                      - '2026-08-04'
                      - '2026-08-05'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/webhostings/{whuser}/databases/{database}/backups/{date}:
    get:
      tags:
      - Webhosting
      summary: Get a webhosting database backup
      description: Retrieve one database backup for the selected backup date. The date must be one of the values returned by the database backup list endpoint for the same webhosting database.
      operationId: getWebhostingDatabaseBackup
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
        - name: database
          in: path
          description: Database name
          required: true
          schema:
            type: string
            example: userteszt_wordpress0
        - name: date
          in: path
          description: Backup date returned by the database backup list endpoint
          required: true
          schema:
            type: string
            format: date
            example: '2026-07-20'
      responses:
        '200':
          description: Database backup retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetWebhostingBackupResponse'
        '400':
          description: Backup date is not available for the selected database
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                InvalidBackupDate:
                  summary: Backup date is not available
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: invalid_backup_date
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    put:
      tags:
      - Webhosting
      summary: Get a webhosting database backup
      description: "PUT variant of the database-backup retrieval route. It returns the same backup payload as GET for the selected database backup date. The date must be one of the values returned by the database backup list endpoint for the same webhosting database."
      operationId: getWebhostingDatabaseBackupViaPut
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
        - name: database
          in: path
          description: Database name
          required: true
          schema:
            type: string
            example: userteszt_wordpress0
        - name: date
          in: path
          description: Backup date returned by the database backup list endpoint
          required: true
          schema:
            type: string
            format: date
            example: '2026-07-20'
      responses:
        '200':
          description: Database backup retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetWebhostingBackupResponse'
        '400':
          description: Backup date is not available for the selected database
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                InvalidBackupDate:
                  summary: Backup date is not available
                  value:
                    code: 400
                    message: Bad request
                    response:
                      code: invalid_backup_date
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/webhostings/{whuser}/tasks:
    get:
      tags:
      - Webhosting
      summary: List webhosting tasks
      description: List scheduled and one-off tasks belonging to the selected webhosting account. Supports the standard filter, ordering, and pagination query parameters.
      operationId: indexWebhostingTasks
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
        - $ref: '#/components/parameters/IndexFilter'
        - $ref: '#/components/parameters/IndexOrder'
        - $ref: '#/components/parameters/IndexLimit'
        - $ref: '#/components/parameters/IndexOffset'
      responses:
        '200':
          description: Webhosting tasks retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexWebhostingTasksResponse'
              examples:
                default:
                  summary: Webhosting task list
                  value:
                    code: 200
                    message: Request successfully completed
                    response:
                      count: 2
                      data:
                        - id: 915
                          webhosting_id: 104767
                          username: userteszt
                          type: C
                          url: http://example.com/cron.php
                          interval_minutes: 60
                          last_scheduled_at: '2026-07-29 02:00:00'
                          last_executed_at: '2026-07-29 02:00:03'
                          last_execution_time_s: 3
                          expires_at: null
                          inserted_at: '2026-07-01 12:00:00'
                          executed_count: 145
                        - id: 916
                          webhosting_id: 104767
                          username: userteszt
                          type: A
                          url: http://example.com/once.php
                          interval_minutes: null
                          last_scheduled_at: null
                          last_executed_at: null
                          last_execution_time_s: null
                          expires_at: '2026-07-30 04:00:00'
                          inserted_at: '2026-07-29 03:55:00'
                          executed_count: 0
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      tags:
      - Webhosting
      summary: Create a webhosting task
      description: Create a scheduled or one-off task under the selected webhosting account. `url` must use the `http://` scheme and include a non-empty path. If `interval_minutes` is provided with a non-zero value, the task becomes a recurring cron-style task and `start_time` is stored as `last_scheduled_at`. If `interval_minutes` is omitted or set to `0`, the task becomes a one-off task and `start_time` is stored as `expires_at`.
      operationId: createWebhostingTask
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreWebhostingTaskRequest'
            examples:
              recurring:
                summary: Recurring task
                value:
                  url: http://example.com/cron.php
                  interval_minutes: 60
                  start_time: '2026-07-30 02:00:00'
              oneOff:
                summary: One-off task
                value:
                  url: http://example.com/once.php
                  start_time: '2026-07-30 04:00:00'
      responses:
        '200':
          description: Webhosting task created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoreWebhostingTaskResponse'
              examples:
                recurring:
                  summary: Recurring task created
                  value:
                    code: 200
                    message: Data updated successfully
                    response:
                      updated:
                        - url
                        - interval_minutes
                        - start_time
                      data:
                        id: 915
                        webhosting_id: 104767
                        username: userteszt
                        type: C
                        url: http://example.com/cron.php
                        interval_minutes: 60
                        last_scheduled_at: '2026-07-30 02:00:00'
                        last_executed_at: null
                        last_execution_time_s: null
                        expires_at: null
                        inserted_at: '2026-07-29 12:00:00'
                        executed_count: 0
                oneOff:
                  summary: One-off task created
                  value:
                    code: 200
                    message: Data updated successfully
                    response:
                      updated:
                        - url
                        - start_time
                      data:
                        id: 916
                        webhosting_id: 104767
                        username: userteszt
                        type: A
                        url: http://example.com/once.php
                        interval_minutes: null
                        last_scheduled_at: null
                        last_executed_at: null
                        last_execution_time_s: null
                        expires_at: '2026-07-30 04:00:00'
                        inserted_at: '2026-07-29 12:05:00'
                        executed_count: 0
        '400':
          description: Validation failure or webhosting task business-rule error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                MissingUrl:
                  summary: URL is required
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        url:
                          - code: validation.required
                            message: The url field is required.
                InvalidScheme:
                  summary: Only http URLs are accepted
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        url:
                          - code: validation.invalid_scheme
                            message: url must start with http://
                PathEmpty:
                  summary: URL path cannot be empty
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        url:
                          - code: validation.path_empty
                            message: Path cannot be empty
                LimitExceeded:
                  summary: Task limit exceeded for the webhosting account
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        url:
                          - code: validation.limit_exceeded
                            message: Limit exceeded.
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/webhostings/{whuser}/tasks/{tasks}:
    delete:
      tags:
      - Webhosting
      summary: Delete a webhosting task
      description: Delete one scheduled or one-off task belonging to the selected webhosting account.
      operationId: deleteWebhostingTask
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
        - name: tasks
          in: path
          description: ID of the webhosting task
          required: true
          schema:
            type: integer
            example: 915
      responses:
        '200':
          description: Webhosting task deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteWebhostingTaskResponse'
              examples:
                default:
                  summary: Task deleted
                  value:
                    code: 200
                    message: Record successfully removed
                    response:
                      data: true
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    get:
      tags:
      - Webhosting
      summary: Get a webhosting task
      description: Retrieve one scheduled or one-off task belonging to the selected webhosting account.
      operationId: showWebhostingTask
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
        - name: tasks
          in: path
          description: ID of the webhosting task
          required: true
          schema:
            type: integer
            example: 915
      responses:
        '200':
          description: Webhosting task retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowWebhostingTaskResponse'
              examples:
                default:
                  summary: Webhosting task details
                  value:
                    code: 200
                    message: Request successfully completed
                    response:
                      id: 915
                      webhosting_id: 104767
                      username: userteszt
                      type: C
                      url: http://example.com/cron.php
                      interval_minutes: 60
                      last_scheduled_at: '2026-07-29 02:00:00'
                      last_executed_at: '2026-07-29 02:00:03'
                      last_execution_time_s: 3
                      expires_at: null
                      inserted_at: '2026-07-01 12:00:00'
                      executed_count: 145
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/webhostings/{whuser}/tasks/{job}:
    put:
      tags:
      - Webhosting
      summary: Update a webhosting task
      description: Update a scheduled or one-off task belonging to the selected webhosting account.
      operationId: updateWebhostingTask
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
        - name: job
          in: path
          description: ID of the webhosting task
          required: true
          schema:
            type: integer
            example: 915
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWebhostingTaskRequest'
            example: {}
      responses:
        '200':
          description: Webhosting task updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateWebhostingTaskResponse'
              examples:
                default:
                  summary: No-op task update
                  value:
                    code: 200
                    message: Data updated successfully
                    response:
                      updated: []
                      data:
                        id: 915
                        webhosting_id: 104767
                        username: userteszt
                        type: C
                        url: http://example.com/cron.php
                        interval_minutes: 60
                        last_scheduled_at: '2026-07-29 02:00:00'
                        last_executed_at: '2026-07-29 02:00:03'
                        last_execution_time_s: 3
                        expires_at: null
                        inserted_at: '2026-07-01 12:00:00'
                        executed_count: 145
        '400':
          description: Validation failure for unsupported webhosting task update fields
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                UnknownField:
                  summary: Submitted fields are not accepted on this route
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        interval_minutes:
                          - code: validation.unknown_field
                            message: Unknown field.
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/webhostings/{whuser}/datashares:
    get:
      tags:
      - Webhosting
      summary: List webhosting data shares
      description: List the data-share accounts configured under one webhosting account. These entries are backed by the `hosting.userftp` records exposed through the datashare route.
      operationId: indexWebhostingDatashares
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
        - $ref: '#/components/parameters/IndexFilter'
        - $ref: '#/components/parameters/IndexOrder'
        - $ref: '#/components/parameters/IndexLimit'
        - $ref: '#/components/parameters/IndexOffset'
      responses:
        '200':
          description: Webhosting data shares retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexWebhostingDatasharesResponse'
              examples:
                default:
                  summary: Datashare list
                  value:
                    code: 200
                    message: Request successfully completed
                    response:
                      count: 2
                      data:
                        - id: 71
                          webhosting_id: 104767
                          webhosting_name: userteszt
                          username: userteszt_share1
                          readonly: N
                          path: /www/share-blog01/
                        - id: 72
                          webhosting_id: 104767
                          webhosting_name: userteszt
                          username: userteszt_share2
                          readonly: Y
                          path: /www/share-media02/
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      tags:
      - Webhosting
      summary: Create a webhosting data share
      description: Create a data-share account under the selected webhosting account. The username must start with the webhosting username followed by `_`, the path must start with `/`, and the share must be marked read-only or read-write.
      operationId: createWebhostingDatashare
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreWebhostingDatashareRequest'
            example:
              username: userteszt_share1
              password: StrongPass123
              readonly: N
              path: /www/share-blog01/
      responses:
        '200':
          description: Webhosting data share created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoreWebhostingDatashareResponse'
              examples:
                default:
                  summary: Datashare created
                  value:
                    code: 200
                    message: Data updated successfully
                    response:
                      updated:
                        - username
                        - password
                        - readonly
                        - path
                      data:
                        id: 71
                        webhosting_id: 104767
                        webhosting_name: userteszt
                        username: userteszt_share1
                        readonly: N
                        path: /www/share-blog01/
        '400':
          description: Validation failure or datashare business-rule error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                MissingUsername:
                  summary: Username is required
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        username:
                          - code: validation.required
                            message: The username field is required.
                InvalidReadonly:
                  summary: Readonly flag must be Y or N
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        readonly:
                          - code: validation.in
                            message: The selected readonly is invalid.
                InvalidPath:
                  summary: Path must start with a slash
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        path:
                          - code: validation.regex
                            message: The path format is invalid.
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/webhostings/{whuser}/datashares/{id}:
    delete:
      tags:
      - Webhosting
      summary: Delete a webhosting data share
      description: Delete one data-share account from the selected webhosting account.
      operationId: deleteWebhostingDatashare
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
        - name: id
          in: path
          description: ID of the data-share account
          required: true
          schema:
            type: integer
            example: 71
      responses:
        '200':
          description: Webhosting data share deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteWebhostingDatashareResponse'
              examples:
                default:
                  summary: Datashare deleted
                  value:
                    code: 200
                    message: Record successfully removed
                    response:
                      data: true
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    get:
      tags:
      - Webhosting
      summary: Get a webhosting data share
      description: Retrieve one data-share account from the selected webhosting account.
      operationId: showWebhostingDatashare
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
        - name: id
          in: path
          description: ID of the data-share account
          required: true
          schema:
            type: integer
            example: 71
      responses:
        '200':
          description: Webhosting data share retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShowWebhostingDatashareResponse'
              examples:
                default:
                  summary: Datashare details
                  value:
                    code: 200
                    message: Request successfully completed
                    response:
                      id: 71
                      webhosting_id: 104767
                      webhosting_name: userteszt
                      username: userteszt_share1
                      readonly: N
                      path: /www/share-blog01/
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    put:
      tags:
      - Webhosting
      summary: Update a webhosting data share
      description: Update mutable settings of a data-share account belonging to the selected webhosting account.
      operationId: updateWebhostingDatashare
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
        - name: whuser
          in: path
          description: ID of the webhosting account
          required: true
          schema:
            type: integer
            example: 104767
        - name: id
          in: path
          description: ID of the data-share account
          required: true
          schema:
            type: integer
            example: 71
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWebhostingDatashareRequest'
            example:
              password: StrongerPass123
              readonly: Y
              path: /www/share-blog01/
      responses:
        '200':
          description: Webhosting data share updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateWebhostingDatashareResponse'
              examples:
                default:
                  summary: Datashare updated
                  value:
                    code: 200
                    message: Data updated successfully
                    response:
                      updated:
                        - password
                        - readonly
                        - path
                      data:
                        id: 71
                        webhosting_id: 104767
                        webhosting_name: userteszt
                        username: userteszt_share1
                        readonly: Y
                        path: /www/share-blog01/
        '400':
          description: Validation failure for webhosting data-share update
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                PasswordTooShort:
                  summary: Password must be at least 8 characters
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        password:
                          - code: validation.min.string
                            message: The password must be at least 8 characters.
                InvalidReadonly:
                  summary: Readonly flag must be Y or N
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        readonly:
                          - code: validation.in
                            message: The selected readonly is invalid.
                InvalidPath:
                  summary: Path must start with a slash
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        path:
                          - code: validation.regex
                            message: The path format is invalid.
                UsernameNotMutable:
                  summary: Username cannot be changed through this route
                  value:
                    code: 400
                    message: Bad form data
                    response:
                      formErrors:
                        username:
                          - code: validation.unknown_field
                            message: Unknown field.
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /token:
    delete:
      tags:
      - User
      summary: Delete the current token
      description: Delete the currently presented API token. This is the logout-style endpoint for token-authenticated sessions and removes exactly the token sent in the `X-Token` header.
      operationId: deleteCurrentToken
      security:
        - XToken: []
      responses:
        '200':
          description: Current token removed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteTokenResponse'
              example:
                code: 200
                message: Token successfully removed
                response:
                  token: 1A2b3C4d5E6f7G8h9I0j1K2l3M4n5O6p
        '500':
          $ref: '#/components/responses/InternalServerError'

  /simplepay/backref:
    get:
      tags:
      - Payments
      summary: Validate a SimplePay back-reference
      description: Validate the SimplePay return URL parameters after the customer is redirected back from the payment page. The route checks the supplied URL payload with the SimplePay back-reference helper and returns whether the validation result was `ok` or `error`.
      operationId: validateSimplepayBackref
      security:
        - XToken: []
      parameters:
        - name: url
          in: query
          description: Full callback URL or signed URL fragment returned by SimplePay
          required: false
          schema:
            type: string
            example: https://example.com/return?order_ref=ORD-123&status=SUCCESS
        - name: order_ref
          in: query
          description: SimplePay order reference
          required: false
          schema:
            type: string
            example: ORD-123
        - name: order_currency
          in: query
          description: Currency used for the original order
          required: false
          schema:
            type: string
            example: HUF
      responses:
        '200':
          description: SimplePay back-reference validated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimplepayBackrefResponse'
              example:
                code: 200
                message: Request successfully completed
                response:
                  validation: ok
                  url: https://example.com/return?order_ref=ORD-123&status=SUCCESS
        '500':
          $ref: '#/components/responses/InternalServerError'

  /customers/{customer_id}/stripe/setup:
    post:
      tags:
      - Payment Methods
      - Payments
      summary: Create a Stripe setup intent
      description: Used for creating a paymentmethod which is `stripe`, as a regular user you won't have access to this, and will have to mine out stripe public keys from our frontend.
      operationId: createStripeSetupIntent
      security:
        - XToken: []
      parameters:
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: integer
            example: 1
      responses:
        '200':
          description: Stripe setup intent created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateStripeSetupResponse'
              example:
                code: 200
                message: Request successfully completed
                response:
                  setup_intent_id: seti_1Q2w3E4r5T6y7U8i9O0p
                  client_secret: seti_1Q2w3E4r5T6y7U8i9O0p_secret_AbCdEfGhIjKlMnOp
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    IndexFilter:
      name: filter
      in: query
      description: >-
        Custom legacy PHP-style filter query fragment.

        Unlike normal query parameters, this value is inserted directly at
        the root of the query string without a `filter=` prefix, so watch out you will need our custom mustache templates to generate this accurately in PHP.

        Example:
        filter_field[0]=state&filter_op[0]=in&filter_value[0][]=REGISZTRALVA&filter_value[0][]=BEJEGYZENDO
      required: false
      style: form
      explode: true
      x-php-query-fragment: true
      schema:
        type: string
    IndexOrder:
      name: order
      in: query
      description: >-
        Ordering rules.
        Each array element uses the format `field,<asc,desc>`.
      required: false
      schema:
        type: array
        items:
          $ref: '#/components/schemas/IndexOrder'

    IndexLimit:
      name: limit
      in: query
      description: Maximum number of records to return. Default 300, maximum 300.
      required: false
      schema:
        $ref: '#/components/schemas/IndexLimit'

    IndexOffset:
      name: offset
      in: query
      description: Number of records to skip for pagination.
      required: false
      schema:
        $ref: '#/components/schemas/IndexOffset'

  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic

    XToken:
      type: apiKey
      in: header
      name: X-Token

  schemas:
    IndexOrder:
      type: string
      description: >-
        A single ordering rule in `field,direction` format.
        Direction defaults to `asc` when omitted.
      pattern: '^[a-z0-9_]+(?:,(?:asc|desc))?$'
      example: domain,asc

    IndexLimit:
      type: integer
      minimum: 1
      maximum: 300
      default: 300
      example: 100

    IndexOffset:
      type: integer
      minimum: 0
      default: 0
      example: 0

    SuccessEnvelope:
      description: Shared success response envelope.
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed

    SuccessDataResponse:
      description: Shared success response with a single `response.data` payload.
      allOf:
        - $ref: '#/components/schemas/SuccessEnvelope'
        - type: object

    SuccessListResponse:
      description: Shared success response with `response.data[]` and optional `response.count`.
      allOf:
        - $ref: '#/components/schemas/SuccessEnvelope'
        - type: object
          properties:
            response:
              type: object
              properties:
                count:
                  description: Total number of returned records
                  type: integer
                  example: 42

    SuccessUpdateResponse:
      description: Shared success response for create/update flows returning `updated` and `data`.
      allOf:
        - $ref: '#/components/schemas/SuccessEnvelope'
        - type: object
          properties:
            message:
              example: Data updated successfully
            response:
              type: object
              properties:
                updated:
                  description: List of field names that were updated
                  type: array
                  items:
                    type: string

    SuccessBooleanDataResponse:
      description: Shared success response with a boolean `response.data` payload.
      allOf:
        - $ref: '#/components/schemas/SuccessEnvelope'
        - type: object
          properties:
            message:
              example: Record successfully removed
            response:
              type: object
              properties:
                data:
                  description: Operation result
                  type: boolean
                  example: true

    SuccessNullDataResponse:
      description: Shared success response with `response.data` explicitly set to null.
      allOf:
        - $ref: '#/components/schemas/SuccessEnvelope'
        - type: object
          properties:
            message:
              example: Record successfully removed
            response:
              type: object
              properties:
                data:
                  description: This response intentionally returns no payload.
                  nullable: true
                  example: null

    ValidationErrorEntry:
      description: One field-level validation error returned inside `response.formErrors`.
      type: object
      properties:
        code:
          description: Validation error code
          type: string
          example: validation.required
        message:
          description: Human-readable validation error message
          type: string
          example: The full name field is required.

    ErrorEnvelope:
      description: Shared error response envelope.
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
        message:
          description: Error message
          type: string
        response: {}

    ErrorMessagePayload:
      description: Standard business or authorization error payload.
      type: object
      properties:
        message:
          description: Detailed error message
          type: string
        params:
          description: Error parameters
          type: object

    ValidationFormErrorsPayload:
      description: Validation error payload keyed by request field.
      type: object
      properties:
        formErrors:
          description: Map of field names to their validation errors
          type: object
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/ValidationErrorEntry'

    User:
      description: The user object
      type: object
      properties:
        id:
          description: The ID of the user in the system
          type: integer
          example: 1
        username:
          description: user's username, (email)
          type: string
          example: testuser@example.com
        pincode_created_at:
          description: When the users PIN code was created
          type: string
          nullable: true
          example: '2026-07-16 12:55:43'
        pincode:
          description: A 6 didit number support staff uses to easily identify a person
          type: string
          nullable: true
          example: '012345'
        language:
          description: The language the billing is done with, and the UI is rendered as.
          type: string
          enum:
            - HU
            - hu
            - EN
            - en
          example: HU
        full_name:
          description: User's full name
          type: string
          example: John Doe
        phone_number:
          description: User's phone number
          type: string
          example: ''
        last_activity_at:
          description: Last activity with the API
          type: string
          nullable: true
          example: '2026-07-16 12:55:43'
        created_at:
          description: When the user was created at
          type: string
          example: '2026-07-16 12:55:38'
        activated_on:
          description: When the user was activated
          type: string
          nullable: true
          example: '2026-07-16 12:55:38'
        state:
          description: State of the user
          type: string
          enum:
            - ACTIVE
            - SIGNUP
            - SUSPEND
          example: ACTIVE
        role:
          description: Users role in our system
          type: string
          enum:
            - user
            - admin
          example: user

    Customer:
      description: The customer object containing all the information about it.
      type: object
      properties:
        id:
          description: Id of the customer
          type: integer
          example: 1
        name:
          description: Name of the customer
          type: string
          example: John Doe Billing
        deadline_days:
          description: The amount of days the user has to pay a proforma.
          type: integer
          example: 8
        date_of_birth:
          description: When the user was born, for `PRIVATE` only.
          type: string
          format: date
          nullable: true
          example: '1999-07-16'
        vat_last_checked_at:
          description: The last time the VAT number was checked for validity.
          type: string
          nullable: true
          example: '2026-07-16 12:55:43'
        vat_valid:
          description: If the VAT number is valid
          type: boolean
          nullable: true
          example: true
        hu_group_vat:
          description: Hungarian VAT number
          type: string
          nullable: true
          example: 'HU12345678'
        post_cc:
          description: The country code of the posting address
          type: string
          nullable: true
          example: HU
        post_zip:
          description: ZIP code of the customers posting address
          type: string
          nullable: true
          example: '1138'
        post_city:
          description: The location this customer is under
          type: string
          nullable: true
          example: Budapest
        post_str:
          description: Street of the customer
          type: string
          nullable: true
          example: 'Main St 1.'
        unpaid_allowed_until:
          description: Tiltasvedelem, how long the user is allowed to have unpaid invoices
          type: string
          format: date
          nullable: true
          example: '2026-07-16'
        invoice_language:
          description: The language this customer receives their invoices in
          type: string
          enum:
            - hu
            - en
          example: hu
        default_currency:
          description: Default currency of the cusomer
          type: string
          example: HUF
        autopay:
          type: integer
          example: 0
        rules_id:
          description: Rules that belong to this customer
          type: integer
          example: 1
        owner:
          description: The user id this customer belongs to
          type: integer
          example: 1
        c_id:
          description: TODO
          type: integer
          example: 1
        type:
          description: The legality of this customer, either LEGAL for a legal entity such as a company, or PRIVATE for a private person.
          type: string
          enum:
            - PRIVATE
            - LEGAL
          example: PRIVATE
        status:
          description: Status of customer
          type: string
          example: ACTIVE
        changed:
          description: Last time this customer has been edited
          type: string
          example: '2026-07-16 12:55:38'
        finance_notify_email:
          description: The email this customer gets their financial notifications to
          type: integer
          example: 1
        datacenter_device_id:
          description: The ID this customers physical devices are labeled in datancenters, if they have any
          type: integer
          nullable: true
          example: 1
        datacenter_device_permission:
          description: Permission level to datacenter devices
          type: string
          enum:
            - full
            - local
            - console
          nullable: true
          example: full
        payment_method:
          description: Default payment method, by default BANKTRANSFER
          type: string
          enum:
            - BANKTRANSFER
            - CHEQUE
            - PAYPAL
          example: BANKTRANSFER
        invoice_method:
          description: The method this user recives their invoices via
          type: string
          enum:
            - EPROFORMA_EINVOICE
            - EPROFORMA_INVOICE
            - PROFORMA_INVOICE
            - INVOICE
            - EINVOICE
            - BARTER
            - SUPERBARTER
            - INVOICEALWAYS
            - EINVOICEALWAYS
          example: PROFORMA_INVOICE
        ident:
          description: The TIN of the company or date of birth for private person.
          type: string
          nullable: true
          oneOf:
          - title: Company (TIN)
            properties:
              ident:
                type: string
                examples:
                  - "12345678-1-12"
                  - "DE12345678"

          - title: Private Person (Date of Birth)
            properties:
              ident:
                type: string
                format: date
                example: "1990-05-17"

        invoice_country:
          description: The country that invoices are billed under
          type: string
          example: HU
        invoice_zip:
          description: The ZIP code that invoices are billed under
          type: string
          example: '1138'
        invoice_city:
          description: The city that invoices are billed under
          type: string
          example: Budapest
        invoice_street:
          description: The street that invoices are billed under
          type: string
          example: 'Main St 1.'
        created_at:
          description: When this customer was created
          type: string
          example: '2026-07-16 12:55:38'

        updated_at:
          description: When this customer was last updated at
          type: string
          example: '2026-07-16 13:15:37'

        slug:
          description: Slug of the customer
          type: string
          example: test-john-doe-billing
        vat:
          description: The amount of VAT this customer is billed with
          type: string
          example: '27.00'
        sznet_id:
          description: Id of the user from another platform that was integrated into ours
          type: string
          examples:
            - "net23:username"
            - "xet:x"
        vat_rule:
          description: The VAT rule
          type: string
          example: hu-private

    SessionData:
      description: Compact snapshot of the currently authenticated session.
      type: object
      properties:
        first_name:
          description: Authenticated user's first name
          type: string
          nullable: true
          example: John
        last_name:
          description: Authenticated user's last name
          type: string
          nullable: true
          example: Doe
        name:
          description: Authenticated user's full display name
          type: string
          nullable: true
          example: John Doe
        role:
          description: Effective role of the authenticated user
          type: string
          enum:
            - user
            - admin
          example: user
        phone_number:
          description: Authenticated user's phone number
          type: string
          nullable: true
          example: +36.16000289
        username:
          description: Authenticated user's username
          type: string
          format: email
          example: john.doe@example.com
        customers:
          description: Customers currently accessible to the authenticated user.
          type: array
          items:
            type: object
            properties:
              id:
                description: Customer ID
                type: integer
                example: 1
              name:
                description: Customer display name
                type: string
                example: John Doe

    CustomerPivot:
      type: object
      properties:
        owner:
          type: integer
          example: 1
        c_id:
          type: integer
          example: 1

    UserWithCustomer:
      description: User listing with customers attached
      allOf:
        - $ref: '#/components/schemas/User'
        - type: object
          properties:
            customer:
              description: List of customers that belong to this user
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/Customer'
                  - type: object
                    properties:
                      pivot:
                        $ref: '#/components/schemas/CustomerPivot'
          required:
            - customer

    DomainWithCustomer:
      description: Domain result with the eager-loaded customer relation used by customer search.
      allOf:
        - $ref: '#/components/schemas/Domain'
        - type: object
          properties:
            customer:
              $ref: '#/components/schemas/Customer'

    ServiceWithCustomer:
      description: Service result with the eager-loaded customer relation used by customer search.
      allOf:
        - $ref: '#/components/schemas/Service'
        - type: object
          properties:
            customer:
              $ref: '#/components/schemas/Customer'

    InvoiceItemWithInvoice:
      description: Invoice item result with the eager-loaded invoice relation used by customer search.
      allOf:
        - $ref: '#/components/schemas/InvoiceItem'
        - type: object
          properties:
            invoice:
              $ref: '#/components/schemas/Invoice'

    CustomerSearchResultGroups:
      description: Grouped customer search result buckets returned by the customer search endpoint.
      type: object
      properties:
        contact:
          type: array
          items:
            $ref: '#/components/schemas/Contact'
        domain:
          type: array
          items:
            $ref: '#/components/schemas/DomainWithCustomer'
        service:
          type: array
          items:
            $ref: '#/components/schemas/ServiceWithCustomer'
        invoice_item:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceItemWithInvoice'

    CustomerWithUsers:
      description: Customers and their users
      allOf:
        - $ref: '#/components/schemas/Customer'
        - type: object
          properties:
            users:
              description: Users who have access to this customer.
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/User'
                  - type: object
                    properties:
                      pivot:
                        $ref: '#/components/schemas/CustomerPivot'
          required:
            - users

    IAPNotifySettings:
      description: Notification suppression setting for one user-customer access record.
      type: object
      properties:
        id:
          description: Notify settings ID
          type: integer
          example: 1
        iap_rules_id:
          description: Related access record ID
          type: integer
          example: 42
        disable_notify:
          description: Notification channel disabled for this user on this customer
          type: string
          enum:
            - finance_email
            - finance_sms
          example: finance_email

    StoreCustomerNotifySettingsRequest:
      description: Request body for creating a notification suppression setting for a user-customer membership
      type: object
      properties:
        disable_notify:
          description: Notification channel to disable for this user on this customer
          type: string
          enum:
            - finance_email
            - finance_sms
          example: finance_email
      required:
        - disable_notify

    Service:
      description: Billing service record linked to a domain through `services.t_id = domain.id`.
      type: object
      properties:
        id:
          description: Service ID
          type: integer
          example: 1001
        customer_id:
          description: Owning customer ID
          type: integer
          example: 1
        product_id:
          description: Product identifier from `services_list`
          type: string
          example: DOMAIN-HU-1Y
        product_group:
          description: Legacy product group marker
          type: string
          nullable: true
          example: domains
        state:
          description: Current service state
          type: string
          example: active
        price:
          description: Net recurring price of the service
          type: number
          nullable: true
          example: 2490
        vat:
          description: VAT rate stored on the service
          type: number
          nullable: true
          example: 27
        invoice_interval_months:
          description: Billing interval in months
          type: integer
          example: 12
        price_currency:
          description: Currency the service price is stored in
          type: string
          example: HUF
        invoice_currency:
          description: Currency invoices are issued in
          type: string
          example: HUF
        started_on:
          description: Service start date
          type: string
          nullable: true
          example: '2026-07-17'
        invoiced_until:
          description: Last billed period end date
          type: string
          nullable: true
          example: '2027-07-16'
        paid_until:
          description: Paid-through date when tracked separately
          type: string
          nullable: true
          example: '2027-07-16'
        last_paid:
          description: Date of the last successful payment
          type: string
          nullable: true
          example: '2026-07-17'
        deleted_at:
          description: Soft-delete timestamp
          type: string
          nullable: true
          example: '2026-07-17 10:15:00'
        pending_disable_on:
          description: Scheduled disable date if cancellation is pending
          type: string
          nullable: true
          example: '2026-08-01'
        price_updated_at:
          description: When the service price was last changed
          type: string
          nullable: true
          example: '2026-07-17 10:15:00'
        info:
          description: Human-readable service description
          type: string
          nullable: true
          example: example.hu domain registration
        postpay:
          description: Whether the service bills in arrears
          type: string
          enum:
            - '0'
            - '1'
          example: '0'
        company:
          description: Internal company code
          type: string
          example: ATW
        is_disabled:
          description: Whether the service is disabled
          type: string
          enum:
            - Y
            - N
          example: N
        auto_renew:
          description: Whether the service renews automatically
          type: integer
          nullable: true
          example: 1
        created_at:
          description: Creation timestamp
          type: string
          nullable: true
          example: '2026-07-17 10:15:00'
        updated_at:
          description: Last update timestamp
          type: string
          nullable: true
          example: '2026-07-17 10:20:00'
        paymentmethod:
          description: Preferred payment method override on the service
          type: string
          nullable: true
          example: banktransfer

    Contact:
      description: Contact record linked to a domain
      type: object
      properties:
        id:
          description: Contact ID
          type: integer
          example: 501
        customer_id:
          description: Owning customer ID
          type: integer
          nullable: true
          example: 1
        contact_type:
          description: Legal type of the contact
          type: string
          enum:
            - PRIVATE
            - LEGAL
          example: LEGAL
        name:
          description: Registered contact name
          type: string
          nullable: true
          example: Example Kft.
        ident:
          description: Tax number or birth date, depending on contact type
          type: string
          nullable: true
          example: 12345678-1-12
        language:
          description: Preferred language
          type: string
          nullable: true
          example: hu
        country:
          description: Country code
          type: string
          nullable: true
          example: HU
        zip_code:
          description: Postal code
          type: string
          nullable: true
          example: '1138'
        city:
          description: City
          type: string
          nullable: true
          example: Budapest
        street:
          description: Street address without house number
          type: string
          nullable: true
          example: Main St
        contact:
          description: Human contact person name
          type: string
          nullable: true
          example: John Doe
        email:
          description: Contact email address
          type: string
          nullable: true
          format: email
          example: john.doe@example.com
        phone_number:
          description: Contact phone number
          type: string
          nullable: true
          example: "+36.12345678"
        fax_number:
          description: Contact fax number
          type: string
          nullable: true
          example: "+36.12345679"
        added:
          description: When the contact was created
          type: string
          nullable: true
          example: '2026-07-17 10:15:00'
        modified_at:
          description: When the contact was last modified
          type: string
          nullable: true
          example: '2026-07-17 10:20:00'
        hureg_id:
          description: External HUREG contact identifier when present
          type: string
          nullable: true
          example: ABC-12345

    IndexContactsResponse:
      description: Response after successfully retrieving customer contacts
      allOf:
        - $ref: '#/components/schemas/SuccessListResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                count:
                  description: Total number of returned records
                  type: integer
                  example: 42
                data:
                  description: Array of contact entries
                  type: array
                  items:
                    $ref: '#/components/schemas/Contact'

    StoreContactRequest:
      description: Request body for creating a contact
      type: object
      required:
        - contact_type
        - name
        - country
        - language
        - zip_code
        - city
        - street
        - contact
        - email
        - phone_number
      properties:
        contact_type:
          description: Legal type of the contact
          type: string
          enum:
            - PRIVATE
            - LEGAL
          example: LEGAL
        name:
          description: Registered contact name
          type: string
          example: Example Kft.
        ident:
          description: >
            Tax number for LEGAL contacts, or birth date for PRIVATE contacts
            (format: YYYY-MM-DD, e.g., 1999-01-01)
          type: string
          example: "12345678-1-12"
        country:
          description: Country code
          type: string
          example: HU
        language:
          description: Preferred language code
          type: string
          example: hu
        zip_code:
          description: Postal code
          type: string
          example: "1138"
        city:
          description: City
          type: string
          example: Budapest
        street:
          description: Street address
          type: string
          example: Main St
        contact:
          description: Human contact person name
          type: string
          example: John Doe
        email:
          description: Contact email address
          type: string
          format: email
          example: john.doe@example.com
        phone_number:
          description: Contact phone number
          type: string
          pattern: '^\\+[0-9]{1,3}\\.[0-9]{3,12}$'
          example: "+36.12345678"
        fax:
          description: Contact fax number
          type: string
          pattern: '^\\+[0-9]{1,3}\\.[0-9]{3,12}$'
          example: "+36.12345679"

    StoreContactResponse:
      description: Response after successfully creating a contact
      allOf:
        - $ref: '#/components/schemas/SuccessDataResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                data:
                  description: The created contact
                  $ref: '#/components/schemas/Contact'

    ShowContactResponse:
      description: Response after successfully retrieving a contact
      allOf:
        - $ref: '#/components/schemas/SuccessDataResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                data:
                  description: The contact record
                  $ref: '#/components/schemas/Contact'

    UpdateContactRequest:
      description: Request body for updating a contact. Partial updates are supported.
      type: object
      properties:
        contact_type:
          description: Legal type of the contact
          type: string
          enum:
            - PRIVATE
            - LEGAL
          example: LEGAL
        name:
          description: Registered contact name
          type: string
          example: Example Kft.
        ident:
          description: >
            Tax number for LEGAL contacts, or birth date for PRIVATE contacts
            (format: YYYY-MM-DD, e.g., 1999-01-01)
          type: string
          example: "12345678-1-12"
        country:
          description: Country code
          type: string
          example: HU
        language:
          description: Preferred language code
          type: string
          example: hu
        zip_code:
          description: Postal code
          type: string
          example: "1138"
        city:
          description: City
          type: string
          example: Budapest
        street:
          description: Street address
          type: string
          example: Main St
        contact:
          description: Human contact person name
          type: string
          example: John Doe
        email:
          description: Contact email address
          type: string
          format: email
          example: john.doe@example.com
        phone_number:
          description: Contact phone number
          type: string
          pattern: '^\\+[0-9]{1,3}\\.[0-9]{3,12}$'
          example: "+36.12345678"
        fax:
          description: Contact fax number
          type: string
          pattern: '^\\+[0-9]{1,3}\\.[0-9]{3,12}$'
          example: "+36.12345679"

    UpdateContactResponse:
      description: Response after successfully updating a contact
      allOf:
        - $ref: '#/components/schemas/SuccessUpdateResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                updated:
                  type: array
                  items:
                    type: string
                  example:
                    - name
                    - email
                data:
                  description: The updated contact record
                  $ref: '#/components/schemas/Contact'

    DeleteContactResponse:
      description: Response after successfully deleting a contact
      allOf:
        - $ref: '#/components/schemas/SuccessBooleanDataResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                data:
                  description: Deletion result

    DomainZoneInfo:
      description: DNS zone metadata loaded for a domain when a zone exists in `domain_ns_info`.
      type: object
      properties:
        domain:
          description: Domain name the zone belongs to
          type: string
          example: example.hu
        alias:
          description: Alias target zone, or `default` for the default template zone
          type: string
          nullable: true
          example: default
        last_modified_at:
          description: When the zone contents were last modified
          type: string
          nullable: true
          example: '2026-07-17 10:20:00'
        last_saved_at:
          description: When the zone was last explicitly saved
          type: string
          nullable: true
          example: '2026-07-17 10:20:00'
        lastexport:
          description: Last export timestamp
          type: string
          nullable: true
          example: '2026-07-17 10:30:00'
        lastsign:
          description: Last DNSSEC signing timestamp
          type: string
          nullable: true
          example: '2026-07-17 10:35:00'
        ttl:
          description: Default TTL
          type: integer
          nullable: true
          example: 3600
        mname:
          description: SOA primary nameserver
          type: string
          example: ns1.atw.hu
        soa_email:
          description: SOA contact mailbox in DNS format
          type: string
          example: hostmaster.example.hu
        serial:
          description: SOA serial
          type: integer
          example: 2026071701
        refresh:
          description: SOA refresh interval
          type: integer
          example: 10800
        retry:
          description: SOA retry interval
          type: integer
          example: 3600
        expire:
          description: SOA expire interval
          type: integer
          example: 604800
        negative_cache:
          description: SOA negative cache TTL
          type: integer
          example: 3600

    Email:
      type: object
      properties:
        username:
          type: string
          example: user@example.com
        quota_b:
          type: integer
          nullable: true
          example: 100000000
        active:
          type: integer
          example: 1
        create_date:
          type: string
          example: '2026-07-16 12:55:38'
        change_date:
          type: string
          nullable: true
          example: '2026-07-16 12:55:43'

    EmailAlias:
      type: object
      properties:
        address:
          type: string
          example: user@example.com
        target:
          type: string
          example: dest@example.com
        domain:
          type: string
          example: example.com

    Webhosting:
      description: Webhosting account, including the linked billing service.
      type: object
      properties:
        id:
          description: Webhosting account ID
          type: integer
          example: 104767
        username:
          description: Webhosting username
          type: string
          example: userteszt
        homedir:
          description: Home directory path of the webhosting account
          type: string
          example: /hosting/userteszt
        mailbox:
          description: Mailbox feature flag from the hosting account
          type: integer
          example: 0
        ip_allowed:
          description: Comma-separated list of allowed country codes for login restrictions
          type: string
          example: HU
        webexec:
          description: Whether web execution is enabled
          type: boolean
          example: false
        sqlserver:
          description: Assigned SQL server identifier
          type: string
          nullable: true
          example: null
        sqlquota_warn:
          description: SQL quota warning threshold flag
          type: integer
          example: 0
        pkg_version:
          description: Package version identifier
          type: string
          nullable: true
          example: null
        service_id:
          description: Linked billing service ID
          type: integer
          example: 53173
        disk_quota_kb:
          description: Disk quota in KiB
          type: integer
          example: 2000000
        sql_quota_kb:
          description: SQL quota in KiB
          type: integer
          example: 4099000
        email_quota_mb:
          description: Mail storage quota in MB
          type: integer
          example: 2500
        domain_limit:
          description: Maximum number of hosted domains
          type: integer
          example: 1
        datashare_limit:
          description: Maximum number of data shares
          type: integer
          example: 25
        ftplogin_at:
          description: Time of the last FTP login
          type: string
          nullable: true
          example: null
        created_at:
          description: Creation timestamp of the webhosting account
          type: string
          example: '2019-09-05 11:58:38'
        emails_sent_today:
          description: Number of emails sent today
          type: integer
          example: 0
        daily_email_send_limit:
          description: Daily outbound email limit
          type: integer
          example: 100000
        tasks_limit:
          description: Maximum number of concurrent tasks
          type: integer
          example: 10
        disk_used_kb:
          description: Currently used disk space in KiB when quota usage is loaded
          type: integer
          example: 41414141
        domains:
          description: Hosted domains attached to the webhosting account when loaded by the detail endpoint
          type: array
          items:
            $ref: '#/components/schemas/WebhostingDomain'
        service:
          description: Linked billing service record
          $ref: '#/components/schemas/Service'

    Cpanel:
      description: cPanel linked to a billing service.
      type: object
      properties:
        id:
          description: cPanel ID
          type: integer
          example: 104767
        service_id:
          description: Linked billing service ID
          type: integer
          example: 1001
        server:
          description: Backing server identifier used to determine the cPanel type
          type: string
          nullable: true
          example:  some.server.hu
        username:
          description: cPanel username
          type: string
          nullable: true
          example: exampleuser
        ip:
          description: Primary IP address assigned to the account
          type: string
          nullable: true
          example: 192.0.2.10
        ns1:
          description: Primary nameserver stored for the account
          type: string
          nullable: true
          example: ns1.example.test
        ns2:
          description: Secondary nameserver stored for the account
          type: string
          nullable: true
          example: ns2.example.test
        created_at:
          description: Creation timestamp
          type: string
          nullable: true
          example: '2026-07-01 12:00:00'
        updated_at:
          description: Last update timestamp
          type: string
          nullable: true
          example: '2026-07-10 08:30:00'
        type:
          description: Inferred cPanel backend type based on the server value
          type: string
          enum:
            - cpanel
            - directadmin
            - vps
          example: directadmin
        service:
          description: Linked billing service
          allOf:
            - $ref: '#/components/schemas/Service'
          nullable: true

    FreeUser:
      description: Publicly visible free-hosting user resolved from its secret token.
      type: object
      properties:
        username:
          description: Free-hosting username
          type: string
          example: freeuser1
        email:
          description: Contact email address of the free-hosting user
          type: string
          format: email
          nullable: true
          example: freeuser1@example.com
        page_name:
          description: Public page name configured for the free-hosting account
          type: string
          nullable: true
          example: Example free page
        category:
          description: Free-hosting category code
          type: string
          nullable: true
          example: altalanos
        ftp_last_login_at:
          description: Last recorded FTP login timestamp
          type: string
          nullable: true
          example: '2026-07-20 09:15:00'
        adfree_expiration:
          description: Date until the ad-free option is active
          type: string
          nullable: true
          example: '2026-12-31'
        registered_at:
          description: Registration date of the free-hosting user
          type: string
          nullable: true
          example: '2026-06-15'
        mail_sent:
          description: Number of sent mails recorded for the account
          type: integer
          nullable: true
          example: 0
        mail_quota:
          description: Mail quota of the account
          type: integer
          nullable: true
          example: 100
        disk_quota_kb:
          description: Disk quota in KiB
          type: integer
          nullable: true
          example: 200000
        allowed:
          description: Whether the free-hosting user is enabled
          type: integer
          enum:
            - 0
            - 1
          example: 1
        state:
          description: Current workflow state of the free-hosting user
          type: string
          nullable: true
          example: delete
        state_update:
          description: Timestamp of the last state change
          type: string
          nullable: true
          example: '2026-08-06 10:20:00'

    VPS:
      description: VPS resource returned by the VPS endpoints.
      type: object
      properties:
        id:
          description: Internal VPS ID
          type: integer
          example: 101
        vpsid:
          description: External VPS identifier
          type: integer
          example: 12345
        service_id:
          description: Linked billing service ID
          type: integer
          nullable: true
          example: 65054
        name:
          description: Backend VPS name
          type: string
          example: u12345
        custom_name:
          description: Customer-visible VPS label
          type: string
          nullable: true
          example: Example VPS
        started_at:
          description: When the VPS was started or created
          type: string
          nullable: true
          example: '2026-07-20 15:42:11'
        type:
          description: Virtualization type
          type: string
          enum:
            - pv
            - hvm
            - vmware
            - uefi
          example: hvm
        state:
          description: Current power state
          type: string
          enum:
            - "OFF"
            - STARTING
            - "ON"
            - MIGRATING
            - STOPPING
          nullable: true
          example: ON
        run:
          description: Legacy run-state flag
          type: string
          enum:
            - '0'
            - '1'
          nullable: true
          example: '1'
        recovery:
          description: Whether recovery mode is enabled
          type: integer
          example: 0
        cpu_count:
          description: Number of virtual CPUs
          type: integer
          example: 4
        cpu_model:
          description: CPU profile used by the VPS
          type: string
          nullable: true
          example: Broadwell
        ram_size_mb:
          description: RAM size in MB
          type: integer
          nullable: true
          example: 8192
        ssd_size_gb:
          description: SSD size in GB
          type: integer
          nullable: true
          example: 80
        hdd_size_gb:
          description: HDD size in GB
          type: integer
          example: 0
        archive_size_gb:
          description: Archive storage size in GB
          type: integer
          example: 0
        pkg_version:
          description: Package version identifier
          type: string
          nullable: true
          example: '5'
        machine_type:
          description: Virtual machine type identifier
          type: string
          example: pc-q35-rhel8.5.0
        ostype:
          description: Guest operating system family when stored
          type: string
          nullable: true
          example: linux
        email_state:
          description: Notification state for VPS-related email warnings
          type: string
          nullable: true
          enum:
            - ""
            - warned
            - whitelisted
            - default
          example: default
        disks:
          description: Attached VPS disks when loaded by the detail endpoint
          type: array
          items:
            $ref: '#/components/schemas/VpsDisk'
        interfaces:
          description: Network interfaces when loaded by the detail endpoint
          type: array
          items:
            $ref: '#/components/schemas/VpsInterface'
        addresses:
          description: Assigned address linked to the VPS service when loaded by the detail endpoint
          type: array
          items:
            $ref: '#/components/schemas/VpsAddress'
        service:
          description: Linked billing service record
          $ref: '#/components/schemas/Service'

    VpsDisk:
      description: VPS disk resource.
      type: object
      properties:
        id:
          description: Disk ID
          type: integer
          example: 501
        vps_id:
          description: External VPS identifier this disk belongs to
          type: integer
          example: 12345
        name:
          description: Disk name
          type: string
          nullable: true
          example: u12345-ssd-1aabcd
        size_mib:
          description: Disk size in MiB
          type: integer
          nullable: true
          example: 51200
        type:
          description: Disk type
          type: string
          enum:
            - ssd
            - hdd
            - swap
            - archive
          example: ssd
        sla:
          description: Storage SLA tier
          type: string
          enum:
            - high
            - low
          example: high
        boot:
          description: Whether this is the boot disk
          type: string
          nullable: true
          enum:
            - Y
          example: Y
        rw:
          description: Read-write mode flag
          type: string
          nullable: true
          example: w
        snapshot_parent_id:
          description: Parent disk ID when this disk is a snapshot
          type: integer
          nullable: true
          example: null
        bus:
          description: Optional disk bus type
          type: string
          nullable: true
          enum:
            - virtio
            - ide
            - scsi
            - sata
          example: virtio

    VpsTask:
      description: VPS task resource.
      type: object
      properties:
        id:
          description: Task ID
          type: integer
          example: 701
        vps_id:
          description: Internal VPS ID this task belongs to
          type: integer
          nullable: true
          example: 101
        parameters:
          description: Legacy serialized parameter string when present
          type: string
          nullable: true
          example: null
        command:
          description: Task command
          type: string
          nullable: true
          enum:
            - install
            - poweron
            - poweroff
            - shutdown
            - reboot
            - recovery
          example: install
        created_at:
          description: When the task was created
          type: string
          nullable: true
          example: '2026-07-21 10:15:00'
        updated_at:
          description: When the task was last updated
          type: string
          nullable: true
          example: '2026-07-21 10:16:00'
        started_at:
          description: When task execution started
          type: string
          nullable: true
          example: '2026-07-21 10:17:00'
        completed_at:
          description: When task execution completed
          type: string
          nullable: true
          example: '2026-07-21 10:18:00'
        deleted_at:
          description: Soft-delete timestamp
          type: string
          nullable: true
          example: null
        result:
          description: Result text or status details
          type: string
          nullable: true
          example: success

    StoreVpsTaskRequest:
      description: Request body for creating a VPS task.
      type: object
      additionalProperties: false
      properties:
        command:
          description: Task command to run.
          type: string
          enum:
            - install
            - poweron
            - poweroff
            - shutdown
            - reboot
            - recovery
          example: install
        password:
          description: Password to set during an `install` task.
          type: string
          minLength: 8
          example: StrongPass123
        systemdisk:
          description: Disk ID to use as the system disk during an `install` task.
          type: integer
          minimum: 0
          example: 501
        os:
          description: Operating system image name used during an `install` task.
          type: string
          example: debian-12
      required:
        - command

    StoreVpsDiskRequest:
      description: Request body for creating a VPS disk.
      type: object
      additionalProperties: false
      properties:
        name:
          description: Disk name. Must be unique and start with the VPS name followed by a hyphen.
          type: string
          maxLength: 40
          pattern: '^[0-9a-zA-Z-]*$'
          example: vps101-ssd-1
        size_mib:
          description: Disk size in MiB.
          type: integer
          example: 51200
        type:
          description: Disk type.
          type: string
          enum:
            - ssd
            - hdd
            - swap
            - archive
          example: ssd
        sla:
          description: Storage SLA tier.
          type: string
          enum:
            - high
            - low
          example: high
        boot:
          description: Set to `Y` to mark the disk as bootable.
          type: string
          enum:
            - Y
          example: Y
        bus:
          description: Optional disk bus type.
          type: string
          enum:
            - virtio
            - ide
            - scsi
            - sata
          example: virtio
        snapshot_parent_id:
          description: Existing disk ID to snapshot. The parent disk must belong to the same VPS and must not itself be a snapshot.
          type: integer
          example: 500
      required:
        - name
        - size_mib
        - type
        - sla

    UpdateVpsDiskRequest:
      description: Request body for updating a VPS disk. Only submitted fields are considered. `size_mib` may only increase. `name`, `type`, `sla`, and `snapshot_parent_id` are immutable after creation and fail validation if supplied.
      type: object
      additionalProperties: false
      properties:
        size_mib:
          description: New disk size in MiB. Must be greater than or equal to the current size.
          type: integer
          example: 102400
        boot:
          description: Set to `Y` to mark the disk as bootable, or `N` to clear the boot flag.
          type: string
          enum:
            - Y
            - N
          example: Y
        bus:
          description: Optional disk bus type. On q35 machine types, `ide` is rejected.
          type: string
          enum:
            - virtio
            - ide
            - scsi
            - sata
          example: virtio
        name:
          description: Disk type.
          type: string
          maxLength: 40
          pattern: '^[0-9a-zA-Z-]*$'
          example: vps101-ssd-1
        type:
          description: Storage SLA tier.
          type: string
          enum:
            - ssd
            - hdd
            - swap
            - archive
          example: ssd
        sla:
          description: Storage SLA tier.
          type: string
          enum:
            - high
            - low
          example: high
        snapshot_parent_id:
          description: Parent disk ID when this disk was created from a snapshot.
          type: integer
          example: 500

    VpsInterface:
      description: VPS interface resource.
      type: object
      properties:
        id:
          description: Interface ID
          type: integer
          example: 901
        vps_id:
          description: External VPS identifier this interface belongs to
          type: integer
          example: 12345
        order:
          description: Interface order index
          type: integer
          example: 0
        name:
          description: Interface name
          type: string
          example: u12345-if0
        target:
          description: Backend target string containing the primary IPv4 and IPv6 prefix
          type: string
          example: 192.168.1.1 0:0:0:0:0:0:0:1/56
        mac:
          description: Interface MAC address
          type: string
          example: 00:16:3e:30:39:00
        hw_model:
          description: Virtual NIC model
          type: string
          nullable: true
          enum:
            - virtio
            - e1000
          example: virtio

    UpdateVpsInterfaceRequest:
      description: Request body for updating a VPS interface on the customer route.
      type: object
      additionalProperties: false
      properties:
        hw_model:
          description: Virtual NIC model.
          type: string
          enum:
            - virtio
            - e1000
          example: virtio
        order:
          description: Interface ordering index.
          type: integer
          example: 0
        name:
          description: Interface name.
          type: string
          example: u12345-if0
        target:
          description: Backend target string containing the primary IPv4 and IPv6 prefix.
          type: string
          example: 37.221.208.12 2a01:270:9834::/56
        mac:
          description: Interface MAC address.
          type: string
          example: 00:16:3e:30:39:00

    VpsAddress:
      description: Assigned address details.
      type: object
      properties:
        ip:
          description: Assigned IPv4 or IPv6 CIDR
          type: string
          example: 37.221.208.12
        l3_switch:
          description: Layer-3 switch identifier
          type: string
          nullable: true
          example: vps
        l3_interface:
          description: Layer-3 interface identifier
          type: string
          nullable: true
          example: u12345
        nexthop:
          description: Optional next-hop CIDR for routed prefixes
          type: string
          nullable: true
          example: 2a01:270:9834::1
        customer_id:
          description: Owning customer ID when assigned
          type: integer
          nullable: true
          example: 1
        service_id:
          description: Linked billing service ID when assigned
          type: integer
          nullable: true
          example: 65054

    StoreVpsRequest:
      description: Request body for creating a VPS instance.
      type: object
      properties:
        service_invoice_interval_months:
          description: Billing interval used for pricing the new VPS
          type: integer
          enum:
            - 1
            - 3
            - 12
            - 24
          example: 1
        service_currency:
          description: Billing currency used for pricing the new VPS
          type: string
          enum:
            - HUF
            - EUR
            - USD
          example: HUF
        ram_size_mb:
          description: RAM size in MB
          type: integer
          minimum: 1024
          maximum: 65536
          example: 1024
        cpu_count:
          description: Number of virtual CPUs
          type: integer
          minimum: 1
          maximum: 16
          example: 4
        cpu_model:
          description: CPU profile for the VPS
          type: string
          enum:
            - EPYC-Rome
            - Broadwell
            - Ryzen-7950X-dedicated
          example: Broadwell
        hdd_size_gb:
          description: HDD size in GB
          type: integer
          example: 500
        ssd_size_gb:
          description: SSD size in GB
          type: integer
          example: 100
        custom_name:
          description: Optional customer-visible VPS label
          type: string
          maxLength: 64
          example: Example VPS
        password:
          description: Optional initial VPS password
          type: string
          minLength: 8
          example: secret123
        os:
          description: Optional initial OS image name
          type: string
          example: debian-12
        service_id:
          description: Optional existing billing service ID to link to the new VPS
          type: integer
          example: 65054

    UpdateVpsImageRequest:
      description: Request body for selecting the next image for a VPS instance.
      type: object
      properties:
        image:
          description: Image name to set for the VPS
          type: string
          example: debian-12
      required:
        - image

    VpsVncUrlData:
      description: Console access payload for VMware VPS instances.
      type: object
      properties:
        url:
          description: Direct VMware console URL
          type: string
          example: https://192.168.1.1/?ticket=b991c7b18a38a8c8&host=exp.management.intra
      required:
        - url

    VpsVncTokenData:
      description: Console access payload for non-VMware VPS instances.
      type: object
      properties:
        token:
          description: Short-lived IASession token for console access
          type: string
          example: 1A2b3C4d5E6f7G8h9I0j1K2l3M4n5O6p
      required:
        - token

    VpsVncData:
      description: Console access payload for a VPS instance.
      oneOf:
        - $ref: '#/components/schemas/VpsVncUrlData'
        - $ref: '#/components/schemas/VpsVncTokenData'

    CreateVpsPrepayVpsInput:
      description: Main VPS configuration for the prepaid order.
      type: object
      additionalProperties: false
      properties:
        cpu_count:
          description: Number of virtual CPUs
          type: integer
          example: 2
        cpu_model:
          description: CPU profile for the VPS
          type: string
          enum:
            - Broadwell
            - EPYC-Rome
            - Ryzen-7950X-dedicated
          example: Broadwell
        ssd_size_gb:
          description: SSD size in GB
          type: integer
          example: 50
        hdd_size_gb:
          description: HDD size in GB
          type: integer
          example: 0
        ram_size_mb:
          description: RAM size in MB
          type: integer
          example: 4096
        extra_ip_count:
          description: Optional extra IPv4 count used for pricing
          type: integer
          example: 0
      required:
        - cpu_count
        - ssd_size_gb
        - ram_size_mb

    CreateVpsPrepayCreateOptionsInput:
      description: Optional VPS provisioning settings.
      type: object
      additionalProperties: false
      properties:
        os:
          description: Optional OS image name to install
          type: string
          example: debian-12

    CreateVpsPrepayRequest:
      description: Request body for creating a prepaid VPS order. The payload is grouped into VPS configuration, optional provisioning settings, service billing options, and order options.
      type: object
      additionalProperties: false
      properties:
        vps:
          description: VPS sizing and pricing input
          $ref: '#/components/schemas/CreateVpsPrepayVpsInput'
        vps_create_options:
          description: Optional VPS provisioning settings
          $ref: '#/components/schemas/CreateVpsPrepayCreateOptionsInput'
        service:
          description: Service billing options for the pending prepaid service
          $ref: '#/components/schemas/CreatePrepayServiceInput'
        order:
          description: Optional order-level pricing modifiers
          $ref: '#/components/schemas/CreateWebhostingPrepayOrderInput'
      required:
        - vps
        - vps_create_options
        - service
        - order

    WebhostingDomain:
      description: Hosted domain entry.
      type: object
      properties:
        domain:
          description: Hosted domain name
          type: string
          example: example.com
        username:
          description: Owning webhosting username
          type: string
          example: userteszt
        path:
          description: Document root path for the domain
          type: string
          example: /www/
        php_version:
          description: Configured PHP version for the domain
          type: string
          example: '8.2'
        inserted_at:
          description: When the domain was attached to the webhosting account
          type: string
          example: '2019-09-05 11:58:38'

    WebhostingDatashare:
      description: Data-share account attached to a webhosting account.
      type: object
      properties:
        id:
          description: Data-share ID
          type: integer
          example: 71
        webhosting_id:
          description: Owning webhosting account ID
          type: integer
          example: 104767
        webhosting_name:
          description: Owning webhosting account username
          type: string
          example: userteszt
        username:
          description: Datashare login name
          type: string
          example: userteszt_share1
        readonly:
          description: Whether the datashare is read-only
          type: string
          enum:
            - Y
            - N
          example: N
        path:
          description: Absolute path accessible through the datashare account
          type: string
          example: /www/share-blog01/

    WebhostingTask:
      description: Scheduled or one-off webhosting task entry.
      type: object
      properties:
        id:
          description: Task ID
          type: integer
          example: 915
        webhosting_id:
          description: Owning webhosting account ID
          type: integer
          example: 104767
        username:
          description: Owning webhosting account username
          type: string
          example: userteszt
        type:
          description: Task type. `C` is a recurring cron-style task and `A` is a one-off task.
          type: string
          enum:
            - A
            - C
          example: C
        url:
          description: Target URL requested by the task runner. Must be http, not https
          type: string
          example: http://example.com/cron.php
        interval_minutes:
          description: Recurrence interval in minutes for recurring tasks
          type: integer
          nullable: true
          example: 60
        last_scheduled_at:
          description: Next or last scheduled execution timestamp used by the legacy scheduler
          type: string
          nullable: true
          example: '2026-07-29 02:00:00'
        last_executed_at:
          description: Timestamp of the last real execution attempt
          type: string
          nullable: true
          example: '2026-07-29 02:00:03'
        last_execution_time_s:
          description: Duration in seconds of the last real execution
          type: integer
          nullable: true
          example: 3
        expires_at:
          description: Expiry timestamp for one-off tasks
          type: string
          nullable: true
          example: null
        inserted_at:
          description: Task creation timestamp
          type: string
          nullable: true
          example: '2026-07-01 12:00:00'
        executed_count:
          description: Number of execution attempts recorded for the task
          type: integer
          nullable: true
          example: 145

    UpdateWebhostingTaskRequest:
      description: Request body for updating a webhosting task.
      type: object
      additionalProperties: false
      properties: {}

    StoreWebhostingTaskRequest:
      description: Request body for creating a webhosting task.
      type: object
      additionalProperties: false
      properties:
        url:
          description: HTTP URL to execute. The legacy validator only accepts the `http://` scheme and requires a non-empty path component.
          type: string
          example: http://example.com/cron.php
        interval_minutes:
          description: Optional recurrence interval in minutes. Provide a non-zero value for a recurring task. Omit or set to `0` for a one-off task.
          type: integer
          minimum: 0
          maximum: 50000
          example: 60
        start_time:
          description: First scheduled execution time for recurring tasks, or execution deadline for one-off tasks. Must use `Y-m-d H:i:s` format.
          type: string
          example: '2026-07-30 02:00:00'
      required:
        - url
        - start_time

    StoreWebhostingDatashareRequest:
      description: Request body for creating a webhosting data-share account.
      type: object
      additionalProperties: false
      properties:
        username:
          description: Datashare login name. Must start with the webhosting username followed by `_`.
          type: string
          pattern: '^[a-z0-9-_]{1,65}$'
          example: userteszt_share1
        password:
          description: Initial datashare password.
          type: string
          minLength: 8
          example: StrongPass123
        readonly:
          description: Whether the datashare should be read-only.
          type: string
          enum:
            - Y
            - N
          example: N
        path:
          description: Absolute path exposed by the datashare account. Must start with `/`.
          type: string
          maxLength: 255
          pattern: '^\/.*'
          example: /www/share-blog01/
        ip_allowed:
          description: Optional IP or location restriction payload accepted by the backend.
          type: string
          example: HU,AT
      required:
        - username
        - password
        - readonly
        - path

    UpdateWebhostingDatashareRequest:
      description: Request body for updating a webhosting data-share account. Only submitted fields are considered. `username` is intentionally omitted because it is create-only on the customer route.
      type: object
      additionalProperties: false
      properties:
        password:
          description: Replacement datashare password.
          type: string
          minLength: 8
          example: StrongerPass123
        readonly:
          description: Whether the datashare should be read-only.
          type: string
          enum:
            - Y
            - N
          example: Y
        path:
          description: Absolute path exposed by the datashare account. Must start with `/`.
          type: string
          maxLength: 255
          pattern: '^\/.*'
          example: /www/share-blog01/
        ip_allowed:
          description: Optional IP or location restriction payload accepted by the backend.
          type: string
          example: HU,AT

    StoreWebhostingDomainRequest:
      description: Request body for creating a hosted domain on a webhosting account.
      type: object
      additionalProperties: false
      properties:
        domain:
          description: Hosted domain name to attach.
          type: string
          example: blog.example.com
        path:
          description: Document root path for the domain.
          type: string
          example: /www/blog/
        php_version:
          description: PHP version to configure for the domain.
          type: string
          enum:
            - '8.2'
            - '8.1'
            - '8.0'
            - '7.4'
            - '7.3'
            - '7.2'
            - '7.1'
            - '7.0'
            - '5.6'
            - '5.5'
            - '5.4'
            - '5.3'
          example: '8.2'
        dkim_private:
          description: Optional DKIM private key in PEM format.
          type: string
          example: "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"
      required:
        - domain

    UpdateWebhostingDomainRequest:
      description: Request body for updating a hosted domain on a webhosting account. Only submitted fields are considered.
      type: object
      additionalProperties: false
      properties:
        path:
          description: Document root path for the domain.
          type: string
          example: /www/blog/
        php_version:
          description: PHP version to configure for the domain.
          type: string
          enum:
            - '8.2'
            - '8.1'
            - '8.0'
            - '7.4'
            - '7.3'
            - '7.2'
            - '7.1'
            - '7.0'
            - '5.6'
            - '5.5'
            - '5.4'
            - '5.3'
          example: '8.1'
        dkim_private:
          description: Optional DKIM private key in PEM format.
          type: string
          example: "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"
        username:
          description: Webhosting account username.
          type: string
          example: userteszt

    InstallWebhostingDomainSoftwareRequest:
      description: Request body for installing software into a hosted domain.
      type: object
      additionalProperties: false
      properties:
        password:
          description: Initial admin or database password used during installation.
          type: string
          minLength: 8
          example: StrongPass123
        path:
          description: Install path relative to the hosted domain root. Must start with `/` and cannot contain `.` or `..` path segments.
          type: string
          maxLength: 255
          pattern: '^\/[\/a-zA-Z0-9]*$'
          example: /blog
        software:
          description: Software package to install.
          type: string
          enum:
            - wordpress
          example: wordpress
      required:
        - password
        - path
        - software

    UpdateWebhostingDomainCertificateRequest:
      description: Request body for storing a custom TLS certificate and private key for a hosted domain.
      type: object
      additionalProperties: false
      properties:
        key:
          description: Private key in PEM format.
          type: string
          example: "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"
        certificate:
          description: Full certificate chain in PEM format.
          type: string
          example: "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----"
      required:
        - key
        - certificate

    WebhostingDatabase:
      description: Webhosting database entry.
      type: object
      properties:
        id:
          description: Database ID
          type: integer
          example: 901
        webhosting_id:
          description: Owning webhosting account ID
          type: integer
          example: 104767
        database:
          description: Database name
          type: string
          example: userteszt_wordpress0
        sqlserver:
          description: Backend SQL server identifier
          type: string
          nullable: true
          example: sql5
        used_b:
          description: Used database storage in bytes when available
          type: integer
          nullable: true
          example: 10485760

    StoreWebhostingDatabaseRequest:
      description: Request body for creating a webhosting database.
      type: object
      additionalProperties: false
      properties:
        database:
          description: Database name. Must equal the webhosting username or start with `{username}_`.
          type: string
          pattern: '^[a-z0-9][_a-z0-9-]{2,30}$'
          example: userteszt_wordpress0
        password:
          description: Initial database password.
          type: string
          minLength: 8
          example: StrongPass123
      required:
        - database

    UpdateWebhostingDatabaseRequest:
      description: Request body for updating a webhosting database. On the customer route only password changes are documented.
      type: object
      additionalProperties: false
      properties:
        password:
          description: New database password.
          type: string
          minLength: 8
          example: StrongerPass123

    WebhostingFtpLog:
      description: FTP log entry returned by the webhosting FTP log endpoint.
      type: object
      properties:
        user:
          description: Webhosting username the FTP event belongs to
          type: string
          example: userteszt
        event:
          description: FTP event code
          type: string
          enum:
            - C
            - D
          example: C
        param:
          description: Optional event parameter
          type: string
          nullable: true
          example: ''
        ip:
          description: Source IP address recorded for the FTP action
          type: string
          example: 100.64.5.80
        date:
          description: When the FTP event happened
          type: string
          example: '2026-02-11 12:50:10'

    StoreWebhostingRequest:
      description: Request body for creating a webhosting account.
      type: object
      properties:
        domain:
          description: Optional initial domain to attach during account creation
          type: string
          example: example.com
        free_wh_username:
          description: Optional free-hosting username to reuse instead of generating one
          type: string
          example: freeuser1
        free_wh_mail_redirect:
          description: Optional mail redirect target used by the free-hosting workflow
          type: string
          example: user@example.com
        service_id:
          description: Optional existing billing service ID to link to the new webhosting account
          type: integer
          example: 53173
        disk_quota_kb:
          description: Disk quota in KiB
          type: integer
          example: 2000000
        sql_quota_kb:
          description: SQL quota in KiB
          type: integer
          example: 4099000
        email_quota_mb:
          description: Mail storage quota in MB
          type: integer
          example: 2500
        password:
          description: Initial webhosting account password
          type: string
          minLength: 8
          example: secret123
        ip_allowed:
          description: Optional comma-separated country allowlist for login restrictions
          type: string
          example: HU
        webexec:
          description: Whether web execution should be enabled
          type: boolean
          example: false
        daily_email_send_limit:
          description: Optional daily outbound email limit
          type: integer
          example: 100000
        task_limit:
          description: Optional task limit
          type: integer
          example: 10
      required:
        - disk_quota_kb
        - sql_quota_kb
        - email_quota_mb
        - password

    CreateWebhostingPrepayWebhostingInput:
      description: Main webhosting payload used to price and queue the prepaid order.
      type: object
      additionalProperties: false
      properties:
        username:
          description: Optional requested webhosting username
          type: string
          example: tesztelek1
        disk_quota_kb:
          description: Disk quota in KiB
          type: integer
          example: 2000000
        sql_quota_kb:
          description: SQL quota in KiB
          type: integer
          example: 1000000
        email_quota_mb:
          description: Mail storage quota in MB
          type: integer
          example: 2000
        datashare_limit:
          description: Maximum number of data shares
          type: integer
          example: 200
        domain_limit:
          description: Maximum number of hosted domains
          type: integer
          example: 50
      required:
        - disk_quota_kb
        - sql_quota_kb
        - email_quota_mb

    CreateWebhostingPrepayCreateOptionsInput:
      description: Optional provisioning hints used later when the order is fulfilled.
      type: object
      additionalProperties: false
      properties:
        free_wh_username:
          description: Optional free-hosting username to reuse
          type: string
          example: freeuser1
        free_wh_mail_redirect:
          description: Optional redirect target used by the free-hosting workflow
          type: string
          example: user@example.com
        domain:
          description: Optional initial domain to attach when provisioning runs
          type: string
          example: example.com

    CreatePrepayServiceInput:
      description: Billing input used by prepaid order endpoints to create the pending service and first invoice item. `currency` is shared across prepaid flows. `invoice_interval_months` is used by interval-based prepaid services such as VPS and webhosting. `pkg_version` is available for prepaid flows that expose versioned pricing.
      type: object
      additionalProperties: false
      properties:
        currency:
          description: Currency to price and bill the pending service in
          type: string
          enum:
            - HUF
            - EUR
            - USD
          example: HUF
        invoice_interval_months:
          description: Billing interval for the pending service when the prepaid flow supports interval-based pricing
          type: integer
          enum:
            - 1
            - 3
            - 6
            - 12
          example: 12
        pkg_version:
          description: Optional package version identifier used by prepaid flows that support versioned pricing
          type: string
          enum:
            - '1'
            - '2'
            - '3'
            - '4'
            - '5'
          example: '5'
      required:
        - currency

    CreateWebhostingPrepayOrderInput:
      description: Optional pricing modifiers applied while creating the first invoice item.
      type: object
      additionalProperties: false
      properties:
        coupon_code:
          description: Optional coupon code
          type: string
          example: 2026-07_sale_50

    CreateWebhostingPrepayRequest:
      description: Request body for creating a prepaid webhosting order.
      type: object
      additionalProperties: false
      properties:
        webhosting:
          $ref: '#/components/schemas/CreateWebhostingPrepayWebhostingInput'
        wh_create_options:
          $ref: '#/components/schemas/CreateWebhostingPrepayCreateOptionsInput'
        service:
          $ref: '#/components/schemas/CreatePrepayServiceInput'
        order:
          $ref: '#/components/schemas/CreateWebhostingPrepayOrderInput'
      required:
        - webhosting
        - wh_create_options
        - service
        - order

    StoreEmailAliasRequest:
      description: Create an email alias
      type: object
      properties:
        address:
          description: The address to listen to when forwarding. Entering no username before the @ will redirect all the incoming mail to @example.com
          type: string
          example:
            - user@example.com
            - "@example.com"
        target:
          description: Destination
          type: string
          maxLength: 767
          example: dest@example.com
      required:
        - address
        - target

    StoreEmailAliasResponse:
      description: Response when the store succseeded
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Data updated successfully
        response:
          description: Response payload
          type: object
          properties:
            updated:
              type: array
              items:
                type: string
              example:
                - address
                - target
            data:
              $ref: '#/components/schemas/EmailAlias'

    ShowEmailAliasResponse:
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              $ref: '#/components/schemas/EmailAlias'

    DeleteEmailAliasResponse:
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Record successfully removed
        response:
          description: Response payload
          type: object
          properties:
            data:
              type: boolean
              example: true

    EmailVacation:
      type: object
      properties:
        address:
          type: string
          example: user@example.com
        message:
          type: string
          maxLength: 5000
          example: I'm on vacation
        start_at:
          type: string
          example: '2026-07-16 12:00:00'
        end_at:
          type: string
          example: '2026-07-30 12:00:00'

    StoreEmailVacationRequest:
      type: object
      properties:
        message:
          type: string
          minLength: 1
          maxLength: 5000
          example: I'm on vacation
        start_at:
          type: string
          example: '2026-07-16 12:00:00'
        end_at:
          type: string
          example: '2026-07-30 12:00:00'

    StoreEmailVacationResponse:
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Data updated successfully
        response:
          description: Response payload
          type: object
          properties:
            updated:
              type: array
              items:
                type: string
              example:
                - message
                - start_at
                - end_at
            data:
              $ref: '#/components/schemas/EmailVacation'

    StoreEmailRequest:
      type: object
      properties:
        username:
          type: string
          format: email
          example: user@example.com
        quota_b:
          type: integer
          minimum: 100000000
          example: 100000000
        password:
          type: string
          minLength: 6
          example: secret123
        spamfolder:
          type: integer
          enum:
            - 0
            - 1
          example: 0
      required:
        - username
        - quota_b
        - password

    StoreEmailResponse:
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Data updated successfully
        response:
          description: Response payload
          type: object
          properties:
            updated:
              type: array
              items:
                type: string
              example:
                - username
                - quota_b
                - password
            data:
              $ref: '#/components/schemas/Email'

    DeleteEmailResponse:
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Record successfully removed
        response:
          description: Response payload
          type: object
          properties:
            data:
              type: boolean
              example: true

    DeleteEmailVacationResponse:
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Record successfully removed
        response:
          description: Response payload
          type: object
          properties:
            data:
              type: boolean
              example: true

    ShowEmailVacationResponse:
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          $ref: '#/components/schemas/EmailVacation'

    UpdateEmailVacationRequest:
      type: object
      properties:
        message:
          type: string
          minLength: 1
          maxLength: 5000
          example: I'm on vacation
        start_at:
          type: string
          example: '2026-07-16 12:00:00'
        end_at:
          type: string
          example: '2026-07-30 12:00:00'

    UpdateEmailVacationResponse:
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Data updated successfully
        response:
          description: Response payload
          type: object
          properties:
            updated:
              type: array
              items:
                type: string
              example:
                - message
                - start_at
                - end_at
            data:
              $ref: '#/components/schemas/EmailVacation'

    ShowEmailResponse:
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          $ref: '#/components/schemas/Email'

    ShowEmailQuotaResponse:
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              description: Quota usage per folder as key-value pairs of folder name to byte count
              type: object
              additionalProperties:
                type: integer
              example:
                .Trash: 12314
                Incoming: 1231231

    UpdateEmailRequest:
      type: object
      properties:
        quota_b:
          type: integer
          minimum: 100000000
          example: 200000000
        password:
          type: string
          minLength: 6
          example: newpass123
        spamfolder:
          type: integer
          enum:
            - 0
            - 1
          example: 0

    UpdateEmailResponse:
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Data updated successfully
        response:
          description: Response payload
          type: object
          properties:
            updated:
              type: array
              items:
                type: string
              example:
                - quota_b
            data:
              $ref: '#/components/schemas/Email'

    Domain:
      description: Domain resource returned by the domain endpoints.
      type: object
      properties:
        id:
          description: Domain ID
          type: integer
          example: 9001
        service_id:
          description: Linked billing service ID
          type: integer
          nullable: true
          example: 1001
        customer_id:
          description: Owning customer ID
          type: integer
          example: 1
        sznet_owner:
          description: Legacy SZNET owner marker when present
          type: string
          nullable: true
          example: reseller-42
        domain:
          description: ASCII/Punycode domain name
          type: string
          example: example.hu
        domain_utf8:
          description: UTF-8 domain representation
          type: string
          example: example.hu
        nameserver:
          description: Primary nameserver host name.
          type: string
          nullable: true
          example: ns1.atw.hu
        ns2:
          description: Secondary nameserver data as stored by the service.
          type: string
          nullable: true
          example: '|ns2.atw.hu|ns3.atw.hu|'
        additional_nameservers:
          description: Secondary nameserver host names as a list.
          type: array
          items:
            type: string
          example:
            - ns2.atw.hu
            - ns3.atw.hu
        has_glue_record:
          description: Whether the primary nameserver points inside the same zone and therefore carries a glue record
          type: boolean
          example: false

        state:
          description: Current domain state
          type: string
          enum:
            - BEJEGYZENDO
            - VAROLISTA
            - REGISZTRALVA
            - SIKERTELEN
            - FELMONDASALATT
            - KARANTEN
            - TOROLVE
            - NS2ONLY
            - FORCEREG
          example: REGISZTRALVA
        state_changed_at:
          description: When the domain state was last changed
          type: string
          nullable: true
          example: '2026-07-17 10:20:00'
        registered_on:
          description: Registration date
          type: string
          nullable: true
          example: '2026-07-17'
        expires_on:
          description: Expiry date
          type: string
          nullable: true
          example: '2027-07-17'
        deleted_at:
          description: Scheduled or effective deletion date
          type: string
          nullable: true
          example: '2027-08-17'
        registration_type:
          description: How the domain entered the system
          type: string
          enum:
            - new
            - transfer
            - inhouse
          nullable: true
          example: new
        created_at:
          description: Creation timestamp
          type: string
          nullable: true
          example: '2026-07-17 10:15:00'
        registrar:
          description: Registrar code handling this TLD
          type: string
          nullable: true
          example: HUREG
        domain_type:
          description: Domain category code.
          type: string
          nullable: true
          example: R
        dnssec:
          description: Whether DNSSEC is enabled
          type: string
          enum:
            - Y
            - N
          example: N
        last_checked_at:
          description: When the record was last checked or updated by the system
          type: string
          example: '2026-07-17 10:20:00'
        service_billed:
          description: Billed-through date of the linked service.
          type: string
          nullable: true
          example: '2027-07-16'
        service:
          description: Linked billing service record
          allOf:
            - $ref: '#/components/schemas/Service'
          nullable: true
        contact:
          description: Contacts linked to the domain
          type: array
          items:
            $ref: '#/components/schemas/Contact'
        zoneInfo:
          description: DNS zone metadata when a zone exists for the domain
          allOf:
            - $ref: '#/components/schemas/DomainZoneInfo'
          nullable: true

    DomainAvailabilityOperationFlag:
      description: Availability result for a requested domain operation.
      oneOf:
        - type: boolean
        - type: string
          enum:
            - maybe
      example: true

    DomainAvailabilityData:
      description: >
        Available operations for the requested domain name. Fields are present
        only when that operation is relevant for the current domain state.
      type: object
      properties:
        new:
          description: Whether a new registration is available for the domain.
          $ref: '#/components/schemas/DomainAvailabilityOperationFlag'
        transfer:
          description: Whether a transfer is available for the domain.
          $ref: '#/components/schemas/DomainAvailabilityOperationFlag'
        ns2only:
          description: Whether the domain can be created with `registration_type=ns2only`.
          type: boolean
          example: true
        timed:
          description: Expiration date and time for a timed registration flow, when available.
          type: string
          example: '2026-12-31 23:59:59'
      additionalProperties: false

    DomainAvailabilityResponse:
      description: Response after successfully checking domain availability
      allOf:
        - $ref: '#/components/schemas/SuccessEnvelope'
        - type: object
          properties:
            response:
              type: object
              properties:
                data:
                  $ref: '#/components/schemas/DomainAvailabilityData'

    DomainAvailabilityBadRequestResponse:
      description: 400 response returned when the supplied domain name format is invalid.
      allOf:
        - $ref: '#/components/schemas/ErrorEnvelope'
        - type: object
          properties:
            code:
              example: 400
            message:
              example: Bad form data
            response:
              type: object
              properties:
                formErrors:
                  description: Validation error returned for the invalid domain syntax.
                  type: string
                  example: Domain syntax error

    DomainRecord:
      type: object
      properties:
        id:
          type: integer
          example: 1
        domain:
          type: string
          example: example.hu
        record:
          type: string
          example: www
        ttl:
          type: string
          nullable: true
          example: "3600"
        type:
          type: string
          enum:
            - A
            - AAAA
            - TXT
            - NS
            - MX
            - CNAME
            - SRV
            - CAA
            - TLSA
            - SOA
            - DNAME
            - PTR
            - SPF
            - CERT
          example: A
        value:
          type: string
          nullable: true
          example: "192.168.1.1"

    IndexDomainRecordsResponseData:
      description: Payload returned inside `response` for the domain DNS records list endpoint.
      type: object
      properties:
        count:
          description: Total number of returned records
          type: integer
          example: 42
        data:
          description: Array of domain DNS record entries
          type: array
          items:
            $ref: '#/components/schemas/DomainRecord'

    StoreDomainRecordRequest:
      description: Request body for creating a domain DNS record
      type: object
      required:
        - record
        - type
      properties:
        record:
          description: DNS record name (e.g., `www`, `@` for apex)
          type: string
          example: www
        type:
          description: DNS record type
          type: string
          enum:
            - A
            - AAAA
            - TXT
            - NS
            - MX
            - CNAME
            - SRV
            - CAA
            - TLSA
          example: A
        value:
          description: DNS record value
          type: string
          example: "192.168.1.1"

    ShowDomainRecordResponse:
      description: Response after successfully retrieving a domain DNS record
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              description: The domain DNS record
              $ref: '#/components/schemas/DomainRecord'

    ReplaceDomainRecordsRequest:
      description: Request body for replacing all DNS records with a zone file
      type: object
      required:
        - zone
      properties:
        zone:
          description: DNS zone file content as text
          type: string
          example: |
            $TTL 3600
            @ IN SOA ns1.atw.hu. hostmaster.example.hu. (1 3600 1800 604800 3600)
            @ IN NS ns1.atw.hu.
            www IN A 192.168.1.1

    ReplaceDomainRecordsResponse:
      description: Response after successfully replacing domain DNS records
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object

    UpdateDomainRecordRequest:
      description: Request body for updating a domain DNS record
      type: object
      properties:
        ttl:
          description: TTL in seconds
          type: integer
          minimum: 0
          maximum: 2147483647
          example: 3600
        value:
          description: DNS record value
          type: string
          maxLength: 1024
          example: "192.168.1.2"

    DeleteDomainRecordResponse:
      description: Response after successfully deleting a domain DNS record
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Record successfully removed
        response:
          description: Response payload
          type: object
          properties:
            data:
              description: Deletion result
              type: boolean
              example: true

    DeleteDomainDocResponse:
      description: Response after successfully deleting a domain document
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Record successfully removed
        response:
          description: Response payload
          type: object
          properties:
            data:
              description: Whether the delete operation succeeded
              type: boolean
              example: true

    ShowDomainZoneInfoResponse:
      description: Response after successfully retrieving domain zone info
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              description: The domain zone info
              $ref: '#/components/schemas/DomainZoneInfo'

    UpdateDomainZoneInfoRequest:
      description: Request body for updating domain zone info
      type: object
      properties:
        alias:
          description: >
            Alias target for the zone. `"no"` removes the alias and copies
            default zone SOA values. `"default"` aliases to the default template zone.
          type: string
          enum:
            - no
            - default
          example: no
        last_saved_at:
          description: >
            Setting this to `"now"` increments the SOA serial and updates the save timestamp.
          type: string
          enum:
            - now
          example: now

    StoreDomainZoneInfoResponse:
      description: Response after successfully creating domain zone info
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              description: The domain zone info
              $ref: '#/components/schemas/DomainZoneInfo'

    InvoiceItem:
      type: object
      properties:
        id:
          type: integer
          example: 1
        customer_id:
          type: integer
          example: 1
        invoice_id:
          type: integer
          nullable: true
          example: 1
        service_id:
          type: integer
          nullable: true
          example: 1001
        product_id:
          type: string
          nullable: true
          example: DOMAIN-HU-1Y
        description:
          type: string
          nullable: true
          example: example.hu domain registration
        net_price:
          type: number
          nullable: true
          example: 2490
        currency:
          type: string
          nullable: true
          example: HUF
        vat:
          type: integer
          nullable: true
          example: 27
        quantity:
          type: number
          nullable: true
          example: 1
        unit:
          type: string
          enum:
            - piece
            - day
            - month
            - year
            - meter
            - kWh
          nullable: true
          example: piece
        start_date:
          type: string
          nullable: true
          example: '2026-07-17'
        end_date:
          type: string
          nullable: true
          example: '2027-07-16'
        state:
          type: string
          enum:
            - normal
            - paid
            - deleted
          nullable: true
          example: normal
        discount_amount:
          type: number
          nullable: true
          example: 0
        is_issued:
          type: string
          nullable: true
          example: unissued
        created_at:
          type: string
          nullable: true
          example: '2026-07-17 10:15:00'
        updated_at:
          type: string
          nullable: true
          example: '2026-07-17 10:20:00'

    PaymentMethod:
      type: object
      properties:
        id:
          type: integer
          example: 1
        customer_id:
          type: integer
          example: 1
        priority:
          type: integer
          example: 0
        is_default:
          type: boolean
          example: false
        provider:
          type: string
          example: stripe
        expiry:
          type: string
          format: date
          nullable: true
          example: '2026-12-31'
        identifier:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        status:
          type: string
          nullable: true
        created_at:
          type: string
          nullable: true
          example: '2026-07-17 10:15:00'
        updated_at:
          type: string
          nullable: true
          example: '2026-07-17 10:20:00'

    Invoice:
      type: object
      properties:
        id:
          type: integer
          example: 1
        customer_id:
          type: integer
          example: 1
        invoice_id:
          type: string
          nullable: true
          example: 'A2026/00001'
        proforma_id:
          type: string
          nullable: true
          example: '123456'
        invoice_state:
          type: string
          nullable: true
          example: issued
        proforma_state:
          type: string
          nullable: true
          example: issued
        total_price:
          type: number
          nullable: true
          example: 3162.30
        proforma_issue_date:
          type: string
          nullable: true
          example: '2026-07-17'
        proforma_payment_deadline:
          type: string
          nullable: true
          example: '2026-07-25'
        invoice_issue_date:
          type: string
          nullable: true
          example: '2026-07-17'
        invoice_payment_deadline:
          type: string
          nullable: true
          example: '2026-07-25'
        paid_on_date:
          type: string
          nullable: true
          example: '2026-07-20'
        fulfillment_date:
          type: string
          nullable: true
          example: '2026-07-17'
        description:
          type: string
          nullable: true
          example: Invoice for July 2026
        currency:
          type: string
          nullable: true
          example: HUF
        payment_method:
          type: string
          nullable: true
          example: BANKTRANSFER
        tax_number:
          type: string
          nullable: true
          example: '12345678-1-12'
        invoice_name:
          type: string
          nullable: true
          example: John Doe Billing
        invoice_country:
          type: string
          nullable: true
          example: HU
        invoice_zip:
          type: string
          nullable: true
          example: '1138'
        invoice_city:
          type: string
          nullable: true
          example: Budapest
        invoice_street:
          type: string
          nullable: true
          example: 'Main St 1.'
        post_country:
          type: string
          nullable: true
          example: HU
        post_street:
          type: string
          nullable: true
          example: 'Main St 1.'
        storno_state:
          type: string
          nullable: true
          example: normal
        company:
          type: string
          nullable: true
          example: ATW
        eproforma_state:
          type: string
          nullable: true
          example: Y
        einvoice_state:
          type: string
          nullable: true
          example: N
        state:
          type: string
          enum:
            - unpaid
            - paid
            - cancelled
          nullable: true
          example: unpaid
        is_invoice:
          type: boolean
          nullable: true
          example: true
        invoice_number:
          type: string
          nullable: true
          example: 'A2026/00001'
        deadline:
          type: string
          nullable: true
          example: '2026-07-25'
        created_at:
          type: string
          nullable: true
          example: '2026-07-17 10:15:00'
        updated_at:
          type: string
          nullable: true
          example: '2026-07-17 10:20:00'

    InvoiceWithItems:
      description: Invoice or proforma including its loaded invoice items.
      allOf:
        - $ref: '#/components/schemas/Invoice'
        - type: object
          properties:
            items:
              description: Invoice items currently attached to the invoice
              type: array
              items:
                $ref: '#/components/schemas/InvoiceItem'

    ServiceWithValidItems:
      allOf:
        - $ref: '#/components/schemas/Service'
        - type: object
          properties:
            valid_items:
              description: Valid invoice items currently linked to the service.
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/InvoiceItem'
                  - type: object
                    properties:
                      invoice:
                        $ref: '#/components/schemas/Invoice'
          required:
            - valid_items

    ShowServiceValidItemsResponse:
      allOf:
        - $ref: '#/components/schemas/SuccessEnvelope'
        - type: object
          properties:
            response:
              $ref: '#/components/schemas/ServiceWithValidItems'

    DeleteServiceResponse:
      allOf:
        - $ref: '#/components/schemas/SuccessNullDataResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                data:
                  description: Deletion result
                  nullable: true
                  example: null

    DeleteDomainResponse:
      description: Response after successfully deleting a domain
      allOf:
        - $ref: '#/components/schemas/SuccessBooleanDataResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                data:
                  description: Deletion result
                  type: boolean
                  example: true

    UpdateDomainRequest:
      type: object
      properties:
        contacts_owner:
          type: integer
          example: 501
        nameserver:
          type: string
          pattern: '^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$'
          example: ns2.example.hu
        prepay_task_id:
          type: integer
          example: 9876
        zone_info_request_save:
          type: string
          enum:
            - yes
          example: yes

    UpdateTaskRequest:
      type: object
      properties:
        result:
          type: string
          enum:
            - cancel
            - success
            - tryagain
            - fail
          example: cancel
        result1:
          type: string
          enum:
            - item-paid
          example: item-paid
        result2:
          type: string
          nullable: true
          example: some detail

    UpdateTaskResponse:
      allOf:
        - $ref: '#/components/schemas/SuccessUpdateResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                updated:
                  type: array
                  items:
                    type: string
                  example:
                    - result
                data:
                  $ref: '#/components/schemas/Task'

    ShowServiceResponse:
      allOf:
        - $ref: '#/components/schemas/SuccessEnvelope'
        - type: object
          properties:
            response:
              $ref: '#/components/schemas/Service'

    UpdateServiceRequest:
      description: Change the services option
      type: object
      properties:
        auto_renew:
          description: Enable or disable the auto renew (the system automatically creates invoice items, which become invoices when the service is close to it's expiry) For domains, it's 45 days before expiry.
          type: integer
          enum:
            - 0
            - 1
          example: 1
        paymentmethod:
          description: Payment method of the service
          type: string
          enum:
            - stripe
            - banktransfer
            - paypal
            - coingate
          example: stripe
    UpdateServiceResponse:
      description: Response after update
      type: object
      properties:
        code:
          type: integer
          example: 200
        message:
          type: string
          example: Data updated successfully
        response:
          type: object
          properties:
            updated:
              type: array
              items:
                type: string
              example:
                - auto_renew
            data:
              $ref: '#/components/schemas/Service'

    UpdateDomainResponse:
      description: Response after successfully updating a domain
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Data updated successfully
        response:
          description: Response payload
          type: object
          properties:
            updated:
              description: List of domain attributes that were updated by the request
              type: array
              items:
                type: string
              example:
                - nameserver
            data:
              $ref: '#/components/schemas/Domain'

    ShowDomainResponse:
      description: Response after successfully retrieving a single domain
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              description: The requested domain resource
              $ref: '#/components/schemas/Domain'

    CreateDomainRequest:
      description: Request body for creating a domain. Unknown fields are rejected. `contacts_owner` is required for `registration_type=new` and `registration_type=transfer`. `auth_code` is required for transfers. `prepay_task_id` is used only when finalizing a prepaid `/domains-prepay` order.
      type: object
      additionalProperties: false
      properties:
        domain:
          description: Domain name to create.
          type: string
          pattern: '^[a-z0-9.-]*$'
          example: example.hu
        registration_type:
          description: Requested registration flow. `new` or `transfer`.
          type: string
          enum:
            - new
            - transfer
          example: transfer
        contacts_owner:
          description: Owner contact ID from `/customers/{customer_id}/contacts`. Required for `new` and `transfer`.
          type: integer
          example: 501
        nameserver:
          description: Optional primary nameserver override.
          type: string
          example: ns1.atw.hu
        auth_code:
          description: Transfer authorization code. Required when `registration_type=transfer`.
          type: string
          nullable: true
          example: AUTH-CODE-123
      required:
        - domain
        - registration_type

    CreateDomainValidationError:
      allOf:
        - $ref: '#/components/schemas/ValidationErrorEntry'
      description: One field-level validation error entry returned inside `response.formErrors`.

    CreateDomainValidationErrorResponse:
      description: 400 response returned when the request body fails field validation.
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 400
        message:
          description: Status message
          type: string
          example: Bad form data
        response:
          description: Validation error payload
          type: object
          properties:
            formErrors:
              type: object
              properties:
                domain:
                  description: Can contain `validation.required`, `validation.regex`, `validation.domain_invalid_tld`, or `validation.unknown_field`.
                  type: array
                  items:
                    $ref: '#/components/schemas/CreateDomainValidationError'
                registration_type:
                  description: Can contain `validation.required`, `validation.in`, `validation.test`, or `validation.unknown_field`.
                  type: array
                  items:
                    $ref: '#/components/schemas/CreateDomainValidationError'
                contacts_owner:
                  description: Can contain `validation.required_if`, `validation.numeric`, `validation.contact_not_found`, `validation.domain_contact_data_missing~<missing_fields>`, or `validation.unknown_field`.
                  type: array
                  items:
                    $ref: '#/components/schemas/CreateDomainValidationError'
                prepay_task_id:
                  description: Can contain `validation.numeric` or `validation.unknown_field`.
                  type: array
                  items:
                    $ref: '#/components/schemas/CreateDomainValidationError'
                nameserver:
                  description: Can contain `validation.nameserver` or `validation.unknown_field`.
                  type: array
                  items:
                    $ref: '#/components/schemas/CreateDomainValidationError'
                auth_code:
                  description: Can contain `validation.required` or `validation.unknown_field`.
                  type: array
                  items:
                    $ref: '#/components/schemas/CreateDomainValidationError'

    CreateDomainBusinessErrorResponse:
      description: 400 response returned when the request passed field validation but domain creation failed a business rule.
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 400
        message:
          description: Status message
          type: string
          example: Bad request
        response:
          description: Domain business-rule error payload
          type: object
          properties:
            code:
              description: Stable domain business error code
              type: string
              enum:
                - already_taken
                - inhouse_transfer_already_in_progress
                - prepay_task_invalid
                - prepay_task_not_ready
                - prepay_task_already_used
              example: prepay_task_not_ready
            message:
              description: Human-readable explanation of the business error
              type: string
              example: The supplied prepay task is not ready for domain registration yet.

    CreateDomainBadRequestResponse:
      description: 400 response returned by the domain create endpoint. The response can contain either field-level validation errors or a domain business-rule error.
      oneOf:
        - $ref: '#/components/schemas/CreateDomainValidationErrorResponse'
        - $ref: '#/components/schemas/CreateDomainBusinessErrorResponse'

    CreateDomainPrepayDomainInput:
      description: Domain pricing request payload inside the nested request body.
      type: object
      additionalProperties: false
      properties:
        domain:
          description: Domain name to price
          type: string
          example: example.hu
        action:
          description: Requested prepaid domain action
          type: string
          enum:
            - register
            - transfer
          example: register
        years:
          description: Registration or renewal period in years. Alwas 1 for `register` . For `transfer` always 0.
          type: integer
          nullable: true
          example: 1
      required:
        - domain
        - action

    CreateDomainPrepayEnvelopeRequest:
      description: Nested request body accepted by this endpoint.
      type: object
      additionalProperties: false
      properties:
        domain:
          $ref: '#/components/schemas/CreateDomainPrepayDomainInput'
        service:
          $ref: '#/components/schemas/CreatePrepayServiceInput'
      required:
        - domain
        - service

    CreateDomainPrepayFlatRequest:
      description: Flat request body accepted by this endpoint.
      type: object
      additionalProperties: false
      properties:
        domain:
          description: Domain name to price
          type: string
          example: example.hu
        operation:
          description: Requested prepaid domain action
          type: string
          enum:
            - register
            - renew
            - transfer
            - restore
            - ownerchange
          example: register
        years:
          description: Registration or renewal period in years. Required for `register` and `renew`. For `transfer`, `restore`, and `ownerchange`, use `0`.
          type: integer
          nullable: true
          example: 1
        currency:
          description: Currency to price and bill the pending service in
          type: string
          enum:
            - HUF
            - EUR
            - USD
          example: HUF
      required:
        - domain
        - operation
        - currency

    CreateDomainPrepayValidationError:
      allOf:
        - $ref: '#/components/schemas/ValidationErrorEntry'
      description: One field-level validation error returned during domain pricing validation.

    CreateDomainPrepayValidationErrorResponse:
      description: 400 response returned when the flat domain pricing request is invalid.
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 400
        message:
          description: Status message
          type: string
          example: Bad form data
        response:
          description: Validation error payload
          type: object
          properties:
            formErrors:
              type: object
              properties:
                domain:
                  description: Can contain `validation.required`.
                  type: array
                  items:
                    $ref: '#/components/schemas/CreateDomainPrepayValidationError'
                operation:
                  description: Can contain `validation.required` or `validation.in`.
                  type: array
                  items:
                    $ref: '#/components/schemas/CreateDomainPrepayValidationError'
                years:
                  description: Can contain `validation.required_if`, `validation.integer`, or `validation.between`.
                  type: array
                  items:
                    $ref: '#/components/schemas/CreateDomainPrepayValidationError'
                currency:
                  description: Can contain `validation.required` or `validation.in`.
                  type: array
                  items:
                    $ref: '#/components/schemas/CreateDomainPrepayValidationError'

    CreateDomainPrepayBusinessErrorResponse:
      description: 400 response returned after validation passed but the domain pricing request could not be completed.
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 400
        message:
          description: Status message
          type: string
          example: Bad request
        response:
          description: Domain pricing business-rule error payload
          type: object
          properties:
            code:
              description: Stable error code
              type: string
              example: invalid_domain
            message:
              description: Human-readable explanation
              type: string
              example: The requested domain name uses an extension that is not supported for this pricing request.

    CreateDomainPrepayBadRequestResponse:
      description: 400 response returned by the prepaid domain order endpoint. This route can return either field validation errors or a domain pricing/business-rule error object.
      oneOf:
        - $ref: '#/components/schemas/CreateDomainPrepayValidationErrorResponse'
        - $ref: '#/components/schemas/CreateDomainPrepayBusinessErrorResponse'

    ForbiddenResponse:
      description: 403 Forbidden response
      allOf:
        - $ref: '#/components/schemas/ErrorEnvelope'
        - type: object
          properties:
            code:
              example: 403
            message:
              example: Forbidden
            response:
              allOf:
                - $ref: '#/components/schemas/ErrorMessagePayload'
                - type: object
                  properties:
                    message:
                      example: "You don't have permission to access this resource"

    NotFoundResponse:
      description: 404 Not Found response
      allOf:
        - $ref: '#/components/schemas/ErrorEnvelope'
        - type: object
          properties:
            code:
              example: 404
            message:
              example: Endpoint does not exist
            response:
              allOf:
                - $ref: '#/components/schemas/ErrorMessagePayload'
                - type: object
                  properties:
                    message:
                      example: "The specified key_field does not exist"

    UnauthorizedTotpResponse:
      description: 401 Unauthorized TOTP response. The response array contains one error code.
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 401
        message:
          description: Error message
          type: string
          example: Invalid credentials
        response:
          description: TOTP error code
          type: array
          items:
            type: string
            enum:
              - totp_code_required
              - totp_code_invalid
          minItems: 1
          maxItems: 1
          example:
            - totp_code_required

    BadRequestResponse:
      description: 400 Bad Request response with form validation errors
      allOf:
        - $ref: '#/components/schemas/ErrorEnvelope'
        - type: object
          properties:
            code:
              example: 400
            message:
              example: Bad form data
            request_id:
              description: Unique request identifier
              type: integer
              example: 15248065
            response:
              $ref: '#/components/schemas/ValidationFormErrorsPayload'

    RegisterRequest:
      description: Request body for registering a new user without email confirmation
      type: object
      properties:
        full_name:
          description: Full name of the user. Required. Minimum 3 characters.
          type: string
          minLength: 3
          example: John Doe
        phone_number:
          description: Phone number in +[cc].[number] format. Required.
          type: string
          pattern: '^\+(?!36\.0)[0-9]{1,3}\.[0-9]{3,12}$'
          example: "+36.12345678"
        username:
          description: Username (email address). Required. Must be a valid email and must be unique.
          type: string
          format: email
          example: john.doe@example.com
        password:
          description: Password for the new account. Required. Minimum 6 characters.
          type: string
          minLength: 6
          example: "secret123"
        language:
          description: Preferred language of the user. Optional. Defaults to HU.
          type: string
          enum:
            - HU
            - EN
          example: HU
      required:
        - full_name
        - phone_number
        - username
        - password

    RegisterResponse:
      description: Response after successfully registering a new user
      allOf:
        - $ref: '#/components/schemas/SuccessUpdateResponse'
        - type: object
          properties:
            request_id:
              description: Unique request identifier
              type: integer
              example: 15248115
            response:
              type: object
              properties:
                updated:
                  description: List of fields accepted from the request and saved
                  example:
                    - phone_number
                    - full_name
                    - username
                    - password
                data:
                  $ref: '#/components/schemas/User'

    ActivateUserRequest:
      description: Request body for activating a signed-up user account
      type: object
      properties:
        code:
          description: Email confirmation code sent during signup
          type: string
          example: "123456"
        password:
          description: New account password. Minimum 8 characters.
          type: string
          minLength: 8
          example: "secret123"
      required:
        - code
        - password

    ActivateUserResponse:
      description: Response after successfully activating a user
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Empty response payload
          type: array
          example: []

    CheckUserCodeResponse:
      description: Response after successfully verifying a user activation code
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Empty response payload
          type: array
          example: []

    CheckUserCodeBadRequestResponse:
      description: Response when the supplied activation code is invalid or expired
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 400
        message:
          description: Status message
          type: string
          example: Bad request
        response:
          description: Business-rule error payload
          type: object
          properties:
            code:
              type: string
              example: bad_code
            message:
              type: string
              example: The supplied activation code is invalid.

    EmailConfirmRequest:
      description: Request body for sending an email confirmation code.
      type: object
      properties:
        username:
          description: Email address that should receive the confirmation code.
          type: string
          format: email
          example: john.doe@example.com
        lang:
          description: Language of the confirmation email.
          type: string
          enum:
            - hu
            - en
          example: hu
      required:
        - username
        - lang

    EmailConfirmRequestResponse:
      description: Response after successfully accepting an email confirmation request
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Empty response payload
          type: array
          example: []

    EmailConfirmVerifyRequest:
      description: Request body for verifying an email confirmation code.
      type: object
      properties:
        username:
          description: Email address whose confirmation code should be checked.
          type: string
          format: email
          example: john.doe@example.com
        code:
          description: Confirmation code supplied to the user.
          type: string
          example: ABCDEFGH12345678
      required:
        - username
        - code

    EmailConfirmVerifyResponse:
      description: Response after successfully verifying an email confirmation code
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Empty response payload
          type: array
          example: []

    EmailConfirmVerifyBadRequestResponse:
      description: Response when the supplied email confirmation code is invalid
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 400
        message:
          description: Status message
          type: string
          example: Bad request
        response:
          description: Empty response payload
          type: array
          example: []

    CreateUserRecoveryResponse:
      description: Response after successfully accepting a password-recovery request
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Empty response payload
          type: array
          example: []

    UserExistsResponse:
      description: Response after successfully checking a user's existence
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Current user state payload
          type: object
          properties:
            state:
              description: Current account state of the user
              type: string
              enum:
                - INACTIVE
                - ACTIVE
                - SIGNUP
                - SUSPEND
              example: ACTIVE

    UserRecoveryInvalidCodeResponse:
      description: Response when the supplied recovery code is invalid
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 400
        message:
          description: Status message
          type: string
          example: Bad request
        response:
          description: Business-rule error payload
          type: object
          properties:
            error:
              type: string
              example: invalid code

    UpdateUserRequest:
      description: Request body for updating a user. All fields are optional; only provided fields will be updated.
      type: object
      properties:
        full_name:
          description: Full name of the user. Minimum 3 characters.
          type: string
          minLength: 3
          example: Jane Doe
        phone_number:
          description: Phone number in +[cc].[number] format. Must match regex /^\+(?!36\.0)[0-9]{1,3}\.[0-9]{3,12}$/. Country code is 1-3 digits, number is 3-12 digits. Cannot be +36.0xxx.
          type: string
          pattern: '^\+(?!36\.0)[0-9]{1,3}\.[0-9]{3,12}$'
          example: "+36.87654321"
        username:
          description: Username (email address). Must be a valid email and must be unique. Changing the username will log the user out.
          type: string
          format: email
          example: jane.doe@example.com
        password:
          description: New password. Minimum 6 characters.
          type: string
          minLength: 6
          example: "newpass123"
        language:
          description: Preferred language of the user.
          type: string
          enum:
            - HU
            - EN
          example: EN

    UpdateUserResponse:
      description: Response after successfully updating a user
      allOf:
        - $ref: '#/components/schemas/SuccessUpdateResponse'
        - type: object
          properties:
            message:
              example: Data updated successfully
            response:
              type: object
              properties:
                data:
                  $ref: '#/components/schemas/User'

    CreateCpanelSessionResponse:
      description: Response after successfully creating a control-panel session URL
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Created control-panel session payload
          type: object
          properties:
            url:
              description: One-time login URL for the control panel
              type: string
              example: https://cp01.hosting.example:2083/cpsess1234567890/login/?session=abcdef

    StoreCustomerRequest:
      description: Request body for creating a new customer
      oneOf:
        - $ref: '#/components/schemas/StorePrivateCustomerRequest'
        - $ref: '#/components/schemas/StoreLegalCustomerRequest'
      discriminator:
        propertyName: type
        mapping:
          PRIVATE: '#/components/schemas/StorePrivateCustomerRequest'
          LEGAL: '#/components/schemas/StoreLegalCustomerRequest'

    StoreCustomerRequestBase:
      description: Shared fields for customer creation requests
      type: object
      properties:
        name:
          description: Name of the cusomer, for `PRIVATE` the users full legal name, for `LEGAL` the company's/ornaization's name
          type: string
          minLength: 2
          example: John Doe
        payment_method:
          description: The primary payment method to use, by default BANKTRANSFER
          type: string
          enum:
            - BANKTRANSFER
            - PAYPAL
          example: BANKTRANSFER
        invoice_method:
          description: The invoice method to use.
          type: string
          enum:
            - EPROFORMA_EINVOICE
            - EPROFORMA_INVOICE
            - PROFORMA_INVOICE
            - BARTER
            - INVOICE
            - EINVOICE
            - INVOICEALWAYS
            - EINVOICEALWAYS
          example: PROFORMA_INVOICE
        invoice_country:
          description: The country of this company's/person's residence
          type: string
          minLength: 2
          example: HU
        invoice_zip:
          description: The ZIP of this company's/person's residence
          type: string
          minLength: 2
          example: "1138"
        invoice_city:
          description: The city of this company's/person's residence
          type: string
          minLength: 2
          example: Budapest
        invoice_street:
          description: The street of this company's/person's residence
          type: string
          minLength: 6
          example: Main St 1.
        invoice_language:
          description: The language that the invoice swill be created with and interfaces will be rendered with
          type: string
          enum:
            - HU
            - EH
          example: HU
        hu_group_vat:
          description: The group VAT number of the company
          type: string
          nullable: true
          example: "HU12345678"
        default_currency:
          description: Default currency to use when billing
          type: string
          enum:
            - HUF
            - EUR
            - USD
          nullable: true
          example: HUF

        sznet_id:
          description: The company this custmer is under.
          type: string
          enum:
            - "xet:x"
          nullable: true
          example: null
      required:
        - name
        - invoice_country
        - invoice_zip
        - invoice_city
        - invoice_street
        - invoice_language

    StorePrivateCustomerRequest:
      description: Request body for creating a private customer
      allOf:
        - $ref: '#/components/schemas/StoreCustomerRequestBase'
        - type: object
          properties:
            type:
              description: Use `PRIVATE` when the customer represents a private person.
              type: string
              enum:
                - PRIVATE
              example: PRIVATE
            ident:
              description: Birth date of the private customer in `YYYY-MM-DD` format when sent as the private identifier.
              type: string
              nullable: true
              maxLength: 20
              example: "1990-05-17"

          required:
            - type

    StoreLegalCustomerRequest:
      description: Request body for creating a legal customer
      allOf:
        - $ref: '#/components/schemas/StoreCustomerRequestBase'
        - type: object
          properties:
            type:
              description: Use `LEGAL` when the customer represents a company or organization.
              type: string
              enum:
                - LEGAL
              example: LEGAL
            ident:
              description: Tax number of the legal customer.
              type: string
              nullable: true
              maxLength: 20
              example: "12345678-1-12"
          required:
            - type

    StoreCustomerResponse:
      description: Response after successfully creating a customer
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              $ref: '#/components/schemas/Customer'

    UpdateCustomerRequest:
      description: "Request body for updating an existing customer. This is a partial-update schema: all fields are optional, but any provided field must be valid."
      type: object
      properties:
        type:
          description: Customer type.
          type: string
          enum:
            - PRIVATE
            - LEGAL
          example: PRIVATE
        name:
          description: Customer display name
          type: string
          minLength: 2
          example: John Doe
        ident:
          description: Tax identifier or legal identifier
          type: string
          nullable: true
          maxLength: 20
          example: "12345678-1-12"
        date_of_birth:
          description: Date of birth for private customers
          type: string
          format: date
          nullable: true
          example: "1990-05-17"
        payment_method:
          description: Default payment method
          type: string
          enum:
            - BANKTRANSFER
            - PAYPAL
          example: BANKTRANSFER
        invoice_method:
          description: Invoice delivery/billing method
          type: string
          enum:
            - EPROFORMA_EINVOICE
            - EPROFORMA_INVOICE
            - PROFORMA_INVOICE
            - BARTER
            - INVOICE
            - EINVOICE
            - INVOICEALWAYS
            - EINVOICEALWAYS
          example: PROFORMA_INVOICE
        invoice_country:
          description: Invoice country code
          type: string
          minLength: 2
          example: HU
        invoice_zip:
          description: Invoice ZIP/postal code
          type: string
          minLength: 2
          example: "1138"
        invoice_city:
          description: Invoice city
          type: string
          minLength: 2
          example: Budapest
        invoice_street:
          description: Invoice street address
          type: string
          minLength: 6
          example: Main St 1.
        invoice_language:
          description: Invoice language
          type: string
          enum:
            - hu
            - en
          example: hu
        hu_group_vat:
          description: Hungarian group VAT number
          type: string
          nullable: true
          example: "HU12345678"
        default_currency:
          description: Default currency of the customer
          type: string
          enum:
            - HUF
            - EUR
            - USD
          nullable: true
          example: HUF
        sznet_id:
          description: Internal SZNET identifier
          type: string
          enum:
            - "xet:x"
          nullable: true
          example: null

    CustomerChangeRequest:
      description: Request body for submitting a customer change request. This follows the customer update fields, but `type` is intentionally not accepted on this route. Optional `attachments[]` files may be uploaded together with the changed fields.
      type: object
      properties:
        name:
          description: Customer display name
          type: string
          minLength: 2
          example: John Doe
        ident:
          description: Tax identifier or legal identifier
          type: string
          nullable: true
          maxLength: 20
          example: "12345678-1-12"
        date_of_birth:
          description: Date of birth for private customers
          type: string
          format: date
          nullable: true
          example: "1990-05-17"
        payment_method:
          description: Default payment method
          type: string
          enum:
            - BANKTRANSFER
            - PAYPAL
          example: BANKTRANSFER
        invoice_method:
          description: Invoice delivery/billing method
          type: string
          enum:
            - EPROFORMA_EINVOICE
            - EPROFORMA_INVOICE
            - PROFORMA_INVOICE
            - BARTER
            - INVOICE
            - EINVOICE
            - INVOICEALWAYS
            - EINVOICEALWAYS
          example: PROFORMA_INVOICE
        invoice_country:
          description: Invoice country code
          type: string
          minLength: 2
          example: HU
        invoice_zip:
          description: Invoice ZIP/postal code
          type: string
          minLength: 2
          example: "1138"
        invoice_city:
          description: Invoice city
          type: string
          minLength: 2
          example: Budapest
        invoice_street:
          description: Invoice street address
          type: string
          minLength: 6
          example: Main St 1.
        invoice_language:
          description: Invoice language
          type: string
          enum:
            - hu
            - en
          example: hu
        hu_group_vat:
          description: Hungarian group VAT number
          type: string
          nullable: true
          example: "HU12345678"
        default_currency:
          description: Default currency of the customer
          type: string
          enum:
            - HUF
            - EUR
            - USD
          nullable: true
          example: HUF
        sznet_id:
          description: Internal SZNET identifier
          type: string
          enum:
            - "xet:x"
          nullable: true
          example: null
        attachments:
          description: Optional supporting files uploaded with the change request.
          type: array
          items:
            type: string
            format: binary

    UpdateCustomerResponse:
      description: Response after successfully updating a customer
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Data updated successfully
        response:
          description: Response payload
          type: object
          properties:
            updated:
              description: List of customer attributes that were updated by the request.
              type: array
              items:
                type: string
              example:
                - name
                - invoice_city
            data:
              $ref: '#/components/schemas/Customer'

    AddLinkRequest:
      description: Request body for adding a user to a customer
      type: object
      properties:
        user_id:
          description: Username (email) of the user to link to the customer. Must be a valid existing user.
          type: string
          format: email
          example: john.doe@example.com
      required:
        - user_id

    AddLinkResponse:
      description: Response after successfully linking a user to a customer
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              description: Created customer access record
              type: object

    RemoveLinkResponse:
      description: Response after successfully unlinking a customer from a user
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Record successfully removed
        response:
          description: Response payload
          type: object
          properties:
            data:
              description: Deleted customer access record
              type: object

    SetTotpRequest:
      description: Request body for setting up TOTP
      type: object
      properties:
        new_totp_secret:
          description: 16-character TOTP secret in base32 format
          type: string
          minLength: 16
          maxLength: 16
          example: "JBSWY3DPEHPK3PXP"
        new_totp_code:
          description: TOTP code generated from the secret to verify authenticity
          type: string
          example: "123456"
      required:
        - new_totp_secret
        - new_totp_code

    SetTotpResponse:
      description: Response after successfully setting up TOTP
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: array
          example: []

    DeleteTotpResponse:
      description: Response after successfully disabling TOTP
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: array
          example: []

    DestroyAllTokensResponse:
      description: Response after successfully destroying all tokens
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: All tokens for this user removed
        response:
          description: Response payload
          type: object
          properties:
            username:
              description: Username of the user whose tokens were destroyed
              type: string
              example: john.doe@example.com

    UserToken:
      description: Active authentication token session.
      type: object
      properties:
        id:
          description: Token session ID
          type: integer
          example: 306331
        user_id:
          description: User ID that owns the token
          type: integer
          example: 1
        username:
          description: Username (email) that owns the token
          type: string
          example: john.doe@example.com
        token:
          description: 32-character authentication token
          type: string
          example: 1A2b3C4d5E6f7G8h9I0j1K2l3M4n5O6p
        created_at:
          description: When the token was created
          type: string
          example: '2026-07-23 10:12:27'
        updated_at:
          description: When the token was last used or updated
          type: string
          nullable: true
          example: '2026-07-23 11:05:10'
        expires_at:
          description: When the token expires. `null` means the token does not expire automatically.
          type: string
          nullable: true
          example: '2026-07-30 10:12:27'
        ip:
          description: IP address last recorded for the token
          type: string
          nullable: true
          example: 127.0.0.1
        user_agent:
          description: User agent last recorded for the token
          type: string
          nullable: true
          example: Mozilla/5.0

    IndexUserTokensResponse:
      description: Response after successfully retrieving a user's active tokens
      allOf:
        - $ref: '#/components/schemas/SuccessListResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                count:
                  description: Total number of returned records
                  type: integer
                  example: 42
                data:
                  description: Array of active token sessions
                  type: array
                  items:
                    $ref: '#/components/schemas/UserToken'

    CreateTokenResponse:
      description: Response after successfully creating a token
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Token created
        response:
          description: Response payload
          type: object
          properties:
            token:
              description: The generated 32-character alphanumeric token
              type: string
              example: "aB3dE5fG7hI9jK1lM3nO5pQ7rS9tU1vW"

    DeleteTokenResponse:
      description: Response after successfully deleting a token
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Token successfully removed
        response:
          description: Response payload
          type: object
          properties:
            token:
              description: The removed authentication token
              type: string
              example: "aB3dE5fG7hI9jK1lM3nO5pQ7rS9tU1vW"

    ShowUserTokenResponse:
      description: Response after successfully retrieving a token
      allOf:
        - $ref: '#/components/schemas/SuccessDataResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                data:
                  description: The requested token session
                  $ref: '#/components/schemas/UserToken'

    GetPinResponse:
      description: Response after successfully retrieving the user's PIN
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            pin_code:
              description: 6-digit PIN code for the user
              type: string
              example: "012345"

    ApiLogEntry:
      description: A single API log entry
      type: object
      properties:
        id:
          description: Log entry ID
          type: integer
          example: 1
        ip:
          description: Client IP address
          type: string
          example: "192.168.1.1"
        user_id:
          description: ID of the user who made the request
          type: integer
          example: 1
        customer_id:
          description: ID of the customer associated with the request
          type: integer
          nullable: true
          example: 1
        method:
          description: HTTP method used
          type: string
          example: GET
        uri:
          description: Request URI
          type: string
          example: "/users/john.doe@example.com"
        request:
          description: Request body (JSON)
          type: string
          nullable: true
          example: null
        response_code:
          description: HTTP response status code
          type: integer
          example: 200
        response_message:
          description: Response message
          type: string
          example: Request successfully completed
        response_data:
          description: Response body (JSON)
          type: string
          nullable: true
          example: null
        model:
          description: Related resource type
          type: string
          nullable: true
          example: null
        model_id:
          description: Related resource ID
          type: integer
          nullable: true
          example: null
        created_at:
          description: When the log entry was created
          type: string
          example: "2026-07-16 12:55:38"
        updated_at:
          description: When the log entry was last updated
          type: string
          example: "2026-07-16 12:55:38"

    UpdateDatacenterDeviceRequest:
      type: object
      properties:
        user_info:
          type: string
          maxLength: 50
          nullable: true
          example: "Updated device info"

    UpdateDatacenterDeviceResponse:
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Data updated successfully
        response:
          description: Response payload
          type: object
          properties:
            updated:
              description: List of changed field names
              type: array
              items:
                type: string
              example:
                - power_state
            data:
              $ref: '#/components/schemas/DatacenterDevice'

    DatacenterDeviceMeasurement:
       type: object
       properties:
         id:
           type: integer
           example: 1
         datacenter_device_id:
           type: integer
           example: 1
         measured_at:
           type: string
           format: date
           nullable: true
           example: "2026-07-16"
         measurement_type:
           type: string
           enum:
             - guess
             - measurement
           example: measurement
         wattage:
           type: number
           minimum: 1
           maximum: 10000
           example: 120
         description:
           type: string
           nullable: true
           example: null
         created_at:
           type: string
           example: "2026-07-16 12:55:38"
         updated_at:
           type: string
           example: "2026-07-16 12:55:38"

    DatacenterDeviceUser:
       type: object
       properties:
         rules_id:
           type: integer
           example: 1
         datacenter_device_id:
           type: integer
           example: 1
         datacenter_device_permission:
           type: string
           enum:
             - full
             - local
             - console
           example: full
         owner:
           type: integer
           example: 1
         added:
           type: string
           example: "2026-07-16 12:55:38"
         changed:
           type: string
           example: "2026-07-16 12:55:38"
         user:
           $ref: '#/components/schemas/User'

    DatacenterDeviceService:
       type: object
       properties:
         id:
           type: integer
           example: 1
         customer_id:
           type: integer
           example: 1
         product_id:
           type: string
           example: VPS-2048-MONTHLY
         price:
           type: number
           example: 1000
         price_currency:
           type: string
           enum:
             - EUR
             - HUF
             - USD
           example: HUF
         invoice_currency:
           type: string
           enum:
             - EUR
             - HUF
             - USD
           example: HUF
         started_on:
           type: string
           format: date
           example: "2026-01-01"
         invoiced_until:
           type: string
           format: date
           example: "2026-08-01"
         state:
           type: string
           example: active
         is_disabled:
           type: string
           enum:
             - Y
             - N
           example: N
         auto_renew:
           type: integer
           enum:
             - 0
             - 1
           example: 1
         info:
           type: string
           nullable: true
           example: null
         created_at:
           type: string
           example: "2026-07-16 12:55:38"
         updated_at:
           type: string
           example: "2026-07-16 12:55:38"
         deleted_at:
           type: string
           nullable: true
           example: null

    DatacenterDevice:
      description: A datacenter device
      type: object
      properties:
        id:
          description: Device ID
          type: integer
          example: 1
        service_id:
          description: ID of the associated service
          type: integer
          example: 1
        measured_energy_service_id:
          description: ID of the measured energy service
          type: integer
          nullable: true
          example: null
        datacenter_id:
          description: Datacenter identifier
          type: string
          enum:
            - DL2
            - HA
            - VHS
            - EXPO
            - IRODA
          example: DL2
        device_type:
          description: Type of the device
          type: string
          enum:
            - server
            - nas
            - network
            - pdu
            - etc
          example: server
        size:
          description: Size of the device (1-48)
          type: integer
          minimum: 1
          maximum: 48
          example: 1
        position:
          description: Physical position in the rack
          type: string
          example: "A01"
        power_state:
          description: Current power state
          type: string
          enum:
            - ON
            - OFF
          example: ON
        power_state_changed_at:
          description: When the power state was last changed
          type: string
          example: "2026-07-16 12:55:38"
        description:
          description: Description of the device (max 128 chars)
          type: string
          example: "Web server node"
        user_info:
          description: User-visible info (max 50 chars)
          type: string
          nullable: true
          example: null
        width_cm:
          description: Width in centimeters (5-80)
          type: integer
          nullable: true
          example: 42
        height_cm:
          description: Height in centimeters (5-80)
          type: integer
          nullable: true
          example: 42
        psu_1_ups:
          description: UPS connection for PSU 1
          type: string
          nullable: true
          example: "PDU1/1"
        psu_2_ups:
          description: UPS connection for PSU 2
          type: string
          nullable: true
          example: "PDU2/1"
        psu_3_ups:
          description: UPS connection for PSU 3
          type: string
          nullable: true
          example: null
        psu_4_ups:
          description: UPS connection for PSU 4
          type: string
          nullable: true
          example: null
        created_at:
          description: When the device was created
          type: string
          example: "2026-07-16 12:55:38"
        updated_at:
          description: When the device was last updated
          type: string
          example: "2026-07-16 12:55:38"
        deleted_at:
          description: When the device was soft-deleted
          type: string
          nullable: true
          example: null
        rules:
          description: User rules for this device
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/DatacenterDeviceUser'
        service:
          description: Associated service for this device
          $ref: '#/components/schemas/DatacenterDeviceService'
        measured_energy_service:
          description: Measured energy service for this device
          $ref: '#/components/schemas/DatacenterDeviceService'
        measurements:
          description: Power measurements for this device
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/DatacenterDeviceMeasurement'

    IndexDatacenterDevicesResponse:
      description: Response after successfully retrieving datacenter devices
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              description: Array of datacenter device entries
              type: array
              items:
                $ref: '#/components/schemas/DatacenterDevice'
            count:
              description: Total number of devices
              type: integer
              example: 42

    ShowDatacenterDeviceResponse:
      description: Response after successfully retrieving a datacenter device
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              $ref: '#/components/schemas/DatacenterDevice'

    ServiceInventoryItem:
      description: Public service inventory entry.
      type: object
      properties:
        id:
          description: Numeric ID of the service inventory entry
          type: integer
          example: 1
        product_id:
          description: Product identifier
          type: string
          example: CUSTOM-12-WH
        description:
          description: Human-readable product description
          type: string
          example: Standard webhosting
        invoice_interval_months:
          description: Billing interval in months
          type: string
          nullable: true
          example: '12'
        loyalty_period_months:
          description: Loyalty period in months
          type: integer
          nullable: true
          example: 12
        price:
          description: Net price for the product
          type: number
          nullable: true
          example: 400
        price_currency:
          description: Currency of the listed price
          type: string
          example: HUF
        vat:
          description: VAT percentage
          type: number
          nullable: true
          example: 27

    IndexServiceInventoryResponse:
      description: Response after successfully retrieving service inventory entries
      allOf:
        - $ref: '#/components/schemas/SuccessListResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                count:
                  description: Total number of returned records
                  type: integer
                  example: 42
                data:
                  description: Array of service inventory entries
                  type: array
                  items:
                    $ref: '#/components/schemas/ServiceInventoryItem'

    ShowServiceInventoryResponse:
      description: Response after successfully retrieving a service inventory entry
      allOf:
        - $ref: '#/components/schemas/SuccessDataResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                data:
                  $ref: '#/components/schemas/ServiceInventoryItem'

    CompanyVatLookup:
      description: Company invoice details returned by the VAT lookup.
      type: object
      properties:
        ident:
          description: VAT or tax identifier returned by the lookup provider.
          type: string
          example: SK2021959555
        invoice_country:
          description: Two-letter invoice country code returned by the VAT lookup.
          type: string
          example: SK
        name:
          description: Company name returned by the VAT record.
          type: string
          example: Fallback State Kft.
        invoice_zip:
          description: Postal code when returned by the lookup provider.
          type: string
          nullable: true
          example: "1138"
        invoice_city:
          description: City when returned by the lookup provider.
          type: string
          nullable: true
          example: Budapest
        invoice_street:
          description: Street address when returned by the lookup provider.
          type: string
          nullable: true
          example: Esztergomi ut 66.
      required:
        - ident
        - invoice_country
        - name

    ShowCompanyByVatResponse:
      description: Response after successfully retrieving company VAT data
      allOf:
        - $ref: '#/components/schemas/SuccessDataResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                data:
                  $ref: '#/components/schemas/CompanyVatLookup'

    CompanyVatLookupBadRequestResponse:
      description: 400 Bad Request response for an invalid VAT lookup
      allOf:
        - $ref: '#/components/schemas/ErrorEnvelope'
        - type: object
          properties:
            code:
              example: 400
            message:
              example: Bad request
            response:
              type: object
              properties:
                code:
                  description: Machine-readable business error code.
                  type: string
                  example: invalid_vat
                message:
                  description: Human-readable explanation of the VAT lookup error.
                  type: string
              required:
                - code
                - message

    Payment:
      type: object
      properties:
        id:
          type: integer
          example: 1
        transfer_type:
          type: string
          nullable: true
          example: "Elektronikus bankon belüli átutalás"
        payment_id:
          type: string
          example: "132418CA"
        customer_id:
          type: integer
          nullable: true
          example: 1
        partner_name:
          type: string
          nullable: true
          example: "John Doe"
        partner_account_number:
          type: string
          nullable: true
          example: "12345678-90123456-78901234"
        amount:
          type: number
          example: 15000
        currency:
          type: string
          enum:
            - HUF
            - EUR
            - USD
          example: HUF
        received_on:
          type: string
          format: date
          nullable: true
          example: "2026-07-16"
        comment:
          type: string
          nullable: true
          example: "A2024 / 123456"
        extra_comment:
          type: string
          nullable: true
          example: null
        bank:
          type: string
          example: "RAIFFEISEN"
        state:
          type: string
          enum:
            - NEW
            - OK
            - WAITING
            - ARCHIV
          example: NEW
        company:
          type: string
          enum:
            - ATW
          example: ATW
        created_at:
          type: string
          example: "2026-07-16 12:55:38"
        updated_at:
          type: string
          nullable: true
          example: null

    CustomerSummary:
      type: object
      properties:
        webhosting:
          type: integer
          example: 5
        domain:
          type: integer
          example: 10
        vps:
          type: integer
          example: 3
        vps_off:
          type: integer
          example: 1
        unpaid_balances:
          type: integer
          example: 2
        unpaid_proformas:
          type: integer
          example: 1
        expired_invoices:
          type: integer
          example: 0
        expired_proformas:
          type: integer
          example: 0
        expiring_domains:
          type: integer
          example: 1

    CustomerSummaryResponse:
      description: Response after successfully retrieving customer summary
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              $ref: '#/components/schemas/CustomerSummary'

    IndexCustomerTasksResponse:
      description: Response after successfully retrieving customer tasks
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              description: Array of task entries
              type: array
              items:
                $ref: '#/components/schemas/Task'
            count:
              description: Total number of tasks
              type: integer
              example: 42

    ShowTaskResponse:
      description: Response after successfully retrieving a task
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              description: The task record
              $ref: '#/components/schemas/Task'

    IndexCustomerServicesResponse:
      description: Response after successfully retrieving customer services
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              description: Array of service entries
              type: array
              items:
                $ref: '#/components/schemas/Service'
            count:
              description: Total number of services
              type: integer
              example: 42

    PayInvoiceCreditRequest:
      type: object
      required:
        - invoice_ids
        - payment_method
      properties:
        invoice_ids:
          type: array
          maxItems: 20
          items:
            type: integer
          example:
            - 1
        payment_method:
          type: string
          enum:
            - credit
          example: credit

    PayInvoiceStripeRequest:
      type: object
      required:
        - invoice_ids
        - payment_method
        - success_url
        - fail_url
      properties:
        invoice_ids:
          type: array
          maxItems: 20
          items:
            type: integer
          example:
            - 1
        payment_method:
          type: string
          enum:
            - stripe
          example: stripe
        success_url:
          type: string
          example: https://example.com/success
        fail_url:
          type: string
          example: https://example.com/fail

    PayInvoiceCoingateRequest:
      type: object
      required:
        - invoice_ids
        - payment_method
        - success_url
        - fail_url
      properties:
        invoice_ids:
          type: array
          maxItems: 20
          items:
            type: integer
          example:
            - 1
        payment_method:
          type: string
          enum:
            - coingate
          example: coingate
        success_url:
          type: string
          example: https://example.com/success
        fail_url:
          type: string
          example: https://example.com/fail

    PayInvoiceSimplepayRequest:
      type: object
      required:
        - invoice_ids
        - payment_method
        - success_url
        - fail_url
      properties:
        invoice_ids:
          type: array
          maxItems: 20
          items:
            type: integer
          example:
            - 1
        payment_method:
          type: string
          enum:
            - simplepay
          example: simplepay
        success_url:
          type: string
          example: https://example.com/success
        fail_url:
          type: string
          example: https://example.com/fail

    PayInvoicePaypalRequest:
      type: object
      required:
        - invoice_ids
        - payment_method
        - success_url
        - fail_url
      properties:
        invoice_ids:
          type: array
          maxItems: 20
          items:
            type: integer
          example:
            - 1
        payment_method:
          type: string
          enum:
            - paypal
          example: paypal
        success_url:
          type: string
          example: https://example.com/success
        fail_url:
          type: string
          example: https://example.com/fail

    PayInvoiceStripeResponse:
      type: object
      properties:
        status:
          type: string
          example: requires_payment
        client_secret:
          type: string
          nullable: true
          example: pi_123_secret_456

    CreateStripeSetupResponse:
      description: Response after successfully creating a Stripe SetupIntent
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Stripe SetupIntent data for collecting and attaching a payment method
          type: object
          properties:
            setup_intent_id:
              description: Stripe SetupIntent identifier
              type: string
              example: seti_1Q2w3E4r5T6y7U8i9O0p
            client_secret:
              description: Client secret for confirming the SetupIntent in Stripe.js
              type: string
              example: seti_1Q2w3E4r5T6y7U8i9O0p_secret_AbCdEfGhIjKlMnOp

    SimplepayBackrefResponse:
      description: Response after successfully validating a SimplePay back-reference
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: SimplePay back-reference validation result
          type: object
          properties:
            validation:
              description: Result of the back-reference signature and payload check
              type: string
              enum:
                - ok
                - error
              example: ok
            url:
              description: Echo of the supplied `url` query parameter
              type: string
              nullable: true
              example: https://example.com/return?order_ref=ORD-123&status=SUCCESS

    PayInvoiceRedirectResponse:
      type: object
      properties:
        url:
          type: string
          example: https://payment.example.com/checkout

    PayInvoiceSimplepayResponse:
      type: object
      properties:
        html:
          type: string
          example: '<form>...</form>'

    PayInvoiceResponse:
      oneOf:
        - $ref: '#/components/schemas/PayInvoiceCreditResponse'
        - $ref: '#/components/schemas/PayInvoiceStripeResponse'
        - $ref: '#/components/schemas/PayInvoiceRedirectResponse'
        - $ref: '#/components/schemas/PayInvoiceSimplepayResponse'

    PayInvoiceCreditResponse:
      type: object
      properties: {}

    CreateInvoiceRequest:
      type: object
      required:
        - invoice_item_ids
      properties:
        invoice_item_ids:
          type: array
          items:
            type: integer
          example:
            - 1
            - 2
        invoice_state:
          type: string
          enum:
            - paid
          example: paid

    SplitInvoiceRequest:
      type: object

      required:
        - invoice_item_ids
      properties:
        invoice_item_ids:
          type: array
          items:
            type: integer
          example:
            - 1
            - 2

    SplitInvoiceResponse:
      type: object
      properties:
        code:
          type: integer
          example: 200
        message:
          type: string
          example: Request successfully completed
        response:
          type: object
          properties:
            data:
              type: array
              items:
                $ref: '#/components/schemas/Invoice'
            count:
              type: integer
              example: 2

    CreateInvoiceResponse:
      type: object
      properties:
        code:
          type: integer
          example: 200
        message:
          type: string
          example: Data updated successfully
        response:
          type: object
          properties:
            updated:
              type: array
              items:
                type: string
              example:
                - invoice_item_ids
            data:
              $ref: '#/components/schemas/Invoice'

    UpdateInvoiceRequest:
      type: object
      properties:
        invoice_item_ids:
          type: array
          items:
            type: integer
          example:
            - 1
            - 2
            - 3
        invoice_state:
          type: string
          enum:
            - paid
          example: paid

    UpdateInvoiceResponse:
      allOf:
        - $ref: '#/components/schemas/SuccessUpdateResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                updated:
                  type: array
                  items:
                    type: string
                  example:
                    - invoice_state
                data:
                  $ref: '#/components/schemas/Invoice'

    IndexCustomerInvoicesResponse:
      description: Response after successfully retrieving customer invoices
      allOf:
        - $ref: '#/components/schemas/SuccessListResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                count:
                  description: Total number of returned records
                  type: integer
                  example: 42
                data:
                  description: Array of invoice entries
                  type: array
                  items:
                    $ref: '#/components/schemas/Invoice'

    ShowInvoiceResponse:
      description: Response after successfully retrieving an invoice
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Retrieved invoice
          $ref: '#/components/schemas/InvoiceWithItems'

    FixInvoiceVatResponse:
      description: Response after successfully recalculating VAT on a proforma invoice
      allOf:
        - $ref: '#/components/schemas/SuccessEnvelope'
        - type: object
          properties:
            response:
              description: Recalculated proforma invoice
              $ref: '#/components/schemas/Invoice'

    IndexCustomerInvoiceItemsResponse:
      description: Response after successfully retrieving unissued invoice items
      allOf:
        - $ref: '#/components/schemas/SuccessListResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                count:
                  description: Total number of returned records
                  type: integer
                  example: 42
                data:
                  description: Array of unissued invoice item entries
                  type: array
                  items:
                    $ref: '#/components/schemas/InvoiceItem'

    IndexInvoiceItemsResponse:
      description: Response after successfully retrieving invoice items for an invoice
      allOf:
        - $ref: '#/components/schemas/SuccessListResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                count:
                  description: Total number of returned records
                  type: integer
                  example: 42
                data:
                  description: Array of invoice item entries
                  type: array
                  items:
                    $ref: '#/components/schemas/InvoiceItem'

    ShowInvoiceItemResponse:
      description: Response after successfully retrieving an invoice item
      allOf:
        - $ref: '#/components/schemas/SuccessDataResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                data:
                  description: The invoice item record
                  $ref: '#/components/schemas/InvoiceItem'

    IndexPaymentMethodsResponse:
      description: Response after successfully retrieving customer payment methods
      allOf:
        - $ref: '#/components/schemas/SuccessListResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                count:
                  description: Total number of returned records
                  type: integer
                  example: 42
                data:
                  description: Array of payment method entries
                  type: array
                  items:
                    $ref: '#/components/schemas/PaymentMethod'

    ShowPaymentMethodResponse:
      description: Response after successfully retrieving a payment method
      allOf:
        - $ref: '#/components/schemas/SuccessDataResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                data:
                  description: The payment method record
                  $ref: '#/components/schemas/PaymentMethod'

    UpdatePaymentMethodRequest:
      description: Request body for updating a payment method
      type: object
      properties:
        is_default:
          description: >
            Whether this is the default payment method.
            When set to true, other payment methods for the same customer are automatically unset as default.
          type: boolean
          example: true
        description:
          description: Free-text description of the payment method (up to 250 characters)
          type: string
          example: My card ending in 4242

    DeletePaymentMethodResponse:
      description: Response after successfully deleting a payment method
      allOf:
        - $ref: '#/components/schemas/SuccessBooleanDataResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                data:
                  description: Deletion result

    IndexCustomerPaymentsResponse:
      description: Response after successfully retrieving customer payments
      allOf:
        - $ref: '#/components/schemas/SuccessListResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                count:
                  description: Total number of returned records
                  type: integer
                  example: 42
                data:
                  description: Array of payment entries
                  type: array
                  items:
                    $ref: '#/components/schemas/Payment'

    IndexCustomerDomainsResponse:
      description: Response after successfully retrieving customer domains
      allOf:
        - $ref: '#/components/schemas/SuccessListResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                count:
                  description: Total number of returned records
                  type: integer
                  example: 3
                data:
                  description: Array of customer domains
                  type: array
                  items:
                    $ref: '#/components/schemas/Domain'

    CreateDomainResponse:
      description: Response after successfully creating a domain
      allOf:
        - $ref: '#/components/schemas/SuccessUpdateResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                updated:
                  description: Input fields that were accepted and applied during creation
                  example:
                    - domain
                    - registration_type
                    - contacts_owner
                    - prepay_task_id
                    - nameserver
                    - auth_code
                data:
                  $ref: '#/components/schemas/Domain'

    CreateDomainPrepayResponse:
      description: Response after successfully creating a prepaid domain order
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Pending service created for the prepaid domain order
          allOf:
             - $ref: '#/components/schemas/Service'

    DomainPriceListItem:
      type: object
      properties:
        id:
          type: integer
          example: 1
        prgroup:
          type: integer
          example: 0
        suffix:
          type: string
          example: hu
        reg_price:
          type: string
          example: "1000.00"
        renew_price:
          type: string
          example: "800.00"
        transfer_price:
          type: string
          example: "900.00"
        karanten_price:
          type: string
          example: "1200.00"
        ochg_price:
          type: string
          example: "500.00"
        cc:
          type: string
          example: HUF
        regdata:
          nullable: true
          $ref: '#/components/schemas/DomainRegistrarTldData'

    PublicDomainTldPriceItem:
      description: Public price list entry for one domain TLD.
      type: object
      properties:
        tld:
          description: Domain suffix or public TLD label.
          type: string
          example: com
        register_price:
          description: Registration price for the TLD in the listed currency.
          type: string
          example: "3490.00"
        renewal_price:
          description: Renewal price for the TLD in the listed currency.
          type: string
          example: "3490.00"
        transfer_price:
          description: Transfer-in price for the TLD in the listed currency.
          type: string
          example: "3490.00"
        quarantine_price:
          description: Quarantine or redemption recovery price for the TLD in the listed currency.
          type: string
          example: "32000.00"
        currency:
          description: Currency code used by the returned prices.
          type: string
          example: HUF
      required:
        - tld
        - register_price
        - renewal_price
        - transfer_price
        - quarantine_price
        - currency

    DomainRegistrarTldData:
      type: object
      properties:
        id:
          type: integer
          example: 1
        tld:
          type: string
          example: hu
        min_reg_time:
          type: integer
          example: 1
        grace_period:
          type: integer
          example: 14
        redemption_period:
          type: integer
          example: 30
        contact_types:
          type: string
          nullable: true
          example: "owner:1:1 tech:1:1 admin:1:1"
        currency:
          type: string
          nullable: true
          example: HUF
        register_price:
          type: string
          nullable: true
          example: "1500.00"
        renew_pricex:
          type: string
          nullable: true
          example: "1200.00"
        transfer_pricex:
          type: string
          nullable: true
          example: "1300.00"
        quarantine_price:
          type: string
          nullable: true
          example: "1600.00"
        min_registration_years:
          type: integer
          example: 1
        max_registration_years:
          type: integer
          nullable: true
          example: 10

    IndexDomainPricesResponse:
      description: Response after successfully retrieving domain prices
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              description: Array of domain price list entries
              type: array
              items:
                $ref: '#/components/schemas/DomainPriceListItem'
            count:
              description: Total number of entries
              type: integer
              example: 42

    ListPublicDomainTldPricesResponse:
      description: Response after successfully retrieving the public domain TLD price list
      allOf:
        - $ref: '#/components/schemas/SuccessDataResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                data:
                  description: Array of public domain TLD price entries
                  type: array
                  items:
                    $ref: '#/components/schemas/PublicDomainTldPriceItem'

    Task:
      type: object
      properties:
        id:
          type: integer
          example: 1
        customer_id:
          type: integer
          nullable: true
          example: 1
        user_id:
          type: integer
          nullable: true
          example: 1
        created_at:
          type: string
          nullable: true
          example: '2026-07-17 10:15:00'
        activated_at:
          type: string
          nullable: true
          example: '2026-07-17 10:20:00'
        first_tried_at:
          type: string
          nullable: true
          example: '2026-07-17 10:25:00'
        last_tried_at:
          type: string
          nullable: true
          example: '2026-07-17 10:30:00'
        completed_at:
          type: string
          nullable: true
          example: '2026-07-17 10:35:00'
        visible:
          type: string
          enum:
            - 'N'
            - 'Y'
          example: 'Y'
        module:
          type: string
          nullable: true
          example: domain
        result:
          type: string
          nullable: true
          enum:
            - cancel
            - success
            - tryagain
            - fail
          example: success
        result1:
          type: string
          nullable: true
          example: item-paid
        result2:
          type: string
          nullable: true
          example: some detail
        result3:
          type: string
          nullable: true
          example: additional detail
        arg1:
          type: string
          nullable: true
          example: '9001'
        arg2:
          type: string
          nullable: true
          example: '9001'
        arg3:
          type: string
          nullable: true
          example: example.hu
        arg4:
          type: string
          nullable: true
          example: some data

    IndexDomainTasksResponse:
      allOf:
        - $ref: '#/components/schemas/SuccessListResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                count:
                  description: Total number of returned records
                  type: integer
                  example: 42
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/Task'

    IndexDomainRecordsResponse:
      description: Response after successfully retrieving domain DNS records
      allOf:
        - $ref: '#/components/schemas/SuccessListResponse'
        - type: object
          properties:
            response:
              $ref: '#/components/schemas/IndexDomainRecordsResponseData'

    IndexEmailsResponse:
      allOf:
        - $ref: '#/components/schemas/SuccessListResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                count:
                  description: Total number of returned records
                  type: integer
                  example: 42
                data:
                  description: Array of email entries
                  type: array
                  items:
                    $ref: '#/components/schemas/Email'

    IndexEmailVacationsResponse:
      allOf:
        - $ref: '#/components/schemas/SuccessListResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                count:
                  description: Total number of returned records
                  type: integer
                  example: 42
                data:
                  description: Array of email vacation entries
                  type: array
                  items:
                    $ref: '#/components/schemas/EmailVacation'

    IndexEmailAliasesResponse:
      allOf:
        - $ref: '#/components/schemas/SuccessListResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                count:
                  description: Total number of returned records
                  type: integer
                  example: 42
                data:
                  description: Array of email alias entries
                  type: array
                  items:
                    $ref: '#/components/schemas/EmailAlias'

    IndexWebhostingsResponse:
      description: Response after successfully retrieving customer webhostings
      allOf:
        - $ref: '#/components/schemas/SuccessListResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                count:
                  description: Total number of returned webhosting entries
                  type: integer
                  example: 1
                data:
                  description: Array of webhosting entries
                  type: array
                  items:
                    $ref: '#/components/schemas/Webhosting'

    IndexCpanelResponse:
      description: Response after successfully retrieving cPanel
      allOf:
        - $ref: '#/components/schemas/SuccessListResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                count:
                  description: Total number of returned records
                  type: integer
                  example: 42
                data:
                  description: Array of cPanel entries
                  type: array
                  items:
                    $ref: '#/components/schemas/Cpanel'

    ShowCpanelResponse:
      description: Response after successfully retrieving a cPanel
      allOf:
        - $ref: '#/components/schemas/SuccessEnvelope'
        - type: object
          properties:
            response:
              $ref: '#/components/schemas/Cpanel'

    DeleteFreeUserSecretResponse:
      description: Response after successfully marking a free-hosting user for deletion via its secret token
      allOf:
        - $ref: '#/components/schemas/SuccessEnvelope'
        - type: object
          properties:
            response:
              $ref: '#/components/schemas/FreeUser'

    ShowFreeUserSecretResponse:
      description: Response after successfully retrieving a free-hosting user by secret
      allOf:
        - $ref: '#/components/schemas/SuccessEnvelope'
        - type: object
          properties:
            response:
              $ref: '#/components/schemas/FreeUser'

    IndexWebhostingDomainsResponse:
      description: Response after successfully retrieving webhosting domains
      allOf:
        - $ref: '#/components/schemas/SuccessListResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                count:
                  description: Total number of returned records
                  type: integer
                  example: 42
                data:
                  description: Array of webhosting domain entries
                  type: array
                  items:
                    $ref: '#/components/schemas/WebhostingDomain'

    IndexWebhostingDatasharesResponse:
      description: Response after successfully retrieving webhosting data shares
      allOf:
        - $ref: '#/components/schemas/SuccessListResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                count:
                  description: Total number of returned records
                  type: integer
                  example: 42
                data:
                  description: Array of webhosting data-share entries
                  type: array
                  items:
                    $ref: '#/components/schemas/WebhostingDatashare'

    StoreWebhostingDatashareResponse:
      description: Response after successfully creating a webhosting data share
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Data updated successfully
        response:
          description: Response payload
          type: object
          properties:
            updated:
              description: List of fields accepted from the request and saved
              type: array
              items:
                type: string
              example:
                - username
                - password
                - readonly
                - path
            data:
              $ref: '#/components/schemas/WebhostingDatashare'

    DeleteWebhostingDatashareResponse:
      description: Response after successfully deleting a webhosting data share
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Record successfully removed
        response:
          description: Response payload
          type: object
          properties:
            data:
              description: Whether the delete operation succeeded
              type: boolean
              example: true

    ShowWebhostingDatashareResponse:
      description: Response after successfully retrieving a webhosting data share
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Retrieved data-share account
          $ref: '#/components/schemas/WebhostingDatashare'

    UpdateWebhostingDatashareResponse:
      description: Response after successfully updating a webhosting data share
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Data updated successfully
        response:
          description: Response payload
          type: object
          properties:
            updated:
              description: List of fields accepted from the request and saved
              type: array
              items:
                type: string
              example:
                - password
                - readonly
                - path
            data:
              $ref: '#/components/schemas/WebhostingDatashare'

    UpdateWebhostingTaskResponse:
      description: Response after successfully updating a webhosting task
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Data updated successfully
        response:
          description: Response payload
          type: object
          properties:
            updated:
              description: List of fields accepted from the request and saved.
              type: array
              items:
                type: string
              example: []
            data:
              $ref: '#/components/schemas/WebhostingTask'

    StoreWebhostingTaskResponse:
      description: Response after successfully creating a webhosting task
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Data updated successfully
        response:
          description: Response payload
          type: object
          properties:
            updated:
              description: List of fields accepted from the request and saved
              type: array
              items:
                type: string
              example:
                - url
                - interval_minutes
                - start_time
            data:
              $ref: '#/components/schemas/WebhostingTask'

    ShowWebhostingTaskResponse:
      description: Response after successfully retrieving a webhosting task
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Retrieved webhosting task
          $ref: '#/components/schemas/WebhostingTask'

    DeleteWebhostingTaskResponse:
      description: Response after successfully deleting a webhosting task
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Record successfully removed
        response:
          description: Response payload
          type: object
          properties:
            data:
              description: Whether the delete operation succeeded
              type: boolean
              example: true

    IndexWebhostingTasksResponse:
      description: Response after successfully retrieving webhosting tasks
      allOf:
        - $ref: '#/components/schemas/SuccessListResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                count:
                  description: Total number of returned records
                  type: integer
                  example: 42
                data:
                  description: Array of webhosting task entries
                  type: array
                  items:
                    $ref: '#/components/schemas/WebhostingTask'

    IndexWebhostingDatabasesResponse:
      description: Response after successfully retrieving webhosting databases
      allOf:
        - $ref: '#/components/schemas/SuccessListResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                count:
                  description: Total number of returned records
                  type: integer
                  example: 42
                data:
                  description: Array of webhosting database entries
                  type: array
                  items:
                    $ref: '#/components/schemas/WebhostingDatabase'

    StoreWebhostingDatabaseResponse:
      description: Response after successfully creating a webhosting database
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Data updated successfully
        response:
          description: Response payload
          type: object
          properties:
            updated:
              description: List of fields accepted from the request and saved
              type: array
              items:
                type: string
              example:
                - database
                - password
            data:
              $ref: '#/components/schemas/WebhostingDatabase'

    DeleteWebhostingDatabaseResponse:
      description: Response after successfully deleting a webhosting database
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Record successfully removed
        response:
          description: Response payload
          type: object
          properties:
            data:
              description: Whether the delete operation succeeded
              type: boolean
              example: true

    ShowWebhostingDatabaseResponse:
      description: Response after successfully retrieving a webhosting database
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              $ref: '#/components/schemas/WebhostingDatabase'

    StoreWebhostingDomainResponse:
      description: Response after successfully creating a webhosting domain
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Data updated successfully
        response:
          description: Response payload
          type: object
          properties:
            updated:
              description: List of fields updated by the request
              type: array
              items:
                type: string
              example:
                - domain
                - path
                - php_version
                - dkim_private
            data:
              $ref: '#/components/schemas/WebhostingDomain'

    DeleteWebhostingDomainResponse:
      description: Response after successfully deleting a webhosting domain
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Record successfully removed
        response:
          description: Response payload
          type: object
          properties:
            data:
              $ref: '#/components/schemas/WebhostingDomain'

    ShowWebhostingDomainResponse:
      description: Response after successfully retrieving a webhosting domain
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              $ref: '#/components/schemas/WebhostingDomain'

    InstallWebhostingDomainSoftwareResponse:
      description: Response after successfully installing software on a hosted domain
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Installation result details
          type: object
          properties:
            username:
              description: Username of the API user who triggered the install
              type: string
              example: john.doe
            software:
              description: Installed software package
              type: string
              example: wordpress
            db:
              description: Created database name
              type: string
              example: userteszt_wordpress0
            path:
              description: Requested install path relative to the domain root
              type: string
              example: /blog
            domain:
              description: Final installed domain URL
              type: string
              example: https://blog.example.com

    ShowWebhostingDomainCertificateResponse:
      description: Response after successfully retrieving a hosted domain certificate
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Stored certificate details
          type: object
          properties:
            certificate:
              description: Full certificate chain in PEM format
              type: string
              example: "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----"
            expiry:
              description: Certificate expiry as a Unix timestamp
              type: integer
              example: 1784620800

    UpdateWebhostingDomainCertificateResponse:
      description: Response after successfully storing a hosted domain certificate
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Empty response payload
          type: object
          properties: {}

    IndexVpsResponse:
      description: Response after successfully retrieving customer VPS instances
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              description: Array of VPS entries
              type: array
              items:
                $ref: '#/components/schemas/VPS'
            count:
              description: Total number of VPS instances
              type: integer
              example: 42

    StoreVpsResponse:
      description: Response after successfully creating a VPS instance
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Data updated successfully
        response:
          description: Response payload
          type: object
          properties:
            updated:
              description: List of fields updated by the request
              type: array
              items:
                type: string
              example:
                - service_invoice_interval_months
                - service_currency
                - ram_size_mb
                - cpu_count
                - ssd_size_gb
                - hdd_size_gb
            data:
              $ref: '#/components/schemas/VPS'

    CreateVpsPrepayResponse:
      description: Response after successfully creating a prepaid VPS order
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Pending service created for the prepaid VPS order
          type: object
          properties:
            data:
              $ref: '#/components/schemas/Service'

    DeleteVpsResponse:
      description: Response after successfully deleting a VPS instance
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Record successfully removed
        response:
          description: Response payload
          type: object
          properties:
            data:
              $ref: '#/components/schemas/VPS'

    UpdateVpsImageResponse:
      description: Response after successfully setting the VPS image
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties: {}

    VpsImage:
      description: Available VPS image entry.
      type: object
      properties:
        id:
          description: ID of the VPS image
          type: integer
          example: 552789
        name:
          description: Internal image name used by VPS image selection routes.
          type: string
          example: debian-12
        full_name:
          description: Human-readable image name.
          type: string
          example: Debian 12
        method:
          description: Optional install method metadata.
          type: string
          nullable: true
          example:
            - cloudinit
        admin_user:
          description: Default administrator username when provided by the image definition.
          type: string
          nullable: true
          example: null
        min_disk_mib:
          description: Minimum required system disk size in MiB.
          type: integer
          example: 0
        created_at:
          description: When the image was created.
          type: string
          example: "2026-07-16 12:55:38"
        updated_at:
          description: When the image was last updated.
          type: string
          example: "2026-07-16 12:55:38"

    ListVpsImagesResponse:
      description: Response after successfully retrieving available VPS images
      allOf:
        - $ref: '#/components/schemas/SuccessListResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                count:
                  description: Total number of returned records
                  type: integer
                  example: 8
                data:
                  description: Array of available VPS images
                  type: array
                  items:
                    $ref: '#/components/schemas/VpsImage'
          example:
            code: 200
            message: Request successfully completed
            response:
              data:
                - id: 200991
                  name: windows-2019
                  full_name: Windows 2019
                  method: null
                  admin_user: null
                  min_disk_mib: 0
                  created_at: "2026-07-16 12:55:38"
                  updated_at: "2026-07-16 12:55:38"
                - id: 552789
                  name: debian-12
                  full_name: Debian 12
                  method: null
                  admin_user: null
                  min_disk_mib: 0
                  created_at: "2026-07-16 12:55:38"
                  updated_at: "2026-07-16 12:55:38"
              count: 8

    CreateVpsVncResponse:
      description: Response after successfully creating VPS console access data
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              $ref: '#/components/schemas/VpsVncData'

    IndexVpsDisksResponse:
      description: Response after successfully retrieving VPS disks
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              description: Array of VPS disk entries
              type: array
              items:
                $ref: '#/components/schemas/VpsDisk'
            count:
              description: Total number of VPS disks
              type: integer
              example: 2

    IndexVpsInterfacesResponse:
      description: Response after successfully retrieving VPS interfaces
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              description: Array of VPS interface entries
              type: array
              items:
                $ref: '#/components/schemas/VpsInterface'
            count:
              description: Total number of VPS interfaces
              type: integer
              example: 2

    IndexVpsTasksResponse:
      description: Response after successfully retrieving VPS tasks
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              description: Array of VPS task entries
              type: array
              items:
                $ref: '#/components/schemas/VpsTask'
            count:
              description: Total number of VPS tasks
              type: integer
              example: 42

    StoreVpsDiskResponse:
      description: Response after successfully creating a VPS disk
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Data updated successfully
        response:
          description: Response payload
          type: object
          properties:
            updated:
              description: List of fields accepted from the request and saved
              type: array
              items:
                type: string
              example:
                - name
                - size_mib
                - type
                - sla
                - bus
                - boot
            data:
              $ref: '#/components/schemas/VpsDisk'

    StoreVpsTaskResponse:
      description: Response after successfully creating a VPS task
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Data updated successfully
        response:
          description: Response payload
          type: object
          properties:
            updated:
              description: List of fields accepted from the request and saved
              type: array
              items:
                type: string
              example:
                - command
                - password
                - os
                - systemdisk
            data:
              $ref: '#/components/schemas/VpsTask'

    ShowVpsTaskResponse:
      description: Response after successfully retrieving a VPS task
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              $ref: '#/components/schemas/VpsTask'

    DeleteVpsDiskResponse:
      description: Response after successfully deleting a VPS disk
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Record successfully removed
        response:
          description: Response payload
          type: object
          properties:
            data:
              description: Whether the delete operation succeeded
              type: boolean
              example: true

    ShowVpsDiskResponse:
      description: Response after successfully retrieving a VPS disk
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              $ref: '#/components/schemas/VpsDisk'

    ShowVpsInterfaceResponse:
      description: Response after successfully retrieving a VPS interface
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              $ref: '#/components/schemas/VpsInterface'

    UpdateVpsInterfaceResponse:
      description: Response after successfully updating a VPS interface
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Data updated successfully
        response:
          description: Response payload
          type: object
          properties:
            updated:
              description: List of fields accepted from the request and saved
              type: array
              items:
                type: string
              example:
                - hw_model
            data:
              $ref: '#/components/schemas/VpsInterface'

    GetVpsInterfaceStatsResponse:
      description: Response after successfully retrieving VPS interface statistics
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Traffic statistics payload returned by this route.
          type: object
          additionalProperties: true
          example:
            results:
              - series:
                  - name: net
                    columns:
                      - time
                      - recv
                      - sent
                    values:
                      - ['2026-07-21T10:00:00Z', 1024, 512]
        response:
          description: Legacy literal response payload returned by this route.
          type: string
          example: data

    ShowVpsResponse:
      description: Response after successfully retrieving a VPS instance
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              $ref: '#/components/schemas/VPS'

    ShowWebhostingResponse:
      description: Response after successfully retrieving a webhosting account
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              $ref: '#/components/schemas/Webhosting'

    ListWebhostingBackupsResponse:
      description: Response after successfully retrieving available webhosting backup dates
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Available backup dates
          type: array
          items:
            type: string
            example: '2026-07-20'

    GetWebhostingBackupResponse:
      description: Response after successfully retrieving a webhosting backup
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Backup retrieval result
          type: array
          items:
            type: string
            example: 2026-06-01

    IndexWebhostingFtpLogsResponse:
      description: Response after successfully retrieving webhosting FTP log entries
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              description: Array of FTP log entries
              type: array
              items:
                $ref: '#/components/schemas/WebhostingFtpLog'
            count:
              description: Total number of FTP log entries
              type: integer
              example: 42

    StoreWebhostingResponse:
      description: Response after successfully creating a webhosting account
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Data updated successfully
        response:
          description: Response payload
          type: object
          properties:
            updated:
              description: List of fields updated by the request
              type: array
              items:
                type: string
              example:
                - disk_quota_kb
                - sql_quota_kb
                - email_quota_mb
                - password
            data:
              $ref: '#/components/schemas/Webhosting'

    DeleteWebhostingResponse:
      description: Response after successfully deleting a webhosting account
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Record successfully removed
        response:
          description: Response payload
          type: object
          properties:
            data:
              $ref: '#/components/schemas/Webhosting'

    CreateWebhostingPrepayResponse:
      description: Response after successfully creating a prepaid webhosting order
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Pending service created for the prepaid webhosting order
          type: object
          properties:
            data:
              $ref: '#/components/schemas/Service'

    BalanceEntry:
      description: A balance entry
      type: object
      properties:
        amount:
          description: Amount of given balance entry
          type: number
          example: 1000
        currency:
          description: Currency code. HUF, EUR, USD represent refund balances. CREDIT-HUF, CREDIT-EUR, CREDIT-USD represent credit balances created when paying invoices via the credit payment method.
          type: string
          enum:
            - HUF
            - EUR
            - USD
            - CREDIT-HUF
            - CREDIT-EUR
            - CREDIT-USD
          example: HUF
        company:
          description: Company the  balance is under, irrelevant for most endusers
          type: string
          enum:
            - ATW
          example: ATW
      required:
        - amount
        - currency
        - company

    BalanceIndexResponse:
      description: Response after successfully retrieving customer balances
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              description: Array of balance entries grouped by currency and company
              type: array
              items:
                $ref: '#/components/schemas/BalanceEntry'
            count:
              description: Total number of balance entries
              type: integer
              example: 42

    PlanWH:
      description: A webhosting plan
      type: object
      properties:
        name:
          description: Name of the plan
          type: string
          example: STANDARD
        disk_quota_mb:
          description: Amount of disk space
          type: integer
          example: 5120
        sql_quota_mb:
          description: Amount of allowed SQL database space
          type: integer
          example: 1024
        email_quota_mb:
          description: Amount of disk space reserved for email
          type: integer
          example: 1024
        domain_limit:
          description: Amount of domains this webhosting can have
          type: integer
          example: 50
        datashare_limit:
          description: Amount of FTP accounts this webhosting can have
          type: integer
          example: 1
        invoice_interval_months:
          description: How many months to bill this plan for
          type: integer
          example: 12
        currency:
          description: Billing currency
          type: string
          example: HUF
        description:
          description: Description with details
          type: string
          example: "5.12 GB WEBTÁRHELY, 1.02 GB MYSQL TÁRHELY, 1.02 GB E-MAIL TÁRHELY"

    PlanVS:
      description: A plan for a virtual private server
      type: object
      properties:
        name:
          description: Name of the plan
          type: string
          example: STANDARD
        cpu_count:
          description: Amount of vCPU cores, or for dedicated CPU cores.
          type: integer
          example: 2
        cpu_model:
          description: Model of the CPU
          type: string
          enum:
            - Broadwell
            - EPYC-Rome
            - Ryzen-7950X-dedicated
          example: Broadwell
        ssd_size_gb:
          description: Size of the SSD quota
          type: integer
          example: 50
        hdd_size_gb:
          description: Size of the HDD quota
          type: integer
          nullable: true
          example: null
        ram_size_mb:
          description: RAM size
          type: integer
          example: 4096
        invoice_interval_months:
          description: Billing period
          type: integer
          example: 12
        currency:
          description: Billing currency
          type: string
          example: HUF
        extra_ip_count:
          description: Amount of extra IPS (IPv4 and IPv6)
          type: integer
          nullable: true
          example: null
        ip_count:
          description: IP count
          type: integer
          example: 1
        bandwidth_tb_per_month:
          description: Allowed bandwidth based on IP count
          type: integer
          example: 20
        description:
          description: Description with more detail
          type: string
          example: "2 CPU Broadwell, 4096 MB RAM, 50 GB SSD, 1 IPV4"
    PlanHWRENT:
      type: object
      properties:
        name:
          type: string
          example: STANDARD
        bandwidth_mbps:
          type: integer
          example: 300
        cpu_type:
          type: string
          nullable: true
          example: null
        drive:
          type: array
          nullable: true
          items:
            type: object
        ram_size_gb:
          type: integer
          nullable: true
          example: null
        ip_count:
          type: integer
          example: 1
        invoice_interval_months:
          type: integer
          example: 12
        currency:
          type: string
          example: HUF
        description:
          type: string
          example: "Co-location"
        selected:
          type: object
          nullable: true
        config_availability:
          type: object
          nullable: true

    PlanIP:
      description: A plan for IP
      type: object
      properties:
        name:
          type: string
          example: STANDARD
        ip_count:
          type: integer
          example: 4
        invoice_interval_months:
          type: integer
          example: 12
        currency:
          type: string
          example: HUF
        description:
          type: string
          example: "4 DB IP CÍM, tartományok: (/32 /31)"

    VsProductRequest:
      description: Pricing input for `type=vs`.
      type: object
      properties:
        currency:
          type: string
          enum:
            - HUF
            - EUR
            - USD
          example: HUF
        invoice_interval_months:
          type: string
          enum:
            - "1"
            - "3"
            - "6"
            - "12"
            - "24"
          example: "12"
        cpu_count:
          type: integer
          minimum: 1
          maximum: 16
          example: 2
        cpu_model:
          type: string
          enum:
            - Broadwell
            - EPYC-Rome
            - Ryzen-7950X-dedicated
          example: Broadwell
        ssd_size_gb:
          type: integer
          minimum: 10
          maximum: 5000
          example: 50
        hdd_size_gb:
          type: integer
          minimum: 0
          maximum: 20000
          example: 0
        ram_size_mb:
          type: integer
          minimum: 1024
          maximum: 131072
          example: 4096
        extra_ip_count:
          type: integer
          enum:
            - 0
            - 1
            - 2
            - 4
            - 8
            - 16
            - 32
            - 64
          example: 0
        pkg_version:
          type: string
          enum:
            - "2"
            - "3"
            - "4"
            - "5"
          example: "5"
        coupon_code:
          type: string
          example: "2024-04_sale_50"
      required:
        - currency
        - invoice_interval_months
        - cpu_count
        - cpu_model
        - ssd_size_gb
        - ram_size_mb

    WhProductRequest:
      description: Pricing input for `type=wh`.
      type: object
      properties:
        currency:
          type: string
          enum:
            - HUF
            - EUR
            - USD
          example: HUF
        invoice_interval_months:
          type: string
          enum:
            - "1"
            - "3"
            - "6"
            - "12"
            - "24"
          example: "12"
        disk_quota_mb:
          type: integer
          minimum: 100
          maximum: 3000000
          example: 5120
        sql_quota_mb:
          type: integer
          minimum: 0
          maximum: 3000000
          example: 1024
        email_quota_mb:
          type: integer
          minimum: 100
          maximum: 4000000
          example: 1024
        domain_limit:
          type: number
          minimum: 0
          maximum: 5000
          example: 10
        datashare_limit:
          type: integer
          minimum: 0
          maximum: 200
          example: 1
        coupon_code:
          type: string
          example: "2025-12_sale_50"
      required:
        - currency
        - invoice_interval_months
        - disk_quota_mb
        - sql_quota_mb
        - email_quota_mb

    CustomWhProductRequest:
      description: Pricing input for `type=custom-wh`. This currently uses the same input fields as `type=wh`.
      allOf:
        - $ref: '#/components/schemas/WhProductRequest'

    WordpressWhProductRequest:
      description: Pricing input for `type=wordpress-wh`.
      type: object
      properties:
        currency:
          type: string
          enum:
            - HUF
            - EUR
            - USD
          example: HUF
        invoice_interval_months:
          type: string
          enum:
            - "1"
            - "3"
            - "6"
            - "12"
            - "24"
          example: "12"
        disk_quota_gb:
          type: integer
          minimum: 10
          maximum: 3000
          example: 50
        coupon_code:
          type: string
          example: "promo-code"
      required:
        - currency
        - invoice_interval_months
        - disk_quota_gb

    CpanelWhProductRequest:
      description: Pricing input for `type=cpanel-wh`.
      allOf:
        - $ref: '#/components/schemas/WordpressWhProductRequest'

    DedicatedWhProductRequest:
      description: Pricing input for `type=dedicated-wh`.
      allOf:
        - $ref: '#/components/schemas/WordpressWhProductRequest'

    HwrentDriveSelection:
      type: object
      properties:
        id:
          type: string
          example: SSD_SATA_480
      required:
        - id

    HwrentProductRequest:
      description: Pricing input for `type=hwrent`. Use either `config_name` for a predefined hardware configuration or `cpu_type` + `drive` + `ram_size_gb` for a component-based configuration.
      type: object
      properties:
        currency:
          type: string
          enum:
            - HUF
            - EUR
            - USD
          example: HUF
        invoice_interval_months:
          type: string
          enum:
            - "1"
            - "3"
            - "6"
            - "12"
            - "24"
          example: "12"
        bandwidth_mbps:
          type: integer
          enum:
            - 300
          example: 300
        ip_count:
          type: integer
          enum:
            - 0
            - 1
            - 2
            - 4
            - 8
            - 16
            - 32
            - 64
          example: 1
        config_name:
          type: string
          example: SERVER_STD_1
        cpu_type:
          type: string
          example: XEON_E5_2620_V4
        drive:
          type: array
          items:
            $ref: '#/components/schemas/HwrentDriveSelection'
          example:
            - id: SSD_SATA_480
            - id: SSD_SATA_480
        ram_size_gb:
          type: integer
          enum:
            - 4
            - 8
            - 16
            - 24
            - 32
            - 48
            - 64
            - 128
          example: 32
      required:
        - currency
        - invoice_interval_months

    IpProductRequest:
      description: Pricing input for `type=ip`.
      type: object
      properties:
        currency:
          type: string
          enum:
            - HUF
            - EUR
            - USD
          example: HUF
        invoice_interval_months:
          type: string
          enum:
            - "1"
            - "3"
            - "6"
            - "12"
            - "24"
          example: "12"
        ip_count:
          type: number
          minimum: 1
          maximum: 256
          example: 4
      required:
        - currency
        - invoice_interval_months
        - ip_count

    BackupProductRequest:
      description: Pricing input for `type=backup`.
      type: object
      properties:
        currency:
          type: string
          enum:
            - HUF
            - EUR
            - USD
          example: HUF
        invoice_interval_months:
          type: string
          enum:
            - "1"
            - "3"
            - "6"
            - "12"
            - "24"
          example: "12"
        size_gb:
          type: integer
          minimum: 200
          maximum: 100000
          example: 1000
      required:
        - currency
        - invoice_interval_months
        - size_gb

    DomainProductRequest:
      description: Pricing input for `type=domain`. `years` is required for `register` and `renew`, and must be omitted or `0` for `transfer`, `restore`, and `ownerchange`.
      type: object
      properties:
        currency:
          type: string
          enum:
            - HUF
            - EUR
            - USD
          example: HUF
        operation:
          type: string
          enum:
            - register
            - renew
            - transfer
            - restore
            - ownerchange
          example: register
        years:
          type: integer
          minimum: 1
          maximum: 10
          example: 1
        domain:
          type: string
          example: example.hu
      required:
        - currency
        - operation
        - domain

    RackUnitProductRequest:
      description: Pricing input for `type=rack_unit`.
      type: object
      properties:
        currency:
          type: string
          enum:
            - HUF
            - EUR
            - USD
          example: HUF
        invoice_interval_months:
          type: string
          enum:
            - "1"
            - "3"
            - "6"
            - "12"
          example: "12"
        unit_count:
          type: number
          minimum: 1
          maximum: 42
          example: 2
        datacenter:
          type: string
          enum:
            - DL1
            - DL2
            - HA
            - EXPO
          example: DL2
      required:
        - currency
        - invoice_interval_months
        - unit_count
        - datacenter

    DdosProductRequest:
      description: Pricing input for `type=ddos`. `ip_count` and `bandwidth_mbps` default to `16` and `500` when omitted.
      type: object
      properties:
        currency:
          type: string
          enum:
            - HUF
            - EUR
            - USD
          example: HUF
        invoice_interval_months:
          type: string
          enum:
            - "1"
            - "3"
            - "6"
            - "12"
            - "24"
          example: "12"
        bandwidth_mbps:
          type: integer
          enum:
            - 500
          example: 500
        ip_count:
          type: integer
          enum:
            - 16
          example: 16
      required:
        - currency
        - invoice_interval_months

    SmtpProductRequest:
      description: Pricing input for `type=smtp`.
      type: object
      properties:
        currency:
          type: string
          enum:
            - HUF
            - EUR
            - USD
          example: HUF
        invoice_interval_months:
          type: string
          enum:
            - "1"
            - "3"
            - "6"
            - "12"
            - "24"
          example: "12"
      required:
        - currency
        - invoice_interval_months

    SslProductRequest:
      description: Pricing input for `type=ssl`.
      type: object
      properties:
        currency:
          type: string
          enum:
            - HUF
            - EUR
            - USD
          example: HUF
        invoice_interval_months:
          type: string
          enum:
            - "12"
          example: "12"
        type:
          type: string
          enum:
            - rapidssl
            - rapidsslwc
            - sectigossl
            - trbid
            - trbid_ev
            - trbid_wc
          example: rapidssl
      required:
        - currency
        - invoice_interval_months
        - type

    InternetProductRequest:
      description: Pricing input for `type=internet`.
      type: object
      properties:
        currency:
          type: string
          enum:
            - HUF
            - EUR
            - USD
          example: HUF
        invoice_interval_months:
          type: string
          enum:
            - "1"
            - "3"
          example: "1"
        port_speed_mbps:
          type: number
          enum:
            - 1000
            - 10000
          example: 1000
        bandwidth_mbps:
          type: number
          enum:
            - 0
            - 100
            - 300
            - 1000
          example: 300
      required:
        - currency
        - invoice_interval_months
        - port_speed_mbps
        - bandwidth_mbps

    ElectricityProductRequest:
      description: Pricing input for `type=electricity`.
      type: object
      properties:
        currency:
          type: string
          enum:
            - HUF
            - EUR
            - USD
          example: HUF
        invoice_interval_months:
          type: string
          enum:
            - "1"
            - "3"
          example: "1"
        datacenter:
          type: string
          enum:
            - DL1
            - DL2
            - HA
            - EXPO
            - VHS
          example: DL2
        wattage:
          type: number
          minimum: 0
          example: 250
      required:
        - currency
        - invoice_interval_months
        - datacenter
        - wattage

    ServerHostingProductRequest:
      description: Pricing input for `type=sh`. For `server_type=rack`, supply `unit_count`. For `server_type=pc`, supply `pc_width_cm` and `pc_height_cm`. Optional `port_speed_mbps`/`bandwidth_mbps` add internet pricing, and optional `ip_count` adds extra IP pricing.
      type: object
      properties:
        currency:
          type: string
          enum:
            - HUF
            - EUR
            - USD
          example: HUF
        invoice_interval_months:
          type: string
          enum:
            - "1"
            - "3"
            - "12"
          example: "1"
        datacenter:
          type: string
          enum:
            - DL1
            - DL2
            - HA
            - VHS
            - EXPO
          example: HA
        server_type:
          type: string
          enum:
            - rack
            - pc
          example: rack
        wattage:
          type: number
          minimum: 0
          example: 300
        unit_count:
          type: number
          minimum: 1
          maximum: 42
          example: 2
        pc_width_cm:
          type: number
          minimum: 1
          maximum: 50
          example: 20
        pc_height_cm:
          type: number
          minimum: 1
          maximum: 60
          example: 45
        port_speed_mbps:
          type: number
          enum:
            - 1000
            - 10000
          example: 1000
        bandwidth_mbps:
          type: number
          enum:
            - 0
            - 100
            - 300
            - 1000
          example: 300
        ip_count:
          type: number
          minimum: 1
          maximum: 256
          example: 4
      required:
        - currency
        - invoice_interval_months
        - datacenter
        - server_type
        - wattage

    PlanDomain:
      description: A plan for a Domain
      type: object
      properties:
        name:
          description: Name
          type: string
          example: HU
        suffix:
          description: .tld
          type: string
          example: .hu
        register_price:
          description: Price to register
          type: number
          example: 2500
        renew_price:
          description: Price to renew
          type: number
          example: 3500
        restore_price:
          description: Price to restore from quarantine
          type: number
          example: 5000
        ownerchange_price:
          description: Price to change owners (inhouse)
          type: number
          example: 1500
        transfer_price:
          description: Price to transfer from-to another registrator
          type: number
          example: 2500
        cc:
          description: currency
          type: string
          example: HUF
        description:
          description: Description of the plan
          type: string
          example: "HU DOMAIN regisztráció"

    CustomerPlansResponse:
      description: Response after successfully retrieving customer plans
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Response payload
          type: object
          properties:
            data:
              type: object
              properties:
                vat:
                  description: Customer's applicable VAT rate
                  type: number
                  example: 27
                wh:
                  description: Webhosting plans
                  type: array
                  items:
                    $ref: '#/components/schemas/PlanWH'
                vs:
                  description: VPS plans
                  type: array
                  items:
                    $ref: '#/components/schemas/PlanVS'
                hwrent:
                  description: Hardware rental plans
                  type: array
                  items:
                    $ref: '#/components/schemas/PlanHWRENT'
                ip:
                  description: IP address plans
                  type: array
                  items:
                    $ref: '#/components/schemas/PlanIP'
                domain:
                  description: Domain plans
                  type: array
                  items:
                    $ref: '#/components/schemas/PlanDomain'
              required:
                - vat
                - wh
                - vs
                - hwrent
                - ip
                - domain

    CustomPlanPriceComputedFields:
      description: Common computed pricing fields returned for all custom plan price responses.
      type: object
      properties:
        product_id:
          description: Product identifier for the selected plan.
          type: string
          example: "VS-12-12-VS"
        price:
          description: Computed price after customer-specific discount handling.
          type: number
          example: 5000
        undiscounted_price:
          description: Computed price without customer-specific discount handling.
          type: number
          example: 5500
        coupon_price:
          description: Coupon-discounted price when the supplied coupon code is recognized; otherwise `false`.
          oneOf:
            - type: number
              example: 4500
            - type: boolean
              enum:
                - false
              example: false
        vat:
          description: Customer VAT rate used when returning the offer.
          type: number
          example: 27
      required:
        - product_id
        - price
        - undiscounted_price
        - coupon_price
        - vat

    VsCustomPlanPriceData:
      description: Response payload for `type=vs`.
      allOf:
        - $ref: '#/components/schemas/VsProductRequest'
        - $ref: '#/components/schemas/CustomPlanPriceComputedFields'
        - type: object
          properties:
            ip_count:
              type: integer
              example: 1
            bandwidth_tb_per_month:
              type: integer
              example: 20
            description:
              type: string
              example: "2 CPU Broadwell, 4096 MB RAM, 50 GB SSD, 1 IPV4"
            request:
              $ref: '#/components/schemas/VsProductRequest'
          required:
            - description
            - request

    WhCustomPlanPriceData:
      description: Response payload for `type=wh`.
      allOf:
        - $ref: '#/components/schemas/WhProductRequest'
        - $ref: '#/components/schemas/CustomPlanPriceComputedFields'
        - type: object
          properties:
            description:
              type: string
              example: "5.12 GB WEBTÁRHELY, 1.02 GB MYSQL TÁRHELY, 1.02 GB E-MAIL TÁRHELY"
            request:
              $ref: '#/components/schemas/WhProductRequest'
          required:
            - description
            - request

    CustomWhCustomPlanPriceData:
      description: Response payload for `type=custom-wh`.
      allOf:
        - $ref: '#/components/schemas/CustomWhProductRequest'
        - $ref: '#/components/schemas/CustomPlanPriceComputedFields'
        - type: object
          properties:
            description:
              type: string
              example: "5.12 GB WEBTÁRHELY, 1.02 GB MYSQL TÁRHELY, 1.02 GB E-MAIL TÁRHELY"
            request:
              $ref: '#/components/schemas/CustomWhProductRequest'
          required:
            - description
            - request

    WordpressWhCustomPlanPriceData:
      description: Response payload for `type=wordpress-wh`.
      allOf:
        - $ref: '#/components/schemas/WordpressWhProductRequest'
        - $ref: '#/components/schemas/CustomPlanPriceComputedFields'
        - type: object
          properties:
            description:
              type: string
              example: "50 GB TÁRHELY"
            request:
              $ref: '#/components/schemas/WordpressWhProductRequest'
          required:
            - description
            - request

    CpanelWhCustomPlanPriceData:
      description: Response payload for `type=cpanel-wh`.
      allOf:
        - $ref: '#/components/schemas/CpanelWhProductRequest'
        - $ref: '#/components/schemas/CustomPlanPriceComputedFields'
        - type: object
          properties:
            description:
              type: string
              example: "50 GB TÁRHELY"
            request:
              $ref: '#/components/schemas/CpanelWhProductRequest'
          required:
            - description
            - request

    DedicatedWhCustomPlanPriceData:
      description: Response payload for `type=dedicated-wh`.
      allOf:
        - $ref: '#/components/schemas/DedicatedWhProductRequest'
        - $ref: '#/components/schemas/CustomPlanPriceComputedFields'
        - type: object
          properties:
            description:
              type: string
              example: "50 GB TÁRHELY"
            request:
              $ref: '#/components/schemas/DedicatedWhProductRequest'
          required:
            - description
            - request

    HwrentCustomPlanPriceData:
      description: Response payload for `type=hwrent`.
      allOf:
        - $ref: '#/components/schemas/HwrentProductRequest'
        - $ref: '#/components/schemas/CustomPlanPriceComputedFields'
        - type: object
          properties:
            description:
              type: string
              example: "Co-location, 1 GBit/s network connection, 300 MBit/s bandwidth, 1 IPV4"
            selected:
              type: object
              nullable: true
            config_availability:
              type: object
              nullable: true
            request:
              $ref: '#/components/schemas/HwrentProductRequest'
          required:
            - description
            - request

    IpCustomPlanPriceData:
      description: Response payload for `type=ip`.
      allOf:
        - $ref: '#/components/schemas/IpProductRequest'
        - $ref: '#/components/schemas/CustomPlanPriceComputedFields'
        - type: object
          properties:
            description:
              type: string
              example: "4 DB IP CÍM, tartományok: (/32 /31)"
            request:
              $ref: '#/components/schemas/IpProductRequest'
          required:
            - description
            - request

    BackupCustomPlanPriceData:
      description: Response payload for `type=backup`.
      allOf:
        - $ref: '#/components/schemas/BackupProductRequest'
        - $ref: '#/components/schemas/CustomPlanPriceComputedFields'
        - type: object
          properties:
            description:
              type: string
              example: "1000 GB"
            request:
              $ref: '#/components/schemas/BackupProductRequest'
          required:
            - description
            - request

    DomainCustomPlanPriceData:
      description: Response payload for `type=domain`.
      allOf:
        - $ref: '#/components/schemas/DomainProductRequest'
        - $ref: '#/components/schemas/CustomPlanPriceComputedFields'
        - type: object
          properties:
            description:
              type: string
              example: "HU DOMAIN REGISZTRÁCIÓ"
            request:
              $ref: '#/components/schemas/DomainProductRequest'
          required:
            - description
            - request

    RackUnitCustomPlanPriceData:
      description: Response payload for `type=rack_unit`.
      allOf:
        - $ref: '#/components/schemas/RackUnitProductRequest'
        - $ref: '#/components/schemas/CustomPlanPriceComputedFields'
        - type: object
          properties:
            description:
              type: string
              example: "2U rack"
            request:
              $ref: '#/components/schemas/RackUnitProductRequest'
          required:
            - description
            - request

    DdosCustomPlanPriceData:
      description: Response payload for `type=ddos`.
      allOf:
        - $ref: '#/components/schemas/DdosProductRequest'
        - $ref: '#/components/schemas/CustomPlanPriceComputedFields'
        - type: object
          properties:
            description:
              type: string
              example: "DDOS VÉDELEM 500Mbit/s SÁVSZÉLESSÉGIG 16 IP CÍMRE"
            request:
              $ref: '#/components/schemas/DdosProductRequest'
          required:
            - description
            - request

    SmtpCustomPlanPriceData:
      description: Response payload for `type=smtp`.
      allOf:
        - $ref: '#/components/schemas/SmtpProductRequest'
        - $ref: '#/components/schemas/CustomPlanPriceComputedFields'
        - type: object
          properties:
            description:
              type: string
              example: "SMTP"
            request:
              $ref: '#/components/schemas/SmtpProductRequest'
          required:
            - description
            - request

    SslCustomPlanPriceData:
      description: Response payload for `type=ssl`.
      allOf:
        - $ref: '#/components/schemas/SslProductRequest'
        - $ref: '#/components/schemas/CustomPlanPriceComputedFields'
        - type: object
          properties:
            description:
              type: string
              example: "RAPIDSSL CERTIFICATE"
            request:
              $ref: '#/components/schemas/SslProductRequest'
          required:
            - description
            - request

    InternetCustomPlanPriceData:
      description: Response payload for `type=internet`.
      allOf:
        - $ref: '#/components/schemas/InternetProductRequest'
        - $ref: '#/components/schemas/CustomPlanPriceComputedFields'
        - type: object
          properties:
            description:
              type: string
              example: "300 MBPS KAPCSOLAT"
            request:
              $ref: '#/components/schemas/InternetProductRequest'
          required:
            - description
            - request

    ElectricityCustomPlanPriceData:
      description: Response payload for `type=electricity`.
      allOf:
        - $ref: '#/components/schemas/ElectricityProductRequest'
        - $ref: '#/components/schemas/CustomPlanPriceComputedFields'
        - type: object
          properties:
            description:
              type: string
              example: "ENERG"
            request:
              $ref: '#/components/schemas/ElectricityProductRequest'
          required:
            - description
            - request

    ServerHostingCustomPlanPriceData:
      description: Response payload for `type=sh`.
      allOf:
        - $ref: '#/components/schemas/ServerHostingProductRequest'
        - $ref: '#/components/schemas/CustomPlanPriceComputedFields'
        - type: object
          properties:
            description:
              type: string
              example: "SH"
            request:
              $ref: '#/components/schemas/ServerHostingProductRequest'
          required:
            - description
            - request

    PlanParameterLimit:
      description: Numeric minimum and maximum values published by a plan-info endpoint.
      type: object
      properties:
        min:
          type: integer
          example: 1
        max:
          type: integer
          example: 16
      required:
        - min
        - max

    VsPlanInfoLimits:
      type: object
      properties:
        cpu_count:
          $ref: '#/components/schemas/PlanParameterLimit'
        ssd_size_gb:
          $ref: '#/components/schemas/PlanParameterLimit'
        hdd_size_gb:
          $ref: '#/components/schemas/PlanParameterLimit'
        ram_size_mb:
          $ref: '#/components/schemas/PlanParameterLimit'
      required:
        - cpu_count
        - ssd_size_gb
        - hdd_size_gb
        - ram_size_mb

    VsPlanInfoData:
      description: Response payload for `type=vs`.
      type: object
      properties:
        images:
          type: array
          items:
            $ref: '#/components/schemas/VpsImage'
        limits:
          $ref: '#/components/schemas/VsPlanInfoLimits'
      required:
        - images
        - limits

    WhPlanInfoLimits:
      type: object
      properties:
        disk_quota_mb:
          $ref: '#/components/schemas/PlanParameterLimit'
        sql_quota_mb:
          $ref: '#/components/schemas/PlanParameterLimit'
        email_quota_mb:
          $ref: '#/components/schemas/PlanParameterLimit'
      required:
        - disk_quota_mb
        - sql_quota_mb
        - email_quota_mb

    WhPlanPhpInfo:
      type: object
      properties:
        versions:
          type: array
          items:
            type: string
            enum:
              - '8.2'
              - '8.1'
              - '8.0'
              - '7.4'
              - '7.3'
              - '7.2'
              - '7.1'
              - '7.0'
              - '5.6'
              - '5.5'
              - '5.4'
              - '5.3'
        default:
          type: string
          example: '8.2'
        memory_limit_MB:
          type: string
          example: '512'
      required:
        - versions
        - default
        - memory_limit_MB

    WhPlanInfoData:
      description: Response payload for `type=wh`.
      type: object
      properties:
        limits:
          $ref: '#/components/schemas/WhPlanInfoLimits'
        php:
          $ref: '#/components/schemas/WhPlanPhpInfo'
      required:
        - limits
        - php

    DiskQuotaGbPlanInfoLimits:
      type: object
      properties:
        disk_quota_gb:
          $ref: '#/components/schemas/PlanParameterLimit'
      required:
        - disk_quota_gb

    DedicatedWhPlanInfoData:
      description: Response payload for `type=dedicated-wh`.
      type: object
      properties:
        limits:
          $ref: '#/components/schemas/DiskQuotaGbPlanInfoLimits'
      required:
        - limits

    WordpressWhPlanInfoData:
      description: Response payload for `type=wordpress-wh`.
      type: object
      properties:
        limits:
          $ref: '#/components/schemas/DiskQuotaGbPlanInfoLimits'
      required:
        - limits

    CpanelWhPlanInfoData:
      description: Response payload for `type=cpanel-wh`.
      type: object
      properties:
        limits:
          $ref: '#/components/schemas/DiskQuotaGbPlanInfoLimits'
      required:
        - limits

    HwrentPlanInfoLimits:
      type: object
      properties:
        drive:
          type: object
          properties:
            max_count:
              type: integer
              example: 6
            max_M2_PCIe:
              type: integer
              example: 2
          required:
            - max_count
            - max_M2_PCIe
      required:
        - drive

    HwrentCpuOption:
      type: object
      properties:
        model:
          type: string
          example: AMD Ryzen 9 7950X
        brand:
          type: string
          example: AMD
        category:
          type: string
          example: featured
        base_frequency:
          type: string
          example: 4.5 GHz
        turbo_frequency:
          type: string
          nullable: true
          example: 5.7 GHz
        cores:
          type: integer
          example: 16
        threads:
          type: integer
          example: 32
        max_memory:
          type: integer
          example: 128
        i_GPU:
          oneOf:
            - type: boolean
            - type: string
          example: false
        socket:
          type: string
          example: AM5
        ECC:
          oneOf:
            - type: boolean
            - type: string
          example: false
        memory_type:
          type: string
          example: DDR5
        single_score:
          type: integer
          nullable: true
          example: 4200
        multi_score:
          type: integer
          nullable: true
          example: 62000

    HwrentDriveOption:
      type: object
      properties:
        size:
          type: integer
          example: 1000
        size_unit:
          type: string
          example: GB
        type:
          type: string
          example: SSD
        interface:
          type: string
          example: SATA
        category:
          type: string
          example: featured
      required:
        - size
        - size_unit
        - type
        - interface
        - category

    HwrentConfigOption:
      type: object
      properties:
        model:
          type: string
          example: 1U Ryzen configuration
        category:
          type: string
          example: featured
        CPU:
          type: string
          nullable: true
          example: AMD Ryzen 9 7950X
        RAM:
          type: string
          nullable: true
          example: 64GB DDR5
        HDD_COUNT:
          type: integer
          nullable: true
          example: 2
        HDD:
          type: string
          nullable: true
          example: 2x 1TB SSD

    HwrentComponentListData:
      type: object
      properties:
        ram:
          type: object
          properties:
            DDR3:
              type: array
              items:
                type: integer
            DDR4:
              type: array
              items:
                type: integer
            DDR5:
              type: array
              items:
                type: integer
          required:
            - DDR3
            - DDR4
            - DDR5
        drive:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/HwrentDriveOption'
        cpu:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/HwrentCpuOption'
        configs:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/HwrentConfigOption'
      required:
        - ram
        - drive
        - cpu
        - configs

    HwrentPlanInfoData:
      description: Response payload for `type=hwrent`.
      type: object
      properties:
        components:
          $ref: '#/components/schemas/HwrentComponentListData'
        limits:
          $ref: '#/components/schemas/HwrentPlanInfoLimits'
      required:
        - components
        - limits

    ElectricityPlanInfoData:
      description: Response payload for `type=electricity`.
      type: object
      properties:
        unit_price:
          type: object
          properties:
            huf:
              type: object
              properties:
                DL2:
                  type: number
                  example: 150
                HA:
                  type: number
                  example: 150
                EXPO:
                  type: number
                  example: 170
                VHS:
                  type: number
                  example: 160
              required:
                - DL2
                - HA
                - EXPO
                - VHS
          required:
            - huf
        unit:
          type: string
          example: kWh
        quantity:
          type: integer
          example: 1
      required:
        - unit_price
        - unit
        - quantity

    RackUnitPlanInfoData:
      description: Response payload for `type=rack_unit`. The current backend returns `null`.
      type: object
      nullable: true
      example: null

    ServerHostingPlanInfoLimits:
      type: object
      properties:
        pc_width_cm:
          $ref: '#/components/schemas/PlanParameterLimit'
        pc_height_cm:
          $ref: '#/components/schemas/PlanParameterLimit'
      required:
        - pc_width_cm
        - pc_height_cm

    ServerHostingPlanInfoData:
      description: Response payload for `type=sh`.
      type: object
      properties:
        limits:
          $ref: '#/components/schemas/ServerHostingPlanInfoLimits'
      required:
        - limits

    PublicPlanInfoResponse:
      description: Public plan-info response. The exact `response` payload shape depends on the selected plan type.
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          oneOf:
            - $ref: '#/components/schemas/VsPlanInfoData'
            - $ref: '#/components/schemas/WhPlanInfoData'
            - $ref: '#/components/schemas/DedicatedWhPlanInfoData'
            - $ref: '#/components/schemas/WordpressWhPlanInfoData'
            - $ref: '#/components/schemas/CpanelWhPlanInfoData'
            - $ref: '#/components/schemas/HwrentPlanInfoData'
            - $ref: '#/components/schemas/ElectricityPlanInfoData'
            - $ref: '#/components/schemas/RackUnitPlanInfoData'
            - $ref: '#/components/schemas/ServerHostingPlanInfoData'

    CustomerSearchResponse:
      description: Response after successfully searching within one customer.
      allOf:
        - $ref: '#/components/schemas/SuccessDataResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                data:
                  $ref: '#/components/schemas/CustomerSearchResultGroups'

    CustomPlanPriceResponse:
      description: Custom plan pricing response. The exact `response` payload shape depends on the selected plan type.
      type: object
      properties:
        code:
          description: HTTP status code
          type: integer
          example: 200
        message:
          description: Status message
          type: string
          example: Request successfully completed
        response:
          description: Type-specific custom plan pricing data.
          oneOf:
            - $ref: '#/components/schemas/VsCustomPlanPriceData'
            - $ref: '#/components/schemas/WhCustomPlanPriceData'
            - $ref: '#/components/schemas/CustomWhCustomPlanPriceData'
            - $ref: '#/components/schemas/WordpressWhCustomPlanPriceData'
            - $ref: '#/components/schemas/CpanelWhCustomPlanPriceData'
            - $ref: '#/components/schemas/DedicatedWhCustomPlanPriceData'
            - $ref: '#/components/schemas/HwrentCustomPlanPriceData'
            - $ref: '#/components/schemas/IpCustomPlanPriceData'
            - $ref: '#/components/schemas/BackupCustomPlanPriceData'
            - $ref: '#/components/schemas/DomainCustomPlanPriceData'
            - $ref: '#/components/schemas/RackUnitCustomPlanPriceData'
            - $ref: '#/components/schemas/DdosCustomPlanPriceData'
            - $ref: '#/components/schemas/SmtpCustomPlanPriceData'
            - $ref: '#/components/schemas/SslCustomPlanPriceData'
            - $ref: '#/components/schemas/InternetCustomPlanPriceData'
            - $ref: '#/components/schemas/ElectricityCustomPlanPriceData'
            - $ref: '#/components/schemas/ServerHostingCustomPlanPriceData'

    IndexCustomersResponse:
      description: Response after successfully retrieving user's customers
      allOf:
        - $ref: '#/components/schemas/SuccessListResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                count:
                  description: Total number of returned records
                  type: integer
                  example: 42
                data:
                  description: Array of customer entries
                  type: array
                  items:
                    $ref: '#/components/schemas/Customer'

    IndexUserLogResponse:
      description: Response after successfully retrieving user API logs
      allOf:
        - $ref: '#/components/schemas/SuccessListResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                count:
                  description: Total number of returned records
                  type: integer
                  example: 42
                data:
                  description: Array of API log entries
                  type: array
                  items:
                    $ref: '#/components/schemas/ApiLogEntry'

    IndexCustomerLogResponse:
      description: Response after successfully retrieving customer API logs
      allOf:
        - $ref: '#/components/schemas/SuccessListResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                count:
                  description: Total number of returned records
                  type: integer
                  example: 42
                data:
                  description: Array of API log entries
                  type: array
                  items:
                    $ref: '#/components/schemas/ApiLogEntry'

    ShowCustomerLogResponse:
      description: Response after successfully retrieving a single customer API log entry
      allOf:
        - $ref: '#/components/schemas/SuccessDataResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                data:
                  description: The requested API log entry
                  $ref: '#/components/schemas/ApiLogEntry'

    ShowUserLogResponse:
      description: Response after successfully retrieving a single user API log entry
      allOf:
        - $ref: '#/components/schemas/SuccessDataResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                data:
                  description: The requested API log entry
                  $ref: '#/components/schemas/ApiLogEntry'

    GetUserResponse:
      allOf:
        - $ref: '#/components/schemas/SuccessDataResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                data:
                  $ref: '#/components/schemas/UserWithCustomer'

    GetCustomerResponse:
      description: Customer response including the linked users collection.
      allOf:
        - $ref: '#/components/schemas/SuccessDataResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                data:
                  $ref: '#/components/schemas/CustomerWithUsers'

    GetSessionResponse:
      description: Response after successfully retrieving the current authenticated session snapshot.
      allOf:
        - $ref: '#/components/schemas/SuccessDataResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                data:
                  $ref: '#/components/schemas/SessionData'

    IndexCustomerNotifySettingsResponse:
      description: Response after successfully retrieving notification settings for a user-customer membership.
      allOf:
        - $ref: '#/components/schemas/SuccessDataResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/IAPNotifySettings'

    StoreCustomerNotifySettingsResponse:
      description: Response after successfully creating a notification suppression setting for a user-customer membership
      allOf:
        - $ref: '#/components/schemas/SuccessUpdateResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                updated:
                  type: array
                  items:
                    type: string
                  example:
                    - disable_notify
                    - iap_rules_id
                data:
                  $ref: '#/components/schemas/IAPNotifySettings'

    DeleteCustomerNotifySettingsResponse:
      description: Response after successfully deleting a notification suppression setting for a user-customer membership
      allOf:
        - $ref: '#/components/schemas/SuccessBooleanDataResponse'
        - type: object
          properties:
            response:
              type: object
              properties:
                data:
                  description: Deletion result

  responses:
    UnauthorizedTotp:
      description: Authentication failed or additional TOTP authentication is required
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UnauthorizedTotpResponse'
          examples:
            TotpCodeRequired:
              summary: Two-factor authentication code required
              description: >
                Returned when the user has TOTP enabled but no TOTP code
                was supplied.
              value:
                code: 401
                message: Invalid credentials
                response:
                  - totp_code_required
            TotpCodeInvalid:
              summary: Invalid two-factor authentication code
              description: >
                Returned when a TOTP code was supplied but is incorrect
                or expired.
              value:
                code: 401
                message: Invalid credentials
                response:
                  - totp_code_invalid

    BadRequest:
      description: Bad form data. Validation errors are returned in response.formErrors.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BadRequestResponse'

    CompanyVatLookupBadRequest:
      description: Invalid or unrecognized VAT number.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CompanyVatLookupBadRequestResponse'
          examples:
            InvalidVat:
              summary: Invalid VAT number
              value:
                code: 400
                message: Bad request
                response:
                  code: invalid_vat
                  message: Invalid VAT number

    UpdateDomainZoneInfoErrors:
      description: Domain zone info update error. The zone info cannot be updated due to business-rule constraints.
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                description: Error code
                type: integer
                example: 400
              message:
                description: Error message
                type: string
                example: Bad request
              response:
                description: Error response payload
                type: object
                properties:
                  code:
                    description: Specific error code
                    type: string
      examples:
        PendingInsideTransferDomainNotEditable:
          summary: Domain not editable (pending inside transfer)
          description: >
            Returned when zone info is being created or edited for a domain whose related
            domain is not currently editable (e.g., pending inside transfer).
          value:
            code: 400
            message: Bad request
            response:
              code: pending_inside_transfer_domain_not_editable
        ZoneNotAliassed:
          summary: Cannot unalias a non-aliased zone
          description: >
            Returned when `alias=no` is set but the zone is not currently aliassed.
            `alias=no` is only valid if the zone is currently aliassed.
          value:
            code: 400
            message: Bad request
            response:
              code: zone_not_aliassed
        ZoneCurrentlyDefaultAlias:
          summary: Cannot set default alias on an already default zone
          description: >
            Returned when `alias=default` is set but the zone is already a default alias.
          value:
            code: 400
            message: Bad request
            response:
              code: zone_currently_default_alias

    Forbidden:
      description: Forbidden. The user is not authorized to access this resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ForbiddenResponse'

    NotFound:
      description: Not found. The specified resource (e.g., customer) does not exist.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NotFoundResponse'

    InternalServerError:
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: integer
                example: 500
              message:
                type: string
                example: Internal application error. This problem has been logged and we'll start fixing it as soon as possible.
              response:
                type: array
                example: []
