Salesforce integration issues often show up after deployment because production is not just a copy of the sandbox. The code may be the same, while the login URL, integration user, permissions, OAuth setup, secrets, certificates or external-system settings are different.
That is why a sandbox test can pass and the production connection can still fail on its first request. The quickest way to narrow it down is to look at where the failure occurs: authentication, authorization, the API call itself or the connection to the external system.
Why Do Salesforce Integrations Fail in Production?
The biggest differences usually sit outside the business logic. A few areas are worth checking before changing code that already worked in sandbox.
1. The Integration Is Still Pointing to Sandbox
Production and sandbox do not use the same authentication endpoint. Salesforce uses login.salesforce.com for production and test.salesforce.com for sandboxes, although My Domain is the better choice when it is available.
This becomes easy to miss with JWT or OAuth flows. A production user can have the right credentials and still get invalid_grant because the token request is going to the sandbox audience.
Look at the actual authorization URL, token URL, callback URL and instance URL used at runtime. If any of them still contain the sandbox host, fix that before investigating permissions.
2. The Metadata Moved, but the Credentials Did Not
A deployment can create a named credential or external credential in production without making it ready to authenticate.
Secrets, passwords, API keys and tokens often need to be configured separately after deployment. The same applies to environment-specific URLs. A named credential can exist in production and still fail because the principal has never been authenticated there.
This is where many Salesforce authentication errors come from. The object is present, so it looks like the deployment worked, but the runtime credential behind it is missing.
Open the production credential and confirm the principal is authenticated with the production account before testing the callout again.
3. The Production Integration User Has Less Access
Authentication can succeed and the integration can still fail on the next request.
A sandbox user may have broader permissions than the production service account. In production, the user might be missing API Enabled, object access, field permissions or permission to use the OAuth app.
That creates a different kind of Salesforce integration issue. A 401 points you toward authentication, while a 403 or object-access failure usually means the user connected successfully but cannot perform the requested action.
Test with the actual production integration user. An administrator account can make a broken permission model look healthy.
4. OAuth Settings Do Not Match Production
Salesforce connected app issues often come down to settings that were never duplicated exactly.
The production app may use a different callback URL, approved-user policy, OAuth scope or permission assignment. If Salesforce returns invalid_client, OAUTH_APP_BLOCKED or a “Not approved for access” message, the application configuration deserves more attention than the API code.
Salesforce now recommends External Client Apps for new integrations, while existing connected apps continue to work. Whichever model you use, compare the app approval and user access in production with the setup that actually passed testing.
5. The External System Treats Production Differently
Not every Salesforce production deployment error starts in Salesforce.
The external service may allow traffic from the sandbox environment but reject production. Production might use a different API host, client ID, certificate, firewall rule or IP allowlist.
For an outbound Salesforce API integration, both sides have to agree on the production configuration. A sandbox call proves the test path works. It says nothing about the production network path.
How Do You Troubleshoot Salesforce Integration Issues in Production?
Start with the first request that fails.
If login fails, open Setup > Login History for the integration user. That usually tells you whether Salesforce rejected the credentials, blocked the app or denied access before you spend time looking at callout code.
From there, the error itself gives you a useful direction:
| What you see | Check next |
| invalid_client | Client ID and production app |
| invalid_grant | User, JWT audience, token endpoint |
| Not approved for access | App assignment or permission set |
| 401 after authentication | Token, scope, external credential |
| 403 on API request | Object or field permissions |
| Connection or TLS failure | Endpoint, certificate, firewall, allowlist |
Once authentication works, run a small API request with the production user. A simple read is enough to tell you whether login and data access both work. If the read succeeds but a write fails, move into object permissions, field access, validation rules or downstream automation.
Named credentials deserve the same step-by-step treatment. First confirm the URL, then the principal, then the authentication status. There is little value debugging the Apex callout while the production credential itself is unauthenticated.
Practical Example: An ERP Sync Fails After Deployment
Consider an illustrative ERP integration that updates Accounts through REST API. The same code has been running successfully against a sandbox.
After deployment, production returns invalid_grant.
The integration user exists and the certificate is valid, so the team initially looks at permissions. The real problem turns out to be simpler: the JWT audience still points to test.salesforce.com.
After changing the authentication target to the production My Domain, the team tests one Account read and one update before switching on the scheduled sync.
This is why Salesforce integration testing needs an environment-specific step at the end. Sandbox proves the integration logic. Production still has to prove the production identity, endpoint and security configuration.
Common Salesforce Production Deployment Errors
A few shortcuts create repeat problems.
Reusing sandbox secrets is one. Production should have its own service account, tokens, certificates and external-system credentials. That keeps a sandbox refresh or credential rotation from affecting a live integration.
Permission assumptions cause trouble too. A permission set may deploy, but the production user can still be missing an assignment or app access that existed in sandbox.
Testing only with an administrator is another easy way to miss this. If the integration runs under a dedicated service account, that account should be used for the final test.
Also avoid tying production to consumer credentials that belong to a temporary sandbox. If the sandbox is later refreshed or deleted, those credentials can become unusable.
Salesforce Integration Testing Best Practices
Before go-live, keep the production test small and deliberate:
- Use separate environment settings. Sandbox and production should have different URLs, users, keys and secrets.
- Test with the real production integration user.
- Verify OAuth setup. Check scopes, callback URLs, app approval and the production login endpoint.
- Authenticate production credentials after deployment.
- Run one read and one write before enabling the full schedule.
- Test the external side too. Confirm firewalls, certificates, allowlists and production API credentials.
- Record the working setup. Keep the app, endpoint, integration user, scopes and permissions documented.
When several systems share middleware, service accounts and OAuth apps, Salesforce integration services can help map those dependencies before a release.
Conclusion
Salesforce integration issues after sandbox testing usually come from one production-specific difference: the endpoint, credentials, user access, OAuth configuration or external network path.
Find the first request that fails and stay with that layer until it works. Authentication comes first, then authorization, then the API operation itself. That keeps a deployment problem from turning into a code rewrite when the code was never the part that broke.
For environments with several connected systems and frequent releases, top Salesforce consultants can review production configurations and deployment paths before the next cutover.
FAQs
Why does a Salesforce integration work in sandbox but not production?
Sandbox and production use different users, credentials, endpoints, permissions and security settings. The same integration code can therefore behave differently even when nothing in the logic changed.
Should sandbox and production use the same OAuth credentials?
Usually, no. Production should use credentials created for the production org and production external system so sandbox refreshes or test changes do not affect the live connection.
Why does Salesforce return invalid_grant after deployment?
The usual causes are the wrong token endpoint, an incorrect JWT audience, a bad user or rejected credentials. Check the production authentication request before changing API logic.
Can permission differences break a Salesforce integration?
Yes. The production user may authenticate successfully and still lack API, object, field or app access. That often shows up as a 403 or authorization error after login.
What should Salesforce integration testing cover before go-live?
Test authentication, one read, one write, user permissions, the production endpoint and the external system’s network access. Use the real production integration user for that test.











