Ecommerce

Actions

Actions available for implementation in ecommerce connector apps

Canonical actions define the write-operation contract between the frontend and your connector app. When you build an ecommerce connector, you implement action handlers for each of these actions so the frontend can authenticate users, manage carts, and perform other mutations against your commerce backend.

Import these from @laioutr-core/canonical-types/ecommerce.

Auth

AuthLoginAction

ecommerce/auth/login
Login a customer using email and password.
email
stringrequired

The email address of the user.

formatemail
password
stringrequired

The password of the user.

success
booleanrequired
message
string

AuthLogoutAction

ecommerce/auth/logout
Logout a customer.
customerAccessToken
stringrequired

AuthRegisterAction

ecommerce/auth/register
Register a new customer.
email
stringrequired

The email address of the user.

formatemail
password
stringrequired

The password of the user.

firstName
stringrequired

The first name(s) of a person.

lastName
stringrequired

The last name(s) of a person.

salutation
string

Salutation of a person as lowercase key.

title
string

Title of a person as lowercase key.

AuthRecoverAction

ecommerce/auth/recover
Send a recovery email to the customer.
email
stringrequired
formatemail

AuthLoginOauthAction

ecommerce/auth/login-oauth
Login a customer using OAuth.
authorizationUrl
stringrequired

AuthLogoutOauthAction

ecommerce/auth/logout-oauth
Logout a customer.
logoutUrl
stringrequired

AuthOauthCallbackAction

ecommerce/auth/oauth-callback
OAuth callback action for Shopify Customer Account API. This action handles the OAuth 2.0 callback from Shopify's authorization server. It exchanges the authorization code for access tokens and creates a user session.
code
stringrequired

The authorization code returned by Shopify's OAuth server.

state
stringrequired

The state parameter to prevent CSRF attacks.

Cart

CartAddItemsAction

ecommerce/cart/add-items
Add items to the cart.
array

Accepts an array of the following:

CartRemoveItemsAction

ecommerce/cart/remove-items
Remove items from the cart.
string[]

CartUpdateItemsAction

ecommerce/cart/update-items
Update items in the cart. This action is used to update the quantity or custom fields of multiple items in the cart.
array
itemId
stringrequired

Cart line-item id.

quantity
number

The new quantity of the item. Won't update if undefined. Only works for products.

customFields
Record<string, unknown>

CartGetCheckoutUrlAction

ecommerce/cart/get-checkout-url
Get the checkout URL for the cart.
checkoutUrl
stringrequired

Wishlist

WishlistAddItemsAction

ecommerce/wishlist/add-items
Add one or more items to the wishlist.
array
productId
stringrequired

The product id.

variantId
string

The variant id.

customFields
Record<string, unknown>

WishlistRemoveItemsAction

ecommerce/wishlist/remove-items
Remove one or more items from the wishlist.
string[]

Customer

CustomerGetCurrentAction

ecommerce/customer/get-current
Get the current customer data.

CustomerAddressGetAllAction

ecommerce/customer/address-get-all
Get all addresses for the current customer.

CustomerAddressCreateAction

ecommerce/customer/address-create
Create a new address for the current customer.

CustomerAddressUpdateAction

ecommerce/customer/address-update
Update an address for the current customer.
id
stringrequired

The ID of the address to update.

CustomerAddressDeleteAction

ecommerce/customer/address-delete
Delete an address for the current customer.
id
stringrequired

The ID of the address to delete.

CustomerAddressSetDefaultAction

ecommerce/customer/address-set-default
Set a default address for the current customer.
id
stringrequired

The ID of the address to set as default.

type
"shipping" | "billing"required

The type of default to set. Not all backends may support this distinction.

Review

ProductReviewsCreateAction

ecommerce/product/reviews/create
Create and save a new review for a given product ID.
productId
stringrequired
name
stringrequired
email
stringrequired
title
stringrequired
content
stringrequired
points
numberrequired
min1max5
success
booleanrequired
message
string

Entities