Guides

ERP → FNE Mapping

Complete guide for mapping your ERP data to FNE format

ERP → FNE Mapping

This guide shows you how to use custom mapping to transform your ERP data structures to FNE format.

Overview

Custom mapping allows you to automatically transform your ERP data structures to the format expected by the FNE API. This avoids having to manually restructure your data on each call.

Mapping Configuration

Laravel

In config/fne.php:

Symfony

In config/packages/fne.yaml:

Native PHP

In fne.php:

Dot Notation

Mapping supports dot notation to access nested properties:

Usage Example

Without Mapping

Without custom mapping, you must manually restructure your data:

With Mapping

With custom mapping, you can use your ERP data directly:

Mapping with Models

Mapping also works with models via traits:

Priority Order

Custom mapping is applied before standard mapping. The processing order is:

  1. Custom mapping: Transforms ERP keys to FNE keys
  2. Merge: Mapped data is merged with original data
  3. Standard mapping: Standard mapping is applied to merged data

Unmapped Fields

Fields that are not in the mapping are preserved as-is. You can:

  • Map some fields and leave others in FNE format
  • Combine both approaches in the same data structure

Disable Mapping

To disable mapping for a specific call, you can pass data directly in FNE format:

Advanced Examples

Conditional Mapping

Mapping with Default Values

Next Steps

Need help? Check out the complete documentation or open an issue on GitHub.