Skip to content

Shipment for order cannot be created via REST API if order's quote is deleted #261

@milosdacic

Description

@milosdacic

Summary: Shipment for order cannot be created via REST API if order's quote is deleted

Steps to reproduce:

  1. Create order
  2. Delete it's quote(cart) or wait for it to be automatically deleted
  3. Call POST rest/V1/order/{created order id}/ship

Expected result:

Shipment is created, or any detailed error message should be returned.

Actual result:
Generic "Could not save a shipment, see error log for details" message appears. In exception log we can find following error:

[2025-11-18T13:42:52.650672+00:00] main.CRITICAL: Magento\Framework\Exception\NoSuchEntityException: No such entity with cartId = 2277435 in /xxx/vendor/magento/framework/Exception/NoSuchEntityException.php:50
Stack trace:
#0 /xxx/vendor/magento/module-quote/Model/QuoteRepository.php(238): Magento\Framework\Exception\NoSuchEntityException::singleField()
#1 /xxx/vendor/magento/module-quote/Model/QuoteRepository.php(136): Magento\Quote\Model\QuoteRepository->loadQuote()
#2 /xxx/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Quote\Model\QuoteRepository->get()
#3 /xxx/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Quote\Model\QuoteRepository\Interceptor->___callParent()
#4 /xxx/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Quote\Model\QuoteRepository\Interceptor->Magento\Framework\Interception\{closure}()
#5 /xxx/generated/code/Magento/Quote/Model/QuoteRepository/Interceptor.php(23): Magento\Quote\Model\QuoteRepository\Interceptor->___callPlugins()
#6 /xxx/vendor/breadfinance/module-breadcheckout/Observer/SaveBreadApiVersionObserver.php(62): Magento\Quote\Model\QuoteRepository\Interceptor->get()

Environment:
Magento 2.4.6-p4

Severity:
Major (Prevents any third-party shipment integration)

Priority:
High (Should be addressed quickly due to impact on third party integrations)

Additional Information:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions