Members

(constant) editAddress

Edits an existing address on a user's account

Source:

(constant) searchProducts

Calling this function with a given serachParameter object, will result in a product search object being returned with all the products fitting the search criteria.

Source:

Methods

addAddress(address)

Adds a new address to a user's account

Parameters:
Name Type Description
address Object

the address object

Source:

addItemToWishlist(productId, productURL, quantity)

Add a product to the wishlist

Parameters:
Name Type Description
productId string

The product's ID

productURL string

The URL of the product's detail page

quantity string

The quantity of items being added to the wishlist

Source:

addToCart(productId, quantity, variant)

Adds a product to the cart

Parameters:
Name Type Description
productId string

The product's ID

quantity number

The quantity to add

variant object

(optional, connector-specific object) The variant to be added. Check out the configured connector's commands for the required variant object-shape

Source:

addToCartFromWishlist(productId, formValues)

Adds an item to the cart from the wishlist This command is separate from the add to cart command since some connectors will also remove the item from the wishlist

Parameters:
Name Type Description
productId string

The ID for the product that's being added to the cart

formValues object

The form values required for the command

Source:

addToWishlist(productId, productURL)

Add a product to the wishlist

Parameters:
Name Type Description
productId string

The product's ID

productURL string

The URL of the product's detail page

Deprecated:
  • Use the addItemToWishlist command instead found under integration-manager/products/commands
Source:

createCart(cart, options)

Creates a new cart with the optional cart object.

Parameters:
Name Type Description
cart object

The cart you'd like to migrate it's contents over to the new cart

options object

This object is used pass in any kind of optional information to the command

Source:

deleteAddress(addressId)

Deletes an address from the user's account

Parameters:
Name Type Description
addressId String

the unique ID of the address to be deleted

Source:

deleteCart(cart, options)

Deletes the cart with a given id.

Parameters:
Name Type Description
cart number

The cart id which you want to delete

options object

This object is used pass in any kind of optional information to the command

Source:

deletePromoCode(couponCode)

Deletes promo code

Parameters:
Name Type Description
couponCode string

The coupon code to be removed

Source:

fetchSavedShippingAddresses()

Fetches the registered customer's saved shipping addresses

Source:

fetchShippingMethodsEstimate(inputAddress)

Fetches shipping methods estimates for the given checkout stage

Parameters:
Name Type Description
inputAddress object

The address to estimate shipping for

Source:

fetchTaxEstimate(address, shippingMethod)

Estimates taxes for a proposed address and shipping method

Parameters:
Name Type Description
address object

The address to use for tax estimation

shippingMethod string

The shipping method to use for tax estimation (connector-specific!)

Source:

getAccountInfo()

Gets the user's account info.

Source:

getCart(cart, options)

Retrieves the a given cart by it's id.

Parameters:
Name Type Description
cart number

The id of the cart you want to get

options object

This object is used pass in any kind of optional information to the command

Source:

getCategories(ids) → {Object}

Returns a list of category models for the given category ids

Parameters:
Name Type Description
ids Array.<String>

An array of ids of the Categories you want to get

Source:
Returns:

a module:models/Category

Type
Object

getCategory(id) → {Object}

Returns a category model for the given category id

Parameters:
Name Type Description
id string

The id of the Category you want to get

Source:
Returns:

a module:models/Category

Type
Object

getOrder(orderNumber)

Gets the order detail for current user

Parameters:
Name Type Description
orderNumber string

The id of the order

Source:

getOrderList()

Gets the order history for current user

Source:

getProduct(id) → {Object}

Returns a product model for the given product ids

Parameters:
Name Type Description
id String

The id of the Product you want to get

Source:
Returns:

a module:models/Product

Type
Object

getProducts(ids) → {Object}

Returns a list of category models for the given product ids

Parameters:
Name Type Description
ids Array.<String>

An array of ids of the Products you want to get

Source:
Returns:

a module:models/Product

Type
Object

getProductVariantData(variationSelections, variants, categoryIds)

Called when the user selects a product variation. This provides a hook so that the connector can take some action if needed.

Parameters:
Name Type Description
variationSelections object

The user's product variation selections

variants object

The list of product variants

categoryIds object

The list of product variation category IDs

Source:

getSavedAddresses()

Gets the saved address from user's account

Source:

getSearchSuggestions(args)

Suggests products as the user types their search query

Parameters:
Name Type Description
args String

Query string of what the user is typing

Source:

getShippingLocations(cart, options)

Retrieve the shipping locations from API

Parameters:
Name Type Description
cart object

The cart which you want to get the Shipping location

options object

This object is used pass in any kind of optional information to the command

Source:

getShippingMethods(cart, address, options)

Gets the current carts shipping information.

Parameters:
Name Type Description
cart object

The cart which you want to set the shipping address of

address object

The address to set

options object

This object is used pass in any kind of optional information to the command

Source:

getWishlist()

Gets the saved wishlist for a user

Source:

initAccountAddressPage(url, routeName)

Initializes any required data for Account Address page.

Parameters:
Name Type Description
url string

The url of the current page

routeName string

The route name of the current page

Deprecated:
  • Yes
Source:

initAccountDashboardPage(url, routeName)

Initializes any required data for Account Dashboard page.

Parameters:
Name Type Description
url string

The url of the current page

routeName string

The route name of the current page

Deprecated:
  • Yes
Source:

initAccountInfoPage(url, routeName)

Initializes any required data for Account Info page.

Parameters:
Name Type Description
url string

The url of the current page

routeName string

The route name of the current page

Deprecated:
  • Yes
Source:

initAccountOrderListPage(url, routeName)

Initializes any required data for Account Order List page.

Parameters:
Name Type Description
url string

The url of the current page

routeName string

The route name of the current page

Deprecated:
  • Yes
Source:

initAccountViewOrderPage(url, routeName)

Initializes any required data for the Account View Order page.

Parameters:
Name Type Description
url string

The url of the current page

routeName string

The route name of the current page

Deprecated:
  • Yes
Source:

initApp()

Initializes the connector during app startup. This command dispatched be called before any other integration manager commands are.

Source:

initCartPage(url, routeName)

Initializes any required data for the Cart page

Parameters:
Name Type Description
url string

The url of the current page

routeName string

The route name of the current page

Source:

initCheckoutConfirmationPage(url, routeName)

Initializes any required data for the Checkout Confirmation page

Parameters:
Name Type Description
url string

The url of the current page

routeName string

The route name of the current page

Source:

initCheckoutPaymentPage(url, routeName)

Initializes any required data for the Checking Payment page

Parameters:
Name Type Description
url string

The url of the current page

routeName string

The route name of the current page

Source:

initCheckoutShippingPage(url, routeName)

Initializes any required data for the Checkout Shipping page

Parameters:
Name Type Description
url string

The url of the current page

routeName string

The route name of the current page

Deprecated:
  • Please use relevant commands in the cart branch
Source:

initLoginPage(url, routeName)

Initializes any required data for the Login page.

Parameters:
Name Type Description
url string

The url of the current page

routeName string

The route name of the current page

Deprecated:
  • Yes
Source:

initProductDetailsPage(url, routeName)

Initializes any required data for the Product Details page

Parameters:
Name Type Description
url string

The url of the current page

routeName string

The route name of the current page

Source:

initProductListPage(url, routeName)

Initializes any required data for the Product List page

Parameters:
Name Type Description
url string

The url of the current page

routeName string

The route name of the current page

Deprecated:
  • Please use commands on the categories branch instead
Source:

initRegisterPage(url, routeName)

Initializes any required data for the Register page.

Parameters:
Name Type Description
url string

The url of the current page

routeName string

The route name of the current page

Deprecated:
  • Yes
Source:

initWishlistPage(url, routeName)

Initializes any required data for the Wishlist page.

Parameters:
Name Type Description
url string

The url of the current page

routeName string

The route name of the current page

Deprecated:
  • Yes
Source:

login(username, password, rememberMe) → {Promise}

Logs the user in with the given credentials.

Parameters:
Name Type Description
username string

The user's username

password string

The password provided by the user in clear text

rememberMe boolean

true if the login should be persistent (this may be ignored by the connector)

Source:
Returns:

Resolves to the URL to redirect to. This is often controlled by the backend/connector. If the connector returns a valid URL from this command, the app will navigate to the URL.

Type
Promise

logout()

Logs the current user out.

Source:

Called when the user switches between the Sign In and Register sections.

Parameters:
Name Type Description
router object

The React router object

routes string

The routes configured in this application

sectionName string

The section that was selected (typically this maps to a route name, but that is not guaranteed)

Source:

putPromoCode(couponCode)

Adds promo code

Parameters:
Name Type Description
couponCode string

The coupon code to be applied

Source:

registerUser(firstname, lastname, email, password, opts)

Creates an account using the given parameters.

Parameters:
Name Type Description
firstname string

The user's first name

lastname string

The user's lastname

email string

The user's email

password string

The user's password

opts object

An optional object contains custom data or connector specific data

Source:

removeFromCart(itemID)

Removes an item from the cart

Parameters:
Name Type Description
itemID string

The cart item ID to remove

Source:

removeItemFromWishlist(itemID, wishlistID, productID, quantity)

Removes an item from the wishlist Some connectors might not give items within a wishlist a different ID than their product ID. In that case use the same value for both params

Parameters:
Name Type Description
itemID string

The id for the item in the wishlist that should be removed

wishlistID string

The id for the wishlist the item should be removed from

productID string

The product id for the item being removed

quantity string

The quantity of items being removed

Source:

reorderPreviousOrder(orderNumber)

Adds a previous order's items to a user's cart

Parameters:
Name Type Description
orderNumber String
Source:

setShippingAddress(cart, address, options)

Sets the current carts shipping information.

Parameters:
Name Type Description
cart object

The cart which you want to set the shipping address of

address object

The address to set

options object

This object is used pass in any kind of optional information to the command

Source:

setShippingMethod(cart, address, options)

Sets the current carts shipping method information.

Parameters:
Name Type Description
cart object

The cart which you want to set the shipping address of

address object

The method to set

options object

This object is used pass in any kind of optional information to the command

Source:

submitPayment(formValues) → {Promise}

Submits the payment stage of the checkout flow.

Parameters:
Name Type Description
formValues object

All of the values from the payment form (see store/checkout/constants:PAYMENT_FORM_NAME)

Source:
Returns:

Resolves to the URL to redirect to for confirmation. This is often controlled by the backend/connector. If the connector returns a valid URL from this command, the app will navigate to the URL.

Type
Promise

submitShipping(formValues) → {Promise}

Submits the shipping stage of the checkout flow.

Parameters:
Name Type Description
formValues object

All of the values from the shipping form (see store/checkout/constants:SHIPPING_FORM_NAME)

Source:
Returns:

Resolves to the URL to redirect to for payment. This is often controlled by the backend/connector. If the connector returns a valid URL from this command, the app will navigate to the URL.

Type
Promise

updateAccountInfo(formValues)

Updates the user's account info.

Parameters:
Name Type Description
formValues object

The form values provided from the account info

Source:

updateAccountPassword(formValues)

Updates the user's account password.

Parameters:
Name Type Description
formValues object

The form values provided from the account password

Source:

updateBillingAddress(formValues)

Updates the user's billing address to the given address. Some backends don't distinguish between a saved shipping and saved billing addresses. In those cases this command will still save the address for the user.

Parameters:
Name Type Description
formValues object

The form values provided from the address form

Source:

updateCart(cart, cart, options)

Updates a cart with a given id with it's new cart values

Parameters:
Name Type Description
cart number

The cart id of the cart you want to update

cart object

The cart with it's modified values

options object

This object is used pass in any kind of optional information to the command

Source:

updateCartItem(itemID, quantity, productId, variant)

Removes an item from the cart

Parameters:
Name Type Description
itemID string

The cart item ID to update

quantity number

The new quantity

productId string

The new product ID to replace cart item

variant object

(optional, connector-specific object) The new product variant Check out the configured connector's commands for the required variant object-shape

Source:

updateCustomerInformation(cart, cart, options)

Updates the customer information of a cart given cart

Parameters:
Name Type Description
cart object

The cart which you want to set the customer infomation of

cart object

The customer information values

options object

This object is used pass in any kind of optional information to the command

Source:

updateItemQuantity(itemID, quantity)

Updates the quantity of the given item in the cart

Parameters:
Name Type Description
itemID string

The cart item ID to update

quantity number

The new quantity

Source:

updateShippingAddress(formValues)

Updates the user's shipping address to the given address. Some backends don't distinguish between a save shipping and saved billing address. In those cases this command will still save the address for the user.

Parameters:
Name Type Description
formValues object

The form values provided from the address form

Source:

updateShippingAndBilling()

Updates the registered customer's billing and shipping addresses using the address that was given during checkout. This should be called during checkout once shipping information has been provided.

Deprecated:
  • Please use setShippingAddress command instead
Source:

updateWishlistItem(itemID, wishlistID, quantity)

Updates an item in the wishlist Some connectors might not give items within a wishlist a different ID than their product ID. In that case use the same value for both params

Parameters:
Name Type Description
itemID string

The id for the item in the wishlist that should be removed

wishlistID string

The id for the wishlist the item should be removed from

quantity string

The quantity of items being removed

Source:

updateWishlistItemQuantity(quantity, itemId, wishlistId)

Updates the quantity of an item in a wishlist

Parameters:
Name Type Description
quantity string

The new quantity of the item in the wishlist

itemId string

The wishlist item ID

wishlistId string

The ID of the wishlist

Source: