# Why do we need company ID mapping?

Source: https://developer.avalara.com/products/e-invoicing/integration-guides/elr/uek2600453704100/

Guide: E-Invoicing and Live Reporting

# Why do we need company ID mapping?

For both outbound (sale) and inbound (purchase) e-invoicing flows, Avalara determines which Avalara company record the document belongs to. All API responses related to the document include the `companyId` field.

Your integration must map the Avalara `companyId` to your application’s internal reference for the corresponding legal entity or company. This mapping ensures that your system can process the document correctly.

**Parent topic:** [Q-and-A for ELR](/elr/lbp6527542929684/)