Integrating Smart Card Readers with ERP Software
← Back to the smart card SDK and developer centre
How do you integrate a smart card reader with ERP software? The reader never talks to the ERP directly. A piece of software on the PC reads the card (usually just its UID), looks up which employee, customer, asset or account that card belongs to, and turns the tap into an ERP transaction. There are four common ways to build that link: keyboard wedge (the reader types the card number into an ERP screen), a PC/SC bridge program that posts to the ERP's API or import, a middleware service shared by many readers, or database staging tables that the ERP reads on its own schedule. Which one fits depends on what your ERP accepts, not on the reader.
This guide is for developers and integrators who must connect ACS readers, such as the ACR1552U or ACR1252U, to an ERP or business system. It explains the four patterns, the data flow from tap to transaction, the card-to-record mapping, generic examples for REST APIs, file imports and ODBC, and the security limits of a UID. It contains no new code: it shows which of our existing C#, Java and Python samples to extend. If your question is how to connect a reader to a Windows application you already use, start with connecting an ACS reader to a Windows application. BSD Infotech is an independent ACS supplier and integrator, not the manufacturer.
Four Ways to Connect a Card Reader to an ERP
Every integration below starts the same way: a card is tapped on a reader attached to a PC (or a small terminal), and ends the same way: a record exists in the ERP. What differs is where the card number is turned into a business transaction, and who is responsible when something goes wrong in between.
| Pattern | How the data reaches the ERP | Needs on the ERP side | Good for | Main limit |
|---|---|---|---|---|
| 1. Keyboard wedge | The reader types the UID into the field that has the cursor, often followed by Enter | A screen with a card or code field that accepts typed input | Quick look-ups: issue stock to a person, open a customer record, find an asset | UID only; typed and tapped input look the same; works only with readers that have keyboard mode |
| 2. PC/SC bridge program | A small program on the PC reads the card through PC/SC and calls the ERP's API, or writes an import file | An API, a web service or a documented import | One or a few counters; card data beyond the UID; feedback at the reader | A program to install, update and support on every PC |
| 3. Middleware service | Readers (through thin clients) send events to a central service that validates, maps and posts them to the ERP | An API or import, used by one service account | Many readers or sites; several target systems; central logging and retries | More to build and host; a second system to monitor |
| 4. Database staging tables | The bridge or middleware inserts rows into a staging table; an ERP job or import routine picks them up | A staging table or interface table the ERP vendor supports, and a scheduled import | ERPs without a usable API; batch posting (end of shift, end of day) | Not real time; the ERP job must mark rows as processed |
Pattern 1: keyboard wedge into ERP fields
In keyboard emulation mode an ACS reader presents itself to Windows as a USB keyboard and types the card's UID. If the ERP already has a screen where a user types or scans a code, such as a barcode field on a stores-issue screen, a tap can fill it with no software on the PC. ACS lists keyboard mode for the ACR1552U and ACR1581U (through its ACR15XX Keyboard Configuration Tool, checked on the ACS utility tools page on 1 Dec 2026); the ACR1252U and ACR122U do not have it. Setup, the number formats and the switch back to PC/SC mode are on our keyboard emulation guide.
For developers, the wedge has three consequences. The ERP field must accept the exact format the reader types (hex or decimal, byte order, length), so set the reader's format to match the values stored in the ERP, not the other way round. The ERP cannot tell a tap from someone typing the same digits, so this pattern is only as trustworthy as a typed code. And a web-based ERP running in a browser can use the wedge where it cannot reach PC/SC directly, which is often why the wedge is chosen.
Pattern 2: a PC/SC bridge program
A bridge is a small program, usually a tray application or a Windows service, that waits for a card through PC/SC (the Windows smart card interface, winscard.dll), reads it and sends the result on. Because it talks to the reader itself, it knows which reader was used, can read data stored on the card with the right keys, can beep or change the LED for "accepted" and "refused" (see LED and buzzer control), and works with every ACS PC/SC reader, including those without keyboard mode. It then either calls the ERP's API directly or writes a file into the folder the ERP imports from.
A bridge is the usual choice for one or a few counters: a stores window, a canteen counter, a tool crib, a dispatch desk. The .NET NFC reader application on this site is already most of a bridge: it detects the reader, reads one UID per tap and keeps a log. What it lacks is the look-up and the post to the ERP, covered under code to start from.
Pattern 3: a middleware service
When there are many readers, several sites or more than one target system (for example an ERP for stock and a separate HR system), put the business logic in one central service. Each reader PC runs a thin client that only reads cards and sends events (reader ID, UID, time) to the service over HTTPS. The service owns the card-to-record mapping, the rules ("this card may draw from this store"), the ERP credentials, the retries and the audit log. Changing a rule then means changing one service, not visiting every counter. The cost is a server to host and monitor, and a design for what the counters do while the service is unreachable.
Pattern 4: database staging tables
Many ERPs, especially older or heavily customised ones, have no API but do have an import routine that reads from an interface table, a staging database or a file drop. The bridge or middleware inserts one row per event into that table with a status of "new"; the ERP's scheduled job validates the rows, posts them and marks each one "posted" or "error". Never write directly into the ERP's own transaction tables unless the vendor documents that as supported: you would bypass its validation, numbering and audit trail. Agree the table layout, the status values and who clears errors with the ERP's administrator before writing any code.
The Data Flow: From Card UID to ERP Transaction
Whatever the pattern, the same steps happen in the same order. Designing them explicitly is what separates a reliable integration from one that loses or duplicates transactions.
Tap card on reader -> 1. Read UID (or authenticated card data) + reader name + time -> 2. Normalise one agreed format, e.g. 8 hex digits, upper case, card byte order -> 3. Look up card number -> ERP key (employee code, customer ID, asset tag) -> 4. Validate card active? person allowed here? quantity/limit OK? -> 5. Build ERP transaction: type, ERP key, items/amount, location, event ID -> 6. Post API call, import file or staging-table row -> 7. Confirm ERP document number or error -> LED/beep/screen message -> 8. Log local record with event ID and result (for retries and audits)
- Read. One read per tap. A PC/SC program should read a card once when it arrives and ignore it until it is removed, as our C# UID guide does. Record which reader produced the read: at a site with several counters it tells you where the transaction happened.
- Normalise. The same card can appear as hex or decimal, in either byte order, with or without leading zeros. Choose one canonical format for the whole system and convert at the edge. Why the numbers differ is explained in hex, decimal and byte order.
- Look up. Translate the card number into the key the ERP understands. The ERP rarely knows card numbers; it knows employee codes, customer IDs or asset tags. See where the mapping should live.
- Validate. Check the card is active (not reported lost, not replaced) and that the action is allowed, before anything reaches the ERP. Rejecting at the counter gives the user an immediate answer.
- Build. Create the transaction with a unique event ID generated at the counter, for example a GUID. If the post is retried after a time-out, the ERP or middleware can use that ID to recognise the duplicate instead of booking it twice.
- Post. Send it through whatever the ERP supports (next section). Use a time-out and treat "no answer" as "unknown", not as "failed".
- Confirm. Show the ERP's document number or its error message, and give a distinct beep or LED colour for success and refusal so the operator does not have to watch the screen.
- Log. Write every event and its result locally before and after posting. That log is what lets you resend after a network failure and answer "was this card really used at 10:42?".
Where the Card-to-Record Mapping Should Live
The look-up table (card number to ERP key) is the heart of the integration. There are two sensible places for it.
| Option | How it works | Choose it when |
|---|---|---|
| In the ERP | A card-number field (often a custom field) on the employee, customer or asset master. The bridge sends the card number and the ERP finds the record. | The ERP can search by that field through its API or import, and the ERP team will maintain it. |
| In the bridge or middleware | Its own table: card number, ERP key, status (active, lost, replaced), valid from/to, issued by, issued on. The ERP only ever receives its own keys. | The ERP cannot store or search card numbers, several systems need the same mapping, or cards are replaced often. |
Either way, plan the card life cycle from the start: enrolment (tap a new card at an admin PC and link it to a record, never by typing the number), replacement (the old card is blocked, not deleted, so old transactions still resolve), leavers (block on the last working day) and shared or visitor cards (map to a pool record, not to a person). Keep the history: a transaction booked in March must still resolve to the right person after the card is reissued in June.
Examples by ERP Interface: REST API, CSV Import, ODBC
ERPs differ widely, so these examples are generic: they describe the interface type, not a particular product. Check your ERP's own documentation for the exact endpoints, file layouts and tables, and ask its administrator for a test company or sandbox before posting anything.
REST or web-service API
The cleanest route when the ERP offers it. The bridge or middleware sends an HTTPS request, typically JSON, to an endpoint such as "create stock issue" or "create time entry", authenticated with a token or a dedicated API user. A typical payload carries the event ID, the ERP key found by the look-up (not the raw UID), the transaction details, the location or reader ID and the time with its time zone. Handle the documented error responses one by one (unknown employee, closed period, insufficient stock) and show them at the counter in plain language.
File import (CSV, XML or Excel)
Many ERPs import transactions from files dropped into a folder or uploaded on a schedule. The bridge appends one line per event to a file and closes it at a fixed interval; the ERP imports the closed files. Follow the ERP's template exactly: column order, date format, decimal separator and encoding. For CSV, quote fields that contain commas, quotes or line breaks (the RFC 4180 convention), and write each file under a temporary name first, renaming it only when complete, so the ERP never imports half a file. Our .NET sample's CSV export already writes RFC 4180-style files.
ODBC or direct database access
Where the ERP's database is reachable over ODBC or a native driver, the integration can read masters (for example, the employee list to build the card mapping) and write events into the staging tables described in pattern 4. Use a database account that can read the masters and insert into the staging tables only, nothing more. Reading is low-risk; writing outside documented interface tables is not.
When the target is an accounting package
If the system that must receive the data is an accounting package rather than an ERP, the same patterns apply, but the posting side (vouchers, ledgers, item and tax mapping) is its own discipline. For Tally and TallyPrime, BSD offers this as a separate service: see BSD's Tally integration services. A card reader then simply becomes one more source of transactions, for example canteen or stores issues that end up as vouchers.
What this page does not claim. These are integration patterns, not a list of ERPs BSD has connected readers to. Whether a particular ERP exposes an API, an import or interface tables, and what its licence allows, must be checked with that ERP's vendor or administrator for each project.
Security: What a Card UID Can and Cannot Prove
A UID is an identifier, not a secret. Every reader can read it before any authentication, it is printed on some cards, it can be typed by hand into a keyboard-wedge field, and some programmable cards can be made to present another card's UID. Our MIFARE authentication and key management guide puts it plainly: use the UID as an account number, never as the only check.
That is fine for low-risk uses: finding a record, issuing a tool that is signed for anyway, logging who collected a delivery. It is not enough when the tap itself moves value or proves identity: a canteen or store debit against a balance, approval of a payment, release of high-value stock. For those, read authenticated data from the card: a value or ID stored in a MIFARE Classic sector protected by your own keys (see reading MIFARE Classic in C#), or better, a file in a DESFire application (see reading MIFARE DESFire cards). NXP itself points security-relevant applications to DESFire and MIFARE Plus rather than MIFARE Classic, as summarised in our MIFARE Classic security notes. Some DESFire and MIFARE Plus cards also use a random UID for privacy, which makes UID-only integration impossible with them.
Protecting the integration itself
- Card keys never belong in the bridge's code or config file. Keep them in a SAM in the reader or on a server, as explained under secure key storage.
- ERP credentials: use a dedicated API or database user with only the rights the integration needs (create these transaction types, read these masters). Do not reuse a person's login. On Windows, store the secret with the operating system's protected storage (for example DPAPI or Credential Manager) rather than in plain text.
- Transport: HTTPS to the API or middleware, and no open database port across the internet.
- Audit: log event ID, reader, card number, ERP key, result and ERP document number. Do not log card keys or passwords.
- Limits: put sensible limits in the validation step (maximum quantity, maximum amount per tap, allowed locations), so a copied card cannot do unlimited damage before it is blocked.
Code to Start From
This page adds no new code. The reader side of every pattern above is already covered by our samples; what you add is the look-up, the post and the log.
| You need | Start with | What to add for the ERP |
|---|---|---|
| The PC/SC basics in C# | PC/SC programming in C# (.NET 10): the WinScard.cs and Pcsc.cs files the other samples share | Nothing yet; this is the foundation |
| The right reader, and replug handling | Detecting an ACS reader in C# | A setting for the reader name on PCs with more than one reader |
| One UID per tap | Reading a card UID in C# | The normalisation to your canonical format |
| A working bridge skeleton | NFC reader application in .NET: reader thread, scan log, CSV export | Replace or extend the CSV export with the API call or staging-table insert; add the look-up and the event ID (its next steps list these) |
| Authenticated card data | MIFARE Classic in C#, DESFire | Your own keys, stored safely, and the field layout your cards use |
| Java or Python instead of C# | ACS readers with Java, Python card monitor | The same look-up, post and log |
| A Linux middleware client | ACS readers on Linux (pcsc-lite) | The same, with the service run by systemd or similar |
All of these samples are compiled by BSD but marked "not yet tested on hardware" on their pages; test them with your own reader and cards before building on them.
Reliability Checklist Before Go-Live
| Check | Why |
|---|---|
| Duplicate taps: ignore the same card on the same reader within a set time, unless the workflow needs repeats | A nervous user taps twice; without this rule the ERP gets two issues |
| Idempotent posting: one event ID per tap, reused on every retry | A time-out after the ERP has booked the transaction otherwise creates a duplicate on retry |
| Offline queue: events stored locally and sent when the ERP or network is back, in order | Network or ERP maintenance should not stop the counter, or lose taps |
| Reader unplugged, PC asleep, Smart Card service stopped | The bridge must recover by itself; our detection guide shows how |
| Clock and time zone: PCs synchronised; times stored with their offset or in UTC | ERP documents are dated by them; a wrong PC clock can book into a closed period |
| Remote Desktop: where the reader is plugged in if the ERP client runs over RDP | The session sees the client PC's reader; see readers over Remote Desktop |
| Test company: all testing against an ERP sandbox, with a sign-off from the accounts or stores team | Mistakes in a live ERP are expensive to reverse |
Troubleshooting a Reader-to-ERP Integration
| What you see | Likely cause | What to do |
|---|---|---|
| ERP says "card not found" for a card that was enrolled | Different number format at enrolment and at the counter (hex vs decimal, byte order, leading zeros) | Normalise in one place; compare both numbers for one card. See byte order and decimal. |
| Keyboard wedge types the number into the wrong window | The ERP field did not have the focus | Use a kiosk-style screen, or move to a PC/SC bridge. See keyboard mode problems. |
| Duplicate transactions in the ERP | Double taps, or retries without an event ID | Add the duplicate-tap rule and idempotent event IDs (checklist above). |
| Bridge stops reading after a replug or sleep | It keeps an old PC/SC context or reader handle | Rebuild the context on service errors, as in the detection guide. |
| Import file rejected or half-imported | Wrong column order, date format or encoding; ERP picked up a file still being written | Follow the ERP template exactly; write to a temporary name and rename when complete. |
| Card is read, but "not found" by the bridge | The card uses a random UID, or another program holds the card | Use cards with a fixed UID or read a stored ID; close other card programs. See card not read. |
| No reader found | Driver, Smart Card service or reader in keyboard-only mode | Run the PC/SC status check, then the "no reader found" steps. |
When BSD Infotech Can Help
BSD Infotech supplies ACS readers and cards and writes the software around them. For ERP and business-system projects that usually means one of these, each scoped and quoted after we have seen the target system and its interfaces:
Reader bridge programs
A program that reads the card through PC/SC and passes the UID or stored card data to your system as a file, a database record or an API call.
Database and API integration
Card events stored in a database or sent to your existing systems through their API, subject to what those systems support.
Accounting integration
Transactions from billing, POS, inventory or card-based applications posted to Tally or TallyPrime.
Reader and card choice
Keyboard mode or PC/SC, UID or secured card data, which ACS model for each counter.
Sources
The readers listed for ACS's keyboard configuration tool were checked on the official ACS utility tools page on 1 Dec 2026. Reader, key-management and code facts come from our linked guides, which cite the ACS, NXP and Microsoft pages they were checked against.
- ACS utility tools (ACR15XX Keyboard Configuration Tool: supported devices)
- RFC 4180: Common Format and MIME Type for CSV Files
- Microsoft: winscard.h (PC/SC API reference)
BSD Infotech is an independent ACS supplier and integrator, not the manufacturer. ACS, the ACS logo and ACS product names belong to Advanced Card Systems Ltd. MIFARE and DESFire are trademarks of NXP B.V. Tally and TallyPrime are trademarks of Tally Solutions Pvt. Ltd. Windows is a trademark of Microsoft Corporation.
