メインコンテンツへスキップ
単発商品のコンテンツを更新します。コンテンツが変更された場合、新しいイミュータブルバージョンが自動的に作成されます。コンテンツが現在のバージョンと同一の場合、新しいバージョンは作成されません。
POST /v1/actions/onetime-product/update-product
認証: API Key
商品のステータス(active/inactive)を変更するには、ステータスの更新エンドポイントを使用してください。このエンドポイントはコンテンツの更新のみです。

リクエストボディ

フィールド必須説明
idstringYes商品 ID(Short ID フォーマット PROD_xxx
namestringNo更新後の商品名(64 文字以下)
descriptionstring | nullNo更新後の説明(null または "" で消去可能)
pricesobjectNo更新後のマルチ通貨価格マップ
mediaarrayNo更新後のメディアアイテム
successUrlstring | nullNo更新後のリダイレクト URL(512 文字以下、有効な http(s) URL であること;null または "" で消去可能)
metadataobjectNo更新後のカスタムメタデータ
pricesmedia のオブジェクトフォーマットについては、商品の作成を参照してください。

リクエスト例

const { product } = await client.onetimeProducts.update({
  id: "PROD_3kF9mNpQrStUvWxYz1A2bC",
  name: "Premium Template Pack v2",
  description: "75 premium design templates — expanded collection.",
  prices: {
    USD: { amount: "59.00", taxIncluded: false, taxCategory: TaxCategory.DigitalGoods },
    EUR: { amount: "55.00", taxIncluded: true, taxCategory: TaxCategory.DigitalGoods },
  },
  successUrl: "https://example.com/thank-you",
});
// Uses callApi() helper from authentication.mdx
const result = await callApi("POST", "/v1/actions/onetime-product/update-product", {
  id: "PROD_3kF9mNpQrStUvWxYz1A2bC",
  name: "Premium Template Pack v2",
  description: "75 premium design templates — expanded collection.",
  prices: {
    USD: { amount: "59.00", taxIncluded: false, taxCategory: "digital_goods" },
    EUR: { amount: "55.00", taxIncluded: true, taxCategory: "digital_goods" },
  },
  successUrl: "https://example.com/thank-you",
});
console.log(result.data.product.name); // => "Premium Template Pack v2"
// Uses callApi() helper from authentication.mdx
String body = """
    {
      "id": "PROD_3kF9mNpQrStUvWxYz1A2bC",
      "name": "Premium Template Pack v2",
      "description": "75 premium design templates — expanded collection.",
      "prices": {
        "USD": { "amount": "59.00", "taxIncluded": false, "taxCategory": "digital_goods" },
        "EUR": { "amount": "55.00", "taxIncluded": true, "taxCategory": "digital_goods" }
      },
      "successUrl": "https://example.com/thank-you"
    }""";

String response = callApi("POST", "/v1/actions/onetime-product/update-product", body);
System.out.println(response);
# Uses call_api() helper from authentication.mdx
result = call_api("POST", "/v1/actions/onetime-product/update-product", {
    "id": "PROD_3kF9mNpQrStUvWxYz1A2bC",
    "name": "Premium Template Pack v2",
    "description": "75 premium design templates — expanded collection.",
    "prices": {
        "USD": {"amount": "59.00", "taxIncluded": False, "taxCategory": "digital_goods"},
        "EUR": {"amount": "55.00", "taxIncluded": True, "taxCategory": "digital_goods"},
    },
    "successUrl": "https://example.com/thank-you",
})
print(result["data"]["product"]["name"])  # => "Premium Template Pack v2"
// Uses callAPI() helper from authentication.mdx
body := map[string]interface{}{
    "id":   "PROD_3kF9mNpQrStUvWxYz1A2bC",
    "name": "Premium Template Pack v2",
    "description": "75 premium design templates — expanded collection.",
    "prices": map[string]interface{}{
        "USD": map[string]interface{}{"amount": "59.00", "taxIncluded": false, "taxCategory": "digital_goods"},
        "EUR": map[string]interface{}{"amount": "55.00", "taxIncluded": true, "taxCategory": "digital_goods"},
    },
    "successUrl": "https://example.com/thank-you",
}
result, err := callAPI("POST", "/v1/actions/onetime-product/update-product", body)
if err != nil {
    log.Fatal(err)
}
fmt.Println(string(result))
// Uses call_api() helper from authentication.mdx
let body = serde_json::json!({
    "id": "PROD_3kF9mNpQrStUvWxYz1A2bC",
    "name": "Premium Template Pack v2",
    "description": "75 premium design templates — expanded collection.",
    "prices": {
        "USD": { "amount": "59.00", "taxIncluded": false, "taxCategory": "digital_goods" },
        "EUR": { "amount": "55.00", "taxIncluded": true, "taxCategory": "digital_goods" }
    },
    "successUrl": "https://example.com/thank-you"
});
let result = call_api("POST", "/v1/actions/onetime-product/update-product", &body).await?;
println!("{}", result);
/* Uses call_api() helper from authentication.mdx */
const char *body =
    "{\"id\":\"PROD_3kF9mNpQrStUvWxYz1A2bC\","
    "\"name\":\"Premium Template Pack v2\","
    "\"description\":\"75 premium design templates — expanded collection.\","
    "\"prices\":{\"USD\":{\"amount\":\"59.00\",\"taxIncluded\":false,\"taxCategory\":\"digital_goods\"},"
    "\"EUR\":{\"amount\":\"55.00\",\"taxIncluded\":true,\"taxCategory\":\"digital_goods\"}},"
    "\"successUrl\":\"https://example.com/thank-you\"}";
char *response = call_api("POST", "/v1/actions/onetime-product/update-product", body);
printf("%s\n", response);
free(response);
// Uses callApi() helper from authentication.mdx
std::string body = R"({
  "id": "PROD_3kF9mNpQrStUvWxYz1A2bC",
  "name": "Premium Template Pack v2",
  "description": "75 premium design templates — expanded collection.",
  "prices": {
    "USD": { "amount": "59.00", "taxIncluded": false, "taxCategory": "digital_goods" },
    "EUR": { "amount": "55.00", "taxIncluded": true, "taxCategory": "digital_goods" }
  },
  "successUrl": "https://example.com/thank-you"
})";
std::string response = callApi("POST", "/v1/actions/onetime-product/update-product", body);
std::cout << response << std::endl;
MERCHANT_ID="MER_2aUyqjCzEIiEcYMKj7TZtw"
TIMESTAMP=$(date +%s)
BODY='{
  "id": "PROD_3kF9mNpQrStUvWxYz1A2bC",
  "name": "Premium Template Pack v2",
  "description": "75 premium design templates — expanded collection.",
  "prices": {
    "USD": { "amount": "59.00", "taxIncluded": false, "taxCategory": "digital_goods" },
    "EUR": { "amount": "55.00", "taxIncluded": true, "taxCategory": "digital_goods" }
  },
  "successUrl": "https://example.com/thank-you"
}'
BODY_HASH=$(echo -n "$BODY" | openssl dgst -sha256 -binary | base64 -w 0)
CANONICAL_REQUEST="POST
/v1/actions/onetime-product/update-product
$TIMESTAMP
$BODY_HASH"

SIGNATURE=$(echo -n "$CANONICAL_REQUEST" | openssl dgst -sha256 -sign private_key.pem | base64 -w 0)

curl -X POST "https://api.waffo.ai/v1/actions/onetime-product/update-product" \
  -H "Content-Type: application/json" \
  -H "X-Merchant-Id: $MERCHANT_ID" \
  -H "X-Timestamp: $TIMESTAMP" \
  -H "X-Signature: $SIGNATURE" \
  -d "$BODY"
MERCHANT_ID="MER_2aUyqjCzEIiEcYMKj7TZtw"
TIMESTAMP=$(date +%s)
BODY='{
  "id": "PROD_3kF9mNpQrStUvWxYz1A2bC",
  "name": "Premium Template Pack v2",
  "description": "75 premium design templates — expanded collection.",
  "prices": {
    "USD": { "amount": "59.00", "taxIncluded": false, "taxCategory": "digital_goods" },
    "EUR": { "amount": "55.00", "taxIncluded": true, "taxCategory": "digital_goods" }
  },
  "successUrl": "https://example.com/thank-you"
}'
BODY_HASH=$(echo -n "$BODY" | openssl dgst -sha256 -binary | base64 -w 0)
CANONICAL_REQUEST="POST
/v1/actions/onetime-product/update-product
$TIMESTAMP
$BODY_HASH"

SIGNATURE=$(echo -n "$CANONICAL_REQUEST" | openssl dgst -sha256 -sign private_key.pem | base64 -w 0)

wget -qO- "https://api.waffo.ai/v1/actions/onetime-product/update-product" \
  --header="Content-Type: application/json" \
  --header="X-Merchant-Id: $MERCHANT_ID" \
  --header="X-Timestamp: $TIMESTAMP" \
  --header="X-Signature: $SIGNATURE" \
  --post-data="$BODY"

成功レスポンス (200)

{
  "data": {
    "product": {
      "id": "PROD_3kF9mNpQrStUvWxYz1A2bC",
      "storeId": "STO_2aUyqjCzEIiEcYMKj7TZtw",
      "name": "Premium Template Pack v2",
      "description": "75 premium design templates — expanded collection.",
      "prices": {
        "USD": { "amount": "59.00", "taxCategory": "digital_goods" },
        "EUR": { "amount": "55.00", "taxCategory": "digital_goods" }
      },
      "media": [],
      "successUrl": "https://example.com/thank-you",
      "metadata": {},
      "status": "active",
      "createdAt": "2026-01-15T10:30:00.000Z",
      "updatedAt": "2026-01-15T11:00:00.000Z"
    }
  }
}

レスポンスフィールド

商品の作成レスポンスと同じです。
商品バージョンはイミュータブルです。既存の注文は元のバージョンを保持します。新規購入は常に最新バージョンを使用します。送信されたコンテンツが現在のバージョンと同一の場合、新しいバージョンは作成されず、既存のバージョンが返されます。

エラー

リトライポリシー:4xx は一切リトライしない — リクエストを修正してから再送信。5xx は指数バックオフでリトライ(5s 開始、最大 3 回)。
ステータスerrors[0].message意味推奨処理
400Missing required field: idid が指定されていませんボディを修正して再送信
400Invalid ID format指定された Short ID をデコードできませんでしたid のフォーマットを修正して再送信
400Invalid currency code通貨コードは ISO 4217 に準拠した3文字の大文字である必要があります(例:USDEURJPY有効な ISO 4217 コードを使用して再送信
400Invalid amount金額は正の数値文字列である必要があります(例:"9.99""100"正の数値文字列を使用して再送信
400Product X has no version in environment Y商品が対象環境にまだバージョンを持たない(例:prod 未公開で更新を試みた)先に Publish Product で商品を対象環境に公開
404Product not found商品が存在しないかアクセスできませんid が現在のマーチャントに属することを確認
500Internal server errorサーバ側の予期しない障害指数バックオフでリトライ(5s 開始、最大 3 回)