> ## 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 domínios

> Compra domínios pela API pública de clientes.

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


## OpenAPI

````yaml /openapi.pt-br.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 domínios
      description: Compra domínios pela API pública de clientes.
      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: Erro de validação
      security:
        - PublicBearerAuth: []
components:
  schemas:
    DomainPurchaseRequest:
      description: Esquema para comprar um ou mais domínios.
      properties:
        contact_info:
          $ref: '#/components/schemas/ContactInfo'
        domains:
          items:
            type: string
          minItems: 1
          title: Domínios
          type: array
        workspace_id:
          format: uuid4
          title: Id do workspace
          type: string
      required:
        - domains
        - workspace_id
        - contact_info
      title: DomainPurchaseRequest
      type: object
    DomainPurchaseResponse:
      properties:
        currency:
          anyOf:
            - type: string
            - type: 'null'
          title: moeda
        estimated_total:
          anyOf:
            - type: string
            - type: 'null'
          title: estimado total
        failed_count:
          default: 0
          title: com falha contagem
          type: integer
        payment_url:
          anyOf:
            - type: string
            - type: 'null'
          title: URL de pagamento
        purchase_batch_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id do lote de compra
        results:
          items:
            $ref: '#/components/schemas/DomainPurchaseResult'
          title: Resultados
          type: array
        successful_count:
          default: 0
          title: bem-sucedidos contagem
          type: integer
      required:
        - results
      title: DomainPurchaseResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detalhe
          type: array
      title: HTTPValidationError
      type: object
    ContactInfo:
      description: Esquema para informações de contato do registrante do domínio.
      properties:
        address_1:
          minLength: 1
          title: Endereço 1
          type: string
        city:
          minLength: 1
          title: Cidade
          type: string
        country:
          description: Código ISO de país com 2 letras
          maxLength: 2
          minLength: 2
          title: País
          type: string
        email:
          format: email
          title: E-mail
          type: string
        first_name:
          minLength: 1
          title: Nome
          type: string
        last_name:
          minLength: 1
          title: Sobrenome
          type: string
        organization:
          minLength: 1
          title: Organização
          type: string
        phone:
          description: Número de telefone com código do país
          title: Telefone
          type: string
        state:
          minLength: 1
          title: Estado
          type: string
        zip:
          minLength: 1
          title: CEP
          type: string
      required:
        - first_name
        - last_name
        - organization
        - email
        - phone
        - address_1
        - city
        - state
        - zip
        - country
      title: ContactInfo
      type: object
    DomainPurchaseResult:
      description: Resultado do início de compra de um único domínio.
      properties:
        domain_name:
          title: Nome de domínio
          type: string
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Erro
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: erro código
        id:
          anyOf:
            - format: uuid4
              type: string
            - type: 'null'
          title: ID
        status:
          title: Status
          type: string
      required:
        - domain_name
        - status
      title: DomainPurchaseResult
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Localização
          type: array
        msg:
          title: Mensagem
          type: string
        type:
          title: Tipo de erro
          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

````