lam.execute
Learn more about the execute keyword
Last updated
Was this helpful?
Was this helpful?
(payload) => {
const { input } = payload;
const { Recipient, PackagesInfo } = input;
const packagePayloads = PackagesInfo.Packages.map(pkg => ({
"lam.workflowId": 39,
"lam.payload": {
address_1: Recipient.Address1,
address_2: Recipient.Address2,
EXT_FIELD_first_name: Recipient.Firstname,
EXT_FIELD_last_name: Recipient.Name,
EXT_FIELD_email: Recipient.Email,
EXT_FIELD_phone: Recipient.Tel,
EXT_FIELD_weight: pkg.Weight.Value,
custom_user_fields: [
{ order_custom_field_id: 1852 }
],
address_city: Recipient.City,
address_state_id: Recipient.CountryStateCode,
address_country_id: Recipient.CountryCode,
address_zip: Recipient.PostalCode,
tracking_number: pkg.PreAssignTrackingNumber.TrackingNumber
}
}));
return {
"lam.execute": packagePayloads
};
}