Agree on Four Things Before Integration

  • Primary Keys and Mapping: Which field each side uses as the unique identifier, and how historical data is aligned.
  • State Machine: What states orders/tickets have, who can advance them, and whether rollback is allowed.
  • Failure Semantics: Whether a timeout counts as success or failure, how many times to retry, and whether a manual compensation queue is needed.
  • Time and Time Zones: Use timezone-aware timestamps uniformly to avoid one-day discrepancies in cross-day reconciliation.

Idempotency Is the Most Overlooked Rule

When the caller resends after a network timeout, an API without idempotency will produce duplicate orders, duplicate charges, or duplicate SMS messages. Always attach a unique business ID to write operations, and have the server check first, then write; this rule prevents more incidents than any rate limiting.

Grant Permissions on a Least-Privilege Basis

Grant integration keys access only to the necessary endpoints, separated by environment, rotatable, and individually revocable. Don't let a “master account” run across all systems, and never write keys into the frontend or log files.

Synchronous or Asynchronous

Use synchronous calls with clearly defined transaction boundaries for strong-consistency scenarios (payments, inventory deduction); use asynchronous message queues with retry and dead-letter alerts for delay-tolerant cases such as reports, archiving, and notifications. When mixing the two, be especially explicit about “whose data is authoritative.”

Build Exceptions into Acceptance Testing

Don't just test the happy path. Network loss, timeouts, duplicate pushes, out-of-order messages, missing fields, and dirty data from the other party—turn these into test cases so you won't be woken up in the middle of the night after launch.