Location Mapping Failure Shopify - Netsuite

I’ve recently inherited a Netsuite / Celigo instance and trying to debug all the hard coding to be able to support the expansion of different locations in our Shopify.

line_items[*].fulfillment_orders.[0].assigned_location_id - this is the current field we are using to support the mapping of Location And Inventory Location.

2 issues -

99% of the time, the mapping is successful for Location, but is never successful for Inventory Location, that field always comes over as BLANK.

Second issue, I get this error when importing some orders, and there is no resolution ability -

Unable to create the order in NetSuite for the Shopify order #6924766511334 Exported value is empty/undefined for the field: $.line_items[*].fulfillment_orders.[0].assigned_location_id. Ensure value is not empty/undefined or Uncheck 'Fail If Unique Match Not Found' field and enter appropriate default value

I can’t debug the payload as the fulfillment details are added by hook during the upload process.

Any experience on how to handle this. I can’t support a default location as there is no consistency as to what location is failing, it could be any.

Hi Michael,

Per your conversation with a rep in a support ticket, the reason the location ID mapping does not go through unless a default location is set is due to missing data on certain line items.

When checking the line_items in the logs, some items do not have an assigned_location field. So far, this has only been observed with discounts — all other line items do have an assigned location. This suggests the issue is most likely limited to non-inventory items.

Because the mapping expects every line item to have an assigned location, it encounters an error and fails when that field is absent.

A good way to handle this is to use a handlebar expression that checks whether an assigned_location exists on each line item, and falls back to your default location when it does not. This way, non-inventory items like discounts won't interrupt the mapping flow.