メインコンテンツへスキップ
マルチ通貨対応の新しい単発購入商品を作成します。
POST /v1/actions/onetime-product/create-product
認証: API Key

リクエストボディ

フィールド必須説明
storeIdstringはいストア ID(Short ID 形式 STO_xxx
namestringはい商品名
descriptionstringいいえ商品説明(Markdown サポート)
pricesobjectはいマルチ通貨価格マップ(下記参照)
mediaarrayいいえ商品画像/動画(下記参照)
successUrlstringいいえ購入成功後のリダイレクト URL
metadataobjectいいえカスタムキーバリューデータ(最大50キー)

価格オブジェクト形式

価格は ISO 4217 通貨コードから価格設定オブジェクトへのマップです。少なくとも1つの通貨が必要です。
{
  "USD": {
    "amount": "29.00",
    "taxIncluded": false,
    "taxCategory": "saas"
  },
  "EUR": {
    "amount": "27.00",
    "taxIncluded": true,
    "taxCategory": "saas"
  }
}
フィールド説明
amountstringPrice as a display format string (e.g., “29.00” = $29.00)
taxIncludedbooleanWhether the amount already includes tax
taxCategorystringTax category for tax calculation
サポートされる taxCategory 値:
説明
digital_goods一般的なデジタル商品
saasSaaS(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"
}
フィールド説明
typestringimage or video
urlstringMedia URL
altstringAlt text for accessibility
thumbnailstringThumbnail 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"
    }
  }
}

レスポンスフィールド

フィールド説明
idstringProduct ID (PROD_xxx)
storeIdstringStore ID (STO_xxx)
prodVersionIdstring | nullActive production version ID (PROD_xxx), null if not published
testVersionIdstring | nullActive test version ID (PROD_xxx), null if not in test
prodStatusstringProduction status: active or inactive
testStatusstringTest status: active or inactive
createdAtstringCreation timestamp (ISO 8601)
updatedAtstringLast update timestamp (ISO 8601)
versionobjectThe version created or active in the current environment
バージョンオブジェクト:
フィールド説明
idstringVersion ID (PROD_xxx)
productIdstringParent product ID (PROD_xxx)
versionNumberintegerSequential version number (starts at 1)
namestringProduct name at this version
descriptionstring | nullProduct description at this version
pricesobjectMulti-currency pricing map
mediaarrayMedia items at this version
successUrlstring | nullSuccess redirect URL at this version
metadataobject | nullCustom metadata at this version
createdAtstringVersion creation timestamp (ISO 8601)
テスト環境(デフォルト)で作成した場合、testStatusactiveprodStatusinactive になります。本番環境で作成した場合、値は逆になります。

エラーレスポンス

ステータスエラー説明
400Missing required field: storeIdstoreId not provided
400Missing required field: namename not provided
400Prices must not be emptyprices is missing or an empty object
404Store not foundStore does not exist or is not accessible