Apex
Design a reliable integration
A practical checklist for callouts, credentials, errors, and asynchronous processing.
By Vishal Verma · Reviewed October 5, 2026
Start with the contract: required fields, response shape, timeout expectations, and what a retry means to the receiving system.
- Use Named Credentials and External Credentials for endpoint and authentication configuration.
- Validate inputs before sending a request.
- Handle unsuccessful HTTP responses and exceptions explicitly.
- Use asynchronous Apex when the workflow needs work outside the initiating transaction. Check the callout and transaction rules for your chosen execution model.
- For repeatable requests, agree on an idempotency key with the external service.
- Test with HttpCalloutMock for success, error responses, and malformed payloads.
Interview discussion: if a timeout occurs, you cannot assume the external system did nothing. A reconciliation or idempotency strategy prevents duplicate business actions.