Modern web applications rarely work alone. Payment gateways, CRMs, ERPs, shipping carriers, SMS providers, email platforms, marketplaces and identity providers all connect to your system. Each integration is a potential point of failure, and failures often appear only in production, when real data and real credentials meet real edge cases. Learning how to test third-party integrations before a production release reduces those surprises dramatically. This guide covers sandbox testing, contract testing, realistic data scenarios, failure simulation and final production checks.
Why You Must Test Third-Party Integrations Differently
Unit tests check your own code. Integration tests check how your code works with systems you do not control. Those systems may:
- Behave differently in sandbox and production
- Change without notice
- Enforce rate limits and timeouts
- Reject data your system considers valid
- Send unexpected responses or duplicate events
Testing must account for this uncertainty.
Step 1: Inventory Every Integration
List each integration with its purpose, direction of data flow, triggers, endpoints used, credentials and owner. Include “hidden” integrations such as analytics tags, chat widgets and email delivery services. Integrations you forget are the ones that fail at launch.
Step 2: Use Sandbox and Test Environments
Most major providers offer sandbox accounts: payment gateways, CRMs, shipping carriers and SMS providers. Configure staging to use sandboxes, with test data that mirrors production structure. Where no sandbox exists, agree a safe testing approach with the provider, such as a test account in production with clearly labelled records.
Step 3: Write Integration Test Scenarios
For each integration, define scenarios covering normal, alternative and error cases:
| Integration | Scenario | Expected result |
|---|---|---|
| Payment gateway | Successful card payment | Order marked paid, confirmation sent |
| Payment gateway | Payment declined | Order stays pending, user sees clear message |
| Payment gateway | Webhook arrives late | Order updates when webhook is processed |
| CRM | New enquiry | Lead created with correct fields and owner |
| CRM | Existing contact | Contact updated, no duplicate |
| ERP | Order with multiple tax rates | Correct tax lines in ERP |
| Courier | Address in unserviceable area | Clear message, order flagged |
| SMS | Invalid number | Error logged, no crash |
Scenarios should reflect real business situations, not just technical success.
Step 4: Test With Realistic Data
Synthetic data with simple names and round numbers misses many problems. Include:
- Long names, special characters and non-English scripts
- Large orders with many lines
- Discounts, coupons and multiple tax rates
- International addresses and phone formats
- Edge values such as zero quantities or maximum lengths
Real production data, anonymised where necessary, is often the best test source.
Step 5: Use Contract Tests
Contract tests check that your system and the provider agree on request and response formats. Record expected API responses and verify that your code handles them correctly. Run contract tests regularly against sandboxes to detect provider changes early.
Step 6: Simulate Failures
Deliberately create failure conditions:
- Timeouts and slow responses
- Server errors from the provider
- Rate limit responses
- Invalid or expired credentials
- Duplicate webhooks
- Out-of-order events
Confirm that retries, queues, error logs and alerts work as designed. Most production incidents come from failure handling that was never tested. See our approach to API integration development.
Step 7: Test End-to-End Business Flows
Integration tests should follow complete journeys across systems, for example: a customer places an order, pays, the ERP receives it, the warehouse ships it, the courier tracking updates the portal and the customer receives notifications. End-to-end tests reveal problems between integrations that isolated tests miss.
Step 8: Prepare Production Configuration
Before release, check:
- Production API keys and secrets are set correctly
- Webhook URLs point to production endpoints
- IP allowlists include production servers
- Callback and redirect URLs are registered with providers
- Rate limits and quotas are sufficient for expected traffic
- Monitoring and alerts are active
Many launch failures happen because staging settings were never switched to production.
Step 9: Run Production Smoke Tests
Immediately after release, run a small set of real transactions where safe: a low-value payment and refund, a test enquiry to the CRM, a test booking. Verify each step and clean up test records afterwards.
Step 10: Monitor Closely After Release
Watch integration success rates, queues and error logs closely for the first days. Include integrations in your post-launch monitoring and website testing and QA regression suites.
Example: The Webhook That Never Arrived
A subscription business tested payments thoroughly in the gateway sandbox. After launch, renewals failed to update customer accounts. The production webhook URL had never been registered with the gateway, because sandbox and production used separate dashboards. A production configuration checklist added after the incident now includes every webhook, callback URL and key for each integration.
Common Mistakes
- Testing only successful scenarios
- Using simplistic test data
- Not simulating provider failures
- Forgetting to switch configuration to production
- No monitoring after release
Who Should Own Integration Testing
Integration testing often falls between teams. Developers assume QA will test end-to-end flows; QA assumes developers tested the APIs; business teams assume both have checked the results in their systems. Assign clear ownership: developers own contract tests and failure handling, QA owns scenario and end-to-end testing, and business owners verify outcomes in the CRM, ERP or finance system. For each integration, name a technical owner and a business owner who sign off together. When third-party vendors are involved, agree their testing responsibilities and availability during test windows, especially if sandbox access or test data must be prepared on their side. This shared ownership is particularly important in projects using custom website development with several connected systems, and in ecommerce website development where payments, inventory and shipping all depend on external services working together.
Frequently Asked Questions
Can We Test Integrations Without Sandboxes?
Yes, with mocks, recorded responses and carefully controlled production tests, but risk is higher.
How Long Does Integration Testing Take?
It depends on the number and complexity of integrations. Plan dedicated time rather than squeezing it into general QA.
Should Business Users Be Involved?
Yes, to confirm that results in CRMs, ERPs and other systems match business expectations.
Testing integrations properly keeps your application reliable when it matters most. Explore our website integration services, review payment gateway integration, learn about email marketing integration, see website backend development, check our integrations page, or contact us.
