マルチ通貨対応の新しい単発購入商品を作成します。
POST /v1/actions/onetime-product/create-product
認証: API Key
リクエストボディ
| フィールド | 型 | 必須 | 説明 |
|---|
storeId | string | はい | ストア ID(Short ID 形式 STO_xxx) |
name | string | はい | 商品名 |
description | string | いいえ | 商品説明(Markdown サポート) |
prices | object | はい | マルチ通貨価格マップ(下記参照) |
media | array | いいえ | 商品画像/動画(下記参照) |
successUrl | string | いいえ | 購入成功後のリダイレクト URL |
metadata | object | いいえ | カスタムキーバリューデータ(最大50キー) |
価格オブジェクト形式
価格は ISO 4217 通貨コードから価格設定オブジェクトへのマップです。少なくとも1つの通貨が必要です。
{
"USD": {
"amount": "29.00",
"taxIncluded": false,
"taxCategory": "saas"
},
"EUR": {
"amount": "27.00",
"taxIncluded": true,
"taxCategory": "saas"
}
}
| フィールド | 型 | 説明 |
|---|
amount | string | Price as a display format string (e.g., “29.00” = $29.00) |
taxIncluded | boolean | Whether the amount already includes tax |
taxCategory | string | Tax category for tax calculation |
サポートされる taxCategory 値:
| 値 | 説明 |
|---|
digital_goods | 一般的なデジタル商品 |
saas | SaaS(Software as a Service) |
software | ダウンロード可能なソフトウェア |
ebook | 電子書籍 |
online_course | オンラインコースと教育 |
consulting | コンサルティングサービス |
professional_service | プロフェッショナルサービス |
メディアアイテム形式
{
"type": "image",
"url": "https://example.com/product.png",
"alt": "Product screenshot",
"thumbnail": "https://example.com/product-thumb.png"
}
| フィールド | 型 | 説明 |
|---|
type | string | image or video |
url | string | Media URL |
alt | string | Alt text for accessibility |
thumbnail | string | Thumbnail URL (optional for images, recommended for videos) |
リクエスト例
import { WaffoPancake, TaxCategory } from "@waffo/pancake-ts";
const client = new WaffoPancake({
merchantId: process.env.WAFFO_MERCHANT_ID!,
privateKey: process.env.WAFFO_PRIVATE_KEY!,
});
const { product } = await client.onetimeProducts.create({
storeId: "STO_2aUyqjCzEIiEcYMKj7TZtw",
name: "Premium Template Pack",
description: "50 premium design templates for your next project.",
prices: {
USD: { amount: "49.00", taxIncluded: false, taxCategory: TaxCategory.DigitalGoods },
EUR: { amount: "45.00", taxIncluded: true, taxCategory: TaxCategory.DigitalGoods },
},
media: [
{ type: "image", url: "https://example.com/templates-preview.png", alt: "Template preview" },
],
successUrl: "https://example.com/thank-you",
metadata: { category: "design", fileCount: "50" },
});
成功レスポンス (200)
{
"data": {
"id": "PROD_3kF9mNpQrStUvWxYz1A2bC",
"storeId": "STO_2aUyqjCzEIiEcYMKj7TZtw",
"prodVersionId": null,
"testVersionId": "PROD_7dG4hJkLmNpQrStUvWxYz1",
"prodStatus": "inactive",
"testStatus": "active",
"createdAt": "2026-01-15T10:30:00.000Z",
"updatedAt": "2026-01-15T10:30:00.000Z",
"version": {
"id": "PROD_7dG4hJkLmNpQrStUvWxYz1",
"productId": "PROD_3kF9mNpQrStUvWxYz1A2bC",
"versionNumber": 1,
"name": "Premium Template Pack",
"description": "50 premium design templates for your next project.",
"prices": {
"USD": { "amount": "49.00", "taxIncluded": false, "taxCategory": "digital_goods" },
"EUR": { "amount": "45.00", "taxIncluded": true, "taxCategory": "digital_goods" }
},
"media": [
{ "type": "image", "url": "https://example.com/templates-preview.png", "alt": "Template preview" }
],
"successUrl": "https://example.com/thank-you",
"metadata": { "category": "design", "fileCount": "50" },
"createdAt": "2026-01-15T10:30:00.000Z"
}
}
}
レスポンスフィールド
| フィールド | 型 | 説明 |
|---|
id | string | Product ID (PROD_xxx) |
storeId | string | Store ID (STO_xxx) |
prodVersionId | string | null | Active production version ID (PROD_xxx), null if not published |
testVersionId | string | null | Active test version ID (PROD_xxx), null if not in test |
prodStatus | string | Production status: active or inactive |
testStatus | string | Test status: active or inactive |
createdAt | string | Creation timestamp (ISO 8601) |
updatedAt | string | Last update timestamp (ISO 8601) |
version | object | The version created or active in the current environment |
バージョンオブジェクト:
| フィールド | 型 | 説明 |
|---|
id | string | Version ID (PROD_xxx) |
productId | string | Parent product ID (PROD_xxx) |
versionNumber | integer | Sequential version number (starts at 1) |
name | string | Product name at this version |
description | string | null | Product description at this version |
prices | object | Multi-currency pricing map |
media | array | Media items at this version |
successUrl | string | null | Success redirect URL at this version |
metadata | object | null | Custom metadata at this version |
createdAt | string | Version creation timestamp (ISO 8601) |
テスト環境(デフォルト)で作成した場合、testStatus は active、prodStatus は inactive になります。本番環境で作成した場合、値は逆になります。
エラーレスポンス
| ステータス | エラー | 説明 |
|---|
| 400 | Missing required field: storeId | storeId not provided |
| 400 | Missing required field: name | name not provided |
| 400 | Prices must not be empty | prices is missing or an empty object |
| 404 | Store not found | Store does not exist or is not accessible |