API integration risk comes from more than a failed HTTP request. The destination may change its schema, reject access or finish an operation before your connection times out. Design for those outcomes before relying on the integration for business work.
Agree on the contract and owner
In a hypothetical CRM-to-ERP connection, document field types, required identifiers, currencies and allowed status changes. Identify who controls each record. Keep representative accepted and rejected payloads as fixtures; a generic request to a placeholder domain proves no compatibility.
| Outcome | Appropriate handling |
|---|---|
| Validation rejection | Fix or route the record for review |
| Authentication failure | Stop and repair access; avoid blind retries |
| Temporary service failure | Retry according to the provider's policy |
| Timeout after submission | Check operation status before creating another |
| Duplicate notification | Recognize the stable event or operation ID |
Do not equate POST with safe retries
MDN HTTP request methods distinguishes HTTP method semantics. A business endpoint may add idempotency, but the integration must verify its actual contract. Stripe idempotent requests documents Stripe's idempotent request mechanism; that behavior should not be assumed for another vendor's order API.
Store enough state to distinguish prepared, submitted and confirmed operations. Use the same operation key for a genuine retry of the same intent. A changed payload is a new decision, not merely another attempt.
Enforce permission at the destination boundary
Use the smallest access scope the workflow needs. Do not log tokens or full sensitive payloads. Define how access is renewed and who owns the service account. Test whether a caller can access another tenant's record by changing an identifier.
How do you know the integration is complete?
Reconcile source and destination records, not only request counts. Test schema changes, missing fields and interruption after dispatch. Keep an operator path for unresolved records. For automation and data engineering, prepare the contract, test credentials through a secure channel and an example recovery case.