Skip to content

Instantly share code, notes, and snippets.

@mamund
Last active December 2, 2021 01:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mamund/1c6b98b281f3014d532e2196b4a467aa to your computer and use it in GitHub Desktop.
Save mamund/1c6b98b281f3014d532e2196b4a467aa to your computer and use it in GitHub Desktop.

Shopping API

  • Supports the book browsing experience and cart management
  • Scope: Public

Add Events

Place the events on the proper line in the table

  • Cart.ItemAdded
  • Cart.ItemRemoved
  • Cart.Cleared
  • Cart.Viewed
  • Books.Listed
  • Books.Searched
Operation Name Description Participants Resource(s) Emitted Events Operation Details Traits
listBooks() List books by category or release date Customer, Call Center Book Request Parameters: categoryId, releaseDate Returns: Books[]
searchBooks() Search for books by author, title Customer, Call Center Book Request Parameters: searchQuery Returns: Books[]
addItemToCart() Add a book to the customer's cart Customer, Call Center Cart Item, Cart Request Parameters: cartId, bookId, quantity Returns: Cart
removeItemFromCart() Remove a book from the customer's cart Customer, Call Center Cart Item, Cart Request Parameters: cartItemId Returns: Cart
clearCart() Remove all books from the customer's cart Customer, Call Center Cart Request Parameters: cartId Returns: Cart
viewCart() View the current cart and total Customer, Call Center Cart Request Parameters: cartId Returns: Cart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment