Never Test an Integration on Real Customer Data
You build an email integration and run it once with the real API key. It works. It also sends a welcome email to every customer in the list. There is no undo button for an email.
Half of an integration lives in someone else’s system. You do not control their data, their limits or their outages. So you control what you can.
A sandbox, and saved responses
A sandbox is a practice copy of the provider’s system. Payments move no money and emails reach no inbox. Use it for anything that creates or sends, and keep sandbox keys and real keys completely apart.
For automated tests, call the real API once, save the reply in a file, and let your tests read that file. It is fast, free and the same every time. Refresh these files now and then, because providers change fields.
curl -s https://api.github.com/users/octocat -o octocat.jsonTest the bad cases too
Most integration bugs are not in the happy path. Check what your code does with a 401, a 429, a 500, a timeout and a missing field. The timeout is the tricky one: the action may have happened even though no reply came, so a plain retry can do it twice.
One final check on a real account, by hand
Sandboxes are not perfect copies. Before you call it done, do one real run on an account you own, with a human watching. One record, one message to yourself. Not a script that loops over real customers.