Title: Store Api Error: Call to undefined method
Last modified: October 22, 2025

---

# Store Api Error: Call to undefined method

 *  Resolved [emrl](https://wordpress.org/support/users/emrl/)
 * (@emrl)
 * [7 months, 2 weeks ago](https://wordpress.org/support/topic/store-api-error-call-to-undefined-method/)
 * WooCommerce version 10.3.0
 * `DELETE /wp-json/wc/store/v1/cart/items`
 * `Error: Call to undefined method Automattic\WooCommerce\StoreApi\SessionHandler::
   get_session_data()`
 * `/woocommerce/includes/class-wc-cart-session.php:689 WC_Cart_Session::remove_shipping_for_package_from_session`
 *     ```wp-block-code
       private function remove_shipping_for_package_from_session() {    $wc_session = WC()->session;    foreach ( array_keys( $wc_session->get_session_data() ) as $key ) {        if ( 0 === strpos( $key, 'shipping_for_package_' ) ) {            $wc_session->set( $key, null );        }
       ```
   
    -  This topic was modified 7 months, 2 weeks ago by [emrl](https://wordpress.org/support/users/emrl/).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [LovingBro (woo-hc)](https://wordpress.org/support/users/lovingbro/)
 * (@lovingbro)
 * [7 months, 2 weeks ago](https://wordpress.org/support/topic/store-api-error-call-to-undefined-method/#post-18691852)
 * Hi [@emrl](https://wordpress.org/support/users/emrl/),
 * I understand how concerning it is to encounter this kind of fatal error while
   using the Store API, especially with something as critical as the cart functionality.
   I’ll do my best to help figure out what’s going on here.
 * To help us investigate further, could you clarify where exactly you’re seeing
   this error? For example, is it in the browser console, a log file, or in a plugin
   integration? A screenshot or further details would really help, you can share
   one using [https://snipboard.io](https://snipboard.io).
 * Also, have you tried rolling back to WooCommerce version 10.2.2 to see if the
   error no longer occurs? That would help confirm if this is a regression introduced
   in 10.3.0.
 * From what you’ve shared, it looks like the issue stems from the use of get_session_data()
   on the Automattic\WooCommerce\StoreApi\SessionHandler class, which may no longer
   expose that method. If a custom plugin or theme is trying to interact with the
   session directly using that method, it could break now that WooCommerce has introduced
   more separation between session implementations.
 * If this is coming from custom code or a third-party plugin, updating that code
   to use WC()->session->get() and WC()->session->set() directly may help or refactoring
   to use the public WooCommerce cart/session API instead of assuming the internal
   session structure.
 * Let us know how it goes and feel free to share those additional details, we’re
   here to help!
 *  Thread Starter [emrl](https://wordpress.org/support/users/emrl/)
 * (@emrl)
 * [7 months, 2 weeks ago](https://wordpress.org/support/topic/store-api-error-call-to-undefined-method/#post-18693146)
 * [@lovingbro](https://wordpress.org/support/users/lovingbro/) We have Bugsnag 
   installed, and it is reporting the error. It happens for any Store API endpoint,
   not just the one above.
 *     ```wp-block-code
       POST /wp-json/wc/store/v1/cart/add-itemPOST /wp-json/wc/store/v1/checkoutDELETE /wp-json/wc/store/v1/cart/items
       ```
   
 * Here is the full stack trace:
 *     ```wp-block-code
       Error · Call to undefined method Automattic\WooCommerce\StoreApi\SessionHandler::get_session_data()/wp-content/plugins/woocommerce/includes/class-wc-cart-session.php:689 WC_Cart_Session::remove_shipping_for_package_from_session	private function remove_shipping_for_package_from_session() {		$wc_session = WC()->session;		foreach ( array_keys( $wc_session->get_session_data() ) as $key ) {			if ( 0 === strpos( $key, 'shipping_for_package_' ) ) {				$wc_session->set( $key, null );			}/wp-content/plugins/woocommerce/includes/class-wc-cart-session.php:426 WC_Cart_Session::set_session/wp-content/plugins/woocommerce/includes/class-wc-cart.php:1459 WC_Cart::calculate_totals/wp-content/plugins/woocommerce/includes/class-wc-cart-session.php:290 WC_Cart_Session::get_cart_from_session/wp-content/plugins/woocommerce/includes/class-wc-cart.php:627 WC_Cart::get_cart/wp-content/plugins/woocommerce/src/StoreApi/Utilities/CartController.php:39 Automattic\WooCommerce\StoreApi\Utilities\CartController::load_cart/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/AbstractCartRoute.php:180 Automattic\WooCommerce\StoreApi\Routes\V1\AbstractCartRoute::load_cart_session/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php:147 Automattic\WooCommerce\StoreApi\Routes\V1\Checkout::get_response/wp-includes/rest-api/class-wp-rest-server.php:1292 WP_REST_Server::respond_to_request/wp-includes/rest-api/class-wp-rest-server.php:1125 WP_REST_Server::dispatch/wp-includes/rest-api/class-wp-rest-server.php:439 WP_REST_Server::serve_request/wp-includes/rest-api.php:459 rest_api_loaded/wp-includes/class-wp-hook.php:324 WP_Hook::apply_filters/wp-includes/class-wp-hook.php:348 WP_Hook::do_action/wp-includes/plugin.php:565 do_action_ref_array/wp-includes/class-wp.php:418 WP::parse_request/wp-includes/class-wp.php:818 WP::main/wp-includes/functions.php:1342 wp/wp-blog-header.php:16 require/index.php:4 [main]
       ```
   
 * This error was not happening in 10.2.2, only 10.3.0
 *  [Moses M. (woo-hc)](https://wordpress.org/support/users/mosesmedh/)
 * (@mosesmedh)
 * [7 months, 2 weeks ago](https://wordpress.org/support/topic/store-api-error-call-to-undefined-method/#post-18693944)
 * Hi [@emrl](https://wordpress.org/support/users/emrl/),
 * Thank you for getting back and for providing such a detailed response. Since 
   you’re able to reproduce the issue and it affects all API endpoints, please open
   a report on GitHub at [https://github.com/woocommerce/woocommerce/issues](https://github.com/woocommerce/woocommerce/issues)
   so the developers can review it directly and assist further with troubleshooting.
 * After creating the issue please feel free to share the link back here so we can
   also follow up and anyone who plays into this thread can also contribute. Let
   me know if you have any further questions.
 *  Plugin Support [thelmachido a11n](https://wordpress.org/support/users/thelmachido/)
 * (@thelmachido)
 * [7 months, 1 week ago](https://wordpress.org/support/topic/store-api-error-call-to-undefined-method/#post-18704282)
 * It’s been a while since we heard back from you for this reason we are closing
   this thread. 
 * If WooCommerce has been useful for your store and you appreciate the support 
   you’ve received, we’d truly appreciate it if you could leave us a quick review
   here: 
 *  [https://wordpress.org/support/plugin/woocommerce/reviews/#new-post](https://wordpress.org/support/plugin/woocommerce/reviews/#new-post)
 * Feel free to open a new forum topic if you run into any other problem. 

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Store Api Error: Call to undefined method’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 4 replies
 * 4 participants
 * Last reply from: [thelmachido a11n](https://wordpress.org/support/users/thelmachido/)
 * Last activity: [7 months, 1 week ago](https://wordpress.org/support/topic/store-api-error-call-to-undefined-method/#post-18704282)
 * Status: resolved