Save shopper context

Create read-only Swym accounts for your shoppers.

swat.saveShopperContext

Save shopper context via Swym shopper capture interfaces; or in other words, make a read-only account on your ecommerce platform using Swym Wishlist.

Definition

swat.saveShopperContext(email, userConfig, onSuccess, onError)

Example

let email = "[email protected]" // shopper email

let userConfig = {
  fname: "first name",
  lname: "last name",
  src: "", // enum(remoteauth, wlreminder, bispaform)
  app: "", // enum(Wishlist, Watchlist)
  skipConnect: false // send connect emails
};

swat.saveShopperContext(email, userConfig, onSuccess, onError)

API Parameters

ArgumentTypeDescription
emailstringA valid shopper email address
userConfigobjectAn object that contains information for creating a shopper context (user account) on the swym platform.
onSuccessfunctionfunction which will be called with the success response
onErrorfunctionError callback function which will be called if there is an error.

Response

{
    "message": "User saved."
}

You will receive a simple message that the user is now saved, The user email in question will receive an email to verify their account.

Other References

User Config

KeyTyperequired?description
fnamestringoptionalShopper first name
lnamestringoptionalShopper last name
acceptMarketingbooleanoptionalSet param to true or false if user has chosen to not check an Add to mailing list checkbox
srcenum(remoteauth, wlreminder, bispaform)optionalEnumerated list of sources for email capture report
appenum(Wishlist, Watchlist)optionalEnumerated list of apps for email capture report
skipConnectbooleanyesSet to true when merchant/retailer settings has a flag to avoid sending remote connect email

Enums

This belongs to src attribute

enumappdescription
remoteauthWishlist, Swym Back in Stock Alertsis a remote authentication event type.
wlreminderWishlistIs a wlreminder authentication context for wishlist.
bispaformSwym Back In Stock AlertsIs a watchlist authentication context for swym back in stock alerts .