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

# Comprar dominios

> Compra dominios mediante la API pública de cliente.

<script src="/locale-bridge.js" />


## OpenAPI

````yaml /openapi.es.json POST /v1/public/accounts/{account_id}/domains/purchase
openapi: 3.1.0
info:
  title: Code API (Public)
  version: 1.0.0
servers:
  - url: https://api.hybridbox.io
security: []
paths:
  /v1/public/accounts/{account_id}/domains/purchase:
    post:
      tags:
        - public-accounts
        - public-domains
      summary: Comprar dominios
      description: Compra dominios mediante la API pública de cliente.
      operationId: >-
        purchase_public_domains_v1_public_accounts__account_id__domains_purchase_post
      parameters:
        - in: path
          name: account_id
          required: true
          schema:
            format: uuid
            title: Account Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DomainPurchaseRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DomainPurchaseResponse'
          description: ''
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Error de validación
      security:
        - PublicBearerAuth: []
components:
  schemas:
    DomainPurchaseRequest:
      description: Esquema para comprar uno o más dominios.
      properties:
        contact_info:
          $ref: '#/components/schemas/ContactInfo'
        domains:
          items:
            type: string
          minItems: 1
          title: Dominios
          type: array
        workspace_id:
          format: uuid4
          title: Id del espacio de trabajo
          type: string
      required:
        - domains
        - workspace_id
        - contact_info
      title: DomainPurchaseRequest
      type: object
    DomainPurchaseResponse:
      properties:
        currency:
          anyOf:
            - type: string
            - type: 'null'
          title: moneda
        estimated_total:
          anyOf:
            - type: string
            - type: 'null'
          title: estimado total
        failed_count:
          default: 0
          title: fallidos recuento
          type: integer
        payment_url:
          anyOf:
            - type: string
            - type: 'null'
          title: URL de pago
        purchase_batch_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id de lote de compra
        results:
          items:
            $ref: '#/components/schemas/DomainPurchaseResult'
          title: Resultados
          type: array
        successful_count:
          default: 0
          title: correctos recuento
          type: integer
      required:
        - results
      title: DomainPurchaseResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detalle
          type: array
      title: HTTPValidationError
      type: object
    ContactInfo:
      description: Esquema para la información de contacto del registrante del dominio.
      properties:
        address_1:
          minLength: 1
          title: Dirección 1
          type: string
        city:
          minLength: 1
          title: Ciudad
          type: string
        country:
          description: Código de país ISO de 2 letras
          maxLength: 2
          minLength: 2
          title: País
          type: string
        email:
          format: email
          title: Correo electrónico
          type: string
        first_name:
          minLength: 1
          title: Nombre
          type: string
        last_name:
          minLength: 1
          title: Apellido
          type: string
        organization:
          minLength: 1
          title: Organización
          type: string
        phone:
          description: Número de teléfono con código de país
          title: Teléfono
          type: string
        state:
          minLength: 1
          title: Estado/provincia
          type: string
        zip:
          minLength: 1
          title: Código postal
          type: string
      required:
        - first_name
        - last_name
        - organization
        - email
        - phone
        - address_1
        - city
        - state
        - zip
        - country
      title: ContactInfo
      type: object
    DomainPurchaseResult:
      description: Resultado del inicio de la compra de un solo dominio.
      properties:
        domain_name:
          title: Nombre de dominio
          type: string
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: error código
        id:
          anyOf:
            - format: uuid4
              type: string
            - type: 'null'
          title: ID
        status:
          title: Estado
          type: string
      required:
        - domain_name
        - status
      title: DomainPurchaseResult
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Ubicación
          type: array
        msg:
          title: Mensaje
          type: string
        type:
          title: Tipo de error
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    PublicBearerAuth:
      bearerFormat: JWT or Hybridbox Service account token
      description: >-
        Public API bearer credential sent as `Authorization: Bearer <token>`.
        Use either an OAuth access token or a Hybridbox Service account token.
      scheme: bearer
      type: http

````