About the eCommerce Checkout Templates API

The Checkout Templates API allows you to create and manage pre-populated checkouts to share with customers. When customers then create checkouts from these templates, the new checkouts already include information such as predefined line items, coupons, or other customizations.

With the Checkout Templates API, you can:

  • Run a sale on a specific product for a limited time
  • Customize the checkout experience

Before you Begin

It’s important to note that the checkout template functionality is not currently available in the Wix Dashboard. If a site creates checkout templates with an app, they must also be able to manage and update their checkout templates through an app. For example, a website offering a sale through a checkout template must be able to change the template’s status to INACTIVE or they will not be able to turn off the sale when they want it to end.

Use Cases

Was this helpful?
Yes
No

Checkout Templates: Sample Use Case & Flow

This article shares some possible use cases your app could support, as well as an sample flow that could support each use case. This can be a helpful jumping off point as you plan your app's implementation.

Run a flash sale through social media

Offer a sale to customers through social media channels that runs for a limited time only. Create the checkout template and pull the URL to automatically redirect anyone that clicks on the link to a checkout page with the offer. When the period for the sale is complete, update the checkout template's status to INACTIVE to turn it off.

To create and share the offer:

  1. Use Create Checkout Template with the product and coupon information for offer.
  2. Use the checkoutTemplateId to build the URL to share with customers. Build the URL in this format: https://www.wixapis.com/ecom/v1/checkout-templates/{checkoutTemplateId}/create-and-redirect-to-checkout?siteId={siteId}.
  3. Post and share the URL to customers.

To turn off the offer at the end of the sale:

  1. Use Update Checkout Template to update checkoutTemplate.status to INACTIVE.

Limit the number of checkouts for a specific coupon

Offer a sale to the first 100 customers that click on an offer. Create a checkout template, then share your own custom link that will run custom logic before creating a new checkout for the customer.

Create a checkout template and add your own custom logic:

  1. Use Create Checkout Template with the product and coupon information for offer.
  2. Create a bank of all new checkouts for this sale by collecting the checkoutIds of checkouts created from this checkoutTemplateId.
  3. Before a new checkout is created with the checkoutTemplateId, check the bank and count the number of checkoutIds being stored.
  4. Once the count hits 100 checkouts, use Update Checkout Template to update checkoutTemplate.status to INACTIVE.
Was this helpful?
Yes
No

Checkout Template Object

A checkout template can be shared with customers to create checkouts with predefined information already included.

Properties
idstringRead-onlyformat GUID
Checkout template ID.

statusstring
3 enum supported values:
UNKNOWN_STATUSACTIVEINACTIVE
Status of the checkout template. When status is INACTIVE checkouts will not be created with this template id. Instead, the endpoint will redirect to the domain site. Default: ACTIVE

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

lineItemsArray <LineItem>maxItems 300
Line items. Max: 300 items

couponCodestring
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.
Was this helpful?
Yes
No

PostCreate Checkout Template

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Creates a checkout template.

A checkout template is used to create a new checkout that will include predefined information. For example, a single link with a checkoutTemplateId can be shared with customers and each time the link is clicked, a new checkout page will be created for that customer with certain checkout information already populated.

The customizable features include the option to allow or to lock coupon codes or gift cards. For example, if a store owner is using the checkout template to offer a flash sale to their social media followers, they may want to lock the option to apply an additional coupon on top of the sale being offered. If so, they can set customization.applyCouponLocked to true.

A checkout can be created with a checkout template in 2 ways:

  • Create and Redirect to Checkout. With this endpoint you can build a URL that when clicked will create a new checkout and redirect the customer to that new checkout page.
  • Create Checkout From Template. This endpoint can be called to create a new checkout from the checkout template. The site may add further customizations to the new checkout and then redirect the customer using the new checkout's checkoutUrl.
Endpoint
POST
https://www.wixapis.com/ecom/v1/checkout-templates

Event TriggersThis method triggers the following events:
Was this helpful?
Yes
No

GetGet Checkout Template

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Retrieves a checkout template.

Endpoint
GET
https://www.wixapis.com/ecom/v1/checkout-templates/{checkoutTemplateId}

Was this helpful?
Yes
No

DeleteDelete Checkout Template

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Deletes a checkout template.

If a checkout template is deleted and a customer attempts to create a checkout with that checkoutTemplateId then the customer will be redirected to the domain site.

Endpoint
DELETE
https://www.wixapis.com/ecom/v1/checkout-templates/{checkoutTemplateId}

Event TriggersThis method triggers the following events:
Was this helpful?
Yes
No

PatchUpdate Checkout Template

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Updates a checkout template.

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.

Endpoint
PATCH
https://www.wixapis.com/ecom/v1/checkout-templates/{checkoutTemplate.id}

Event TriggersThis method triggers the following events:
Was this helpful?
Yes
No

PostQuery Checkout Templates

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Retrieves a list of checkout templates, given the provided paging, filtering, and sorting.

Query Checkout Templates runs with these defaults, which you can override:

  • id sorted in ASC order

The following table shows field support for filters and sorting for the checkout template object:

FieldSupported FiltersSortable
id$eq, $ne, $in, $startsWith, $exists, $hasSomeSortable
status$eq, $ne, $in, $exists, $hasSomeSortable

To learn about working with Query endpoints, see API Query Language, Sorting and Paging, and Field Projection.

Endpoint
POST
https://www.wixapis.com/ecom/v1/checkout-templates/query

Was this helpful?
Yes
No

PostCreate Checkout From Template

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Creates a new checkout based on the checkout template.

Before using this endpoint, you must have a checkout template available. Create a checkout template with Create Checkout Template.

The customer can be directed to the new checkout using the checkout's checkoutUrl.

To create the new checkout and automatically redirect to the checkout page, use Create and Redirect to Checkout.

Endpoint
POST
https://www.wixapis.com/ecom/v1/checkout-templates/{checkoutTemplateId}/create-checkout-from-template

Event TriggersThis method triggers the following events:
Was this helpful?
Yes
No

Checkout Template Created

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Triggered when a checkout template is created.

Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring
Unique event ID. Allows clients to ignore duplicate webhooks.

entityFqdnstring
Fully qualified domain name of the entity associated with the event. Expected wix.ecom.v1.checkout_template.

slugstring
Event name. Expected created.

entityIdstring
ID of the entity associated with the event.

eventTimestringformat date-time
Event timestamp.

triggeredByAnonymizeRequestboolean
Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).

originatedFromstring
If present, indicates the action that triggered the event.

createdEventobject
Event information.

Was this helpful?
Yes
No

Checkout Template Updated

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Triggered when a checkout template is updated.

Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring
Unique event ID. Allows clients to ignore duplicate webhooks.

entityFqdnstring
Fully qualified domain name of the entity associated with the event. Expected wix.ecom.v1.checkout_template.

slugstring
Event name. Expected updated.

entityIdstring
ID of the entity associated with the event.

eventTimestringformat date-time
Event timestamp.

triggeredByAnonymizeRequestboolean
Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).

originatedFromstring
If present, indicates the action that triggered the event.

updatedEventobject
Event information.

Was this helpful?
Yes
No

Checkout Template Deleted

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Triggered when a checkout template is deleted.

Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring
Unique event ID. Allows clients to ignore duplicate webhooks.

entityFqdnstring
Fully qualified domain name of the entity associated with the event. Expected wix.ecom.v1.checkout_template.

slugstring
Event name. Expected deleted.

entityIdstring
ID of the entity associated with the event.

eventTimestringformat date-time
Event timestamp.

triggeredByAnonymizeRequestboolean
Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).

originatedFromstring
If present, indicates the action that triggered the event.

deletedEventstruct
Event information.

Was this helpful?
Yes
No

Checkout Template Used

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Triggered when a checkout is created from a checkout template.

Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring
Unique event ID. Allows clients to ignore duplicate webhooks.

entityFqdnstring
Fully qualified domain name of the entity associated with the event. Expected wix.ecom.v1.checkout_template.

slugstring
Event name. Expected used.

entityIdstring
ID of the entity associated with the event.

eventTimestringformat date-time
Event timestamp.

triggeredByAnonymizeRequestboolean
Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).

originatedFromstring
If present, indicates the action that triggered the event.

actionEventobject
Event information.

Was this helpful?
Yes
No