Skip to main content

iPaaS.com to Adobe Commerce/Magento 2 Invoice Mapping Documentation

How invoices are raised in Adobe Commerce/Magento 2 from iPaaS.com, including payment capture, customer notification and partial invoicing by line.

Summary

Invoices are created in Adobe Commerce/Magento 2 from iPaaS.com Transactions of type Invoice. Each invoice is raised against an existing Magento sales order, optionally capturing payment and notifying the customer, and a child collection specifies which of the order's lines are being invoiced and in what quantity.

The order must already exist in Magento — this family invoices orders, it does not create them. The order is named by a custom field on the iPaaS.com Transaction rather than being resolved from a stored link.

ID Format

Manual Sync ID Format

Enter the iPaaS.com Transaction record identifier of the invoice transaction — the internal numeric identifier in iPaaS.com, for example 90733.

The Magento order number is not accepted as a Manual Sync value.

External ID Format

After a successful transfer, iPaaS.com stores the Adobe Commerce/Magento 2 invoice identifier as the external ID on a record linking the iPaaS.com Transaction to the Magento invoice. Each invoice line likewise carries a link to its Magento invoice line, which the line child both reads and maintains.

Deleted Record Support

Outbound delete is not supported for invoices, and Magento does not support deleting an invoice either. An invoice raised in error is reversed in Magento with a credit memo rather than removed.

Custom Field Support

This family reads a number of iPaaS.com custom fields, which must exist by these exact names for the behavior they control to work.

On the Transaction:

  • Adobe Commerce Order Id: required — names the Magento order the invoice is raised against. Without it the invoice has no target.

  • isInvoiceUpdate: whether the transaction is processed as an invoice against the referenced order. Defaults to true.

  • Capture: whether the invoice captures payment when created. Defaults to true.

  • Notify: whether Magento emails the customer when the invoice is captured. Defaults to true.

  • AppendComment: whether the supplied comment is appended to the invoice. Defaults to true.

  • Comment Value, Comment Is Visible On Front: the comment placed on the invoice itself and its storefront visibility.

  • Order Comment Value, Order Comment Is Visible, Order Comment Is Notified, Order Comment Status: a separate comment added to the original order's comment history, its visibility, whether the customer is notified, and the status recorded alongside it.

On the Transaction Line, read by the line child:

  • SellingUnit: used when resolving the invoice line to the right line on the Magento order.

The capture, notify and append-comment mappings ship with example fallbacks. As delivered an invoice captures payment and emails the customer where those custom fields are not set; both are configurable to the store’s process.

Mapping Collection Status

Status: Enabled. Both collections ship enabled.

Trigger Events: Creation or update of a Transaction of type Invoice in iPaaS.com, plus Manual Sync on demand.

Automatic outbound transfers are enabled on the subscription's Outbound Data Flows page. Until that flow is enabled, no invoices are sent automatically. Manual Sync is always available regardless.

Duplicate or Conflicting Mappings

  • Update Adobe Commerce/Magento 2 Order FROM iPaaS.com writes status and line changes to the same Magento orders. An order that is fully invoiced can no longer be cancelled, so the two families interact: invoicing an order removes the option to cancel it through the order update family.

  • Add/Update Adobe Commerce/Magento 2 Order TO iPaaS.com is the inbound family that brought the order into iPaaS.com in the first place. Its Transactions are of type Order; this family's are of type Invoice, so the two do not compete for the same records.

  • The shipment track collections create shipments against the same orders. Magento treats invoicing and shipping independently, but both change what state transitions remain available on the order.

Duplicate matching

This integration implements no selectable collision-handling methods, and the behavior is not configurable on these collections. The external-ID record linking the iPaaS.com Transaction to the Magento invoice decides whether a transfer creates or updates.

Magento will not accept a second invoice for an order that is already fully invoiced; that attempt produces an error rather than a duplicate.

Unmapped field overwrite risk

This family creates invoices rather than maintaining a broad set of fields, so the usual overwrite risk is narrow. The fields it writes are IsInvoiceUpdate, Capture, Notify, OriginalOrderId, AppendComment, Comment_Value, Comment_Is_Visible_On_Front, Order_Comment_Value, Order_Comment_Is_Visible_On_Front, Order_Comment_Is_Customer_Notified and Order_Comment_Status on the invoice, and ParentItemId, QtyInvoiced, Sku and InvoiceItemEntityId on each invoice line.

Note that a re-transfer can repeat an action rather than simply rewriting a field — capturing payment or sending a notification again — so confirm the capture and notify mappings match the store’s process before enabling automatic transfers.

The mitigation is a DestinationValue. Where a Magento field must hold a specific value that iPaaS.com does not supply, set a DestinationValue on that mapping so the integration writes the value chosen there instead of taking it from the source.

Supported Child Collections

The parent collection is Add/Update Adobe Commerce/Magento 2 Invoice FROM iPaaS.com. It has one child:

  • Add/Update Adobe Commerce/Magento 2 Invoice Line FROM iPaaS.com: specifies which lines of the original Magento order are being invoiced and in what quantity. It runs beneath the parent and does not transfer on its own.

System Caveats

Adobe Commerce/Magento 2 Caveats

  • The order must already exist in Magento. This family invoices existing orders; it never creates one.

  • An order can only be fully invoiced once. Attempting to invoice an order that is already fully invoiced produces an error.

  • Invoicing constrains later cancellation. An order with invoiced items cannot be cancelled, and one that is fully shipped and invoiced cannot be cancelled at all. Reversal is by credit memo in the Magento admin.

  • Capture depends on the payment method. Whether an invoice can capture payment at creation depends on how the order's payment method is configured in Magento.

  • Invoice writes are subject to Magento's API limits. Stagger large manual catch-up runs rather than issuing them concurrently.

iPaaS.com Caveats

  • Only transactions of type Invoice are processed. The filter admits nothing else.

  • The Adobe Commerce Order Id custom field is required. It names the Magento order the invoice is raised against, and there is no fallback if it is absent.

  • Invoice lines are resolved against the original order. Each line is matched to a line on the Magento order by SKU and selling unit; a line that cannot be matched cannot be invoiced.

Integration-Specific Caveats

  • The capture and notify mappings are examples to adapt. As shipped, an invoice captures payment and emails the customer where the corresponding custom fields are not set. Both are edited in the mapping interface, or driven per record through the custom fields, to match the store’s process.

  • Two separate comments are written. One goes on the invoice and one on the original order's comment history, each with its own visibility control. Both default to the same text.

  • The order is named by a custom field, not a stored link. This differs from the order update family, which resolves its target from the external-ID record. A wrong or stale value in Adobe Commerce Order Id sends the invoice to the wrong order.

Setup Requirements

Adobe Commerce/Magento 2 Configuration

  • Confirm the orders to be invoiced exist and are in a state that permits invoicing.

  • Confirm the payment methods in use support capture at invoice creation, if capture is wanted.

iPaaS.com Configuration

  • Create the custom fields listed under Custom Field Support above.

  • Populate Adobe Commerce Order Id on every invoice transaction.

  • Set the capture and notify mappings, or their custom fields, to match the store’s invoicing and notification process.

  • Confirm the invoice lines' SKUs and selling units match lines on the original order.

  • Enable the outbound flow for Adobe Commerce/Magento 2 invoices on the subscription's Outbound Data Flows page.

Full step-by-step setup instructions are in the Adobe Commerce/Magento 2 Installation Instructions article.

Integration Flow

  1. A Transaction of type Invoice is created or updated in iPaaS.com, or a Manual Sync is run against one.

  2. The transaction is evaluated against the parent collection's filter, which admits only transactions of type Invoice.

  3. The Magento order is read from the Adobe Commerce Order Id custom field.

  4. The line child resolves each invoice line to a line on that Magento order, by SKU and selling unit, and sets the quantity being invoiced.

  5. The invoice is created in Adobe Commerce/Magento 2 against the order, capturing payment and notifying the customer according to the capture and notify values.

  6. A comment is placed on the invoice, and a separate comment is added to the original order's comment history.

Mappings

Add/Update Adobe Commerce/Magento 2 Invoice FROM iPaaS.com (Parent)

iPaaS.com data type: Transaction

Mapping Filter

Type == "Invoice"

This collection processes only iPaaS.com Transactions whose type is Invoice. Transactions of every other type — including the orders this integration brings in from Magento — do not pass and are handled by their own families. Records that do not pass are skipped without error.

Mapping Type

Source Field (iPaaS.com)

Destination Field (Adobe Commerce/Magento 2)

Description

Dynamic Formula

return GetCustomFieldValue(CustomFields, "Adobe Commerce Order Id");

OriginalOrderId

Required. Names the Magento order the invoice is raised against, from the Adobe Commerce Order Id custom field. There is no fallback — an invoice with no value here has no target order.

Dynamic Formula

var isInvoiceUpdate = GetCustomFieldValue(CustomFields, "isInvoiceUpdate"); if(isInvoiceUpdate != null) { return isInvoiceUpdate; } return true;

IsInvoiceUpdate

Optional. Whether the transaction is processed as an invoice against the referenced order. Defaults to true.

Dynamic Formula

var capture = GetCustomFieldValue(CustomFields, "Capture"); if(capture != null) { return capture; } return true;

Capture

Optional. Whether the invoice captures payment when created, from the Capture custom field. The fallback is an example value — set it, or the custom field, to match the store’s invoicing process.

Dynamic Formula

var notify = GetCustomFieldValue(CustomFields, "Notify"); if(notify != null) { return notify; } return true;

Notify

Optional. Whether Magento emails the customer when the invoice is captured, from the Notify custom field. The fallback is an example value — set it, or the custom field, to match the store’s notification policy.

Dynamic Formula

var appendComment = GetCustomFieldValue(CustomFields, "AppendComment"); if(appendComment != null) { return appendComment; } return true;

AppendComment

Optional. Whether the supplied comment is appended to the invoice. Defaults to true.

Dynamic Formula

var commentValue = GetCustomFieldValue(CustomFields, "Comment Value"); if(commentValue != null) { return commentValue; } return "Order invoiced by iPaaS.com";

Comment_Value

Optional. The comment placed on the invoice itself. Defaults to Order invoiced by iPaaS.com.

Dynamic Formula

var isVisible = GetCustomFieldValue(CustomFields, "Comment Is Visible On Front"); if(isVisible != null) { return isVisible; } return null;

Comment_Is_Visible_On_Front

Optional. Whether the invoice comment is visible to the customer on the storefront.

Dynamic Formula

var commentValue = GetCustomFieldValue(CustomFields, "Order Comment Value"); if(commentValue != null) { return commentValue; } return "Order invoiced by iPaaS.com";

Order_Comment_Value

Optional. A separate comment added to the original order's comment history, distinct from the one on the invoice. Defaults to the same text.

Dynamic Formula

var commentIsVisible = GetCustomFieldValue(CustomFields, "Order Comment Is Visible"); if(commentIsVisible != null) { return commentIsVisible; } return null;

Order_Comment_Is_Visible_On_Front

Optional. Whether that order comment is visible on the storefront.

Dynamic Formula

var commentIsNotified = GetCustomFieldValue(CustomFields, "Order Comment Is Notified"); if(commentIsNotified != null) { return commentIsNotified; } return null;

Order_Comment_Is_Customer_Notified

Optional. Whether Magento emails the customer when that order comment is added.

Dynamic Formula

var commentStatus = GetCustomFieldValue(CustomFields, "Order Comment Status"); if(commentStatus != null) { return commentStatus; } return null;

Order_Comment_Status

Optional. The status recorded on the original order alongside the comment.

Add/Update Adobe Commerce/Magento 2 Invoice Line FROM iPaaS.com (Child)

iPaaS.com data type: Transaction Line

This collection carries no mapping filter. Every line on the transferring invoice transaction is processed.

Each line is resolved against the original Magento order rather than against the invoice: the order is read from the parent's Adobe Commerce Order Id custom field, the corresponding iPaaS.com Transaction for that order is found, and the line is matched by SKU and selling unit.

Mapping Type

Source Field (iPaaS.com)

Destination Field (Adobe Commerce/Magento 2)

Description

Dynamic Formula

var orderId = GetCustomFieldValue(Parent.CustomFields,"Adobe Commerce Order Id"); if(orderId != null) { var iPaaSTransactionId = await GetSpaceportIdAsync(orderId, "Transaction", SpaceportSystemId); if(iPaaSTransactionId != null) { return await GetLineItemIdByOrderIdSku(orderId,Sku,iPaaSTransactionId.ToString(),"SellingUnit"); } } return null;

ParentItemId

Required. Identifies which line on the original Magento order this invoice line applies to, matched by SKU and selling unit. A line that cannot be matched cannot be invoiced.

Dynamic Formula

var orderId = GetCustomFieldValue(Parent.CustomFields,"Adobe Commerce Order Id"); if(orderId != null) { var iPaaSTransactionId = await GetSpaceportIdAsync(orderId, "Transaction", SpaceportSystemId); if(iPaaSTransactionId != null) { return await GetFormattedSku(Sku, iPaaSTransactionId.ToString(), "SellingUnit"); } } return Sku;

Sku

Required. Identifies the product being invoiced, formatted to include the selling unit where one applies. Falls back to the plain SKU when the order cannot be resolved.

Field

Qty

QtyInvoiced

Required. The number of units to invoice for this line. A partial quantity produces a partial invoice.

Dynamic Formula

var transactionLineExternalId = await GetExternalIdAsync(Id, "Transaction Line", SpaceportSystemId); var externalId = 0; if(transactionLineExternalId != null) { var externalIdSplit = transactionLineExternalId.ToString().Split("\|").length > 1 ? transactionLineExternalId.ToString().Split("\|")[1] : transactionLineExternalId.ToString().Split("\|")[0]; externalId = Int32.Parse(externalIdSplit); } return externalId;

InvoiceItemEntityId

Required. Integration plumbing carrying the Magento invoice line's own identifier, resolved from the link held against the iPaaS.com transaction line. Returns 0 where no link exists, which is the new-line case. Do not remap it.

Error Handling

The full catalog of messages this integration produces, with causes and resolutions, is in the Adobe Commerce/Magento 2 Error Messages article. The conditions most often seen on this transfer are:

  • The order has already been fully invoiced. An invoice was requested for an order with nothing left to invoice. Resolution: confirm the invoice transaction is not a duplicate, and check whether a partial invoice already covered the lines.

  • An invoice with no target order. The Adobe Commerce Order Id custom field is empty or names an order that does not exist. Resolution: populate it with the correct Magento order.

  • An invoice line that cannot be matched. The line's SKU and selling unit do not correspond to a line on the original order. Resolution: correct the SKU or the selling unit.

  • The order cannot be cancelled because of previously invoiced items. A later cancellation attempt through the order update family is blocked by this invoice. Resolution: reverse with a credit memo in the Magento admin.

Errors are reported under Dashboard / Integration Monitoring / Error Logs.

Testing & Validation

Test Scenarios

  1. Create a Transaction of type Invoice with Adobe Commerce Order Id naming an existing order, and confirm a Magento invoice is created against it.

  2. Manually sync using the iPaaS.com Transaction record identifier and confirm it resolves.

  3. Confirm the capture behavior matches the store’s process, testing both with the Capture custom field set and unset.

  4. Confirm the notification behavior matches the store’s policy, testing both with the Notify custom field set and unset.

  5. Invoice a subset of the order's lines and confirm a partial invoice is created with the expected quantities.

  6. Attempt a second invoice against a fully invoiced order and confirm the documented error is raised.

  7. Invoice a line whose SKU carries a selling unit and confirm it resolves to the correct order line.

  8. Invoice a line whose SKU does not appear on the order and confirm it cannot be matched.

  9. Confirm the comment appears both on the invoice and in the original order's comment history, with the expected visibility.

  10. Invoice an order, then attempt to cancel it through the order update family, and confirm the cancellation is blocked.

Validation Checklist

  • Every custom field listed under Custom Field Support exists in the iPaaS.com environment.

  • Adobe Commerce Order Id is populated on every invoice transaction.

  • The capture and notify mappings have been adapted to the store’s invoicing and notification process.

  • Invoice line SKUs and selling units match lines on the original orders.

  • The interaction with order cancellation is understood before invoicing is enabled in production.

Additional Notes

  • The capture and notify mappings ship as example values. Setting them to the store’s own invoicing and notification process is a normal implementation step.

  • The target order is named by a custom field rather than resolved from a stored link, so a wrong or stale value silently sends the invoice to a different order.

  • Invoicing is not reversible through the integration. A mistaken invoice is corrected with a credit memo in the Magento admin.

  • Validate the adapted capture and notify mappings, and the partial-invoice behavior, in a staging environment before enabling automatic transfers in production.

Related Documents

Did this answer your question?