updateCheckoutTemplate( )
Updates a checkout template.
Description
If the info in a checkout template is updated, only new checkouts created from this template will include the updated items. Checkouts previously created from this template before the update will not be affected.
This function requires elevated permissions to run. This function is not universal and runs only on the backend.
Syntax
function updateCheckoutTemplate(_id: string, checkoutTemplate: UpdateCheckoutTemplate): Promise<CheckoutTemplate>
updateCheckoutTemplate Parameters
NAME
TYPE
DESCRIPTION
Checkout template ID.
Checkout template info to update.
Returns
Updated checkout template.
Return Type:
NAME
TYPE
DESCRIPTION
Checkout template ID.
Coupon code.
Note that a checkout can only hold one couponCode
at a time. If an additional couponCode
is added, it will override the existing couponCode
.
For additional information, see the Coupons API.
Custom settings to apply to the checkout page created from this template.
Line items.
Max: 300 items
Status of the checkout template.
When status
is INACTIVE
checkouts will not be created with this template _id
. Instead, the function will redirect to the domain site.
Default: ACTIVE
Was this helpful?
updateCheckoutTemplate example
1import { checkoutTemplates } from 'wix-ecom-backend';23 async function updateCheckoutTemplate(id, checkoutTemplate, options) {4 try {5 const result = await checkoutTemplates.updateCheckoutTemplate(id, checkoutTemplate, options);67 return result;8 } catch (error) {9 console.error(error);10 // Handle the error11 }12 }13