---
title: "Preview B2B Document"
method: POST
path: "/api/b2b/preview"
tags: ["B2B Documents"]
---

# Preview B2B Document

`POST /api/b2b/preview`

## 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/b2b/preview`
- Auth: none declared. Required headers: `authorization`

Generate a preview (base64) of a B2B document.

Typically called with a single order and single document_type for preview.

## Headers

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

## Request body

- B2BDocumentRequest: B2B帳票生成リクエスト — 注文別帳票タイプ選択対応. orders: 注文データ配列。各注文は document_types フィールドを含めることが可能。 document_types: グローバルのフォールバック（注文に個別指定がない場合に使用） include_ai_message: AIメッセージを含めるか（設定のオーバーライド用）
  - `document_types` string[]: グローバルの帳票タイプ（注文別指定がない場合のフォールバック）
  - `orders` object[], required: 注文データ配列。各注文は document_types を含めることが可能
  - `include_ai_message` boolean, nullable

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