---
title: B2B ShipStation Sync Fix — 2026-04-05
type: article
created: '2026-04-05'
updated: '2026-04-05'
source_docs:
- raw/2026-02-04-doudlah-b2b-ship-station-fix-119630297.md
tags:
- doudlah
- shipstation
- woocommerce
- b2b
- plugin
- integration
- fix
layer: 2
client_source: Doudlah Farms
industry_context: food-beverage
transferable: false
---

# B2B ShipStation Sync Fix — 2026-04-05

## Overview

Doudlah B2B orders were syncing to ShipStation with an incorrect status, causing them to appear as already shipped rather than ready for fulfillment. The root cause was a custom plugin (`Autocomplete offline orders`) that was auto-completing orders on the WooCommerce thank-you page, setting their status to `completed` instead of `processing`. ShipStation skips orders marked `completed` (treating them as done) and skips orders marked `on-hold` (treating them as unpaid/not ready) — `processing` is the correct status for ShipStation to pick up and fulfill.

**Attendees:** Karly Oykhman, Mark Hope

---

## Problem

- Doudlah B2B orders use an invoice/offline payment flow — customers do not pay at checkout.
- WooCommerce sets these orders to `on-hold` by default; ShipStation ignores `on-hold` orders.
- A previously-installed custom plugin (`Autocomplete offline orders`) was overriding this and immediately setting orders to `completed` on the thank-you page.
- ShipStation also ignores `completed` orders (treats them as already fulfilled).
- Result: orders were appearing in ShipStation as shipped without ever being properly queued for fulfillment.

---

## Root Cause

**Plugin:** `Autocomplete offline orders` (custom, installed on the Doudlah B2B WooCommerce site)
**File:** `autocomplete-offline-orders.php`
**Line:** 64
**Original value:** `completed`
**Problem:** The plugin was hooking into the thank-you page and immediately transitioning all offline orders to `completed` status.

---

## Fix

Changed line 64 of `autocomplete-offline-orders.php` from `completed` to `processing`.

```php
// Line 64 — before
'completed'

// Line 64 — after
'processing'
```

The fix was identified and applied via an MCP server (Model Context Protocol — an AI-powered terminal console with direct API access to the site). The cache was flushed after the change.

---

## Correct Order Flow (Post-Fix)

1. Customer places B2B order (no payment at checkout).
2. WooCommerce order status → **`processing`** (set by the modified plugin).
3. ShipStation picks up the `processing` order and queues it for fulfillment.
4. Warehouse fulfills and ships the order in ShipStation.
5. ShipStation sends a webhook back to WooCommerce → order status → **`completed`**.

This mirrors the existing B2C site behavior and is the intended flow.

---

## Key Decisions

- **Use `processing` (not `completed`)** as the auto-set status for offline B2B orders. `processing` is the signal ShipStation needs to act; `completed` tells ShipStation the order is already done.
- **Do not permanently leave orders in `processing`** — ShipStation's webhook handles the transition to `completed` after shipping, so no additional automation is needed.

---

## Action Items

- [ ] **Karly** — Place a test B2B order and verify that (1) WooCommerce shows status `processing` immediately after checkout, and (2) ShipStation picks it up correctly (~1 hour lag expected). Report result to Mark.
- [ ] **Mark** — Email Karly a summary note of this fix for filing.
- [ ] **Karly** — File the fix documentation in the Doudlah project file for future reference.

---

## Notes

- The MCP server was used to locate the plugin file, read the relevant PHP, identify the problematic line, rewrite the value, save the file, and flush the cache — all without manual file editing.
- The plugin was not visible in the standard WordPress admin UI settings panels; it required direct file inspection to find.
- Going forward, any changes to WooCommerce order status automation on this site should be documented immediately to avoid re-investigation.

---

## Related

- [[wiki/clients/current/doudlah-farms/_index]]
- [[wiki/clients/current/doudlah-farms/2026-04-05-amazon-inventory-strategy]]