Actions
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/loginThe email address of the user.
The password of the user.
AuthLogoutAction
ecommerce/auth/logoutunknownAuthRegisterAction
ecommerce/auth/registerThe email address of the user.
The password of the user.
The first name(s) of a person.
The last name(s) of a person.
Salutation of a person as lowercase key.
Title of a person as lowercase key.
unknownAuthRecoverAction
ecommerce/auth/recoverunknownAuthLoginOauthAction
ecommerce/auth/login-oauthAuthLogoutOauthAction
ecommerce/auth/logout-oauthAuthOauthCallbackAction
ecommerce/auth/oauth-callbackThe authorization code returned by Shopify's OAuth server.
The state parameter to prevent CSRF attacks.
unknownCart
CartAddItemsAction
ecommerce/cart/add-itemsUnion of all possible items that can be added to the cart. If you find yourself in a situation where you need to add items which are not products or discount-codes, you should create a custom action for that or use the type custom.
Accepts an array of the following:
Per-item outcome, in input order where possible.
CartRemoveItemsAction
ecommerce/cart/remove-itemsstring[]unknownCartUpdateItemsAction
ecommerce/cart/update-itemsCart line-item id.
The new quantity of the item. Won't update if undefined. Only works for products.
Custom fields are a way for implementations to pass arbitrary data to actions, queries, etc.
unknownCartGetCheckoutUrlAction
ecommerce/cart/get-checkout-urlProduct Lists
Product lists replace the former wishlist-specific mutations with one contract for wishlists, favorites, shopping lists, and B2B requisition lists.
ProductListCreateAction
ecommerce/product-list/createThe visibility value set — shared with the ecommerce/product-list/* actions so the vocabulary has a single source.
Initial items to create the list with.
The ID of the created product list.
ProductListUpdateAction
ecommerce/product-list/updateThe visibility value set — shared with the ecommerce/product-list/* actions so the vocabulary has a single source.
unknownProductListDeleteAction
ecommerce/product-list/deleteunknownProductListDuplicateAction
ecommerce/product-list/duplicateThe name of the new list.
The ID of the created copy.
ProductListAddItemsAction
ecommerce/product-list/add-itemsThe list to add to. Absent ⇒ the customer's default wishlist.
unknownProductListUpdateItemsAction
ecommerce/product-list/update-itemsThe list the entries are on. Absent ⇒ the customer's default wishlist.
unknownProductListRemoveItemsAction
ecommerce/product-list/remove-itemsThe list to remove from. Absent ⇒ the customer's default wishlist.
unknownProductListAddToCartAction
ecommerce/product-list/add-to-cartThe list to add to the cart. Absent ⇒ the customer's default wishlist.
Per-item outcome.
Customer
CustomerGetCurrentAction
ecommerce/customer/get-currentA customer is a person who has an account with the shop.
CustomerUpdateAction
ecommerce/customer/updateCustom fields are a way for implementations to pass arbitrary data to actions, queries, etc.
unknownCustomerAddressGetAllAction
ecommerce/customer/address-get-allCustomerAddressCreateAction
ecommerce/customer/address-createunknownCustomerAddressUpdateAction
ecommerce/customer/address-updateThe ID of the address to update.
unknownCustomerAddressDeleteAction
ecommerce/customer/address-deleteThe ID of the address to delete.
unknownCustomerAddressSetDefaultAction
ecommerce/customer/address-set-defaultThe ID of the address to set as default.
The type of default to set. Not all backends may support this distinction.
unknownOrders
OrderReorderAction
ecommerce/order/reorderThe ID of the order to reorder.
Per-item outcome of the reorder.
OrderCancelAction
ecommerce/order/cancelThe ID of the order to cancel.
unknownOrderGetStatisticsAction
ecommerce/order/get-statisticsThe calendar year to aggregate. Defaults to the current year.
The calendar year the statistics cover.
One entry per month with data; months without orders may be omitted.
Documents
DocumentGetAllAction
ecommerce/document/get-allDocumentGetDownloadUrlAction
ecommerce/document/get-download-urlThe ID of the document to download.
Legal
LegalWithdrawalAction
ecommerce/legal/withdrawalReview
ProductReviewsCreateAction
ecommerce/product/reviews/createA rating between 1 and 5. That's the most common rating scale. No other scale is supported at the moment. Decimals are allowed.