---
title: "Generate Batch Retry Failed"
method: POST
path: "/api/messages/generate-batch/retry-failed"
tags: ["Messages"]
---

# Generate Batch Retry Failed

`POST /api/messages/generate-batch/retry-failed`

## Request

- Base URL: `https://api.soeru.biz` (the document declares no server; this is the origin it was published from)
- URL: `https://api.soeru.biz/api/messages/generate-batch/retry-failed`
- Auth: none declared. Required headers: `authorization`

B-3 (2026-04-27): フロントが「失敗した N 件を再生成」ボタンから叩く
エンドポイント。

動作は ``/generate-batch`` と同等だが、独立した rate-limit bucket を
持つので「初回バッチ全体」と「リトライ」がお互いの quota を食い合わない。
ユーザーが連打しても 5 件チャンク + per-order retry の安全装置が
効くので、Supabase / Anthropic に対する追加負荷は限定的。

冪等性: ``/generate-batch`` 同様に同日キャッシュ (`find_today_messages`)
があるので、初回バッチで成功した order_id を間違って渡してしまっても
キャッシュから restored として返り、API/課金は二度走らない。

## Headers

- `x-shop-id` string, nullable: Optional shop ID
- `authorization` string, required: Bearer <token>

## Request body

- BatchGenerateRequest
  - `orders` GenerateRequest[], required
    - `order_id` string, required
    - `customer_name` string
    - `customer_email` string, nullable
    - `item_names` string[]
    - `total_price` integer
    - `is_gift` boolean
    - `delivery_context` string, nullable
    - `repeat_count` integer, nullable
    - `is_repeat` boolean, nullable
    - `mode` string
  - `restore_only` boolean

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/soeru/apis/soeru-api.md) · [All operations](https://skmtc.dev/soeru/apis/soeru-api/llms.txt) · [OpenAPI document](https://skmtc.dev/soeru/apis/soeru-api/revisions/63f8d371abed?raw)
