Appearance
API Client packages ​
Documentation related to the API Client package.
INFO
A new version of the API Client is currently in development (see NPM).
Features are TypeScript autocompletion and generated types based on the envoirment.
Additional docs about the API Client ​
List of all public methods ​
Exported within @shopware-pwa/api-client package
CMS ​
| name | description |
|---|---|
getCmsPage deprecated | the method is becoming obsolete and will be removed in the future as the SwagShopwarePwa plugin won't be needed. |
| getLandingPage | Fetches a landing page entity |
| getSeoUrl | an array of SEO URLs for given entity |
| getSeoUrls | an array of SEO URLs for given entityCan be used for other languages as well by providing the languageId |
Cart ​
| name | description |
|---|---|
| addCartItems | Adds multiple items to the cart.Accepts every type of cart item. |
| addProductToCart | Adds specific quantity of the product to the cart by productId. It creates a new cart line item.Warning: This method does not change the state of the cart in any way if productId already exists in a cart. For changing the quantity use addQuantityToCartLineItem() or changeCartLineItemQuantity() methods. |
| addPromotionCode | Adds new promotion code to the cart by its code.Promotion code is being added as separate cart item line. |
| changeCartItemQuantity | Changes the current quantity in specific cart line item to given quantity.Example: If current quantity is 3 and you pass 2 as quantity parameter, you will get a new cart's state with quantity 2. |
| clearCart | When no sw-context-token given then this method return an empty cart with the new sw-context-token.When sw-context-token given then this method simply returns the current state of the cart.As the purpose of this method is not clear we recommend to use |
| getCart | Gets the current cart for the sw-context-token. |
| removeCartItem | Deletes the cart line item by id.This method may be used for deleting "product" type item lines as well as "promotion" type item lines. |
Category ​
| name | description |
|---|---|
| getCategories | Get a list of categories by provided search criteria. |
| getCategory | Get a single category by its id. |
Checkout ​
| name | description |
|---|---|
| cancelOrder | Cancel an order |
| changeOrderPaymentMethod | Change payment method for given order |
| createOrder | Creates an order for logged in and guest users |
| getOrderDetails | Get order details |
| handlePayment |
Context ​
| name | description |
|---|---|
| getAvailableCountries | Get all available countries |
| getAvailableCurrencies | Get all available currencies |
| getAvailableLanguages | Get all available languages |
| getAvailablePaymentMethods | get all available payment methods |
| getAvailableSalutations | Get all available salutations |
| getAvailableShippingMethods | Get all available shipping methods |
| getPaymentMethodDetails | Get payment method details |
| getSessionContext | Loads session context, containing all session-related data. |
| getShippingMethodDetails | Get Shipping method details |
| getUserCountry | Get the current session's country |
| getUserSalutation | Get the current session's salutation |
| setCurrentBillingAddress | Set the current session's billing address to correspoding to id |
| setCurrentCountry | Set the current session's country |
| setCurrentCurrency | Set the current session's currency to correspoding to id |
| setCurrentLanguage | Set the current session's language to corresponding to id |
| setCurrentPaymentMethod | Set the current session's payment method to correspoding to id |
| setCurrentShippingAddress | Set the current session's shipping address to correspoding to id |
| setCurrentShippingMethod | Set the current session's shipping method to correspoding to id |
Customer ​
| name | description |
|---|---|
| CustomerRegisterResponse | |
| CustomerResetPasswordParam | |
| CustomerUpdateEmailParam | |
| CustomerUpdatePasswordParam | |
| CustomerUpdateProfileParam | |
| confirmAccountRegistration | Confirm an account registration in double opt-in mode |
| confirmPasswordReset | Confirm a customer's password reset. Set new password for account. |
| createCustomerAddress | Create an address and respond the new address's id |
| deleteCustomerAddress | Delete's the customer's address by id |
| getCustomer | Get customer's object |
| getCustomerAddress | Get the customer's address by id |
| getCustomerAddresses | Get all customer's addresses |
| getCustomerOrders | Get all customer's orders |
| isNewsletterSubscriber | Checking if user is newsletter subscriber |
| login | Login user to shopware instance. |
| logout | End up the user session. |
| register | Register a customer |
| resetPassword | Reset a customer's password |
| setDefaultCustomerBillingAddress | Set address as default |
| setDefaultCustomerPaymentMethod | Set payment method under provided ID as default |
| setDefaultCustomerShippingAddress | Set address as default |
| updateCustomerAddress | Update an address for specific ID |
| updateEmail | Update a customer's email |
| updatePassword | Update a customer's password |
| updateProfile | Update a customer's profile data |
Forms ​
| name | description |
|---|---|
| ContactFormData | |
| NewsletterSubscribeData | |
| newsletterSubscribe | Subscribes to newsletter |
| newsletterUnsubscribe | Unsubscribe from newsletter |
| sendContactForm | Sends contact form |
Navigation ​
| name | description |
|---|---|
| GetStoreNavigationParams | |
| getStoreNavigation | Get a list of categories by provided search criteria. |
Product ​
| name | description |
|---|---|
| addProductReview | Add a review to specific product by its ID |
| getCategoryProducts | Get default amount of products and listing configuration for given category |
| getProduct | Get the product with passed productId |
| getProductCrossSelling | Get the product with passed productId |
| getProductReviews | Get product reviews |
| getProducts | Get default amount of products |
Search ​
| name | description |
|---|---|
| searchProducts | Search for products based on criteria.From: Shopware 6.4 |
| searchSuggestedProducts | Search for suggested products based on criteria.From: Shopware 6.4 |
Wishlist ​
| name | description |
|---|---|
| addWishlistProduct | Add a product with a specific ID to the wishlist |
| getWishlistProducts | Fetch a current Wishlist with added products |
| mergeWishlistProducts | Merge the current Wishlist with a products with provided IDs |
| removeWishlistProduct | Delete a product with a specific ID from the wishlist |
Endpoints ​
| name | description |
|---|---|
| getAddWishlistProductEndpoint | |
| getCancelOrderEndpoint | |
| getCategoryDetailsEndpoint | |
| getCategoryEndpoint | |
| getChangeOrderPaymentMethodEndpoint | |
| getCheckoutCartEndpoint | |
| getCheckoutCartLineItemEndpoint | |
| getCheckoutOrderEndpoint | |
| getCmsEndpoint | |
| getConfirmPasswordResetEndpoint | |
| getContactFormEndpoint | |
| getContextCountryEndpoint | |
| getContextCurrencyEndpoint | |
| getContextEndpoint | |
| getContextLanguageEndpoint | |
| getContextPaymentMethodEndpoint | |
| getContextSalutationEndpoint | |
| getContextShippingMethodEndpoint | |
| getCustomerAccountConfirmEndpoint | |
| getCustomerAddAddressEndpoint | |
| getCustomerAddressEndpoint | |
| getCustomerDefaultBillingAddressEndpoint | |
| getCustomerDefaultShippingAddressEndpoint | |
| getCustomerDetailsUpdateEndpoint | |
| getCustomerEndpoint | |
| getCustomerLoginEndpoint | |
| getCustomerLogoutEndpoint | |
| getCustomerOrderEndpoint | |
| getCustomerRegisterEndpoint | |
| getCustomerResetPasswordEndpoint | |
| getCustomerUpdateEmailEndpoint | |
| getCustomerUpdatePasswordEndpoint | |
| getCustomerUpdatePaymentMethodEndpoint | |
| getDocumentDownloadEndpoint | |
| getGetWishlistProductsEndpoint | |
| getLandingPageDetailsEndpoint | |
| getMergeWishlistProductsEndpoint | |
| getNewsletterRecipientEndpoint | |
| getNewsletterSubscribeEndpoint | |
| getNewsletterUnsubscribeEndpoint | |
| getOrderDownloadsEndpoint | |
| getPageResolverEndpoint | |
| getProductCrossSellingEndpoint | |
| getProductDetailsEndpoint | |
| getProductEndpoint | |
| getProductListingEndpoint | |
| getProductReviewsEndpoint | |
| getRemoveWishlistProductEndpoint | |
| getSearchEndpoint | |
| getSeoUrlEndpoint | |
| getStoreNavigationEndpoint | |
| getStoreNewsletterConfirmEndpoint | |
| getStoreNewsletterSubscribeEndpoint | |
| getStoreNewsletterUnsubscribeEndpoint | |
| getSuggestSearchEndpoint | |
| handlePaymentEndpoint |
Other ​
| name | description |
|---|---|
| ConfigChangedArgs | |
| ShopwareApiInstance | |
| ClientSettings | |
| config | |
| createInstance | |
| getDocumentDownload | Download selected document |
| getOrderDownloads | Get order downloads (file) |
| getSitemap | Get sitemap |
| getSitemapEndpoint | |
| invokeGet | Invoke custom GET request to shopware API. Mostly for plugins usage.You can skip domain and pass only endpoint ex. |
| invokePost | Invoke custom POST request to shopware API. Mostly for plugins usage.You can skip domain and pass only endpoint ex. |
| onConfigChange | |
| setup | Setup configuration. Merge default values with provided in param.This method will override existing config. For config update invoke update method. |
| update | Update current configuration. This will change only provided values. |