ERP Connector Data Mapping Specification
Introduction
This reference defines the ERP data elements and their MachineMetrics field names. Use it with the custom connector guide and the SDK documentation supplied with your connector project. For a pre-built connector, use its guide for the implemented records and configuration.
The document is intended for three audiences:
- ERP customers and IT teams – who need to understand what data must be provided.
- MachineMetrics internal staff – who configure and validate integrations.
- Automation agents (e.g., MCP or Cursor) – which use this document as structured guidance to generate queries, mappings, or API calls when building a connector.
How to Use This Document
This reference covers Parts, Part Operations, Work Orders, Work Order Operations, Resources, Persons, Reasons, Labor Tickets, and Timesheets. It also explains the relationships and metadata that connect those records.
Three Different Contracts
| Layer | What it describes | How to use it |
|---|---|---|
| ERP schema and ERP Data Studio | Stored records, references, relationships, and fields exposed for inspection. | Understand which record you are viewing and how it relates to other records. |
| Connector and SDK payload | The values a particular import/export path accepts and how it serializes them. | Follow the SDK version installed in your connector and the selected API's payload contract. |
| Customer setup | ERP accounts, permissions, resource mappings, operator links, and workflow choices. | Follow Setup and Verification and your connector guide. |
A field visible in ERP Data Studio is not automatically a field to send in an ERP import. Some values are assigned by MachineMetrics or supplied by the authenticated company context. An SDK REST payload can serialize a numeric value as a string even when the stored field is numeric.
The API Name column identifies the field. Check the selected API's naming and types before constructing requests. Do not use a read/query response as an import payload without checking that contract.
Required vs Optional Fields
The Required/Optional annotations describe integration guidance. They do not describe database nullability, every SDK constructor, or every connector's validation rules. For example, an open work order can have a null closed date, and an ERP ticket ID may not exist until the ERP accepts the ticket.
Tables with a Mapping notes column describe stored fields without implying that every exposed field is a required connector input. Confirm required fields, defaults, and supported entities for your connector's installed SDK and endpoint. SDK-version labels describe the payload contract; confirm feature availability for the installed connector.
Data Synchronization Overview
ERP Connectors must support both:
- Historical load – imports work orders, operations, and other records up to a defined date to initialize MM.
- Incremental syncs – ongoing updates that only pull new or modified records using the
updatedAtfield (or ERP equivalent).
Different tables (e.g., Work Orders, Labor Tickets) may use different sync strategies, but all must include a reliable change-tracking field to avoid unnecessary data transfer.
For details on the required order in which to load this data, see the Load Sequence section at the end of the mapping specifications.
Parts
A Part identifies a manufactured item and its revision and method. Within a company, the identity is the combination of partNumber, partRevision, and method. Part number alone is not sufficient when revisions or methods differ.
| Field | API name | Logical type | Mapping notes |
|---|---|---|---|
| Part number | partNumber | string | ERP part identifier. |
| Part revision | partRevision | string | Revision component of the part identity. Preserve the connector's normalization for an unused revision. |
| Method | method | string | Method/routing component of the part identity. Use the value expected by the connector; do not substitute a different method label during updates. |
| Created / updated | createdAt, updatedAt | datetime | Stored record timestamps; see Identifiers and Sync Metadata. |
| Custom fields | customFields, customFieldsSchemaRef | object / reference | Optional extension data; see Custom Fields. |
ERP Data Studio's Parts view uses this composite identity and shows related part operations and work orders. The part's display name is exposed as partName on Part Operations; it is not a separate name field in the Part payload described here.
Part Operations
A Part Operation describes a step in the part's routing. A Work Order Operation describes that step for a particular production order. Several work orders can therefore reference the same part operation.
The routing-step identity is the part identity plus sequenceNumber, within a company. partOperationRef is a separate MachineMetrics reference to the stored row.
| Field | API name | Logical type | Mapping notes |
|---|---|---|---|
| Part identity | partNumber, partRevision, method | strings | Identifies the parent Part. Keep all components consistent with that record. |
| Operation sequence | sequenceNumber | number | Identifies the step within the routing. Some SDK send models use a string representation. |
| Resource | resourceId | string | ERP resource assigned to the routing step. |
| Part display name | partName | string | Human-readable part name exposed on the part operation. |
| Description | description | string | Description of the routing step. |
| Cycle time | cycleTimeMs | number | Expected cycle time, in milliseconds. |
| Setup time | setupTimeMs | number | Expected setup time, in milliseconds. |
| Quantity per part | quantityPerPart | number | Parts produced per cycle. |
| Stored reference | partOperationRef | reference | MachineMetrics row identifier used for lookup in ERP Data Studio. Do not substitute an ERP operation number. |
| Created / updated | createdAt, updatedAt | datetime | Stored record timestamps. |
| Custom fields | customFields, customFieldsSchemaRef | object / reference | Extension data for this routing step. |
In flattened SDK imports, operationDescription supplies the Part Operation's description, and partOperationCustomFields supplies its custom fields. The similarly named opCustomFields belongs to the Work Order Operation instead. Check the flattened-row contract before assigning data that varies by order to a shared routing step.
Work Orders
Work order data is the foundation of the ERP Connector. These fields define the unique identifier for each work order, its scheduling information, quantities, and part details. MachineMetrics uses this data to display accurate work order progress, calculate OEE, and tie machine activity back to ERP-defined jobs.
- When possible, extract work orders and work order operations together. This ensures every operation is consistently linked with its parent work order and avoids "orphaned" operations.
- If your ERP has multiple scheduling or due date fields, choose the one that best represents the actual production schedule on the shop floor.
- In some ERPs, the customer name is not stored directly on the work order. In this case, it may need to be retrieved by joining the work order → sales order → customer master chain.
| Field Name | Description | Required/Optional | API Name | Data Type | SDK |
|---|---|---|---|---|---|
| Work Order ID | ERP order identifier; see the full order key in Identifiers and Sync Metadata. | ✅ Required | workOrderId | string | 1.0 |
| Lot | Refers to a material batch. If not used, default to an empty string. | ✅ Required | lot | string | 1.0 |
| Split | Batch number if order split for staggered delivery. If not used, default to an empty string. | ✅ Required | split | string | 1.0 |
| Sub | Refers to a child work order linked to a main work order, often used for sub-assemblies. If not used, default to an empty string. | ✅ Required | sub | string | 1.0 |
| Description | Description of the work to be done. | ⚪ Optional | description | string | 1.0 |
| Scheduled Start Date/Time | Planned start date/time. | ✅ Required | scheduledStartDate | datetime | 1.0 |
| Scheduled End Date/Time | Planned end date/time. | ✅ Required | scheduledEndDate | datetime | 1.0 |
| Due Date | Date work order must be completed. | ✅ Required | dueDate | date | 1.0 |
| Closed Date | Actual date the work order was closed. May be null or blank until the work order is closed; an open or active work order will not have one. The connector must be able to pull this value once it is populated. | ✅ Required | closedDate | date | 1.0 |
| Quantity Required | Planned production quantity. | ✅ Required | quantityRequired | number | 1.0 |
| Status | Current state of the work order. Map ERP values deliberately; see Enumerations for the SDK vocabulary and endpoint-specific behavior. | ✅ Required | status | string | 1.0 |
| Method / Job Type | Type of work. | ⚪ Optional | method | string | 1.0 |
| Part Number | Part identifier. | ✅ Required | partNumber | string | 1.0 |
| Part Revision | Part revision/version. | ⚪ Optional | partRevision | string | 1.0 |
| Part Description | Text description of part. | ⚪ Optional | partDescription | string | 1.0 |
| Part Family/Product Line | ERP grouping/category. | ⚪ Optional | partFamily | string | Upcoming |
| Customer Name | ERP customer name. | ⚪ Optional | customerName | string | Upcoming |
| Priority | ERP scheduling/priority indicator. | ⚪ Optional | priority | integer | Upcoming |
| Updated At | Timestamp of last update, used for syncing data. | ✅ Required | updatedAt | datetime | 1.0 |
Work Order Operations
Operations (or sequences) are the steps required to complete a work order. Operation data enables MachineMetrics to show where in the process a job is, track sequence-specific performance, and capture cycle/setup times for OEE.
- When extracting work orders and work order operations together, repeated fields linking work order operations to the work order (work order ID, lot, split, sub) are not required.
- Each operation must have a valid Resource ID (workcenter/machine) that exists in the ERP's resource list. This ensures MachineMetrics can tie production activity and labor tickets back to the correct machine or workcenter.
| Field Name | Description | Required/Optional | API Name | Data Type | SDK |
|---|---|---|---|---|---|
| Work Order ID | ERP order identifier; see the full order key in Identifiers and Sync Metadata. | ✅ Required | workOrderId | string | 1.0 |
| Lot | Refers to a material batch. If not used, default to an empty string. | ✅ Required | lot | string | 1.0 |
| Split | Batch number if order split for staggered delivery. If not used, default to an empty string. | ✅ Required | split | string | 1.0 |
| Sub | Refers to a child work order linked to a main work order, often used for sub-assemblies. If not used, default to an empty string. | ✅ Required | sub | string | 1.0 |
| Sequence Number | Operation/sequence identifier. | ✅ Required | sequenceNumber | number | 1.0 |
| Resource ID | Workcenter or machine identifier. | ✅ Required | resourceId | string | 1.0 |
| Start Quantity | The number of parts that have been completed on the WOO. | ⚪ Optional | startQuantity | number | 1.0 |
| Finish Quantity | The number of parts required to be made. | ✅ Required | finishQuantity | number | 1.0 |
| Expected Reject Rate | The % of parts expected to be bad when the job (operation) is done. | ⚪ Optional | expectedRejectRate | number | 1.0 |
| Scheduled Start Date/Time | Planned start for operation. | ✅ Required | scheduledStartDate | datetime | 1.0 |
| Scheduled End Date/Time | Planned end for operation. | ✅ Required | scheduledFinishDate | datetime | 1.0 |
| Closed Date | Actual date the operation completed. | ⚪ Optional | closedDate | date | 1.0 |
| Cycle Time (ms) | Expected cycle time per part in milliseconds. | ⚪ Optional | cycleTimeMs | integer | 1.0 |
| Setup Time (ms) | Expected setup time in milliseconds. | ⚪ Optional | setupTimeMs | integer | 1.0 |
| Production Hourly Burden Rate | Hourly cost of running the operation in production. | ⚪ Optional | productionBurdenRateHourly | number | 1.0 |
| Setup Hourly Burden Rate | Hourly cost to setup the operation. | ⚪ Optional | setupBurdenRateHourly | number | 1.0 |
| Operation Type | Describes the type of work the operation represents. | ⚪ Optional | operationType | string | 1.0 |
| Quantity per Part | Parts produced per cycle. | ⚪ Optional | quantityPerPart | number | 1.0 |
| Status | Operation status. Map ERP values deliberately; see Enumerations for the SDK vocabulary and endpoint-specific behavior. | ✅ Required | status | string | 1.0 |
| Updated At | Timestamp of last update, used for syncing data. | ✅ Required | updatedAt | datetime | 1.0 |
Labor Tickets
Labor tickets track operator activity such as clock-in/clock-out, production reporting, and scrap. They tie operator activity back to specific work orders, operations, resources, and people so MachineMetrics can attribute labor and production accurately.
At minimum, ensure that operator IDs and timestamps are accurate, as these fields drive labor tracking and traceability.
| Field Name | Description | Required/Optional | API Name | Data Type | SDK |
|---|---|---|---|---|---|
| Work Order ID | Associated work order. | ✅ Required | workOrderId | string | 1.0 |
| Lot | Refers to a material batch. If not used, default to an empty string. | ✅ Required | lot | string | 1.0 |
| Split | Batch number if order split for staggered delivery. If not used, default to an empty string. | ✅ Required | split | string | 1.0 |
| Sub | Refers to a child work order linked to a main work order, often used for sub-assemblies. If not used, default to an empty string. | ✅ Required | sub | string | 1.0 |
| Operation Sequence Number | Associated operation/sequence. | ✅ Required | sequenceNumber | number | 1.0 |
| Resource ID | Resource where labor occurred. | ✅ Required | resourceId | string | 1.0 |
| Person ID | Operator performing work. | ✅ Required | personId | string | 1.0 |
| Labor Ticket ID | Identifier assigned by the ERP. It may be absent before a new outbound ticket has been accepted by the ERP. See Identifiers and Sync Metadata. | Connector-specific | laborTicketId | string | 1.0 |
| Transaction Date | Start date of the labor. | ✅ Required | transactionDate | datetime | 1.0 |
| Clock-In Timestamp | Start time for labor. | ✅ Required | clockIn | datetime | 1.0 |
| Clock-Out Timestamp | End time for labor. | ⚪ Optional at clock-in / ✅ Required at clock-out | clockOut | datetime | 1.0 |
| Good Parts Produced | Number of good parts reported. | ⚪ Optional | goodParts | number | 1.0 |
| Bad Parts Produced | Number of scrapped/rejected parts. | ⚪ Optional | badParts | number | 1.0 |
| Type | Type of labor. Must be mapped to one of the following enumerations: SETUP, PRODUCTION, INDIRECT (map ERP → MM enumerations). | ✅ Required | type | string | 1.0 |
| State | Ticket state, such as OPEN or CLOSED. Other values depend on the connector and workflow; see Enumerations. | ✅ Required | state | string | 1.0 |
| Comment | Additional context about the work related to this ticket. | ⚪ Optional | comment | string | 1.0 |
| Updated At | Timestamp of last update, used for syncing data. | ✅ Required | updatedAt | datetime | 1.0 |
Timesheets
Timesheets record person-level clock-in/out sessions separately from job labor tickets. ERP Data Studio exposes a MachineMetrics Timesheet reference, Person ID, clock-in and clock-out timestamps, source system, external transaction ID, terminal ID, and created/updated timestamps. An open session has no clock-out timestamp.
Timesheet support and synchronization direction must be confirmed for each connector. The labor-ticket mapping above does not define a Timesheet mapping contract. See Timesheets for the user-facing fields and verified connector behavior.
Resources (Workcenters / Machines)
Resource data defines the machines, workcenters, or labor pools where work is performed. This ensures that MachineMetrics can tie machine signals to the correct ERP-defined resource.
Make sure your ERP's resource IDs match the naming convention used on your shop floor to avoid mapping confusion.
| Field Name | Description | Required/Optional | API Name | Data Type | SDK |
|---|---|---|---|---|---|
| Resource ID | Workcenter or machine identifier. | ✅ Required | resourceId | string | 1.0 |
| Name | A colloquial name for the resource, sometimes also just the resource ID. | ⚪ Optional | name | string | 1.0 |
| Resource Group | Whether the resource is an individual machine or a group of machines. | ⚪ Optional | isResourceGroup | boolean | 1.0 |
| Resource Description | Description of resource. | ⚪ Optional | description | string | 1.0 |
| Type | Type of machine, such as Lathe or Mill. | ⚪ Optional | type | string | 1.0 |
| Production Hourly Burden Rate | Hourly cost of running this operation in production. | ⚪ Optional | productionBurdenRateHourly | number | 1.0 |
| Setup Hourly Burden Rate | Hourly cost to setup this operation. | ⚪ Optional | setupBurdenRateHourly | number | 1.0 |
| Updated At | Timestamp of last update, used for syncs. | ✅ Required | updatedAt | datetime | 1.0 |
Resource-Group Membership
isResourceGroup marks a resource as a group. It does not identify the group's members. The schema represents membership separately in erp.resource_group_membership.
| Schema field | Meaning |
|---|---|
memberOfResourceId | Resource ID of the group. |
hasMemberResourceId | Resource ID of the member resource. |
memberOfCompanyId | Company context for the group. |
hasMemberCompanyId | Company context for the member. |
createdAt, updatedAt | Timestamps on the membership record. |
For example, if a group contains two machine resources, the relationship is represented by a membership row for each member. The group and member IDs refer to Resource records. These schema fields describe the relationship; they are not a universal SDK import payload.
Resource-group membership is also distinct from mapping a MachineMetrics machine for labor or scheduling. Configure Record labor as and Schedule jobs as in MES Settings. A MachineMetrics machine group and an ERP resource group should not be treated as the same record merely because their names match.
Persons (Operators / Employees)
Person data defines who is performing the work. Linking operators ensures labor tickets and performance metrics are attributed to the correct individual or team.
If your ERP uses employee numbers or short codes, share these consistently so they can be tied to MachineMetrics operator logins.
| Field Name | Description | Required/Optional | API Name | Data Type | SDK |
|---|---|---|---|---|---|
| Person ID | Unique ERP operator/employee identifier. | ✅ Required | personId | string | 1.0 |
| First Name | Employee/operator first name. | ⚪ Optional | firstName | string | 1.0 |
| Last Name | Employee/operator last name. | ⚪ Optional | lastName | string | 1.0 |
| Active Flag | Whether employee is active/terminated. | ⚪ Optional | isActive | boolean | 1.0 |
| Updated At | Timestamp of last update, used for sync. | ✅ Required | updatedAt | datetime | 1.0 |
Reasons (Scrap Codes)
Reasons capture the standardized codes for scrap or reject reporting. When labor tickets report bad parts, MachineMetrics requires a valid reason code to categorize and sync this information with ERP.
Ensure ERP scrap/reject codes align with MM expectations to avoid mismatches during labor ticket submission.
| Field Name | Description | Required/Optional | API Name | Data Type | SDK |
|---|---|---|---|---|---|
| Reason ID | Unique identifier for the reason code. | ✅ Required | reasonId | string | 1.0 |
| Entity Type | Indicates the context the reason applies to, such as machine downtime or rejected parts (quality). | ⚪ Optional | entityType | string | 1.0 |
| Category | Category of reason (scrap, downtime, etc.). | ⚪ Optional | category | string | 1.0 |
| Code | Short ERP scrap/reject code. | ⚪ Optional | code | string | 1.0 |
| Description | Full description of scrap/reject reason. | ⚪ Optional | description | string | 1.0 |
| Updated At | Timestamp of last update, used for syncing reasons. | ✅ Required | updatedAt | datetime | 1.0 |
Reason Mappings and Labor-Ticket Reasons
An ERP reason has both an ERP-facing identifier (reasonId) and a MachineMetrics reference (reasonRef). The schema also exposes links to MachineMetrics reason records:
| Field | Meaning |
|---|---|
reasonRef | MachineMetrics reference for the ERP reason row. |
rejectReasonRef | Reference to the mapped MachineMetrics reject reason, when present. |
annotationTypeRef | Reference to the mapped MachineMetrics annotation/downtime category, when present. |
The Reasons view in ERP Data Studio exposes those mappings. For the effect of missing reject mappings in ERP Driven mode, see Rejected Parts and Reject Reasons.
A reason's existence in the lookup table does not by itself associate it with a labor ticket. The relationship erp.rel_labor_ticket_reason links laborTicketRef to reasonRef; labor exports can expose the resulting reasons relationship.
The current SDK's MMSendLaborTicket also supports a reasonId for the import path that writes this association. Its REST serializer omits an unset reason rather than sending a null. Do not assume that an omitted reason and an explicit null have the same update behavior, or that every connector uses this path.
Identifiers and Sync Metadata
Keep ERP business IDs separate from MachineMetrics references. Do not replace one with the other because both look numeric.
| Record | Business identity within the company | MachineMetrics reference, where exposed |
|---|---|---|
| Part | partNumber + partRevision + method | Composite identity; no separate Part reference in the described Part query. |
| Part Operation | Part identity + sequenceNumber | partOperationRef |
| Work Order | workOrderId + lot + split + sub | Full composite order identity. |
| Work Order Operation | Full order identity + sequenceNumber | workOrderOperationRef |
| Resource | resourceId | Resource ID in its company context. |
| Person | personId | Person ID in its company context. |
| Reason | reasonId | reasonRef |
| Labor Ticket | laborTicketId assigned by the ERP | laborTicketRef |
| Timesheet | Person/session record; external transaction ID may be present | timesheetRef |
Company context is part of record identity and authorization. Depending on the API, it can be supplied by the authenticated session rather than by a writable companyId field. Preserve empty lot, split, sub, revision, and method components according to the connector's normalization rules.
| Metadata | Meaning and limits |
|---|---|
createdAt | When the stored record was created. This is not automatically the ERP transaction date. |
updatedAt | When the record was updated. Import cursors and ERP change-tracking fields have their own contracts. |
syncedAt | Sync metadata exposed on labor-ticket and SDK Timesheet records. Interpret it with the connector's sync path; it is not proof that the ERP has posted a transaction. |
machineRef, machineGroupId | MachineMetrics references exposed on some resource or labor records. They are distinct from an ERP resourceId; availability depends on the entity and API. |
The Person-to-operator link is configured through ERP Data Studio → Persons. Resource and reason mappings link different records and should be checked separately.
Custom Fields
Supported ERP entities can carry schema-bound extension data in addition to their standard fields.
| Field | Type | Meaning |
|---|---|---|
customFields | object or null | Custom values attached to this record. |
customFieldsSchemaRef | reference or null | Reference to the custom-fields schema associated with those values. |
ERP Data Studio displays these values in a read-only Custom fields section on entity detail pages. Where configured, the labor-ticket edit form also offers editable custom fields based on their schema. This does not make every entity's custom JSON or schema editable; use the fields offered by the record's form.
The SDK's full-payload helpers distinguish omission from an explicit null: undefined fields are omitted, while null values can be included. Its REST serializers and entity-specific paths can handle custom data differently. Use the helper and endpoint contract for the installed SDK rather than replacing omitted data with an empty object or null.
For flattened work order imports, the current SDK separates values for the four entities created from a row:
| Entity | Values property | Schema-reference property |
|---|---|---|
| Part | partCustomFields | partCustomFieldsSchemaRef |
| Part Operation | partOperationCustomFields | partOperationCustomFieldsSchemaRef |
| Work Order | workOrderCustomFields | workOrderCustomFieldsSchemaRef |
| Work Order Operation | opCustomFields | opCustomFieldsSchemaRef |
Keep shared Part and Part Operation data consistent across rows that refer to the same identity. Put order-specific values on the order or order operation.
Load Sequence
Load referenced records before the records that depend on them. The exact import calls and batching depend on the connector and API.
- Resources, Reasons, and Persons: Establish lookup records first. If importing resource-group membership, create both the group and its member Resources before their relationship.
- Parts and Part Operations: Create the Part before its routing steps. Keep the full part identity consistent across rows.
- Work Orders and Work Order Operations: Create the parent order and the referenced routing data before its operations. Flattened SDK imports can build these related entities from the same rows.
- Transactions and relationships: Load labor tickets after their referenced people, resources, orders, and operations. Associate reasons only after the ticket and reason exist. A Timesheet references a Person and does not require a job operation.
Use the SDK's entity-specific or flattened import methods for the installed version. Do not assume that one call imports every relationship or that labor-ticket support also imports Timesheets.
Enumerations
The current SDK documents the following known values. Work order and operation statuses are string fields; the SDK's status types also accept strings outside these lists. A connector must map ERP states to the intended MachineMetrics workflow rather than assuming an unrecognized value behaves like a known one.
| Record | Known values in the SDK |
|---|---|
| Work Order | RELEASED, NOT RELEASED, COMPLETED, PENDING, CANCELLED, ACTIVE, DELETED |
| Work Order Operation | RELEASED, NOT RELEASED, ACTIVE, COMPLETED, CANCELLED, DELETED |
| Labor Ticket type | The send/receive models use strings; documented workflows use SETUP, PRODUCTION, and INDIRECT. |
| Labor Ticket state | The receive model describes OPEN, CLOSED, and CANCELLED; the field is a string, not a universal two-value enum. |
The SDK's comparison helper normalizes case and spacing and treats CANCELED as CANCELLED. Use the intended canonical value when mapping an ERP state. An ERP's closed order/operation state should map to COMPLETED, not an invented order status of CLOSED. This distinction does not change the CLOSED labor-ticket state.
Implementation Notes
Use the tables above for field requirements rather than maintaining a second list of the same rules.
- Keep datetime values in ISO 8601 format, with an explicit UTC or local offset. Date values can use
YYYY-MM-DD. - Every operation must reference its parent work order, with a sequence number that identifies the operation within that order.
- Resources and people referenced by labor tickets must exist before those tickets are loaded.
- A SETUP or PRODUCTION ticket references a work order, operation, resource, and person.
- Keep employee active flags current to avoid assigning labor to inactive people.
- Match scrap reason identifiers and codes to the ERP's reason records when reporting bad parts.
Follow Load Sequence when implementing the import. Confirm any ERP-specific extraction format with your implementation team; the record relationships must be preserved regardless of transport.