We’ve had several orders starting at the date Nov 17th where the order was never exported into the Shipstation platform. I can see the orders in the order feed in Woocommerce, but the orders which weren’t exported, have no reference in the Shipstation woocommerce integration plugin’s log file for their dates. Only the orders which successfully exported are referenced in the log file. I’ve tried recreating the Store connection within shipstation and I’m currently running the latest version of Woocommerce and WordPress as well as the woocommerce shipstation integration plugin. This issue did begin though after installing Sequential Order Numbers for WooCommerce plugin by webToffee. We needed this plugin because past orders with the same order (previous website build) were affecting the export of new orders because they had identical order numbers. Could it be a plugin conflict which is causing this issue? How would I debug these faulty orders which aren’t being exported?
I noticed that in your first message, you mentioned you installed Sequential Order Numbers for the WooCommerce plugin on your website. Then switched to the WooCommerce Sequential Order Numbers Pro plugin.
Please note that above mentioned plugin controls the Order ID for Products only and not for any other post type such as Posts or Pages.
Let me know if you need further clarification. We are here to help 🙂
This is not correct. The plugin Woocommerce Sequential Order Numbers Pro only affects the Order Number (visible in backend woo order dashboard) and not the postID of the order.
After activating the Sequential Order Numbers Pro plugin I set the Order Number to start at 3000
Okay this was my solution. I had to do a database SQL operation on the wp_posts table
SQL:
ALTER TABLE wp_posts AUTO_INCREMENT = 100000;
I picked the value 100,000 by iterating through all my orders in my woocommerce store connection in Shipstation using their List Order API call then paginated and kept track of the maximum orderKey value through each pagination response. I determined my maximum was 60208 and choose 10000 just to be safe and make sure no future conflicts arise. Since this is only affecting new orders, I don’t see this operation affecting any other tables that may depend on the postID column as a foreign key. Here’s my Python code incase someone could use it.
import requests
import logging
# Setup basic logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
def get_orders(store_id, page=1):
url = f"https://ssapi.shipstation.com/orders?storeId={store_id}&page={page}"
headers = {
'Authorization': ''
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
return response.json()
else:
logging.error(f"Failed to retrieve data: Status Code {response.status_code}")
return None
store_id = '####' // replace with your store id
page = 1
max_order_key = None
while True:
logging.info(f"Processing page: {page}")
data = get_orders(store_id, page)
if data and 'orders' in data:
# Convert orderKey to integer for correct comparison
page_max_order_key = max(int(order['orderKey']) for order in data['orders'] if order['orderKey'].isdigit())
logging.info(f"Max orderKey on page {page}: {page_max_order_key}")
if max_order_key is None or page_max_order_key > int(max_order_key):
max_order_key = str(page_max_order_key)
logging.info(f"Overall max orderKey after page {page}: {max_order_key}")
page += 1
if page > data['pages']:
break
else:
break
logging.info(f"Final overall maximum orderKey value is: {max_order_key}")