> ## 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.

# ドメインを購入

> 公開顧客APIを通じてドメインを購入します。

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


## OpenAPI

````yaml /openapi.ja.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: ドメインを購入
      description: 公開顧客APIを通じてドメインを購入します。
      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: 検証エラー
      security:
        - PublicBearerAuth: []
components:
  schemas:
    DomainPurchaseRequest:
      description: 1つ以上のドメインを購入するスキーマ。
      properties:
        contact_info:
          $ref: '#/components/schemas/ContactInfo'
        domains:
          items:
            type: string
          minItems: 1
          title: ドメイン
          type: array
        workspace_id:
          format: uuid4
          title: ワークスペースID
          type: string
      required:
        - domains
        - workspace_id
        - contact_info
      title: ドメインPurchaseリクエスト
      type: object
    DomainPurchaseResponse:
      properties:
        currency:
          anyOf:
            - type: string
            - type: 'null'
          title: 通貨
        estimated_total:
          anyOf:
            - type: string
            - type: 'null'
          title: 推定合計
        failed_count:
          default: 0
          title: 失敗数
          type: integer
        payment_url:
          anyOf:
            - type: string
            - type: 'null'
          title: 支払いURL
        purchase_batch_id:
          anyOf:
            - type: string
            - type: 'null'
          title: 購入バッチID
        results:
          items:
            $ref: '#/components/schemas/DomainPurchaseResult'
          title: 結果
          type: array
        successful_count:
          default: 0
          title: 成功数
          type: integer
      required:
        - results
      title: ドメインPurchaseレスポンス
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: 詳細
          type: array
      title: HTTPValidationエラー
      type: object
    ContactInfo:
      description: ドメイン登録者の連絡先情報スキーマ。
      properties:
        address_1:
          minLength: 1
          title: 住所1
          type: string
        city:
          minLength: 1
          title: 市区町村
          type: string
        country:
          description: 2文字のISO国コード
          maxLength: 2
          minLength: 2
          title: 国
          type: string
        email:
          format: email
          title: メール
          type: string
        first_name:
          minLength: 1
          title: 名
          type: string
        last_name:
          minLength: 1
          title: 姓
          type: string
        organization:
          minLength: 1
          title: 組織
          type: string
        phone:
          description: 国番号付き電話番号
          title: 電話
          type: string
        state:
          minLength: 1
          title: 州/都道府県
          type: string
        zip:
          minLength: 1
          title: 郵便番号
          type: string
      required:
        - first_name
        - last_name
        - organization
        - email
        - phone
        - address_1
        - city
        - state
        - zip
        - country
      title: ContactInfo
      type: object
    DomainPurchaseResult:
      description: 単一ドメイン購入開始の結果。
      properties:
        domain_name:
          title: ドメイン名
          type: string
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: エラー
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: エラーコード
        id:
          anyOf:
            - format: uuid4
              type: string
            - type: 'null'
          title: ID
        status:
          title: ステータス
          type: string
      required:
        - domain_name
        - status
      title: ドメインPurchaseResult
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: 場所
          type: array
        msg:
          title: メッセージ
          type: string
        type:
          title: エラータイプ
          type: string
      required:
        - loc
        - msg
        - type
      title: Validationエラー
      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

````