Skip to main content
Question

Linking a Drop-Ship PO to an SO via REST API when vendor is not the item's default vendor

  • May 18, 2026
  • 1 reply
  • 28 views

joshatsbp
Freshman II
Forum|alt.badge.img

I'm building an integration that creates Sales Orders and Drop-Ship Purchase Orders via the Acumatica REST API (endpoint version 24.200.001 / a custom endpoint based on it). Once the SO and PO are created, the integration then links the PO and SO line via the API. Everything works correctly when the PO vendor matches the item's default vendor in Acumatica, but fails when using a non-default vendor.

What works: After creating the SO and Drop-Ship PO, I release the SO from Hold, then send:

 

PUT /SalesOrder?$expand=Details,Details/PurchasingDetails
{
"OrderType": { "value": "SO" },
"OrderNbr": { "value": "SO-000123" },
"Details": [{
"id": "<soLineId>",
"PurchasingDetails": [{
"POOrderType": { "value": "Drop-Ship" },
"POOrderNbr": { "value": "PO-000456" },
"POOrderLineNbr": { "value": 1 },
"Selected": { "value": true }
}]
}]
}

When the PO vendor is the item's default vendor, SOLineSplit records are auto-created by Acumatica when the PO is saved, and this call successfully selects/links them.

What fails: When the PO vendor is not the item's default vendor, PurchasingDetails on the SO line is empty — no SOLineSplit records were auto-created when the PO was saved. The linking PUT call above returns 200 but the link does not appear to materialize in Acumatica.

What I've tried:

  1. Setting SOOrderTypeSOOrderNbrSOLineNbr on the PO Detail line at PO creation time → causes a PXLockViolationException.
  2. Setting those same fields via a separate PUT to /PurchaseOrder after PO creation → call succeeds (HTTP 200), but no SOLineSplit records appear on the SO line.
  3. The Acumatica Web UI "PO Link" dialog (SO → Details → highlight line → PO Link toolbar) works for any vendor, including non-default, though I need to explicitly search for the vendor since it’s initially populated by open POs for the default vendor. The equivalent action does not appear to be exposed as a REST action in our endpoint, and I don't see anything relevant in the standard Default/24.200.001 SalesOrder actions list either.

Question: Is there a way to trigger SO↔PO linking via REST when the PO vendor is not the item's Acumatica default vendor? Specifically, is there a REST action or sequencing approach that causes SOLineSplit records to be created for a non-default vendor PO?

1 reply

Forum|alt.badge.img+1
  • Semi-Pro III
  • May 19, 2026

Approach: Custom REST Action (PO Link)

 

Extend SOOrderEntry

Add a PXAction

Inside it, call the same internal linking logic

Expose it via your endpoint
 

Step 1: Graph Extension

 

Create an extension on SOOrderEntry:

 

using PX.Data;

using PX.Objects.SO;

using PX.Objects.PO;

using System.Collections;

 

public class SOOrderEntry_Extension : PXGraphExtension<SOOrderEntry>

{

public PXAction<SOOrder> LinkDropShipPO;

 

[PXButton]

[PXUIField(DisplayName = "Link Drop-Ship PO")]

protected IEnumerable linkDropShipPO(PXAdapter adapter)

{

SOOrder order = Base.Document.Current;

 

if (order == null)

return adapter.Get();

 

foreach (SOLine line in Base.Transactions.Select())

{

if (line.LineType != SOLineType.GoodsForDropShip)

continue;

 

// Find matching PO line (you can refine this logic)

POLine poLine = PXSelect<

POLine,

Where<POLine.inventoryID, Equal<Required<POLine.inventoryID>>,

And<POLine.completed, Equal<False>>>>

.Select(Base, line.InventoryID);

 

if (poLine == null)

continue;

 

// 🔑 THIS is the key part — create SOLineSplit

SOLineSplit split = new SOLineSplit

{

OrderType = line.OrderType,

OrderNbr = line.OrderNbr,

LineNbr = line.LineNbr,

InventoryID = line.InventoryID,

Qty = line.OrderQty,

POType = poLine.OrderType,

PONbr = poLine.OrderNbr,

POLineNbr = poLine.LineNbr

};

 

Base.splits.Insert(split);

}

 

Base.Actions.PressSave();

 

return adapter.Get();

}

}

 

Step 2: Expose in REST Endpoint

Go to:

Web Service Endpoints (SM207060)

Open your endpoint (24.200.001 or custom)

Select SalesOrder

Add Action

Step 3: Call via REST