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

# 워터마크 삽입 주문 생성

> 워터마크 삽입 주문을 생성합니다.
- 이미지당 최대 10개의 워터마크 텍스트
- 주문당 최대 100개의 파일
- 지원 이미지 형식 (IMG): jpg, jpeg, png, webp, bmp, tiff
- 지원 문서 형식 (DOCUMENT): pdf

## 입력 모드 (업로드 / URL / 혼합)
입력 모드는 각 파일 객체의 `originalFileUrl` 존재 여부에 따라 결정됩니다:
- **업로드 모드** (`originalFileUrl` 없음): Presigned URL 발급 → 클라이언트가 S3에 업로드 → 처리 자동 시작
- **URL 모드** (`originalFileUrl` 제공): 해당 URL에서 이미지를 다운로드하여 즉시 처리
- **혼합 모드**: 일부 파일은 업로드 모드, 나머지는 URL 모드로 동시 처리

### 동작 방식
| 조건 | 주문 상태 | Confirm 필요 여부 |
|------|---------|-----------------|
| 모든 파일에 `originalFileUrl` 있음 | `pending` | 불필요 (서버 다운로드 후 자동 시작) |
| `originalFileUrl` 없는 파일 존재 | `pending` | 불필요 (업로드 후 자동 시작) |

<Note>Anti-AI, AI Detection과 달리 Watermark Embed는 별도의 confirm 단계가 필요하지 않습니다. 파일 업로드가 완료되면 처리가 자동으로 시작됩니다.</Note>


## 주문 결과 다운로드

주문이 `complete` 상태가 되면 [다운로드 URL 발급](/ko/api-reference/orders/download-order) 엔드포인트를 사용하여 처리된 파일을 다운로드할 수 있습니다:

```bash theme={null}
curl -X GET https://api.bizmori.com/api/v2/orders/{orderId}/download \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

<Warning>
  주문 생성 후 **최대 7일**까지 파일을 다운로드할 수 있습니다. 7일이 경과하면 주문이 `expired` 상태로 전환되며, 이후 파일을 다운로드할 수 없습니다.
</Warning>


## OpenAPI

````yaml POST /api/v2/orders/wtr-embed
openapi: 3.0.0
info:
  title: BIZ MORI API
  version: 2.0.0
  description: |
    BIZ MORI API provides four core services for digital content protection:
    - **Anti-AI**: Protect images from AI training
    - **Watermark Embed**: Embed invisible digital watermarks into images
    - **Watermark Extract**: Extract and verify watermarks from images
    - **AI Detection**: Detect whether an image is AI-generated
  contact:
    name: BIZ MORI Support
    email: support@bizmori.com
servers:
  - url: https://api.bizmori.com
    description: Production
security: []
tags:
  - name: Anti-AI
    description: Anti-AI image protection orders
  - name: Watermark Embed
    description: Watermark embedding orders
  - name: Watermark Extract
    description: Watermark extraction orders
  - name: AI Detection
    description: AI-generated image detection orders
  - name: Orders
    description: Order query and management
  - name: Webhooks
    description: Webhook configuration and events
paths:
  /api/v2/orders/wtr-embed:
    post:
      tags:
        - Watermark Embed
      summary: Create watermark embed order
      description: >
        Create a watermark embedding order.

        - Up to 10 watermark texts per image

        - Up to 100 files per order

        - Supported image formats (IMG): jpg, jpeg, png, webp, bmp, tiff

        - Supported document formats (DOCUMENT): pdf


        ## Input Modes (Upload / URL / Mixed)

        The input mode is determined by the presence of `originalFileUrl` in
        each file object:

        - **Upload mode** (no `originalFileUrl`): Presigned URL issued → Client
        uploads to S3 → Processing starts automatically

        - **URL mode** (`originalFileUrl` provided): Image downloaded from the
        URL and processed immediately

        - **Mixed mode**: Some files in Upload mode, others in URL mode
        simultaneously


        ### Behavior

        | Condition | Order Status | Confirm Required |

        |-----------|-------------|-----------------|

        | All files have `originalFileUrl` | `pending` | No (auto-starts after
        server downloads) |

        | Any file without `originalFileUrl` | `pending` | No (auto-starts after
        upload) |


        <Note>Unlike Anti-AI and AI Detection, Watermark Embed does not require
        a separate confirm step. Processing starts automatically after file
        upload completes.</Note>
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - idempotencyKey
                - files
              properties:
                idempotencyKey:
                  type: string
                  description: Idempotency key
                files:
                  type: array
                  minItems: 1
                  maxItems: 100
                  items:
                    type: object
                    required:
                      - fileName
                      - watermarks
                    properties:
                      fileName:
                        type: string
                        description: File name
                        example: image.jpg
                      originalFileUrl:
                        type: string
                        format: uri
                        description: >
                          Original image URL (optional)

                          - Provided: URL mode (no presigned URL issued,
                          immediate processing)

                          - Not provided: Upload mode (presigned URL issued)
                        example: https://example.com/image.jpg
                      watermarks:
                        type: array
                        minItems: 1
                        maxItems: 10
                        items:
                          type: object
                          required:
                            - text
                          properties:
                            text:
                              type: string
                              maxLength: 1000
                              description: Watermark text
            examples:
              uploadMode:
                summary: Upload mode (traditional)
                value:
                  idempotencyKey: key-embed-001
                  files:
                    - fileName: image1.jpg
                      watermarks:
                        - text: MORI_WATERMARK
                    - fileName: image2.png
                      watermarks:
                        - text: MORI_WATERMARK
              urlMode:
                summary: URL mode (immediate processing)
                value:
                  idempotencyKey: key-embed-url-001
                  files:
                    - fileName: image1.jpg
                      originalFileUrl: https://example.com/image1.jpg
                      watermarks:
                        - text: MORI_WATERMARK
                    - fileName: image2.png
                      originalFileUrl: https://example.com/image2.png
                      watermarks:
                        - text: MORI_WATERMARK
              mixedMode:
                summary: Mixed mode
                value:
                  idempotencyKey: key-embed-mixed-001
                  files:
                    - fileName: upload-file.jpg
                      watermarks:
                        - text: MORI_WATERMARK
                    - fileName: url-file.png
                      originalFileUrl: https://example.com/image.png
                      watermarks:
                        - text: MORI_WATERMARK
      responses:
        '200':
          description: Order created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      orderName:
                        type: string
                      orderId:
                        type: string
                      status:
                        type: string
                        enum:
                          - pending
                        description: |
                          Order status
                          - `pending`: Always returned regardless of input mode
                      files:
                        type: array
                        items:
                          type: object
                          description: >-
                            File info (fields vary by mode)

                            - Upload mode: fileId, fileName, uploadUrl, fileKey,
                            fileFormat, fileType

                            - URL mode: fileId, fileName, originalFileUrl,
                            fileKey, fileFormat, fileType
                          properties:
                            fileId:
                              type: integer
                            fileName:
                              type: string
                            uploadUrl:
                              type: string
                              format: uri
                              description: >-
                                Presigned upload URL. Returned in upload mode
                                only.
                            originalFileUrl:
                              type: string
                              format: uri
                              description: >-
                                Public image URL provided in the request.
                                Returned in URL mode only.
                            fileKey:
                              type: string
                              description: S3 object key for the file.
                            fileFormat:
                              type: string
                              description: File format.
                              enum:
                                - JPG
                                - PNG
                                - WEBP
                                - BMP
                                - TIFF
                                - PDF
                            fileType:
                              type: string
                              description: File type category.
                              enum:
                                - IMG
                                - DOCUMENT
              examples:
                uploadModeResponse:
                  summary: Upload mode response
                  value:
                    data:
                      orderName: wtr_embed_20260318120000.000
                      orderId: '424706541233094656'
                      status: pending
                      files:
                        - fileId: 2469
                          fileName: image.jpg
                          uploadUrl: >-
                            https://s3.ap-northeast-2.amazonaws.com/...?X-Amz-Algorithm=AWS4-HMAC-SHA256&...
                          fileKey: wtr-embed/424706541233094656/images/1/image.jpg
                          fileFormat: JPG
                          fileType: IMG
                        - fileId: 2470
                          fileName: document.pdf
                          uploadUrl: >-
                            https://s3.ap-northeast-2.amazonaws.com/...?X-Amz-Algorithm=AWS4-HMAC-SHA256&...
                          fileKey: >-
                            wtr-embed/424706541233094656/documents/2/document.pdf
                          fileFormat: PDF
                          fileType: DOCUMENT
                urlModeResponse:
                  summary: URL mode response
                  value:
                    data:
                      orderName: wtr_embed_20260318120000.000
                      orderId: '424707536709206016'
                      status: pending
                      files:
                        - fileId: 2490
                          fileName: image.png
                          originalFileUrl: https://example.com/image.jpg
                          fileKey: wtr-embed/424707536709206016/images/1/image.png
                          fileFormat: PNG
                          fileType: IMG
                mixedModeResponse:
                  summary: Mixed mode response
                  value:
                    data:
                      orderName: wtr_embed_20260318120000.000
                      orderId: '424707536709206016'
                      status: pending
                      files:
                        - fileId: 2490
                          fileName: image.png
                          originalFileUrl: https://example.com/image.jpg
                          fileKey: wtr-embed/424707536709206016/images/1/image.png
                          fileFormat: PNG
                          fileType: IMG
                        - fileId: 2491
                          fileName: photo.jpeg
                          uploadUrl: >-
                            https://s3.ap-northeast-2.amazonaws.com/...?X-Amz-Algorithm=AWS4-HMAC-SHA256&...
                          fileKey: wtr-embed/424707536709206016/images/2/photo.jpeg
                          fileFormat: JPG
                          fileType: IMG
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/UsageLimitExceeded'
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST https://api.bizmori.com/api/v2/orders/wtr-embed \
              -H "Authorization: Bearer YOUR_API_TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
                "idempotencyKey": "key-embed-001",
                "files": [
                  {
                    "fileName": "image.jpg",
                    "watermarks": [{"text": "MORI_WATERMARK"}]
                  }
                ]
              }'
        - lang: javascript
          label: JavaScript
          source: >-
            const response = await
            fetch('https://api.bizmori.com/api/v2/orders/wtr-embed', {
              method: 'POST',
              headers: {
                'Authorization': 'Bearer YOUR_API_TOKEN',
                'Content-Type': 'application/json'
              },
              body: JSON.stringify({
                idempotencyKey: 'key-embed-001',
                files: [
                  {
                    fileName: 'image.jpg',
                    watermarks: [{ text: 'MORI_WATERMARK' }]
                  }
                ]
              })
            });

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

            response = requests.post(
                'https://api.bizmori.com/api/v2/orders/wtr-embed',
                headers={'Authorization': 'Bearer YOUR_API_TOKEN'},
                json={
                    'idempotencyKey': 'key-embed-001',
                    'files': [
                        {
                            'fileName': 'image.jpg',
                            'watermarks': [{'text': 'MORI_WATERMARK'}]
                        }
                    ]
                }
            )
            data = response.json()
components:
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: VALIDATION_FAILED
    Unauthorized:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: AUTH_NOT_AUTHENTICATED
    UsageLimitExceeded:
      description: Usage limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: USAGE_LIMIT_EXCEEDED
  schemas:
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API Key for external client access

````