Home > @vsf-enterprise/commercetools-api

# commercetools-api package

Types and default queries for API endpoints

# Remarks

The @vsf-enterprise/commercetools-api library contains everything needed to fetch data from the commercetools e-commerce platform. This includes API client configuration, API endpoints or default queries.

# Enumerations

Enumeration Description
AttributeType
TokenType Types of access tokens used by the integration

# Functions

Function Description
addBillingAddress(context, params, customQuery) Endpoint for adding new billing address for the current user. By default, it uses the addBillingAddressDefaultQuery GraphQL query
addMultipleToMyShoppingList(context, params, customQuery) Endpoint for adding multiple items to the wishlist. By default, it uses the addMultipleToMyShoppingListDefaultQuery GraphQL query
addReview(context, params, customQuery) Endpoint for adding new product reviews. By default, it uses the addReviewDefaultQuery GraphQL query
addShippingAddress(context, params, customQuery) Endpoint for adding new shipping address for the current user. By default, it uses the addShippingAddressDefaultQuery GraphQL query
addToCart(context, cart, params, customQuery) Endpoint for adding product to the provided cart. By default, it uses the updateCartDefaultQuery GraphQL query
addToMyShoppingList(context, params, customQuery) Endpoint for adding item to the wishlist. By default, it uses the addToMyShoppingListDefaultQuery GraphQL query
applyCartCoupon(context, params, discountCode, customQuery) Endpoint for applying discount code to the provided cart. By default, it uses the updateCartDefaultQuery GraphQL query
createCart(context, cartDraft, customQuery) Endpoint for creating a new cart for the current user. By default, it uses the createCartDefaultQuery GraphQL query
createMyOrderFromCart(context, draft, customQuery) Endpoint for creating order from cart of the current user. By default, it uses the createMyOrderFromCartDefaultQuery GraphQL query
createMyShoppingList(context, draft, customQuery) Endpoint for creating new wishlist. By default, it uses the createMyShoppingListDefaultQuery GraphQL query
customerChangeMyPassword(context, version, currentPassword, newPassword) Endpoint for changing password of the currently logged user. By default, it uses the customerChangeMyPasswordDefaultQuery GraphQL query
customerResetPassword(context, tokenValue, newPassword, customQuery) Endpoint for resetting password for the user associated with given token. By default, it uses the customerResetPasswordDefaultQuery GraphQL query
customerSignMeIn(context, draft, customQuery) Endpoint for logging in a user. By default, it uses the customerSignMeInDefaultQuery GraphQL query
customerSignMeUp(context, draft, customQuery) Endpoint for registering a new user. By default, it uses the customerSignMeUpDefaultQuery GraphQL query
customerSignOut(context) Endpoint for logging out the current user. It doesn't use any GraphQL query
customerUpdateMe(context, currentUser, updatedUserData, customQuery) Endpoint for updating data of the currently logged user. By default, it uses the customerUpdateMeDefaultQuery GraphQL query
deleteBillingAddress(context, params, customQuery) Endpoint for deleting saved billing address of the currently logged user based on provided ID. By default, it uses the deleteBillingAddressDefaultQuery GraphQL query
deleteCart(context, params, customQuery) Endpoint for deleting cart of the currently logged user based on parameters. By default, it uses the deleteCartDefaultQuery GraphQL query
deleteShippingAddress(context, params, customQuery) Endpoint for deleting saved shipping address of the currently logged user based on provided ID. By default, it uses the deleteShippingAddressDefaultQuery GraphQL query
getCart(context, cartId, customQuery)
getCategory(context, params, customQuery) Endpoint for loading categories based on filter parameters. By default, it uses the getCategoryDefaultQuery GraphQL query
getChannel(context, params) Endpoint for fetching a list of channels. By default, it uses the getChannelDefaultQuery GraphQL query
getFacetCategories(context, params, customQuery) Endpoint for loading categories based on filter parameters. By default, it uses the getFacetCategoriesDefaultQuery GraphQL query
getFacetProductProjection(context, params, customQuery) Endpoint for loading products based on provided filters, as well as sorting and pagination options. By default, it uses the getFacetProductProjectionDefaultQuery GraphQL query
getInventory(context, params, customQuery) Endpoint for checking inventory for given product SKUs. By default, it uses the getInventoryDefaultQuery GraphQL query
getMe(context, params, customQuery) Endpoint for retrieving data about current user. By default, it uses the getMeBasicProfileDefaultQuery GraphQL query when customer parameter is not passed and the getMeFullProfileDefaultQuery GraphQL query when it's passed
getMyShoppingList(context, customQuery) Endpoint for retrieving wishlist for a current user. By default, it uses the getMyShoppingListDefaultQuery GraphQL query
getOrders(context, params, customQuery) Endpoint for fetching filtered, sorted, and paginated user orders. By default, it uses the getOrdersDefaultQuery GraphQL query
getProduct(context, params, customQuery) Endpoint for fetching filtered, and paginated products. By default, it uses the getProductDefaultQuery GraphQL query
getReview(context, params, customQuery) Endpoint for fetching paginated reviews for the provided product. By default, it uses the getReviewDefaultQuery GraphQL query
getShippingMethods(context, cartId, customQuery) Endpoints for fetching shipping methods available for the given cart. By default, it uses the getShippingMethodsDefaultQuery GraphQL query
getStores(context, params) Endpoint for fetching available stores. By default, it uses the getStoresDefaultQuery GraphQL query
isAnonymousSession(token) Helper for checking if given token is an anonymous session
isGuest(context) Endpoint for checking if user is a guest. It doesn't use any GraphQL query
isLoggedIn(context) Endpoint for checking if user is logged in or not. It doesn't use any GraphQL query
isUserSession(token) Helper for checking if given token represents an user session
removeCartCoupon(context, params, discountCode, customQuery) Endpoint for removing coupon code from cart. By default, it uses the updateCartDefaultQuery GraphQL query
removeFromCart(context, cart, product, customQuery) Endpoint for removing product from the cart. By default, it uses the updateCartDefaultQuery GraphQL query
removeFromMyShoppingList(context, params, customQuery) Endpoint for removing products from the wishlist. By default, it uses the addToMyShoppingListDefaultQuery GraphQL query
setDefaultBillingAddress(context, params, customQuery) Endpoint for setting default billing address of the currently logged user based on provided ID. By default, it uses the setDefaultBillingAddressDefaultQuery GraphQL query
setDefaultShippingAddress(context, params, customQuery) Endpoint for setting default shipping address of the currently logged user based on provided ID. By default, it uses the setDefaultShippingAddressDefaultQuery GraphQL query
updateBillingAddress(context, params, customQuery) Endpoint for updating billing address of the current user. By default, it uses the updateBillingAddressDefaultQuery GraphQL query
updateCart(context, params, customQuery) Updates user cart using provided actions. By default, it uses the updateCartDefaultQuery GraphQL query
updateCartQuantity(context, cart, product, customQuery) Endpoint for updating quantity of given product from the cart. By default, it uses the updateCartDefaultQuery GraphQL query
updateShippingAddress(context, params, customQuery) Endpoint for updating shipping address of the current user. By default, it uses the updateShippingAddressDefaultQuery GraphQL query
updateShippingDetails(context, cart, shippingDetails, customQuery) Updated shipping address details on the given cart. By default, it uses the updateCartDefaultQuery GraphQL query

# Interfaces

Interface Description
AddBillingAddressParams Parameters for the addBillingAddress API endpoint
AddMultipleToMyShoppingListParams Parameters for the addMultipleToMyShoppingList API endpoint
AddReviewParams Parameters for the addMultipleToMyShoppingList API endpoint
AddShippingAddressParams Parameters for the addShippingAddress API endpoint
AddToCartParams First parameter for the addToCart API endpoint
AddToCartProductParams Second parameter for the addToCart API endpoint
AddToMyShoppingListParams Parameters for the addToMyShoppingList API endpoint
ApiConfig The api property in integration configuration
ApiMethods All API endpoints available in the integration out of the box
ApplyCartCouponParams Parameters for the applyCartCoupon API endpoint
Auth Object with helpers for reading and creating access token cookies and accessing current token provider
BaseSearch
CartData
CategoryWhereSearch
ChannelsWhereSearch
ClientInstance
Config Integration configuration after initialization and merging defaults
Context Contains current request and response object, integration configuration and helper methods
CookiesConfig Names of the cookies for user currency, country, locale, and store
CreateCartParams Parameters for the createCart API endpoint
CreateMyOrderFromCartParams Parameters for the createMyOrderFromCart API endpoint
CreateMyShoppingListParams Parameters for the createMyShoppingList API endpoint
CustomerUpdateCurrentUser First parameter used in the customerUpdateMe API endpoint
DeleteBillingAddressParams Parameters for the deleteBillingAddress API endpoint
DeleteCartParams Parameters for the deleteCart API endpoint
DeleteShippingAddressParams Parameters for the deleteShippingAddress API endpoint
Filter
FilterOption
FlowOptions
GetChannelParams Parameters for the getChannel API endpoint
GetFacetProductProjectionParams Parameters for the getFacetProductProjection API endpoint
GetInventoryParams Parameters for the getInventory API endpoint
GetMeParams Parameters for the getMe API endpoint
GetOrdersParams Parameters for the getOrders API endpoint
GetReviewParams Parameters for the getReview API endpoint
GetStoresParams Parameters for the getStores API endpoint
LineItemIdentifier
LocaleItem
OrderWhereSearch
ProductIdentifier
ProductWhereSearch
RemoveCartCouponParams Parameters for the removeCartCoupon API endpoint
RemoveFromCartParams First arameter for the removeFromCart API endpoint
RemoveFromMyShoppingListParams Parameters for the removeFromMyShoppingList API endpoint
ServerApiConfiguration The serverApi property in integration configuration
SetDefaultBillingAddressParams Parameters for the setDefaultBillingAddress API endpoint
SetDefaultShippingAddressParams Parameters for the setDefaultShippingAddress API endpoint
SetupConfig
ShoppingListData
Token Token returned by commercetools API
UpdateBillingAddressParams Parameters for the updateBillingAddress API endpoint
UpdateCartParams Parameters for the updateCart API endpoint
UpdateCartQuantityParams First parameter for the updateCartQuantity API endpoint
UpdateCartQuantityProductParams Second parameter for the updateCartQuantity API endpoint
UpdatedUserData Second parameter used in the customerUpdateMe API endpoint
UpdateShippingAddressParams Parameters for the updateShippingAddress API endpoint
UpdateShippingDetailsParams Parameters for the updateShippingDetails API endpoint

# Namespaces

Namespace Description
cartActions

# Variables

Variable Description
addBillingAddressDefaultQuery Default GraphQL query for the addBillingAddress API endpoint. It concatenates the CustomerFragment and addBillingAddressMutation
addBillingAddressMutation Portion of the GraphQL query used in the addBillingAddress API endpoint
addMultipleToMyShoppingListDefaultQuery Default GraphQL query for the addMultipleToMyShoppingList API endpoint
AddressFragment Reusable GraphQL fragment
addReviewDefaultQuery Default GraphQL query for the addReview API endpoint
addShippingAddressDefaultQuery Default GraphQL query for the addShippingAddress API endpoint. It concatenates the CustomerFragment and addShippingAddressMutation
addShippingAddressMutation Portion of the GraphQL query used in the addShippingAddress API endpoint
addToMyShoppingListDefaultQuery Default GraphQL query for the addToMyShoppingList API endpoint
CartFragment Reusable GraphQL fragment. It concatenates AddressFragment, CustomerFragment, LineItemFragment, ShippingMethodFragment and DefaultCartFragment
ChannelFragment Reusable GraphQL fragment. It concatenates LocalizedStringFragment, AddressFragment and DefaultChannelFragment
createCartDefaultQuery Default GraphQL query for the createCart API endpoint. It concatenates the CartFragment and createCartMutation
createCartMutation Portion of the GraphQL query used in the createCart API endpoint
createMyOrderFromCartDefaultQuery Default GraphQL query for the createMyOrderFromCart API endpoint. It concatenates the OrderFragment and createMyOrderFromCartMutation
createMyOrderFromCartMutation Portion of the GraphQL query used in the createMyOrderFromCart API endpoint
createMyShoppingListDefaultQuery Default GraphQL query for the createMyShoppingList API endpoint
CT_COOKIE_NAME Name of the cookie storing the access token
customerChangeMyPasswordDefaultQuery Default GraphQL query for the customerChangeMyPassword API endpoint. It concatenates the CustomerFragment and customerChangeMyPasswordMutation
customerChangeMyPasswordMutation Portion of the GraphQL query used in the customerChangeMyPassword API endpoint
customerCreatePasswordResetToken Endpoint for request a token for resetting password for the user with given e-mail address. By default, it uses the customerCreatePasswordResetTokenDefaultQuery GraphQL query
customerCreatePasswordResetTokenDefaultQuery Default GraphQL query for the customerCreatePasswordResetToken API endpoint
CustomerFragment Reusable GraphQL fragment. It concatenates AddressFragment and DefaultCustomerFragment
customerResetPasswordDefaultQuery Default GraphQL query for the customerResetPassword API endpoint. It concatenates the CustomerFragment and customerResetPasswordMutation
customerResetPasswordMutation Portion of the GraphQL query used in the customerResetPassword API endpoint
customerSignMeInDefaultQuery Default GraphQL query for the customerSignMeIn API endpoint. It concatenates the CustomerFragment, CartFragment and customerSignMeInMutation
customerSignMeInMutation Portion of the GraphQL query used in the customerSignMeIn API endpoint
customerSignMeUpDefaultQuery Default GraphQL query for the customerSignMeUp API endpoint. It concatenates the CustomerFragment, CartFragment and customerSignMeUpMutation
customerSignMeUpMutation Portion of the GraphQL query used in the customerSignMeUp API endpoint
customerUpdateMeDefaultQuery Default GraphQL query for the customerUpdateMe API endpoint. It concatenates the CustomerFragment and customerUpdateMeMutation
customerUpdateMeMutation Portion of the GraphQL query used in the customerUpdateMe API endpoint
DefaultCartFragment Portion of the CartFragment
DefaultChannelFragment Portion of the ChannelFragment
DefaultCustomerFragment Portion of the CustomerFragment
DefaultInitiatorFragment Portion of the InitiatorFragment
DefaultInventoryEntriesQueryResultFragment Portion of the InventoryEntriesQueryResultFragment
DefaultInventoryEntryFragment Portion of the InventoryEntryFragment
DefaultLineItemFragment Portion of the LineItemFragment
DefaultOrderFragment Portion of the OrderFragment
DefaultStoreFragment Portion of the StoreFragment
DefaultStoreQueryResultFragment Portion of the StoreQueryResultFragment
deleteBillingAddressDefaultQuery Default GraphQL query for the deleteBillingAddress API endpoint. It concatenates the CustomerFragment and deleteBillingAddressMutation
deleteBillingAddressMutation Portion of the GraphQL query used in the deleteBillingAddress API endpoint
deleteCartDefaultQuery Default GraphQL query for the deleteCart API endpoint. It concatenates the CartFragment and deleteCartMutation
deleteCartMutation Portion of the GraphQL query used in the deleteCart API endpoint
deleteShippingAddressDefaultQuery Default GraphQL query for the deleteShippingAddress API endpoint. It concatenates the CustomerFragment and deleteShippingAddressMutation
deleteShippingAddressMutation Portion of the GraphQL query used in the deleteShippingAddress API endpoint
getBasicProfileQuery Portion of the GraphQL query used in the getMe API endpoint when customer parameter is not passed
getCartDefaultQuery Default GraphQL query for the getCart API endpoint. It concatenates the CartFragment and getCartQuery
getCartQuery Portion of the GraphQL query used in the getCart API endpoint
getCategoryDefaultQuery Default GraphQL query for the getCategory API endpoint
getChannelDefaultQuery Default GraphQL query for the getChannel API endpoint
getFacetCategoriesDefaultQuery Default GraphQL query for the getFacetCategories API endpoint
getFacetProductProjectionDefaultQuery Default GraphQL query for the getFacetProductProjection API endpoint. It concatenates the ChannelFragment and productProjectionsSearchQuery
getFullProfileQuery Portion of the GraphQL query used in the getMe API endpoint when customer parameter is passed
getInventoryDefaultQuery Default GraphQL query for the getInventory API endpoint
getMeBasicProfileDefaultQuery Default GraphQL query for the getMe API endpoint when customer parameter is not passed. It concatenates the CartFragment and getBasicProfileQuery
getMeFullProfileDefaultQuery Default GraphQL query for the getMe API endpoint when customer parameter is passed. It concatenates the CartFragment, CustomerFragment and getFullProfileQuery
getMyOrdersQuery Portion of the GraphQL query used in the getOrders API endpoint
getMyShoppingListDefaultQuery Default GraphQL query for the getMyShoppingList API endpoint
getOrdersDefaultQuery Default GraphQL query for the getOrders API endpoint. It concatenates the OrderFragment and getMyOrdersQuery
getProductDefaultQuery Default GraphQL query for the getProduct API endpoint. It concatenates the ProductPriceFragment, ChannelFragment and productsQuery
getReviewDefaultQuery Default GraphQL query for the getReview API endpoint
getShippingMethodsDefaultQuery Default GraphQL query for the getShippingMethods API endpoint. It concatenates the ShippingMethodFragment and shippingMethodsQuery
getStoresDefaultQuery Default GraphQL query for the getStores API endpoint. It concatenates the StoreQueryResultFragment and storesQuery
InitiatorFragment Reusable GraphQL fragment. It concatenates ReferenceFragment and DefaultInitiatorFragment
inventoryEntriesQuery Portion of the GraphQL query used in the getInventory API endpoint
InventoryEntriesQueryResultFragment Reusable GraphQL fragment. It concatenates InventoryEntryFragment and DefaultInventoryEntriesQueryResultFragment
InventoryEntryFragment Reusable GraphQL fragment. It concatenates InitiatorFragment and DefaultInventoryEntryFragment
LineItemFragment Reusable GraphQL fragment. It concatenates ProductPriceFragment and DefaultLineItemFragment
LocalizedStringFragment Reusable GraphQL fragment
OrderFragment Reusable GraphQL fragment. It concatenates AddressFragment, LineItemFragment and DefaultOrderFragment
ProductPriceFragment Reusable GraphQL fragment
productProjectionsSearchQuery Portion of the GraphQL query used in the getFacetProductProjection API endpoint
productsQuery Portion of the GraphQL query used in the getProduct API endpoint
ReferenceFragment Reusable GraphQL fragment
setDefaultBillingAddressAction
setDefaultBillingAddressDefaultQuery Default GraphQL query for the setDefaultBillingAddress API endpoint. It concatenates the CustomerFragment and setDefaultBillingAddressMutation
setDefaultBillingAddressMutation Portion of the GraphQL query used in the setDefaultBillingAddress API endpoint
setDefaultShippingAddressAction
setDefaultShippingAddressDefaultQuery Default GraphQL query for the setDefaultShippingAddress API endpoint. It concatenates the CustomerFragment and setDefaultShippingAddressMutation
setDefaultShippingAddressMutation Portion of the GraphQL query used in the setDefaultShippingAddress API endpoint
ShippingMethodFragment Reusable GraphQL fragment
shippingMethodsQuery Portion of the GraphQL query used in the getShippingMethods API endpoint
StoreFragment Reusable GraphQL fragment. It concatenates LocalizedStringFragment, ChannelFragment, InitiatorFragment and DefaultStoreFragment
StoreQueryResultFragment Reusable GraphQL fragment. It concatenates StoreFragment and DefaultStoreQueryResultFragment
storesQuery Portion of the GraphQL query used in the getStores API endpoint
updateBillingAddressDefaultQuery Default GraphQL query for the updateBillingAddress API endpoint. It concatenates the CustomerFragment and updateBillingAddressMutation
updateBillingAddressMutation Portion of the GraphQL query used in the updateBillingAddress API endpoint
updateCartDefaultQuery Default GraphQL query for the updateCart API endpoint
updateCartMutation Portion of the GraphQL query used in the updateCart API endpoint
updateShippingAddressDefaultQuery Default GraphQL query for the updateShippingAddress API endpoint. It concatenates the CustomerFragment and updateShippingAddressMutation
updateShippingAddressMutation Portion of the GraphQL query used in the updateShippingAddress API endpoint

# Type Aliases

Type Alias Description
AddBillingAddressResponse Data returned from the addBillingAddress API endpoint
AddMultipleToMyShoppingListResponse Data returned from the addMultipleToMyShoppingList API endpoint
AddReviewResponse Data returned from the addReview API endpoint
AddShippingAddressResponse Data returned from the addShippingAddress API endpoint
AddToCartResponse Data returned from the addBillingAddress API endpoint
AddToMyShoppingListResponse Data returned from the addToMyShoppingList API endpoint
ApiResponseWrapper
ApplyCartCouponResponse Data returned from the applyCartCoupon API endpoint
BillingAddress
BillingAddressAddParams API parameters needed for adding new user billing address.
BillingAddressDeleteParams
BillingAddressResponse
BillingAddressSetDefaultParams
BillingAddressUpdateParams
CartDetails
CartMutationResponse
CartQueryResponse
CartResponse
ChangeMyPasswordResponse
ChannelSearchParams
CreateCartResponse Data returned from the createCart API endpoint
CreateMyOrderFromCartResponse Data returned from the createMyOrderFromCart API endpoint
CreateMyShoppingListResponse Data returned from the createMyShoppingList API endpoint
CreatePasswordResetTokenResponse
CustomerChangeMyPasswordResponse Data returned from the customerChangeMyPassword API endpoint
CustomerCreatePasswordResetTokenResponse Data returned from the customerCreatePasswordResetToken API endpoint
CustomerResetPasswordResponse Data returned from the customerResetPassword API endpoint
CustomerSignMeInResponse Data returned from the customerSignMeIn API endpoint
CustomerSignMeUpResponse Data returned from the customerSignMeUp API endpoint
CustomerUpdateMeResponse Data returned from the customerUpdateMe endpoint
DeleteBillingAddressResponse Data returned from the deleteBillingAddress API endpoint
DeleteCartResponse Data returned from the deleteCart API endpoint
DeleteShippingAddressResponse Data returned from the deleteShippingAddress API endpoint
GetCartResponse Data returned from the getCart API endpoint
GetCategoryResponse Data returned from the getCategory API endpoint
GetChannelResponse Data returned from the getChannel API endpoint
GetFacetCategoriesResponse Data returned from the getFacetCategories API endpoint
GetFacetProductProjectionResponse Data returned from the getFacetProductProjection API endpoint
GetInventoryResponse Data returned from the getInventory API endpoint
GetMeResponse Data returned from the getMe API endpoint
GetMyShoppingListResponse Data returned from the getMyShoppingList API endpoint
GetOrdersResponse Data returned from the getOrders API endpoint
GetProductResponse Data returned from the getProduct API endpoint
GetReviewResponse Data returned from the getReview API endpoint
GetShippingMethodsResponse Data returned from the getShippingMethods API endpoint
GetStoresResponse Data returned from the getStores API endpoint
InventorySearchParams
MutationResponse
OrderMutationResponse
OrderQueryResponse
OrderResponse
QueryResponse Helper for mapping commercetools response to Apollo Client query result
RemoveCartCouponResponse Data returned from the removeCartCoupon API endpoint
RemoveFromCartResponse Data returned from the removeFromCart API endpoint
RemoveFromMyShoppingListResponse Data returned from the removeFromMyShoppingList API endpoint
ResetPasswordResponse
ReviewAddParams
ReviewResponse
ReviewSearchParams
SetDefaultBillingAddressResponse Data returned from the setDefaultBillingAddress API endpoint
SetDefaultShippingAddressResponse Data returned from the setDefaultShippingAddress API endpoint
ShippingAddress
ShippingAddressAddParams
ShippingAddressDeleteParams
ShippingAddressResponse
ShippingAddressSetDefaultParams
ShippingAddressUpdateParams
ShippingMethodsResponse
SignInResponse
UpdateBillingAddressResponse Data returned from the updateBillingAddress API endpoint
UpdateCartQuantityResponse Data returned from the updateCartQuantity API endpoint
UpdateCartResponse Data returned from the updateCart API endpoint
UpdateShippingAddressResponse Data returned from the updateShippingAddress API endpoint
UpdateShippingDetailsResponse Data returned from the updateShippingDetails API endpoint
User
WishlistResponse