How-To: Update external shipping info during Order Import Using Shopify Connector

  • 6 January 2021
  • 1 reply
  • 223 views

Userlevel 5
Badge +1

The current Acumatica Shopify Connector doesn’t process the shipping information during Sales Order Import. But in some cases, Shopify Order will be fulfilled by other 3rd party service, and you want to import the shipping information into Acumatica Order if the order has been fulfilled. 

This request can be resolved by using customization project:

namespace PX.Commerce.Shopify
{
public class SPSalesOrderProcessor_Extension : PXGraphExtension<SPSalesOrderProcessor>
{
public delegate void SaveBucketImportDelegate(SPSalesOrderBucket bucket, IMappedEntity existing, String operation);

[PXOverride]
public virtual void SaveBucketImport(SPSalesOrderBucket bucket, IMappedEntity existing, String operation, SaveBucketImportDelegate baseMethod)
{
//Local is the API Object from Acumatica
SalesOrder localOrder = bucket.Order.Local;

//Extern is the API Object from Shopify
OrderData externOrder = bucket.Order.Extern;

//You can check FulfillmentStatus and Fulfillments object to ensure order has fulfillment data
//If order is unfulfilled, externOrder.Fulfillments is null
if ((externOrder.FulfillmentStatus == OrderFulfillmentStatus.Fulfilled || externOrder.FulfillmentStatus == OrderFulfillmentStatus.Partial)
&& externOrder?.Fulfillments?.Count > 0)
{
//Process the fulfillment data as what you want
foreach(FulfillmentData fulfillmentItem in externOrder?.Fulfillments)
{
if(fulfillmentItem.Status == FulfillmentStatus.Success) //You can handle data based on each fulfillment item status
localOrder.Note += $"Tracking Company: {fulfillmentItem.TrackingCompany}, tracking number: {string.Join(",",fulfillmentItem.TrackingNumbers)}";
}
}

baseMethod(bucket, existing, operation); // calling the base met
}
}
}

Now the shipping information will be auto updated to “Notes” field in Acumatica Order. 

 

 


1 reply

Userlevel 3
Badge

Hi Simon

Does the customization actually ship the Acumatica order too?

I have a customer who’s orders will be delivered by a third party and they update shopify.

My intention then is to fetch the fulfillment and ship the order.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved