Skip to content

Instantly share code, notes, and snippets.

@jphungcode
Created October 21, 2020 02:56
Show Gist options
  • Save jphungcode/77615d6e7b8ef34b0b51a20ef74497c6 to your computer and use it in GitHub Desktop.
Save jphungcode/77615d6e7b8ef34b0b51a20ef74497c6 to your computer and use it in GitHub Desktop.
const pfcEndpoint = "http://www.pfcexpress.com/webservice/v2/CreateShipment.aspx";
let lineItems = [];
// creating an update line items array for the necessary object attributes for PFC
for (let i = 0; i <= data.line_items.length - 1; i++) {
let item = data.line_items[i];
let temp_item = {
SKU: item.sku,
EnName: item.name,
CnName: "",
MaterialQuantity: item.quantity,
Weight: item.meta[0].weight,
Price: item.price,
ProducingArea: "China",
HSCode: "",
Length: item.meta[0].length,
Width: item.meta[0].width,
High: item.meta[0].high,
};
lineItems.push(temp_item);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment