Prepare payment
checkout_prepare_paymentCreate a short-lived server confirmation bound to the exact selected cart lines, cart revision, address, shipping option, and currency. Server checks the supplied cartRevision and selectedLines against the live cart, then returns the current quote cartRevision, confirmationId, expiresAt, totalAmountMinor, currencyCode, quote, and selectedShippingOption. Creates no order or charge at this stage. Requires checkout:write scope. After checkout_quote, prepare this confirmation, ask the user to review the returned total and shipping option, then use checkout_create_payment_link only after approval. Pass the selectedLines again with the returned global cartRevision to prepare payment. At payment-link creation, the confirmation is bound to one idempotencyKey: retries must use that same key, and another key is rejected. If the cart changes, payment creation is blocked and checkout must be prepared again.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| addressId | Yes | UUID of the selected shipping address. | |
| promoCode | No | Optional promotional or coupon code. Validity confirmed at quote time. | |
| useCredits | No | Apply available account credits toward the total. | |
| countryCode | Yes | ISO 3166-1 alpha-2 market country code. Choose from market_list output. | |
| cartRevision | Yes | The global cart revision returned by cart_get. | |
| currencyCode | Yes | ISO 4217 alpha-3 market currency code. Choose from market_list output. | |
| languageCode | Yes | Lowercase ISO 639-1 language code. Choose from market_list output. | |
| selectedLines | Yes | The exact cart lines to check out. Copy itemId, configurationId when present, and wholesale from cart_get. Unlisted cart lines stay in the cart. | |
| shippingOptionId | Yes | Selected shipping option ID from checkout_quote response. Must match shippingOptions[].id exactly. |