Preview moving the subscribers of one price to another
Creates a run in preview with one item per live line on from_price: eligible, or excluded with a reason (two or more lines on the price exclude every line multiple_lines_on_price; target_not_on_account per subscription). The frozen preview counts eligible subscriptions, quantity, old and new amounts and exclusions. Prices must share plan, currency, interval and terms apart from unit_amount (422 price_shape_unsupported naming each differing field). notice_days defaults to the product setting and must be 30–365 (422 notice_below_floor / notice_above_ceiling). One open run per old price (409 migration_in_progress). The preview expires 24 hours after creation; a lapsed preview is expired, its eligible items withdrawn run_expired, before this check. People and keys with catalog:publish; agents 403 agent_not_available.
/price_migrationsCreates a run in preview with one item per live line on from_price: eligible, or excluded with a reason (two or more lines on the price exclude every line multiple_lines_on_price; target_not_on_account per subscription). The frozen preview counts eligible subscriptions, quantity, old and new amounts and exclusions. Prices must share plan, currency, interval and terms apart from unit_amount (422 price_shape_unsupported naming each differing field). notice_days defaults to the product setting and must be 30–365 (422 notice_below_floor / notice_above_ceiling). One open run per old price (409 migration_in_progress). The preview expires 24 hours after creation; a lapsed preview is expired, its eligible items withdrawn run_expired, before this check. People and keys with catalog:publish; agents 403 agent_not_available.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/price_migrations" \ -H "Content-Type: application/json" \ -d '{ "from_price": "09df5cc4-588f-4541-8c30-e7e005e8497a", "to_price": "10879e99-dfc0-4fef-8693-46d4a04353d1" }'{ "data": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "object": "price_migration", "livemode": true, "from_price": "09df5cc4-588f-4541-8c30-e7e005e8497a", "to_price": "10879e99-dfc0-4fef-8693-46d4a04353d1", "status": "preview", "notice_days": 30, "created_before": "string", "preview": { "currency": "string", "interval": "day", "interval_count": 1, "old_unit_amount": 0, "new_unit_amount": 0, "subscriptions": 0, "eligible": { "subscriptions": 0, "quantity": 0, "old_amount": 0, "new_amount": 0, "uplift_per_interval": -9007199254740991 }, "excluded": { "trialing": 0, "cancelled": 0, "paused": 0, "payment_plan": 0, "schedule_managed": 0, "pending_update": 0, "change_in_progress": 0, "not_on_old_price": 0, "multiple_lines_on_price": 0, "target_not_on_account": 0, "anchor_unknown": 0, "discount_not_preservable": 0 } }, "preview_expires_at": "2019-08-24T14:15:22Z", "confirmed_at": "string", "cancel_requested_at": "string", "completed_at": "string", "counts": { "status": { "eligible": 0, "excluded": 0, "notice_pending": 0, "notice_delivered": 0, "scheduling": 0, "scheduled": 0, "releasing": 0, "withdrawing": 0, "applied": 0, "withdrawn": 0, "failed": 0 }, "excluded": { "trialing": 0, "cancelled": 0, "paused": 0, "payment_plan": 0, "schedule_managed": 0, "pending_update": 0, "change_in_progress": 0, "not_on_old_price": 0, "multiple_lines_on_price": 0, "target_not_on_account": 0, "anchor_unknown": 0, "discount_not_preservable": 0 }, "withdrawn": { "merchant_revert": 0, "run_cancelled": 0, "run_closed": 0, "paused": 0, "price_changed": 0, "target_unavailable": 0, "subscriber_cancelled": 0, "run_expired": 0, "ineligible_at_render": 0 } }, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" }, "request_id": "266ea41d-adf5-480b-af50-15b940c2b846"}