7 min read · Websites and web apps

A quotation request form on the website sends data to the sales team, and then a staff member has to key it into the CRM (customer relationship management system) a second time. This wastes time and often causes typos. So the company wants the website to push the data into the system by itself through an API (a way for one program to send commands or data directly to another program). But without a plan, new problems follow, such as duplicated or missing data.
Make an inventory: which system, who owns it, how far access goes
Before thinking about code, first list every system involved. Often there is a system nobody knows who maintains, or the admin account belongs to an employee who has already left.
- System name and provider: website, ERP, accounting system, CRM, LINE OA, the spreadsheets actually in use
- System owner: who approves the connection and who can contact the provider
- Does it offer an API: some systems have an API, some only export files, some require an extra package
- Permissions that can be granted: read-only or read-write, and only the data that is needed
- Where the key (API key) is stored: not written in code that other people can open and view
Define the reference ID and the data sent for each event
For each event, such as a customer submitting a form or an invoice being issued, you need to specify what data goes where, and which ID shows that it is the same record in every system. Without a shared ID, the systems can only match records by name or email, which is easy to get wrong.
- Event: a customer submits a quotation request form
- Data sent: request ID, name, company, contact channel, the problem to solve, link to attached files
- Destination: the CRM creates a lead record
- Reference ID: the request ID from the website, stored in both systems so the record can be traced back
- Expected result: one new record is created, not two
Handle resends, timeouts and incomplete data
In the real world, networks can be slow or drop. So a system often resends a request when it gets no reply. The problem is that sometimes the first request has already reached the destination but the reply did not come back in time, so the second request creates duplicate data.
MDN explains that the POST method is not idempotent (repeating it does not give the same result as doing it once), meaning that sending it twice may create two records. GET, PUT and DELETE are defined to be safe to repeat, but MDN also warns that this depends on whether the server was actually written to follow that definition.
One approach some providers use is an idempotency key (a random ID that the sender creates for each command; if the command is sent again with the same ID, the destination recognizes it and does not repeat the action). For example, the Stripe API documentation says it applies to POST so that retrying is safe. It recommends a unique random ID and advises against using personal data as the ID.
- Resend: check the reference ID before creating a new record; if it already exists, update it or skip it
- Timeout: set a suitable wait time, retry at increasing intervals, and set an end point so it does not retry forever
- Incomplete data: define which fields are required; if one is missing, keep the record in a queue for review and do not drop it silently
- Rate limited: if the destination replies 429, wait for the time it states and then try again
Hypothetical example: a customer submits a quotation request form. The website creates request ID REQ-1042 and sends it to the CRM, but the network is slow. The website gets no reply, so it resends once more with the same ID. The CRM finds that REQ-1042 already exists and does not create a new record. The result is one record. Without a reference ID, two records would be created, and the sales team might call the customer twice. The ID and all events here are made up to illustrate the explanation.
Design logs, alerts and an owner
Connected systems will certainly break one day. What matters is knowing early and knowing who has to fix it. Keep a log (a record of system events) for each request, such as time, reference ID, result and error message, but do not store more personal data than necessary.
- Send an alert when sending fails beyond the set limit, to a person who can be named, not a shared inbox that nobody opens
- Provide a page or report that shows pending items, so they can be resent by hand
- Specify how the business keeps working when the destination API is down, for example by holding items in a queue and sending them when it is back
- Write a short document on what is connected to what, which key is used, and when it expires
Watch for limits on the destination API
OWASP notes that many services charge per use, and recommends setting spending limits or usage alerts, because unusually frequent calls can cost money without anyone noticing. For any API we use, always check the provider's documentation for quotas, calls per minute, terms of use and future changes.
Checklist before starting
- List the systems, their owners and their admin accounts
- Check whether each system has an API or needs another method, such as exporting files
- Pick just one first event to connect; do not start with everything at once
- Define a reference ID that matches in every system
- Decide how a resend will not create duplicate data
- Define the required fields, and a place to keep records with incomplete data
- Set up logs, alerts and an owner
- Read the terms, quotas and limits of the destination API
When it fits and when it does not
- Advantage: less repeated keying, and problems can be located point by point, because you can see which step the data stopped at
- Limitation: an API may have quotas, costs and terms that can change, so check the provider's documentation periodically
- Limitation: connecting systems does not fix data that is already wrong in the source system; the data needs to be cleaned up alongside
- Not a fit: if only a few records a week are sent, exporting a file and importing it by hand may be simpler
Talk to BT San about system integration
If you are interested in connecting your website with an ERP or a legacy system, send us the list of systems you use, the data you want exchanged, and the event that wastes the most time, and talk to BT San. We will start by choosing a first event that shows clear results at low risk.




