Skip to main content

Microsoft Dynamics 365 Business Central Invoice From iPaaS.com

Summary

Microsoft Dynamics 365 Business Central Posted Invoice, Invoice Item Line, Shipping Line (Parent Only Support), Transaction Taxes as Invoice Lines (Transaction Tax records in iPaaS.com), and Customer Payment records are transferred FROM iPaaS.com Transactions using the Add/Update Dynamics Invoice mapping collection. The integration creates Posted Sales Invoices, associated line items, and Posted Customer Payments in Business Central from completed order Transactions in iPaaS.com.

ID Format

External ID Format

  • Posted Invoice External ID (in iPaaS.com): invoice|{postedInvoiceId} — Example: invoice|7b3e4f3b-1234-4567-89ab-0c1d2e3f4a5b

  • Posted Invoice Line Item External ID (in iPaaS.com): {postedInvoiceLineItemId} — Example: 7b3e4f3b-1234-4567-89ab-0c1d2e3f4a5b

  • Customer Payment External ID (in iPaaS.com): {AppliesToInvoiceId}|{CustomerPaymentId} — Example: 7b3e4f3b-1234-4567-89ab-0c1d2e3f4a5b|9d2c1b7a-9876-4321-aaaa-bbbbccccdddd

    After sync, the external ID saved in iPaaS.com follows the format invoice|{postedInvoiceId} for the parent invoice. Line items use the Business Central line item GUID directly. Customer payments use a composite format {AppliesToInvoiceId}|{CustomerPaymentId}.

Mapping Collection Status

Status: Enabled

Trigger Events:

  • Transaction created/updated in iPaaS.com where Type == “Invoice” and Status == “Complete”

  • Child mappings (Line, Payment, Shipping, Tax) are executed as part of the same integration when the parent Transaction meets the filter

Duplicate or Conflicting Mappings

This is not the only active mapping collection for Transaction sync. iPaaS.com Transactions are also configured to be created/updated as Business Central Sales Orders using a separate mapping collection named “Dynamics Sales Order FROM iPaaS.com.” Both mappings share the same source entity (Transaction), so collision handling must be configured to prevent duplicate processing. The Invoice mapping filters on Type == “Invoice” and Status == “Complete,” while the Sales Order mapping filters on different criteria.

Supported Child Collections

  • Parent: Add/Update Dynamics Invoice FROM iPaaS.com

  • Child 1: Add/Update Dynamics Invoice Line FROM iPaaS.com — Maps Transaction Line items to invoice lines

  • Child 2: Add/Update Dynamics Invoice Customer Payment FROM iPaaS.com — Creates customer payments applied to the posted invoice

  • Child 3: Add/Update Dynamics Invoice Tax Line FROM iPaaS.com — Adds tax as G/L Account line items

  • Child 4: Add/Update Dynamics Invoice Shipping Line FROM iPaaS.com — Adds shipping as G/L Account line items

System Caveats

iPaaS.com Caveats

  • Customer/Company Requirement: The Business Central customer/company must already exist in iPaaS.com with a valid external ID. The dynamic formulas use GetExternalIdAsync to resolve the customer number.

  • Address Structure: Address mappings rely on an Addresses collection with IsPrimaryShipping == true and fields like Address1, City, Country, Region, PostalCode.

Business Central Caveats

  • Payment Terms Requirement: The payment term (e.g., “COD”) must already exist in Business Central. The dynamic formula GetPaymentTermsIdByNameAsync(“COD”) will fail if the term name does not exactly match.

  • Customer Payment Journal Requirement: The customer payment journal (e.g., “IPAASPAY”) must already exist under Cash Management → Cash Receipt Journals.

  • Location and Bin Requirement: If a Location in Business Central has Bin Mandatory enabled, default bins or valid bin assignments must be configured for items, or invoice posting will fail.

  • Customer Location Code: If locationId is not specified in invoice line mappings, Business Central will use the customer Location Code by default.

  • Posted Records Mutability: Posted invoices and posted payments are restricted in Business Central; the integration is designed to create additional payments, not edit posted invoices or previously posted payments.

  • Payment Method Balancing Account Requirement: Do not configure a Bal. Account Type / Bal. Account No. on payment methods in Business Central (e.g., CASH) used by this integration. If a balancing account is set, Business Central automatically creates a balancing entry during posting, which leads to the payment being automatically applied and closed, preventing proper invoice linkage.

  • Tax Configuration Requirement: When invoice totals are mismatched due to only subtotal mapping, configure tax correctly in Business Central. Customer Setup: enable Tax Liable = TRUE and assign the correct Tax Area Code. Item Setup: assign a Tax Group Code. Shipping Setup: set Tax Group Code = NONTAXABLE on the freight G/L account. Tax Setup: define mappings between Tax Area, Tax Group, and Tax Percentage.

Integration-Specific Caveats

  • Duplication Handling Logic: Invoices use external IDs set to “invoice|{postedInvoiceId}”. Subsequent updates use this to determine that the invoice already exists and only payments should be added. Payments use IDs set to {AppliesToInvoiceId}|{CustomerPaymentId}, allowing the Update method to parse and PATCH the correct customerPayments({id}).

  • Taxes as Line Items: If taxes are available in iPaaS.com, they will be added as line items during sales invoice creation.

Setup Requirements

iPaaS.com Configuration

  • Mapping Collections: Enable the following:

    • Add/Update Dynamics Invoice FROM iPaaS.com

    • Add/Update Dynamics Invoice Line FROM iPaaS.com

    • Add/Update Dynamics Invoice Shipping Line FROM iPaaS.com

    • Add/Update Dynamics Invoice Tax Line FROM iPaaS.com

    • Add/Update Dynamics Invoice Customer Payment FROM iPaaS.com

  • External ID Strategy: Ensure Customer and Company records have correct Business Central external IDs. Ensure any prior order/customer sync flows populate these IDs.

Business Central Configuration

  • Master Data: Customers and Companies present and correctly configured. Payment Terms (e.g., “Cash on delivery”) exist and are active. Customer Payment Journal “INVOICE PAYMENT” set up and ready.

  • Location and Bin Requirements: In Business Central, each inventory Location can be configured to require bins. When Bin Mandatory is enabled, every item transaction must have a bin defined. Users must either assign a default bin to items or use locations that do not require bins.

  • G/L Accounts for Shipping and Tax: Confirm that G/L account numbers such as “15930” exist and are appropriate for shipping/tax charges.

  • API and Permissions: API user/app with permissions to read/write salesinvoices, customerPayments, journals, and execute Microsoft.NAV.post actions.

Authentication & Security

  • Business Central: Uses OAuth 2.0 / application credentials configured in iPaaS.com connection. Credentials stored securely and not hard-coded.

  • iPaaS.com / BigCommerce (if used): Storefront and Admin API tokens stored in iPaaS.com connections and only used from server-side code.

Integration Flow

  1. Transaction (Type = “Invoice”, Status = “Complete”) is created/updated in iPaaS.com.

  2. Invoice header fields are mapped and a draft Sales Invoice is created in Business Central.

  3. Invoice line items are created/updated on that draft invoice.

  4. The draft invoice is posted to a Posted Invoice and given an external ID (invoice|postedInvoiceId).

  5. Customer payments (if any) are created and posted, linked to the posted invoice.

  6. Shipping Line Creation: If Parent.ShippingAmount is not null, adds a G/L Account invoice line for shipping charges using a static G/L number (e.g., 15930).

  7. Tax Line Creation: For each Transaction Tax row, adds G/L Account invoice lines for tax charges.

  8. The final invoice (with lines and payments) and external ID is returned to iPaaS.com.

  9. Later updates only add new payments to the existing posted invoice using the same external ID.

Mappings

Add/Update Dynamics Invoice FROM iPaaS.com (Parent)

Mapping Filter: Type == "Invoice" && Status == "Complete"

Only completed invoice Transactions are included. Drafts or non-invoice Transactions are ignored, ensuring only financially ready documents become posted invoices in Business Central.

Mapping Type

Source Field (iPaaS.com)

Destination Field (Business Central)

Description

Dynamic Formula

var ExternlCustomerID = await GetExternalIdAsync(CustomerId, "Customer", SpaceportSystemId); if(ExternlCustomerID == null || ExternlCustomerID == "") { ExternlCustomerID = await GetExternalIdAsync(CompanyId, "Company", SpaceportSystemId); } return ExternlCustomerID;

CustomerId

Required. Resolves the Business Central customer number by checking Customer external ID first, then falling back to Company external ID.

Dynamic Formula

TransactionCreatedDateTime.Value.ToString("yyyy-MM-dd")

PostedInvoice_InvoiceDate

Recommended. Invoice date in yyyy-MM-dd string format.

Dynamic Formula

TransactionCreatedDateTime.Value.ToString("yyyy-MM-dd")

PostedInvoice_PostingDate

Recommended. Posting date in yyyy-MM-dd string format.

Dynamic Formula

var ExternlCustomerID = await GetExternalIdAsync(CustomerId, "Customer", SpaceportSystemId); if(ExternlCustomerID == null || ExternlCustomerID == "") { ExternlCustomerID = await GetExternalIdAsync(CompanyId, "Company", SpaceportSystemId); } return ExternlCustomerID;

PostedInvoice_BillToCustomerId

Recommended. Sets “Bill To” customer number using same logic as CustomerId.

Dynamic Formula

GetPaymentTermsIdByNameAsync("Cash on delivery")

PostedInvoice_PaymentTermsId

Recommended. Resolves Payment Terms ID by name. The term must exist in Business Central.

Static

"USD"

PostedInvoice_CurrencyCode

Optional. Currency code. Update to match your Business Central currency.

Static

"JO"

PostedInvoice_Salesperson

Optional. Salesperson code. Update to match your Business Central salesperson.

Field

EmailAddress

PostedInvoice_Email

Optional. Email for the invoice.

Dynamic Formula

FieldFromFirstMatch(Addresses, "IsPrimaryShipping == true", "Address1")

PostedInvoice_SellToAddressLine1

Optional. Sell-to street line from primary shipping address.

Dynamic Formula

FieldFromFirstMatch(Addresses, "IsPrimaryShipping == true", "City")

PostedInvoice_SellToCity

Optional. Sell-to city from primary shipping address.

Dynamic Formula

FieldFromFirstMatch(Addresses, "IsPrimaryShipping == true", "Country")

PostedInvoice_SellToCountry

Optional. Sell-to country from primary shipping address.

Dynamic Formula

FieldFromFirstMatch(Addresses, "IsPrimaryShipping == true", "Region")

PostedInvoice_SellToState

Optional. Sell-to region/state from primary shipping address.

Dynamic Formula

FieldFromFirstMatch(Addresses, "IsPrimaryShipping == true", "PostalCode")

PostedInvoice_SellToPostCode

Optional. Sell-to postal code from primary shipping address.

Dynamic Formula

return true;

IsInvoice

Required. Flags this record as an invoice for the integration to create a Posted Sales Invoice.

Add/Update Dynamics Invoice Line FROM iPaaS.com (Child – Transaction Line)

Mapping Filter: No additional filter (inherits parent Transaction context).

Mapping Type

Source Field (iPaaS.com)

Destination Field (Business Central)

Description

Field

Sku

LineObjectNumber

Required. Links SKU to Business Central item number.

Field

Description

Description

Optional. Line description.

Field

Qty

Quantity

Required. Quantity ordered.

Field

UnitPrice

PostedInvoiceItem_UnitPrice

Required. Unit price.

Static

"ITEM"

PostedInvoiceItem_LineType

Required. Sets line type to ITEM.

Add/Update Dynamics Invoice Shipping Line FROM iPaaS.com

Mapping Filter: SourceTypeName == "ParentOnly" && Parent.ShippingAmount != null

Mapping Type

Source Field (iPaaS.com)

Destination Field (Business Central)

Description

Dynamic Formula

return "Account";

PostedInvoiceItem_LineType

Required. Sets line type to G/L Account.

Static

"15930"

LineObjectNumber

Required. G/L account number for shipping line. Update to match your Business Central chart of accounts.

Static

"Shipping Charge"

Description

Optional. Line description for shipping.

Static

1

Quantity

Required. Shipping line quantity set to 1.

Dynamic Formula

Parent.ShippingAmount

PostedInvoiceItem_UnitPrice

Required. Uses Transaction ShippingAmount as line amount.

Add/Update Dynamics Invoice Tax Line FROM iPaaS.com

Mapping Filter: SourceTypeName == "ParentOnly" && Parent.ShippingAmount != null

Mapping Type

Source Field (iPaaS.com)

Destination Field (Business Central)

Description

Static

"15930"

PostedInvoiceItem_lineObjectNumber

Required. G/L account number for tax. Update to match your Business Central chart of accounts.

Static

"Account"

PostedInvoiceItem_LineType

Required. Line type = G/L Account.

Field

Amount

PostedInvoiceItem_UnitPrice

Required. Tax amount.

Static

"1"

PostedInvoiceItem_Quantity

Required. Quantity = 1.

Static

"Tax Charge"

PostedInvoiceItem_Description

Optional. Description for tax line.

Add/Update Dynamics Invoice Customer Payment FROM iPaaS.com (Child – Transaction Payment)

Mapping Filter: No additional filter (inherits parent Transaction context).

Mapping Type

Source Field (iPaaS.com)

Destination Field (Business Central)

Description

Dynamic Formula

GetCustomerPaymentJournalIdByNameAsync("INVOICE PAYMENT")

JournalId

Required. Resolves the Customer Payment Journal ID. The journal must exist in Business Central.

Dynamic Formula

var ExternlCustomerID = await GetExternalIdAsync(Parent.CustomerId, "Customer", SpaceportSystemId); if(ExternlCustomerID == null || ExternlCustomerID == "") { ExternlCustomerID = await GetExternalIdAsync(Parent.CompanyId, "Company", SpaceportSystemId); } return ExternlCustomerID;

CustomerId

Required. External customer ID from parent invoice.

Dynamic Formula

Parent.TransactionCreatedDateTime.Value.ToString("yyyy-MM-dd")

PostingDate

Recommended. Posting date for the payment.

Dynamic Formula

if(Amount > 0) { return -Amount; } return Amount;

Amount

Required. Ensures negative payment amount for Business Central.

Field

Description

Description

Optional. Payment description.

Error Handling

  • “Invalid tax code or G/L account number is supplied” — This error occurs when Business Central rejects an invalid or non-existent tax code or G/L account number. Resolution: Align tax code and G/L account mappings between iPaaS.com and Business Central. Update static values (e.g., “15930”) to valid accounts.

  • “Inventory Account is missing in Inventory Posting Setup Location Code: {LocationCode}, Invt. Posting Group Code: {PostingGroup}” — Business Central cannot find an Inventory Account in Inventory Posting Setup for the specified Location Code and Posting Group. Resolution: In Business Central, open Inventory Posting Setup and configure a valid Inventory Account for the specified combination.

  • “Cannot convert the literal ‘MAIN’ to the expected type ‘Edm.Guid’. (locationId)” — The Business Central API expects a GUID for locationId but receives a string value. Resolution: Use a conversion formula to translate location codes to GUIDs. Update static mappings to use GUID values.

  • “You must specify a journal batch ID or a journal ID to get a journal line” — Business Central requires either a journalId or journalBatchId when creating journal lines. Resolution: Ensure GetCustomerPaymentJournalIdByNameAsync returns a valid journal ID. Verify the journal exists in Business Central Cash Receipt Journals.

  • “There is no Cust. Ledger Entry within the filter” — No Customer Ledger Entry matches the filter criteria. Resolution: Verify filter parameters match an existing open entry. Ensure the invoice is posted and still open.

  • “The ‘amount’ should be a negative number” — Payment amount sent as positive but Business Central expects negative. Resolution: Update payment mapping formula to convert to negative values. Verify upstream systems are not double-negating.

  • “The filter ‘’=‘SELLACRE24_W%2FOORINGS’’ is not valid for the No. field on the Item table” — OData filter contains invalid syntax for the field. Resolution: Fix OData filter syntax. Ensure filter values respect field length and character constraints.

  • “Balance must be equal to ‘0’ in G/L Account: No.={AccountNo}” — Financial transaction is not balanced. Resolution: Review the transaction to ensure debits and credits balance. Check posting setups (Customer Posting Group, General Posting Setup).

  • “Customer Posting Group must have a value in Customer: No.={CustomerNo}” — Customer record missing required Customer Posting Group. Resolution: In Business Central, assign a valid Customer Posting Group to the customer record.

  • “The field Account No. of table Gen. Journal Line contains a value ({AccountNo}) that cannot be found in the related table ({TableName})” — Journal line references a non-existent account number. Resolution: Verify the account exists in the correct table. Update mappings to use valid account numbers.

Validation Rules

  • CustomerId/BillToCustomerId must resolve to a valid Business Central external ID before invoice creation.

  • IsInvoice must be true for the record to create a posted invoice.

  • Line Quantity, UnitPrice, LineType must be provided for each line.

  • Payment Amount must be negative and JournalId must be valid.

  • The static G/L account number must exist and be valid for posting.

Testing & Validation

Test Scenarios

  • Basic Invoice Creation: Create a Transaction in iPaaS.com with Type = “Invoice”, Status = “Complete”, valid Customer external ID, and at least one Transaction Line. Expected: Business Central shows a Posted Invoice with matching header, lines, and no payments if none provided.

  • Invoice with Payment: Same as above, but include a Transaction Payment record. Expected: Business Central shows the Posted Invoice plus a posted Customer Payment applied to that invoice.

  • Invoice Update – New Payment Only: Update the same Transaction to add another Payment. Expected: Business Central creates a new Customer Payment linked to the same posted invoice; header and lines are unchanged.

  • Invoice Without Shipping: Transaction with line items but ShippingAmount == null. Expected: Posted Invoice with item lines only, no shipping G/L line. Payment created normally.

  • Invoice with Multiple Tax Rows: Transaction with multiple tax rows in Transaction Tax. Expected: Each tax row creates a separate G/L Account line on the invoice.

Validation Checklist

  • Customer / Company External IDs correctly resolve to Business Central customers

  • Payment term name in formula matches a Business Central payment term

  • Location code and any required bins are configured in Business Central

  • Static currency, salesperson, and G/L account values are valid

  • Shipping and tax amounts in Business Central match source Transaction totals

  • Payments in Business Central reflect the correct (negative) amounts and reference the correct invoice

Additional Notes

  • Static values like “USD”, “JO”, “IPAASPAY”, “EAST”, and “15930” are implementation-specific and should be reviewed and updated to match your accounting, warehouse, and reporting requirements.

  • If your business requires open sales orders instead of posted invoices, or different handling of adjustments/cancellations, additional collections and logic will be needed.

  • For any significant change to the mapping logic (e.g., new tax logic, multi-currency, dimensions), engage your MiSP or an Integrator.

Did this answer your question?