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

# 注文レポートを作成

> 注文の PDF 分析レポートを作成します。レポートの種類は BIZ MORI が注文の種類から決めるため、送信しません。

- v3 API で作成した watermark 抽出注文 → `watermarkDetection`
- AI Detection 注文 → `aiDetection`

画像の watermark レポートは `ko-KR`、`en-US`、`ja-JP`、PDF の watermark レポートは `ko-KR` のみ対応します。同じ注文・locale を再度リクエストすると既存のレポートを返します。

**レスポンス**
- `202` と `queued`・`processing`: 作成中です。[`GET /api/v3/orders/{orderId}/reports/{locale}`](/ja/api-reference/reports/get-report) で照会してください
- `200` と `completed`: 作成済みのレポートで、`download` を含みます
- `200` と `failed`: 作成に失敗し、再試行できません(`failure.retryable` が `false`)

**watermark レポートの再試行**
watermark レポートが `failed` の場合、同じ注文・locale で再度呼び出すと新しく作成します(`202`)。試行ごとに 1 クレジットを予約し、失敗した試行は返金され、成功した試行だけが差し引かれます。失敗が 3 回に達すると再作成しません。

注文の保管期限を過ぎると、レポートがあっても `400 ORDER_EXPIRED` を返します。




## OpenAPI

````yaml ja/api-reference/openapi.yaml POST /api/v3/orders/{orderId}/reports
openapi: 3.0.0
info:
  title: BIZ MORI API
  version: 2.0.0
  description: >-
    BIZ MORI API は、デジタルコンテンツ保護のための4つのコアサービスを提供します:

    - **Anti-AI**: 画像をAI学習から保護

    - **Watermark Embed**: 画像に不可視のデジタル watermark を埋め込み

    - **Watermark Extract**: 画像から watermark を抽出・検証

    - **AI Detection**: 画像がAI生成かどうかを検知

    - **テストAPIキー**: `sk_test_`
    プレフィックスのキーは同じBearer認証を使用し、実際の処理サービスの実行やクレジットの消費なしに注文ライフサイクルを検証できます。テストアップロードの内容は破棄され、結果ファイルは作成されません
  contact:
    name: BIZ MORI サポート
    email: support@bizmori.com
  license:
    name: Proprietary
    url: https://docs.bizmori.com/legal/terms
servers:
  - url: https://api.bizmori.com
    description: 本番環境
security: []
tags:
  - name: Anti-AI
    description: Anti-AI画像保護の注文
  - name: Watermark Embed
    description: watermark 埋め込みの注文
  - name: Watermark Extract
    description: watermark 抽出の注文
  - name: AI Detection
    description: AI生成画像検知の注文
  - name: Orders
    description: 注文の照会と管理
  - name: Webhooks
    description: Webhookの設定とイベント
  - name: Reports
    description: watermark 抽出・AI Detection 注文の PDF 分析レポート
paths:
  /api/v3/orders/{orderId}/reports:
    post:
      tags:
        - Reports
      summary: 注文レポートを作成
      description: >
        注文の PDF 分析レポートを作成します。レポートの種類は BIZ MORI が注文の種類から決めるため、送信しません。


        - v3 API で作成した watermark 抽出注文 → `watermarkDetection`

        - AI Detection 注文 → `aiDetection`


        画像の watermark レポートは `ko-KR`、`en-US`、`ja-JP`、PDF の watermark レポートは
        `ko-KR` のみ対応します。同じ注文・locale を再度リクエストすると既存のレポートを返します。


        **レスポンス**

        - `202` と `queued`・`processing`: 作成中です。[`GET
        /api/v3/orders/{orderId}/reports/{locale}`](/ja/api-reference/reports/get-report)
        で照会してください

        - `200` と `completed`: 作成済みのレポートで、`download` を含みます

        - `200` と `failed`: 作成に失敗し、再試行できません(`failure.retryable` が `false`)


        **watermark レポートの再試行**

        watermark レポートが `failed` の場合、同じ注文・locale で再度呼び出すと新しく作成します(`202`)。試行ごとに 1
        クレジットを予約し、失敗した試行は返金され、成功した試行だけが差し引かれます。失敗が 3 回に達すると再作成しません。


        注文の保管期限を過ぎると、レポートがあっても `400 ORDER_EXPIRED` を返します。
      operationId: createOrderReport
      parameters:
        - in: path
          name: orderId
          required: true
          schema:
            type: string
          description: 注文 ID
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                locale:
                  type: string
                  enum:
                    - ko-KR
                    - en-US
                    - ja-JP
                  default: ko-KR
                  description: レポートの言語。デフォルトは `ko-KR`
            example:
              locale: en-US
      responses:
        '200':
          description: 作成済みのレポート、または再試行できない失敗レポート
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderReportResponse'
        '202':
          description: レポートのリクエストを受け付け、`queued` または `processing` の状態
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderReportResponse'
        '400':
          description: 不正なリクエスト、注文の種類が対応していない locale、または保管期限を過ぎた注文
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                validation:
                  value:
                    code: VALIDATION_FAILED
                locale:
                  value:
                    code: REPORT_LOCALE_UNSUPPORTED
                expired:
                  value:
                    code: ORDER_EXPIRED
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: 注文が存在しないか別のアカウントの注文、または完了したレポートファイルが存在しない
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                order:
                  value:
                    code: ORDER_NOT_FOUND
                report:
                  value:
                    code: REPORT_NOT_FOUND
        '409':
          description: 注文が完了していないか、まだレポートを作成できない
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: REPORT_NOT_AVAILABLE
        '429':
          description: リクエスト回数の超過
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: RATE_LIMIT_EXCEEDED
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          description: レポート作成を一時的に利用できない
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: SERVICE_UNAVAILABLE
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >
            curl -X POST https://api.bizmori.com/api/v3/orders/ORDER_ID/reports
            \
              -H "Authorization: Bearer YOUR_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
              "locale": "en-US"
            }'
        - lang: javascript
          label: JavaScript
          source: >
            const orderId = 'ORDER_ID';

            const response = await
            fetch(`https://api.bizmori.com/api/v3/orders/${orderId}/reports`, {
              method: 'POST',
              headers: {
                'Authorization': 'Bearer YOUR_API_KEY',
                'Content-Type': 'application/json'
              },
              body: JSON.stringify({
                "locale": "en-US"
              })
            });

            const { data } = await response.json();
        - lang: python
          label: Python
          source: |
            import requests

            order_id = 'ORDER_ID'
            response = requests.post(
                f'https://api.bizmori.com/api/v3/orders/{order_id}/reports',
                headers={'Authorization': 'Bearer YOUR_API_KEY'},
                json={
                  "locale": "en-US"
                }
            )
            data = response.json()['data']
components:
  schemas:
    OrderReportResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/OrderReportResource'
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: エラーコード
    OrderReportResource:
      type: object
      required:
        - orderId
        - reportType
        - locale
        - status
        - download
      properties:
        orderId:
          type: string
          description: 注文 ID
        reportType:
          type: string
          enum:
            - watermarkDetection
            - aiDetection
          description: BIZ MORI が注文の種類から決定
        locale:
          type: string
          enum:
            - ko-KR
            - en-US
            - ja-JP
        status:
          type: string
          enum:
            - queued
            - processing
            - completed
            - failed
          description: レポートの作成ステータス
        download:
          nullable: true
          description: ダウンロード情報。`status` が `completed` のときだけ存在
          allOf:
            - $ref: '#/components/schemas/OrderReportDownload'
        failure:
          nullable: true
          description: 失敗情報。`status` が `failed` のときだけ存在
          allOf:
            - $ref: '#/components/schemas/OrderReportFailure'
    OrderReportDownload:
      type: object
      required:
        - url
        - expiresInSeconds
      properties:
        url:
          type: string
          format: uri
          description: >
            300 秒間有効な PDF の署名付き URL。watermark レポートは `<注文名>-report-<locale>.pdf`
            という名前で保存されます(例: `春キャンペーン-report-ja-JP.pdf`)。

            URL を保存せず、新しい URL が必要なときはレポート API を再度呼び出してください。
        expiresInSeconds:
          type: integer
          enum:
            - 300
    OrderReportFailure:
      type: object
      required:
        - code
        - retryable
      properties:
        code:
          type: string
          enum:
            - REPORT_GENERATION_FAILED
            - REPORT_NOT_AVAILABLE
        retryable:
          type: boolean
          description: >
            `true` の場合、同じ注文・locale で `POST /api/v3/orders/{orderId}/reports`
            を再度呼び出すと新しく作成できます。

            watermark レポートは失敗が 3 回に達すると `false` です。
  responses:
    Unauthorized:
      description: 認証失敗
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: AUTH_NOT_AUTHENTICATED
    InternalError:
      description: 内部サーバーエラー
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: SERVER_INTERNAL_ERROR
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        外部クライアントアクセス用のBearer APIキー。本番キーは `sk_` プレフィックスを使用し、テストキーは `sk_test_`
        プレフィックスを使用して、処理やクレジット消費なしに注文ライフサイクルを検証します。

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.