This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Retrieves the checkout page URL of a specified checkout.
By default, a checkoutUrl
generates for a checkout and directs to a standard Wix checkout page.
However, if overrideCheckoutUrl
has a value, it will replace and set the value of checkoutUrl
.
function getCheckoutUrl(
_id: string,
options: GetCheckoutUrlOptions,
): Promise<GetCheckoutURLResponse>;
Checkout ID.
import { checkout } from "wix-ecom-backend";
async function getCheckoutUrl(id, options) {
try {
const result = await checkout.getCheckoutUrl(id, options);
return result;
} catch (error) {
console.error(error);
// Handle the error
}
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.