News

What Is an API? Definition, Example, Practice

· DigifyNow

Auf Deutsch lesen

An API is a fixed, agreed way for two programs to talk to each other. One system sends a request to a specific address, the endpoint, usually over HTTPS, with a method such as GET or POST and an access key. The other system answers with structured data, usually JSON, and a status code for success or failure. Before you commission an integration, check: Do both systems have a documented API? Which data do they expose? What rate limits apply?

What is an API? The definition

API stands for Application Programming Interface. Strictly speaking, "API interface" is redundant, since the I already means interface. People say it anyway, and they always mean the same thing: a defined set of rules. It specifies which requests one program may send to another, what format the data has to be in and what comes back. Unlike a user interface, an API isn't built for people but for software. There are several kinds. Operating systems and code libraries have APIs that are only called from inside a program. But when a mid-sized business talks about connecting its online store, CRM and accounting, it almost always means a web API. It runs over the internet and uses the HTTP protocol with its standardized methods and status codes. The most common style is REST, a term computer scientist Roy Fielding coined in his dissertation. Alongside it there's GraphQL and the older, XML-based SOAP. The usual data format is JSON: text data made up of field names and values that both programs and people can read. A CSV export that someone downloads and uploads by hand is not an API in the strict sense. That's a file interface: it has no defined request and no direct response.

Illustration for the section "What is an API? The definition"
AI-generated image

API explained simply: what happens during a request?

Picture an order form with fixed fields. Fill it out wrong and it comes back to you with a note. That's how a web API works. A request has four parts. The endpoint is the address, for example …/customers/acme-inc. The method says what should happen: GET reads, POST creates something, PUT or PATCH changes it, DELETE removes it. The header carries extra information, above all the access key, often in the line "Authorization: Bearer …". For changes, the body contains the data itself, almost always as JSON. The response contains a status code with a short status message and usually JSON again, for example {"id": "acme-inc", "name": "Acme Inc."}. Status codes quickly show where a problem lies. HTTP groups them into classes: success messages; client errors, meaning the request itself was faulty; and server errors, meaning the other side has a problem. That distinction saves time when troubleshooting, because it tells you right away which side to look at.

Common HTTP status messages and what they mean in practice
Status messageClassMeaningTypical trigger in practice
OKSuccessRequest succeeded, data in the responseNormal read access
CreatedSuccessRecord was createdPOST of a new order
Bad RequestClient errorRequest is formally invalidRequired field missing, wrong date format
UnauthorizedClient errorNo valid authenticationToken expired or wrong key
ForbiddenClient errorAuthenticated but not authorizedKey only has read permissions
Not FoundClient errorEndpoint or record doesn't existRecord deleted, wrong URL
Too Many RequestsClient errorRate limit exceededToo many requests in a short time
Internal Server ErrorServer errorError on the other sideOutage at the provider

API vs. webhook vs. file interface vs. MCP: what's the difference?

When people talk about integrations, four terms often get mixed up. The difference is who starts the exchange and who processes it. With an API, your system actively asks and gets an immediate answer. With a webhook, the other side reaches out on its own as soon as an event happens. How to secure and test webhooks is covered in What Is a Webhook: How It Works, Testing, Security. A file interface exchanges whole files, such as CSV or XML, often overnight and without feedback per record. Finally, an MCP server is a wrapper around existing APIs so an AI assistant can call them as tools. It doesn't replace the API, it builds on top of it. More on that in MCP Server Explained: Architecture, Examples, Costs.

Four ways to connect systems, compared on the same criteria
TypeWho starts the exchange?Feedback per recordTypical useWhere it breaks
Web APIThe requesting systemYes, immediately via status codeRead an order, create a sales orderRate limits, token lifetimes, version changes
WebhookThe system where the event happensOnly an acknowledgment of receiptNew payment, new leadMessage arrives twice or not at all if the receiver is unreachable
File interfaceA schedule or a personNo, errors only show up on importNightly product import, legacy systems without an APICharacter encoding, delimiters, delay until the next run
MCP serverAn AI assistantYes, via the underlying APIAssistant reads CRM data or creates tasksPermissions must be tight, because the model decides for itself what to call

What does an API integration example look like?

A typical mid-market case: an online store should automatically hand every paid order to the inventory management (ERP) system, and the tracking number should flow back. Without an integration, someone retypes the order, with all the typos that come with it. With an API it runs in five steps. First, the store sends a webhook as soon as a payment comes in. That's a short HTTP message to an address we define, containing the order number. Reputable providers sign this message, and our service verifies the signature before doing anything. Second, our service uses GET to fetch the full order with line items, shipping address and tax rates. Third, it maps the fields, because "sku" in the store might be called "item number" in the ERP. Fourth, it creates the sales order via POST. When the ERP responds with "Created", the order is marked as transferred. Fifth, a PATCH writes the tracking number back to the store once the warehouse ships. The webhook is the trigger; the API delivers the data. The alternative to a webhook is polling: a service asks for new orders at fixed intervals. That's simpler, but it eats into rate limits and data arrives with a delay. Anyone planning a custom frontend for Shopify faces the same question on a larger scale. Disclosure: DigifyNow is an official Shopify Partner agency, so we are a Shopify partner.

Illustration for the question "What does an API integration example look like?"
AI-generated image

Worked example: how many API calls does the sync need?

Whether polling or a webhook fits better can be calculated before anything is built, using three numbers you already have: orders per day from your store, the number of products in your ERP, and the page size and rate limit from your provider's API documentation. Plug those values into the calculations below. We deliberately don't give fixed numbers here, because page size and rate limit vary from provider to provider and often from plan to plan.

  1. Polling: requests per day = minutes in a day divided by the polling interval in minutes. The number depends only on the clock, not on your business: even on a day with zero orders, every request still happens, and most come back empty. Halve the interval and the requests double. In the worst case, an order waits a full interval before it's transferred.
  2. Webhook instead of polling: API calls per day = orders per day times three, namely one GET for the details, one POST into the ERP and one PATCH for the tracking number. The number grows with the business, not with the clock, and every call does real work.
  3. Initial load of the product catalog: page requests = number of products divided by the page size from the documentation, rounded up. Forget pagination and you only fetch the first page. The target system then holds only a fraction of your catalog, with no error message, because the API correctly answered "OK".
  4. Safety net: even with webhooks, a regular reconciliation is worth it, comparing all orders since the last run against the target system via the API. It catches webhooks that got lost because the receiver was briefly unreachable. Add its calls to the webhook calls.

The math makes the real point: the number of calls isn't the problem; the question is whether it stays within the provider's rate limit, including on the day a promotion brings in many times the usual orders. So always calculate with your busiest day, not the average, and add the initial load, which usually generates the most calls all at once.

Building an API integration: what steps does it take?

For a mid-sized business, building an API integration usually doesn't mean inventing a new API. It means writing a small service that connects two existing APIs. At DigifyNow we follow these steps:

  1. Define the data flow: which system is the source of truth for which field? How often do you sync, in real time via webhook or at fixed intervals?
  2. Review the other side's documentation: is there a machine-readable description in OpenAPI format, a test environment (sandbox) and published rate limits?
  3. Set up authentication: either an API key or OAuth with short-lived access tokens and a refresh token. The provider states how long a token is valid when it's issued, in the expires_in field. Keys live only on the server, never in app or browser code.
  4. Map fields and align formats: dates in one consistent format with time zone, amounts as decimals instead of floating-point numbers, required fields validated before sending.
  5. Build error handling: on "Too Many Requests" and server errors, retry with increasing wait times, respecting the Retry-After header in which the other side states the wait time. Important: in HTTP, GET, PUT and DELETE are considered idempotent, so repeating them doesn't change the result. POST is not considered idempotent. An idempotency key in the header ensures a retried POST request doesn't create a duplicate order, provided the other side supports it.
  6. Log and monitor: every failed transfer goes into a list with the reason and can be resent. Otherwise nobody notices that nothing has come through since Tuesday.

In practice, what takes longest is almost never the calls themselves but the data flow, the field mapping and the error handling. If you want to think about workflows on a bigger scale, read more in our article on business process automation and what pays off.

Custom code or integration tool: what's enough for the integration?

Not every API integration needs a custom-coded service. There are three realistic routes, and they differ mainly in how much logic sits between the systems. Many applications offer native integrations: you sign in to one system from the other and choose what gets transferred. Integration platforms like Zapier, Make or n8n come with building blocks for common APIs that you assemble into workflows visually. For Make: DigifyNow is a partner there through a referral code. A custom service is code that talks to the APIs directly. Exactly which features and plans a tool offers is in that provider's documentation; check above all whether the APIs of both your systems are available as building blocks and how executions are billed.

Three routes to an API integration, compared on the same criteria, as of November 2026
RouteFits when …Who runs it?Where it stops
Native integration in the applicationboth systems already know each other and the standard field mapping is enoughthe application's vendorcustom fields and your own rules often can't be represented; error lists are sparse
Integration platform (e.g. Zapier, Make, n8n)the workflow has only a few steps and building blocks exist for both APIsthe platform provider, or you yourself with self-hosted versionslots of branching, large data volumes and pagination get messy; costs depend on the number of executions
Custom servicefield logic, error handling or data volumes go beyond simple workflowswhoever runs the server and maintains the codeneeds development, hosting and someone to keep up with API version changes

Why do API integrations fail in practice?

Most problems don't show up on day one but after weeks. By then it looks like the integration is "somehow not working right anymore". The most common causes:

  • Expired tokens: OAuth access tokens have a lifetime the provider states in the expires_in field. Without automatic renewal via a refresh token, you suddenly get nothing back but "Unauthorized".
  • Missed pagination: many APIs return only one page with a limited number of records per request; the maximum is in the provider's documentation. You reach the next page via a page parameter or a cursor included in the response. If you don't page through, you silently sync only part of the data.
  • Rate limits: during a large initial load or at peak times, the other side responds with "Too Many Requests". Without retry logic, records get lost.
  • Version changes: providers deprecate API versions and shut them off after a notice period. If you don't follow the announcements, you only find out when things break, often through a sudden "Not Found".
  • Duplicate records: a timeout doesn't mean nothing arrived. If a POST request is retried without an idempotency key, you get duplicate orders.
  • Mismatched data models: a customer with several shipping addresses doesn't fit into a system that only knows one. That's a business question, not a technical one.

That's why an integration also needs someone who watches it in operation. Build it once and forget it doesn't work.

Illustration for the question "Why do API integrations fail in practice?"
AI-generated image

How much does an API integration cost?

There's no honest flat price for an API integration, because the effort almost never lies in the calls themselves. It depends on five drivers. First, scope: one direction with one object type, say only orders into the ERP, is a different job from a two-way sync of customers, products and inventory. Second, the quality of the other side: without a sandbox, an OpenAPI description or clear error documentation, you spend more time experimenting than building. Third, the data: inconsistent master data has to be cleaned up before the integration or mapped by rules. Fourth, edge cases like partial shipments, cancellations and credit notes, which often need more logic than the normal case. Fifth, operations: hosting, monitoring, integration platform licenses and keeping up with version changes are ongoing costs. A reliable figure only emerges once the data flow, fields and edge cases are written down. How software projects are estimated in general is explained in Software Development Cost: What Drives It.

When is a custom API integration not worth it?

Not every connection between two programs needs custom code. At DigifyNow we advise against it in four cases. First: if one of the two applications already offers a native integration with the other, that's usually cheaper to run than a custom build. Second: if it's only a handful of records a month, a manual export is often good enough. Third: some older industry software has no API at all. Then the options are a file exchange, direct database access if the vendor allows it, or a software robot that operates the user interface. When RPA instead of an API is the better fit, and why bots break when the interface is updated, is covered in a separate article. Fourth: some providers only unlock the API on higher-tier plans or heavily limit the calls. Clarify that before planning. And on the legal side: if personal data flows to an external service that processes it on your behalf, the GDPR calls for a data processing agreement. Whether one is in place and fits is up to your business, not the technology. If, on the other hand, data exchange is the core of your business, it's worth comparing Individualsoftware vs. SaaS (custom software vs. SaaS).

How DigifyNow builds API integrations

DigifyNow, based in Unnau in Germany's Westerwald region, usually builds integrations as part of larger projects: a custom back office, a CRM or a web app that needs data from a store, accounting or calendar. One example from our references is the custom back office with CRM for Mundo Marketing. The process starts with a free, no-obligation assessment: we look at which systems are involved, whether their APIs are documented and whether a native integration or an integration platform would already do the job. If the answer is yes, we tell you so. Only once the data flow and edge cases are settled do we put together a proposal. What else we build is listed under our services; you can request the assessment through our contact page.

Frequently asked questions

What is a REST API?

REST is an architectural style for web APIs, described by Roy Fielding in his dissertation. Every resource, such as a customer or an order, has its own address. It's manipulated with the HTTP methods GET, POST, PUT, PATCH and DELETE. Every request contains all the information needed; the server keeps no state from one request to the next. With GraphQL, by contrast, you query exactly the fields you need through a single endpoint.

How do APIs and webhooks work together?

With an API, your system actively requests data (pull). With a webhook, the other system reaches out on its own as soon as something happens (push), for example a new payment. The webhook often contains only an ID. You then fetch the full data via the API. That's why in practice the two usually work together: the webhook as the trigger, the API as the data source.

What is an API key and where should it be stored?

An API key is a long string a program uses to identify itself to an API. It usually goes in the header of every request. It belongs on the server, for example in an environment variable or a secrets manager. In an app or in browser code, anyone who inspects the code can read it. Unlike an OAuth token, whose lifetime is given in the expires_in field, an API key often doesn't expire on its own.

How do I know if my software has an API?

Search the vendor's help pages for "API" or "developer". A usable API has public documentation covering endpoints, authentication and rate limits, ideally with an OpenAPI description and a sandbox. If all you find is "import/export", it's a file interface. Also ask whether the API is included in your plan, because some providers only offer it on higher-tier plans.

Request a free assessment of your project