請求モードにポリモーフィックオブジェクトのサポートを追加互換性に関わる変更
新規情報
すべての請求エンドポイントで billing_mode
パラメーターとフィールド形式を統一しました。billing_mode
パラメーターは、以前の文字列形式に代わり、type
フィールドと一貫性のあるオブジェクト形式を使用するようになりました。また、billing_mode_details
フィールドをメインの billing_mode
オブジェクトに統合しました。
この変更により互換性が失われる理由
billing_mode
パラメーターとフィールドの形式が、文字列値 (classic
または flexible
) の受け入れから、type
フィールド ({type: 'flexible'}
など) を指定するオブジェクトの要求に、変更されました。また、別の billing_mode_details
フィールドは削除され、その updated_at
プロパティは、billing_mode
オブジェクトに直接含まれるようになっています。
効果
現在、billing_mode
パラメーターを使用しているか、API レスポンスの billing_mode
フィールドにアクセスしている場合は、構築済みの API を更新する必要があります。
変更前:
{
"billing_mode": "flexible",
"billing_mode_details": {
"updated_at": 1234567890
}
}
変更後:
{
"billing_mode": {
"type": "flexible",
"updated_at": 1234567890
}
}
この変更は、次の API エンドポイントとリソースに影響します。
変更点
billing_mode_details | 削除済み | |
Checkout.Session#create.subscription_data.billing_modeInvoice#create_preview.schedule_details.billing_modeInvoice#create_preview.subscription_details.billing_modeQuote#create.subscription_data.billing_modeQuote.subscription_data.billing_modeSubscription#create.billing_modeSubscriptionSchedule#create.billing_mode | 変更しました | enum('classic'|'flexible') → billing_mode
|
Quote.subscription_data.billing_modeQuotePreviewSubscriptionSchedule.billing_modeSubscription.billing_modeSubscriptionSchedule.billing_mode | 変更しました | optional → required
|
QuotePreviewSubscriptionSchedule.billing_modeSubscription.billing_modeSubscriptionSchedule.billing_mode | 変更しました | enum('classic'|'flexible') → SubscriptionsResourceBillingMode
|
Subscription#migrate.billing_mode | 変更しました | literal('flexible') → billing_mode_migrate
|
アップグレード