> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # RedirectToCheckout # Package: checkout # Namespace: AbandonedCheckoutService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/purchase-flow/checkout/abandoned-checkout/redirect-to-checkout.md ## Introduction Redirects an abandoned checkout to its checkout page. --- ## REST API ### Schema ``` Method: redirectToCheckout Description: Redirects an abandoned checkout to its checkout page. URL: https://www.wixapis.com/ecom/v1/abandoned-checkout/{abandonedCheckoutId}/redirect-to-checkout Method: GET # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: abandonedCheckoutId, metasiteId Method parameters: param name: abandonedCheckoutId | type: none | required: true query param name: metasiteId | type: metasiteId | description: Metasite GUID of the site associated with the abandoned checkout. | required: true Return type: RawHttpResponse - name: body | type: bytes | description: - name: statusCode | type: integer | description: - name: headers | type: array | description: - name: key | type: string | description: - name: value | type: string | description: ``` ### Examples ### Redirect To Checkout Redirects the API caller to the checkout page. ```curl curl -X GET https://www.wixapis.com/ecom/v1/abandoned-checkout/330c3e52-73d4-4cc7-8eb2-61f6c5a07478/redirect-to-checkout?metasiteId=f245094e-5aef-43c5-8d93-765c99e35a39 \ -H "Authorization: " \ -H "Content-Type:application/json" ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.checkout.AbandonedCheckoutService.redirectToCheckout(abandonedCheckoutId, metasiteId) Description: Redirects an abandoned checkout to its checkout page. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: metasiteId, abandonedCheckoutId Method parameters: param name: abandonedCheckoutId | type: string | description: GUID of the abandoned checkout. | required: true param name: metasiteId | type: string | description: Metasite GUID of the site associated with the abandoned checkout. | required: true Return type: PROMISE - name: body | type: bytes | description: - name: statusCode | type: integer | description: - name: headers | type: array | description: - name: key | type: string | description: - name: value | type: string | description: ``` ### Examples ### redirectToCheckout ```javascript import { abandonedCheckouts } from '@wix/ecom'; async function redirectToCheckout(abandonedCheckoutId,metasiteId) { const response = await abandonedCheckouts.redirectToCheckout(abandonedCheckoutId,metasiteId); }; ``` ### redirectToCheckout (with elevated permissions) ```javascript import { abandonedCheckouts } from '@wix/ecom'; import { auth } from '@wix/essentials'; async function myRedirectToCheckoutMethod(abandonedCheckoutId,metasiteId) { const elevatedRedirectToCheckout = auth.elevate(abandonedCheckouts.redirectToCheckout); const response = await elevatedRedirectToCheckout(abandonedCheckoutId,metasiteId); } ``` ### redirectToCheckout (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { abandonedCheckouts } from '@wix/ecom'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { abandonedCheckouts }, // Include the auth strategy and host as relevant }); async function redirectToCheckout(abandonedCheckoutId,metasiteId) { const response = await myWixClient.abandonedCheckouts.redirectToCheckout(abandonedCheckoutId,metasiteId); }; ``` ---