# Migrate Dynamic Payments (/en/checkout/migration)



Migrate Dynamic Payments [#migrate-dynamic-payments]

No migration is needed for fixed-price Paylinks. Continue using them as reusable product pages.

For dynamic carts, replace the temporary-Paylink pattern with this server flow:

1. Recalculate and lock the final order total on your backend.
2. Create one Checkout Session with `amount`, `currency`, and an order-scoped `Idempotency-Key`.
3. Save the returned `checkoutSessionId` against your order.
4. Redirect the buyer to the returned hosted `url`.
5. Fulfill only when a verified `payment.confirmed` webhook matches the order.

Before and after [#before-and-after]

| Temporary Paylink pattern                       | API Checkout                                                      |
| :---------------------------------------------- | :---------------------------------------------------------------- |
| Create a reusable product object per cart total | Create a short-lived payment attempt                              |
| Clean up unused links                           | Session expires automatically                                     |
| Price modeled as catalog configuration          | Price stored as an immutable order snapshot                       |
| Webhook always has `paylinkId`                  | Standalone webhook uses `checkoutSessionId` and `merchantOrderId` |

If existing code expects `paylinkId` on every invoice event, make that field optional for invoice
and payment events. It remains present for Paylink and subscription flows.
