A collection of convenience methods for interacting with the commercetools API.

Constructors

Properties

Methods

applyStore changeMyPassword checkCartExistsById checkCartExistsByKey createAccount createCart createCategory createCustomerGroup createInventoryEntry createMyAccount createMyCart createMyOrderFromActiveCart createMyPayment createOrderFromCart createPayment createProduct createProductSelection createStandalonePrice createStore deleteCartById deleteCategoryById deleteCategoryByKey deleteCustomObject deleteCustomerById deleteCustomerByKey deleteCustomerGroupById deleteCustomerGroupByKey deleteInventoryEntryById deleteInventoryEntryByKey deleteMyActiveCart deleteMyCartById deleteMyPaymentById deleteOrderById deleteOrderByOrderNumber deletePaymentById deleteProductById deleteProductByKey deleteProductSelectionByKey deleteStandalonePriceById deleteStandalonePriceByKey deleteStoreById deleteStoreByKey extractCommonRequestOptions getCartById getCartByKey getCartDiscountById getCartDiscountByKey getCategory getCategoryById getCategoryByKey getCategoryBySlug getCategoryParents getChannelById getChannelByKey getCustomObject getCustomObjectById getCustomerById getCustomerByKey getCustomerByPasswordToken getCustomerGroupById getCustomerGroupByKey getDiscountCodeById getInventoryEntryById getInventoryEntryByKey getMyAccount getMyActiveCart getMyCartById getMyOrderById getMyPaymentById getOrderById getOrderByOrderNumber getPasswordResetToken getPaymentById getProductById getProductByKey getProductProjectionById getProductProjectionByKey getProductProjectionBySlug getProductSelectionById getProductSelectionByKey getProductTypeById getProductTypeByKey getRequestOptions getShippingMethodById getShippingMethodByKey getShippingMethodsForCart getShippingMethodsForCartAndLocation getShippingMethodsForLocation getStandalonePriceById getStandalonePriceByKey getStateById getStateByKey getStoreById getStoreByKey getTaxCategoryById getTaxCategoryByKey getTypeById getTypeByKey graphql importOrder login loginMyAccount queryCartDiscounts queryCarts queryCategories queryChannels queryCustomerGroups queryCustomers queryInventory queryMyCarts queryMyOrders queryMyPayments queryOrders queryPayments queryProductProjections queryProductSelections queryProductTypes queryProductsInStore queryShippingMethods queryStandalonePrices queryStates queryStores queryTaxCategories queryTypes replicate request resetMyPassword saveCustomObject searchProductProjections unpublishProductById unpublishProductByKey updateCartById updateCategoryById updateCategoryByKey updateCustomerById updateCustomerByKey updateCustomerGroupById updateCustomerGroupByKey updateInventoryEntryById updateInventoryEntryByKey updateMyAccount updateMyActiveCart updateMyCart updateMyPaymentById updateOrderById updateOrderByOrderNumber updatePaymentById updateProductById updateProductByKey updateProductSelectionByKey updateStandalonePriceById updateStandalonePriceByKey updateStoreById updateStoreByKey validateConfig

Constructors

Properties

This is the instance of the {@see CommercetoolsAuth} class that this class uses internally. It's exposed publicly so that it can be used by consumer's of this class in order to access authorization API related functionality.

The configuration passed in to the constructor.

endpoints: RegionEndpoints

The Auth and API endpoints driven by the user's setting of CommercetoolsApiConfig.region https://docs.commercetools.com/api/general-concepts#regions

requestExecutor: RequestExecutor<any>

The request executor that's responsible for making the request to commercetools

Methods

  • Applies the store key to a given path

    Parameters

    • path: string
    • storeKey: undefined | null | string

    Returns string

  • Get the parent categories of a given category. This method returns an array of {@see Category} items representing the ancestry of categories for the given category id. The list is ordered from top down. In other words, the root category is always the first item in the list.

    Parameters

    Returns Promise<Category[]>

  • Ensure that all required properties on the {@see CommercetoolsApiConfig} object have been populated. These are currently:

    projectKey: string clientId: string clientSecret: string region: Region clientScopes: string[]

    Parameters

    • config: any

    Returns void