## Run server update Use this method to wrap an async function that makes a request to your server to update the Checkout Session. > `runServerUpdate` enforces a 20-second timeout for your update function. If your function doesn't resolve within 20 seconds, `runServerUpdate` returns an error. Wrap `runServerUpdate` calls in `try`/`catch` blocks to handle any errors. This method returns a `Promise` that resolves with an object containing the following fields: * `type`: one of either `"success"` or `"error"` * `session`: only populated when `type` is `"success"`. Contains a [Session](/js/custom_checkout/session_object) instance representing the updated state. * `error`: only populated when `type` is `"error"`. Contains an object with a string `message` field which can be displayed to your customer. **Syntax:** `actions.runServerUpdate(...)` - `userFunction` (function) **required** An async function to make a request to your server to update the Checkout Session. ### Run server update ```jsx actions.runServerUpdate( () => { return fetch('/update-checkout-session', { method: 'POST', body: JSON.stringify({checkoutSessionId: '{CHECKOUT_SESSION_ID}'}), }); } ); ```