Search.../

getCheckoutTemplate( )

Developer Preview

Retrieves a checkout template.

Admin Method

This function requires elevated permissions to run. This function is not universal and runs only on the backend.

Syntax

function getCheckoutTemplate(checkoutTemplateId: string): Promise<CheckoutTemplate>

getCheckoutTemplate Parameters

NAME
TYPE
DESCRIPTION
checkoutTemplateId
string

ID of the checkout template to retrieve.

Returns

Retrieved checkout template.

Return Type:

Promise<
CheckoutTemplate
>
NAME
TYPE
DESCRIPTION
_id
string

Checkout template ID.

couponCode
string

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.

customization
CheckoutCustomization

Custom settings to apply to the checkout page created from this template.

lineItems
Array<
LineItem
>

Line items.

Max: 300 items

status
string

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?

getCheckoutTemplate example

Copy Code
1import { checkoutTemplates } from 'wix-ecom-backend';
2
3 async function getCheckoutTemplate(checkoutTemplateId) {
4 try {
5 const result = await checkoutTemplates.getCheckoutTemplate(checkoutTemplateId);
6
7 return result;
8 } catch (error) {
9 console.error(error);
10 // Handle the error
11 }
12 }
13