Overview
Magento Shipment Track can be transferred from iPaaS.com using an Add/Update sync method. This mapping supports the automated synchronization of Shipment Track records from iPaaS into Magento via the Shipment Track API (Transactions).
Mapping Collection Status
Mapping Status: Enabled.
Trigger Events: The sync is triggered by the creation or update of Shipment Track in iPaaS.
ID Format: When manually syncing, the Transaction Tracking ID from iPaaS is used.
Conflicting Mappings: This mapping applies only to Shipment Track. Ensure no other mappings target the same Magento entity to prevent data from being overwritten.
System Caveats
Magento Caveats
The OrderId must correspond to an existing order in Magento.
TrackNumber, CarrierCode, and Title are required for successful shipment creation.
iPaaS.com Caveats
Handles dynamic resolution of OrderId and EntityId for each shipment.
Setup Requirements
Magento Configuration
Ensure that orders exist and are invoiced before shipment creation.
Carrier codes configured in Magento should match those returned from iPaaS.
iPaaS.com Configuration
Define Shipment Items Field Separator and Shipment Items Record Delimiter presets (if using item-level shipments).
Ensure the TrackingNumber and ShippingMethodDescription fields are populated.
Authentication & Security
Magento2 API UserName: Used to access iPaaS API for fetching Company and related data.
Magento2 API Key: Used to access iPaaS API for fetching Company and related data
Integration Flow
Trigger: Shipment record generated or updated in iPaaS.
Order Resolution: The OrderId is dynamically resolved from transaction context.
Tracking Details: Tracking number, title, and carrier code are assigned.
Shipment Items: If defined, items are parsed from the preset-delimited format.
Submission: The finalized shipment record is posted to Magento via API.
Mappings
Parent Collection: Magento Shipment Track From iPaaS
Mapping Filter
var shipmentItems = GetCustomFieldValue(CustomFields, "Shipment Items");
if(shipmentItems != null){
return true;
}
else{
throw new Exception("Shipment Items are not provided");
return false;
}
Description:
If the ShipmentItems mapping is not provided, the tracking process will assume all items should be shipped. To ship the entire order without specifying individual items, simply remove the ShipmentItems mapping and any associated filters.
Configuring Shipment Items:
You can specify shipment item values using preset settings:
Shipment Items Field Separator – defines how individual field values (e.g., SKU and quantity) are separated within a record.
Shipment Items Record Delimiter – defines how multiple shipment item records are separated.
Example Configuration:
Shipment Items Record Delimiter: ,
Shipment Items Field Separator: |
Format: {Sku1}|{Quantity1},{Sku2}|{Quantity2}
Mapping Type | Source (iPaaS.com) | Destination (Magento) | Description |
Dynamic Formula |
| OrderId | This mapping calls an asynchronous method to get an external order ID (Magento Order Id), and returns it only if it's not null or empty. |
Dynamic Formula |
| EntityId | This mapping calls an asynchronous method to get an external order shipment ID (Magento Shipment Id), and returns it only if it's not null or empty. |
Dynamic Formula |
| TrackNumber |
|
Dynamic Formula |
| Title |
|
Dynamic Formula |
| CarrierCode | Magento Adobe Commerce allows the following tracking carrier codes: custom, fedex, dhl, ups, and usps. |
Dynamic Formula |
| Comment_Value | This mapping assigns the comment that will be appended to the shipment. Note: If the comment value is null, no comment will be added to the shipment. |
Dynamic Formula |
| Comment_Is_Visible_On_Front | This mapping assigns the value to control whether the comment is shown on the front end. If it is true, the comment will be displayed; otherwise, it will not be shown. |
Dynamic Formula |
| Notify | This field indicates whether to notify the customer about shipments. If set to true, an email will be sent to the customer when the shipment is captured. |
Dynamic Formula |
| ShipmentItems | If the ShipmentItems mapping is not provided, the tracking process will assume all items should be shipped. To ship the entire order without specifying individual items, simply remove the ShipmentItems mapping and any associated filters. Configuring Shipment Items: You can specify shipment item values using preset settings: Shipment Items Field Separator – defines how individual field values (e.g., SKU and quantity) are separated within a record. Shipment Items Record Delimiter – defines how multiple shipment item records are separated. Example:
|
Dynamic Formula |
| Atrributes_SourceCode | This value represents a "source to ship" location, which may be defined in a custom field. The corresponding code for each "source to ship" location can be found in Magento under Stores > Inventory > Sources. |
Dynamic Formula |
| Order_Comment_Value | This mapping assigns a comment that will be appended to the original order’s comment section to provide shipment details. Note: If the comment value is null, no comment will be added to the order. |
Dynamic Formula |
| Order_Comment_Is_Visible_On_Front | This mapping assigns the value that controls whether the comment is shown on the front end for the original order. If it is true, the comment will be displayed; otherwise, it will not be shown. |
Dynamic Formula |
| Order_Comment_Is_Customer_Notified | This field indicates whether to notify the customer when an invoice has been added to the order. If set to true, an email will be sent to the customer when the invoice is captured for that order. |
Dynamic Formula |
| Order_Comment_Status | This mapping assigns the order status, which can be a custom status defined in Magento, such as "Complete," "Cancelled," or "Processing." Note: A defect in the Magento API does not allow setting custom order statuses with the "processing" state, despite the UI offering the same ability. Custom statuses should not be provided to this mapping until the API is corrected. |
Error Handling
Missing OrderId
Description: This error occurs when the order reference cannot be found in Magento. It typically means that the related order has not yet been created or synced properly from iPaaS.
Resolution: Verify that the order exists in Magento and has been successfully synchronized before attempting shipment creation.
Invalid Carrier Code
Description: The Invalid Carrier Code error indicates that the provided shipping method does not correspond to any valid carrier configured in Magento.
Resolution: Check the shipping method name and ensure that the carrier mapping configuration in iPaaS correctly matches Magento’s carrier codes.
Missing Tracking Number
Description: The Missing Tracking Number error occurs when a shipment record is submitted without a valid tracking number.
Resolution: Ensure that the source data includes a valid tracking number before sending the shipment record to Magento.
Validation Rules & Testing
Validation Checklist
OrderId and TrackNumber are provided.
ShipmentItems are correctly formatted (if defined).
CarrierCode maps to a valid Magento carrier.
Comments and visibility settings are valid boolean values.
Test Scenarios
Carrier Validation: Send invalid ShippingMethodDescription: Expect “Invalid Carrier Code” error.
Comment Visibility: Test different combinations of visibility and notification flags.
Additional Notes
The mapping can operate independently or in parallel with parent order synchronization.
