Short answer
Most REST integration failures are not protocol failures; they are unanswered questions about retries, idempotency, and who owns the record when both systems have changed it. This guide covers what integration services should deliver, how to design for failure, authentication and security, rate limits, and how to judge a proposal.
What REST API Integration Services Should Include
REST is a well-understood style, the tooling is mature, and almost every modern system exposes an API. That makes it easy to assume integration work is routine. The protocol is routine; the design decisions are not, and they are where the cost and the risk live.
A complete engagement covers interface discovery and documentation review, contract design, authentication and security, error handling and retry strategy, idempotency, data mapping and transformation, rate limit and throughput design, monitoring and alerting, and the operational runbook that lets someone who is not the developer support it.
| Deliverable | What it contains | Signal it is missing |
|---|---|---|
| Interface contract | Endpoints, payloads, status codes, and what each error means | The specification is a screenshot of a Postman collection |
| Failure design | Retry policy, backoff, dead-letter handling, replay procedure | The design describes only the successful path |
| Idempotency approach | How a repeated request is recognised and handled safely | Nobody can answer what happens if the same message arrives twice |
| Security design | Auth method, credential storage, rotation, transport, data minimisation | Credentials appear in a configuration file in the repository |
| Throughput design | Expected volume, rate limits on both sides, batching strategy | Volume was never discussed |
| Operational runbook | How to detect, diagnose, and replay a failure | Support means messaging the developer who built it |
When reviewing a proposal, the fastest useful test is to look for the failure design. A quote that prices the happy path and treats error handling as implicit will be revised upwards once reality intervenes.
Design for Failure Before Designing the Happy Path
Networks drop connections, services return 503, payloads arrive malformed, and the other team deploys at the wrong moment. An integration is defined by how it behaves when those things happen, because they will.
The questions below should be answered in writing before any code exists. Each has more than one defensible answer, which is precisely why it needs deciding deliberately rather than by whoever writes the code first.
- What is retried? A 500 probably should be. A 400 almost certainly should not, because retrying a malformed request just produces the same error more often.
- How many times, and how far apart? Exponential backoff with jitter is the standard answer; immediate fixed retries turn a brief outage into a self-inflicted denial of service.
- Where does a message go when retries are exhausted? A dead-letter queue someone monitors, not a log line nobody reads.
- Who is alerted, and at what threshold? One failure is noise; a sustained failure rate is an incident. Alerting on every error trains people to ignore alerts.
- How is a message replayed? By whom, through what interface, and with what safeguard against duplicates.
- What does the user see? If a customer-facing action depends on the integration, the interface needs a sensible answer when it is unavailable.
The question that reveals the most
Ask the prospective partner: "A message failed at 2am on Sunday. Walk me through what happens next." A good answer describes alerting thresholds, a dead-letter store, a named support process, and a replay mechanism. A vague answer tells you the integration will be supported by whoever remembers how it works.
Idempotency: The Concept That Prevents Duplicate Orders
An operation is idempotent when performing it twice has the same effect as performing it once. This matters because in a distributed system you frequently cannot tell whether a request succeeded — the response may have been lost after the work was done.
Without idempotency, a retry after a lost response creates a duplicate. Duplicate orders, duplicate invoices, duplicate payments. These are the integration defects that reach the finance director, and they are entirely preventable at design time.
| Approach | How it works | Best for |
|---|---|---|
| Idempotency key | Caller supplies a unique key; the server returns the original result on repeat | Order and payment creation — the strongest general answer |
| Natural key upsert | Match on a business identifier and update rather than insert | Master data sync where a stable external ID exists |
| Conditional request | Use a version or ETag so a stale update is rejected | Preventing one system overwriting newer data from another |
| Deduplication window | Reject identical payloads seen within a period | A pragmatic retrofit when you cannot change the caller |
| Transaction log | Record every processed message identifier and check before processing | When the target system offers no help and you must build it yourself |
Salesforce supports this well through External ID fields and upsert, which handles a large share of real cases without custom work. Where you are integrating two systems you do not control, agree the idempotency mechanism as part of the interface contract rather than assuming the other side has one.
Authentication, Credentials, and Data Minimisation
API security has a small number of well-established answers and a large number of implementations that ignore them, usually because the integration started as a proof of concept and nobody revisited it.
For service-to-service integration, OAuth 2.0 client credentials or the JWT bearer flow are the standard choices. Static API keys still appear widely; they are acceptable when transmitted over TLS and rotated, and a problem when they live in a configuration file in a repository and were last changed four years ago.
| Control | Good practice | What goes wrong |
|---|---|---|
| Auth mechanism | OAuth 2.0 client credentials or JWT bearer with short-lived tokens | Long-lived static keys shared between environments |
| Credential storage | A secrets manager, or Named Credentials in Salesforce | Credentials in source control, config files, or a flow variable |
| Rotation | Scheduled rotation with an owner and a tested procedure | No rotation, because nobody knows what would break |
| Transport | TLS everywhere, with certificate validation enabled | Validation disabled to resolve a certificate issue during testing |
| Least privilege | An integration user with only the permissions the integration needs | The integration runs as a system administrator |
| Data minimisation | Send only the fields required for the purpose | Entire records transmitted because it was easier than selecting fields |
Two practices repay the effort particularly well. First, give every integration its own identity rather than sharing one — when something behaves oddly you can tell which integration did it, and you can revoke one without affecting the others. Second, log what was sent at a level of detail that supports debugging without writing personal data into logs that have weaker access controls than the systems they came from.
Rate Limits and Throughput Design
Every API has limits. Salesforce has daily API request allocations and concurrency limits; most SaaS platforms have per-minute throttles; ERPs often have a practical capacity well below their documented one. Designing without knowing them produces an integration that works in testing and fails at month end.
The core decision is batch versus single-record, and it is driven by volume and latency requirements rather than by preference. Record-at-a-time processing is simpler to reason about and burns through request allocations quickly. Batching is more efficient and complicates error handling, because a batch of two hundred records can partially succeed.
01
Establish the real volume
Not the average — the peak. Month end, campaign launch, and seasonal trading are when integrations fail.
02
Document both sides' limits
Requests per period, concurrency, payload size, and what the API returns when you exceed them.
03
Choose batch size deliberately
Large enough to be efficient, small enough that a partial failure is easy to resolve.
04
Handle partial success explicitly
Decide whether a partly failed batch is retried whole, retried per record, or dead-lettered.
05
Implement backpressure
When the target throttles, slow down rather than retrying harder. Respect Retry-After if it is provided.
06
Monitor consumption
Track allocation usage as a leading indicator. Hitting a daily limit at 3pm is a predictable failure you should have seen coming.
For Salesforce specifically, remember that the daily allocation is shared across every integration, every connected app, and anything else using the API. An integration that behaves well in isolation can exhaust the allocation for everything else.
Synchronous, Asynchronous, or Event-Driven
Many integrations are specified as real-time without anyone asking whether real-time is required. The answer determines architecture, cost, and how hard the integration is to operate.
| Pattern | Use when | Cost of using it unnecessarily |
|---|---|---|
| Synchronous request-response | A user is waiting and needs the answer to proceed | Your interface is as available as the slowest system it calls |
| Asynchronous with callback | The work takes time but the caller needs the eventual result | More moving parts than a simple request needs |
| Scheduled batch | Periodic reconciliation is sufficient | Almost none; this is underused rather than overused |
| Event-driven | Multiple consumers need to react to the same change | Infrastructure and debugging complexity for a single consumer |
| Change data capture | You need to react to record changes in another system | Event volume can be far higher than expected |
| File transfer | Large volumes on a predictable schedule between stable systems | Perceived as old-fashioned; often the most reliable option available |
A useful discipline is to ask what business event depends on the latency. "The warehouse picks orders at 6am" means a 5am batch is sufficient. "A customer service agent needs the balance while on the call" genuinely requires synchronous. Most requirements sit nearer the first than the second, and the difference in cost and reliability is considerable.
How to Judge an Integration Proposal
Integration proposals are hard to compare because the work is largely invisible. These questions separate a considered proposal from an optimistic one, and none require technical expertise to ask.
- "Show me the error handling design." If it is a section rather than a sentence, that is a good sign.
- "What happens if the same message is delivered twice?" You want to hear the word idempotency and a specific mechanism.
- "What volume did you design for, and what did we tell you?" Checks that volume was discussed at all.
- "Who supports this in six months, and how do they see what failed?" Tests whether monitoring and a runbook are in scope.
- "How is a credential rotated?" Reveals whether security was designed or inherited from a proof of concept.
- "What is explicitly out of scope?" A proposal with no exclusions has not been thought through.
Finally, ask for the interface contract to be a deliverable in its own right, reviewed before build starts. The contract is where expensive misunderstandings are cheap to fix. Once code exists on both sides, the same misunderstanding costs considerably more to resolve.
Frequently Asked Questions
Need an Integration That Does Not Wake You at 3am?
RASPSYS builds REST integrations with the failure cases designed in from the start — idempotency, retries, replay, and monitoring — so the people who support them can see what happened and fix it without a developer.