メインコンテンツへスキップ
Update a subscription product’s content. If content has changed, a new immutable version is created automatically. If the content is identical to the current version, no new version is created.
POST /v1/actions/subscription-product/update-product
認証: API Key

リクエストボディ

フィールド必須説明
idstringはい商品 ID(PROD_xxx 形式)
namestringはい更新後の商品名
billingPeriodstringはいweeklymonthlyquarterly、または yearly
pricesobjectYesUpdated multi-currency pricing
descriptionstringいいえ更新後の説明
mediaarrayいいえ更新後のメディア
successUrlstringいいえ更新後のリダイレクト URL
metadataobjectいいえ更新後のメタデータ(trialDays を含む場合があります)

リクエスト例

const { product } = await client.subscriptionProducts.update({
  id: "PROD_3F7H2J5L8N1Q4S6U",
  name: "Pro Plan v2",
  billingPeriod: BillingPeriod.Monthly,
  prices: {
    USD: { amount: "39.00", taxIncluded: false, taxCategory: TaxCategory.SaaS },
    EUR: { amount: "36.00", taxIncluded: false, taxCategory: TaxCategory.SaaS },
  },
  metadata: { trialDays: 7 },
});
商品の更新は新しいイミュータブルバージョンを作成します。既存のサブスクリプションは元のバージョンを保持します。新規サインアップは最新バージョンを使用します。送信されたコンテンツが現在のバージョンと同一の場合、新しいバージョンは作成されません。

エラーレスポンス

ステータス条件
400商品に比較対象の既存バージョンがありません
400trialDays が整数でないか、1-365 の範囲外です
404商品が見つかりません