認証済みマーチャント用の新しいストアを作成します。ストアスラッグは名前から自動生成され、JSONB 設定フィールド(notificationSettings、checkoutSettings)はデフォルト値で初期化されます。Webhook は add-webhook で個別に管理されます — 新規作成されたストアには Webhook レコードが存在しません。
POST /v1/actions/store/create-store
認証: API Key
リクエストボディ
| フィールド | 型 | 必須 | 説明 |
|---|
name | string | Yes | ストア名(1-48 文字、自動トリム) |
リクエスト例
import { WaffoPancake } from "@waffo/pancake-ts";
const client = new WaffoPancake({
merchantId: process.env.WAFFO_MERCHANT_ID!,
privateKey: process.env.WAFFO_PRIVATE_KEY!,
});
const { store } = await client.stores.create({ name: "My Digital Store" });
console.log(store.id); // => "STO_2aUyqjCzEIiEcYMKj7TZtw"
console.log(store.slug); // => "my-digital-store-a1b2c3"
成功レスポンス (200)
{
"data": {
"store": {
"id": "STO_2aUyqjCzEIiEcYMKj7TZtw",
"name": "My Digital Store",
"status": "active",
"logo": null,
"supportEmail": null,
"website": null,
"slug": "my-digital-store-a1b2c3",
"prodEnabled": false,
"notificationSettings": {
"emailOrderConfirmation": true,
"emailSubscriptionConfirmation": true,
"emailSubscriptionCycled": true,
"emailSubscriptionCanceled": true,
"emailSubscriptionRevoked": true,
"emailSubscriptionPastDue": true,
"notifyNewOrders": true,
"notifyNewSubscriptions": true
},
"checkoutSettings": {
"defaultDarkMode": false,
"light": {
"checkoutLogo": null,
"checkoutColorPrimary": "#000000",
"checkoutColorBackground": "#FFFFFF",
"checkoutColorCard": "#F5F5F5",
"checkoutColorText": "#1A1A1A",
"checkoutBorderRadius": "8px"
},
"dark": {
"checkoutLogo": null,
"checkoutColorPrimary": "#FFFFFF",
"checkoutColorBackground": "#1A1A1A",
"checkoutColorCard": "#2A2A2A",
"checkoutColorText": "#F5F5F5",
"checkoutBorderRadius": "8px"
}
},
"deletedAt": null,
"createdAt": "2026-01-15T10:30:00.000Z",
"updatedAt": "2026-01-15T10:30:00.000Z"
}
}
}
レスポンスフィールド
| フィールド | 型 | 説明 |
|---|
id | string | Store ID(Short ID フォーマット STO_xxx) |
name | string | ストア表示名 |
status | string | ストアステータス(active、inactive、または suspended) |
logo | string | null | ストアロゴ URL |
supportEmail | string | null | サポートメールアドレス |
website | string | null | ストアウェブサイト URL |
slug | string | null | 自動生成された URL スラッグ |
prodEnabled | boolean | 本番モードが有効かどうか |
notificationSettings | object | null | 通知設定(通知設定を参照) |
checkoutSettings | object | null | チェックアウトページテーマ(チェックアウト設定を参照) |
deletedAt | string | null | 論理削除タイムスタンプ(ISO 8601)、アクティブの場合 null |
createdAt | string | 作成タイムスタンプ(ISO 8601) |
updatedAt | string | 最終更新タイムスタンプ(ISO 8601) |
エラー
リトライポリシー:4xx は一切リトライしない — リクエストを修正してから再送信。5xx は指数バックオフでリトライ(5s 開始、最大 3 回)。
| ステータス | errors[0].message | 意味 | 推奨処理 |
|---|
| 400 | Missing merchantId in request context | API Key がマーチャントコンテキストを解決できなかった | リトライしない。API Key 設定を確認。 |
| 400 | Missing required field: name | リクエストボディに name が含まれていない | 入力を修正して再送信。 |
| 400 | Store name cannot be empty or contain only whitespace | trim() 後の name が空 | 入力を修正して再送信。 |
| 400 | Store name cannot exceed 48 characters | name が 48 文字を超える | 名前を短縮して再送信。 |
| 400 | Cannot create more stores. Maximum limit of 20 stores per merchant has been reached. | マーチャントが既に 20 ストアを所有 | リトライしない。既存ストアを削除するか、上限緩和をサポートに依頼。 |
各マーチャントは最大 20 ストアまで作成できます。ストア作成者には自動的に owner ロールが割り当てられます。