Articles on: Amazon Marketplace (PrestaShop)

How to Reimport a Deleted Order - Amazon Marketplace

If you delete an order directly in PrestaShop, the Amazon Marketplace module will not automatically reimport it by default.


This is because the module tracks every imported transaction in its own database tables to prevent duplicate order generation. To force the module to reimport an order from Amazon, you must completely remove all references to that order from both PrestaShop core and the module's database tables.



What Happens When You Delete an Order?


Simply deleting an order from the PrestaShop back office or database removes the store transaction, but the module still retains a record showing that the Amazon Order ID was already processed. When the order import script runs again, it checks these module logs, sees that the order ID exists, and skips it.



Required Steps to Reimport a Deleted Order


To allow the module to fetch and import the same Amazon order again, your developer or database administrator must complete the following steps:


Step 1: Delete the PrestaShop Order

Ensure the order and its associated details (items, payments, carriers) are removed from the standard PrestaShop tables (ps_orders, ps_order_detail, etc.).


Step 2: Restock the Inventory

Deleting an order in PrestaShop does not always restore stock levels automatically. Manually adjust or restock the quantities for the products that belonged to the deleted order to ensure your inventory remains accurate.


Step 3: Remove Data from Module Database Tables

You must delete all records associated with the Amazon Order ID from the following module database tables (replace ps_ with your database prefix if applicable):


  • ps_marketplace_orders
  • ps_marketplace_order_address
  • ps_marketplace_order_items


SQL Query Example


-- Replace 'AMAZON_ORDER_ID' with the actual Amazon Order ID (e.g., '123-4567890-1234567')

-- 1. Identify the module internal order ID
SET @mp_order_id = (SELECT id_marketplace_order FROM ps_marketplace_orders WHERE mp_order_id = 'AMAZON_ORDER_ID');

-- 2. Delete associated address and item entries
DELETE FROM ps_marketplace_order_address WHERE id_marketplace_order = @mp_order_id;
DELETE FROM ps_marketplace_order_items WHERE id_marketplace_order = @mp_order_id;

-- 3. Delete the main module order entry
DELETE FROM ps_marketplace_orders WHERE id_marketplace_order = @mp_order_id;


Step 4: Re-trigger the Order Import


Once all records are cleared from both PrestaShop core and the module tables, you can re-import the order:


  1. Go to Orders > Amazon in your PrestaShop back office.
  2. Select the specific date range covering the original purchase date of the Amazon order.
  3. Click Import Orders or manually execute your order import cron script.
  4. The module will detect the Amazon order as new and successfully recreate it in PrestaShop.

Updated on: 04/08/2026

Was this article helpful?

Share your feedback

Cancel

Thank you!