Loading...
New Winner – Cross-Border Excellence | Payoneer India 2026 Check out
Featured Recognized by Salesforce; Proven by impact! Check out

Integrating SAP applications with Salesforce enhances alignment of customer data and business processes. Utilizing SAP Business Technology Platform (BTP) and the SAP Integration Suite, businesses can connect these platforms seamlessly. This guide details the process of setting up the integration, including creating accounts, configuring OAuth settings, and developing an Apex REST API in Salesforce. It covers the creation of an integration flow to facilitate Lead record creation, along with testing the integration using Postman to ensure functionality.

Connecting SAP applications with Salesforce can help businesses keep customer information and business processes aligned across both platforms. SAP Business Technology Platform (SAP BTP) provides an integration layer for exchanging data between these systems without building a separate connection for every application.

In this example, SAP Integration Suite acts as middleware and sends JSON data to a custom Apex endpoint in Salesforce. The endpoint receives the request and creates Lead records, while OAuth 2.0 Client Credentials handles authentication between the platforms.

This guide walks through the complete Salesforce REST API Integration, from setting up SAP BTP and configuring Salesforce authentication to creating an integration flow (iFlow) and testing it with Postman. The example focuses on Lead creation, but the same approach can be extended to other business objects with the required changes.

Step 1: Create an SAP Integration Suite Account

Start by opening the SAP Integration Suite page.

  1. Enter the External Client App Name.
  2. Enter the Contact Email.
  3. Enable OAuth Settings and configure the following:
  • Callback URL: https://your-domain.my.salesforce.com/services/oauth2/token
  • OAuth Scopes:
    • Manage user data via APIs (api)
    • Full access (full)
    • Perform requests at any time (refresh_token, offline_access)
  • Enable the Client Credentials Flow checkbox.
  1. Click Save.

 

Step 1

Step 2: Create an SAP BTP Trial Account

Once your SAP account is ready, open the SAP BTP trial page.

  1. Open the External Client App you created.
  2. Go to Policies or Edit Policies, depending on the interface.
  3. Locate the OAuth Client Credentials Flow settings.
  4. Enable the flow if it is not already enabled.
  5. Select the appropriate Salesforce integration user under Run As.
  6. Save the changes.

You should now be able to access your SAP BTP subaccount and continue with the Integration Suite setup.

Step 2

Step 2.1

Step 2.2

Step 2.3

Step 3: Create an External Client App in Salesforce

Salesforce needs an OAuth application to authenticate requests coming from SAP BTP. For this example, configure an External Client App with the Client Credentials flow.

  1. Log in to your Salesforce Developer Account.
  2. Click the Setup (gear) icon.
  3. In the Quick Find search box, enter External Client Apps.
  4. Open External Client App Manager or the External Client App creation option available in your org.
  5. Select the option to create a new External Client App.

Step 3

Step 4: Configure the External Client App

Enter the basic application details:

  1. Enter the External Client App Name.
  2. Enter the Contact Email.
  3. Enable OAuth Settings and configure the following:
  • Callback URL: https://your-domain.my.salesforce.com/services/oauth2/token
  • OAuth Scopes:
    • Manage user data via APIs (api)
    • Full access (full)
    • Perform requests at any time (refresh_token, offline_access)
  • Enable the Client Credentials Flow checkbox.
  1. Click Save.

Step 5: Configure Salesforce OAuth Policies

The Client Credentials flow requires Salesforce to know which user should execute API requests.

  1. Open the External Client App you created.
  2. Go to Policies or Edit Policies, depending on the interface.
  3. Locate the OAuth Client Credentials Flow settings.
  4. Enable the flow if it is not already enabled.
  5. Select the appropriate Salesforce integration user under Run As.
  6. Save the changes.

The selected user must have API access and the required permissions to create Lead records. It is better to use a dedicated integration user with limited permissions instead of a personal administrator account.

Once the app is configured, retrieve its Consumer Key and Consumer Secret. You will need both values when setting up the OAuth credentials in SAP BTP.

Step 6: Create the Salesforce Apex REST API

In Salesforce Setup or Developer Console, create and deploy an Apex REST class. The endpoint path in this example is `/services/apexrest/SAPLeadAPI/`. The API accepts a JSON array of Lead records and inserts them.

Step 7: Create the SAP Integration Suite Service Subscription

Now move to your SAP BTP subaccount to set up Integration Suite.

  1. Open your SAP BTP Subaccount.
  2. Select Service Marketplace from the left-side menu.
  3. Search for Integration Suite.
  4. Open the service and select the available trial plan.
  5. Click Create to create the service subscription.
  6. Open Instances and Subscriptions.
  7. Under Subscriptions, verify that Integration Suite appears.

The subscription makes the service available in your subaccount. You may need to assign the required role collections before opening and configuring it.

Step 7

Step 8: Assign Role Collections to Subaccount Users

SAP BTP uses role collections to control access to Integration Suite capabilities.

  1. Open your SAP BTP Subaccount.
  2. Under Security, select Users.
  3. Select the user who will configure the integration.
  4. Click Assign Role Collection.
  5. Search for the required role collections and assign the ones applicable to your subscription and activated capabilities.
  6. Save the changes and verify the assigned roles.

The role collections in your supplied setup include:

  • APIManagement.SelfService.Administrator
  • APIPortal.Administrator
  • APIPortal.Service.CatalogIntegration
  • Integration_Provisioner
  • OpenConnectors_User
  • PI_Administrator
  • PI_Business_Expert
  • PI_Integration_Developer
  • Subaccount Administrator


You do not necessarily need every role collection for every integration. Assign the permissions required for the capabilities you intend to use, following your organisation’s access policies.

Step 9: Open SAP Integration Suite

After assigning the required roles:

  1. In the SAP BTP Subaccount, open Services → Instances and Subscriptions.
  2. Under Subscriptions, locate Integration Suite.
  3. Click the service to open it.

Step 9

Step 10: Add and Activate Integration Suite Capabilities

Integration Suite provides different capabilities, including Cloud Integration and API Management. For this example, Cloud Integration is required to build and run the iFlow.

  1. On the Integration Suite home screen, click Add Capabilities.
  2. Select Cloud Integration.
  3. Select the capabilities required for your setup.
  4. For this example, select Cloud Integration and API Management if both are available and needed.
  5. Click Activate.
  6. Wait for the activation process to finish.
  7. Reopen SAP Integration Suite and verify that the selected capabilities are available.

Activation can take several minutes. The time may vary depending on the trial environment.

Step 10

Step 10.1

Step 10.2

Step 11: Configure Salesforce OAuth Credentials in SAP BTP

SAP Integration Suite needs the Salesforce Consumer Key and Consumer Secret to obtain an access token.

  1. In SAP Integration Suite, open the Monitor section.
  2. Select Integrations and APIs.
  3. Scroll to Manage Security.
  4. Open Security Material.
  5. Click Create.
  6. Select OAuth2 Client Credentials.

Step 11

Configure the following details:

Field Value
Name Salesforce_OAuth_Cred
Runtimes Cloud Integration and Integration cell
Token Service URL https://<your-salesforce-domain>/services/oauth2/token
Grant Type Send as part of body
Client ID Salesforce External Client App Consumer Key
Client Secret Salesforce External Client App Consumer Secret
Client Authentication Send as Request Header
Content Type application/x-www-form-urlencoded

Step 11.1

  1. Enter the required values and verify that the Salesforce token URL uses your org’s domain.
  2. Click Deploy or Save, depending on the options available in your SAP Integration Suite environment.

Step 12: Create an Integration Package

The integration package will contain the iFlow used to connect SAP BTP with Salesforce.

  1. In SAP Integration Suite, open the Design section.
  2. Select Integrations and APIs.
  3. Click Create.
  4. Enter the following details:
  • Name: SAP To Salesforce Lead
  • Technical Name: SAP_To_Salesforce_Lead
  • Short Description: Integration flow to create Salesforce Leads using a REST API.
  1. Click Create to create the integration package.

Step 13: Create an Integration Flow (iFlow)

  1. Open the integration package you created.
  2. Go to the Artifacts tab.
  3. Click Add and select Integration Flow.
  4. Enter the following details:
  • Name: SAP to Salesforce Lead
  • ID: SAP_To_Salesforce_Lead
  • Description: Integration flow to create Salesforce Lead records using a REST API.
  1. Click Add to create the integration flow.
  2. Open the newly created iFlow to start configuring the integration process.

Configure and Deploy the Integration Flow

The following steps connect the SAP BTP sender endpoint to the Salesforce Apex REST endpoint.

Step 1: Connect the Sender to the Integration Process

  1. Open your created integration flow in SAP Integration Suite.
  2. Locate the Sender participant on the left side of the canvas.
  3. Select the Sender participant and connect it to the Start Message event.
  4. Select the Sender participant and configure the HTTPS adapter.
  5. Set the sender address to: /sap-to-salesforce-lead
  6. Configure the required authentication method and sender authorization role, such as ESBMessaging.send, if applicable.
  7. Click Save.

Step 14

Step 2: Add and Configure the Request Reply Step

  1. In the iFlow editor, open the Search panel.
  2. Search for Request Reply.
  3. Drag the Request Reply step onto the integration process canvas.
  4. Connect the Start Message event to the Request Reply step.
  5. Connect the Request Reply step to the End Message event.
  6. Add an HTTP Receiver participant to the canvas, if it is not already available.
  7. Connect the Request Reply step to the HTTP Receiver using the appropriate receiver connection.
  8. Select the Request Reply step and verify its configuration.

Step 15

Step 3: Configure the HTTP Receiver Adapter

Select the HTTP Receiver participant and configure the following details:

Field Value
Address https://<your-salesforce-domain>/services/apexrest/SAPLeadAPI/
Proxy Type Internet
Method POST
Authentication OAuth2 Client Credentials
Credential Name Salesforce_OAuth_Cred (this name is Security Material)


Save the configuration. Ensure the endpoint matches your Salesforce Apex REST URL mapping.

Step 4: Save, Deploy, and Copy the Endpoint

  1. Click Save to save the integration flow.
  2. Click Deploy.
  3. Check the Deployment Status on the iFlow canvas.
  4. Wait until the status shows Deployed.
  5. Click Navigate to open the endpoint details.
  6. Copy the HTTPS endpoint URL and keep it for testing.

This is the SAP BTP sender endpoint that Postman will call. It is different from the Salesforce Apex REST endpoint configured in the HTTP Receiver.

Test the Integration Using Postman

After deployment, send a sample JSON request to the SAP BTP endpoint to verify that the complete integration works.

Step 1: Create a Service Key in SAP BTP

You need the SAP BTP service credentials to authenticate the request from Postman.

  1. Log in to your SAP BTP Cockpit.
  2. Select your subaccount.
  3. Open Services → Instances and Subscriptions.
  4. Under the Instances section, locate your Process Integration Runtime service instance.
  5. Open the service instance and select Create Service Key.
  6. Enter a name, such as Postman_Service_Key.
  7. Click Create.

Step 16

  1. Open the created service key and copy the following values:
    • Client ID
    • Client Secret
    • Token URL

Step 2: Send a Request From Postman

  1. Open Postman and create a new HTTP request.
  2. Select POST.
  3. Paste the deployed SAP BTP iFlow endpoint URL.
  4. Open the Authorization tab and select Basic Auth.
  5. Enter the service key credentials:
    • Username: Client ID
    • Password: Client Secret
  6. Open the Headers tab and add:

Content-Type : application/josn
Open the Body tab, select raw, and choose JSON.

7. Enter the following sample payload:

8. Click Send to submit the request.

Expected Response

 Status Code: 201 Created

The 201 Created status confirms that the request successfully created a Lead, provided the response is returned by your configured Apex REST API. 

Step 17

Common Errors and Troubleshooting

During a Salesforce API integration, authentication, endpoint, and payload issues can prevent the request from completing. Check the following details when troubleshooting:

Error What to check
401 / invalid token at SAP endpoint Check the SAP token URL, service-key client ID/secret, token expiry, and that the Bearer token is sent to the runtime endpoint.
403 at SAP Sender Check the sender authentication mode, assigned role (for example ESBMessaging.send), endpoint path, and any CSRF requirements.
unsupported_grant_type from Salesforce Check the OAuth token request, configured grant type, and whether the Salesforce app supports the selected flow.
Invalid_client from Salesforce Verify the Salesforce Consumer Key/Secret and Salesforce OAuth app configuration. Do not use SAP service-key credentials here.
404 from Salesforce Check the Salesforce domain, deployed Apex class, and /services/apexrest/SAPLeadAPI/ path.
400 from Apex REST Inspect the JSON payload, required Lead fields, validation rules, duplicate rules, and the error returned by Apex.


Conclusion

This guide covered how to connect SAP BTP Integration Suite with Salesforce using a custom Apex REST endpoint. From creating the External Client App to configuring OAuth credentials, building the iFlow, and testing the deployed endpoint, each stage contributes to a working integration.

A well-configured Salesforce REST connection gives businesses a way to exchange data between SAP and Salesforce through controlled API requests. The same foundation can support additional objects and business processes as integration requirements grow.

For organisations planning more complex Salesforce API integration projects, working with an experienced Salesforce partner like HIC Global Solutions can help with authentication design, API security, data mapping, and integration maintenance. You can also extend this example to support other Salesforce records by adapting the Apex class and request payload to your business requirements.

Watch Demo Video

Frequently Asked Questions
What is required for Salesforce REST API integration with SAP BTP?

The integration requires an SAP BTP account, Integration Suite, a Salesforce Developer Account, an External Client App, OAuth credentials, and a custom Apex REST API.

How does OAuth 2.0 Client Credentials authentication work in Salesforce?

OAuth 2.0 Client Credentials allows SAP BTP to authenticate API requests using a Consumer Key and Consumer Secret, with Salesforce assigning a configured integration user to execute requests.

What is the role of SAP Integration Suite in Salesforce API integration?

SAP Integration Suite acts as middleware, connecting SAP applications with Salesforce through integration flows (iFlows) that manage HTTP requests, authentication, and data exchange.

What does a 201 Created response mean in Salesforce REST API integration?

A 201 Created response indicates that the Apex REST endpoint successfully processed the request and created the Lead records in Salesforce.

How can businesses improve Salesforce API integration and maintenance?

Businesses can improve integration reliability through secure OAuth configuration, dedicated integration users, appropriate permissions, accurate data mapping, and ongoing monitoring with support from an experienced Salesforce partner like HIC Global Solutions.

Related Articles
How to Automate Lead Qualification in GoHighLevel Using the Gemini API

GoHighLevel workflows can capture lead details and trigger webhooks, but evaluating each prospect against service fit, budget, and purchase readiness requires additional logic. Connecting an AI model makes this evaluation part of the automated process. With Gemini, submitted lead information can be assessed against predefined scoring criteria to generate a qualification status, score, reason, and […]

Read More
How to Connect Claude with Notion Using a Custom Connector

Claude becomes more useful when it can access information stored in external platforms such as Notion. This connection helps users retrieve relevant business documents without manually uploading them into Claude. A custom connector built with the Model Context Protocol (MCP) allows Claude to communicate with Notion through a dedicated server. It can search pages and […]

Read More
How to Configure Volume and Attribute-Based Discounts Using Pricing Procedures in Revenue Cloud Advanced

Revenue Cloud helps businesses automate product pricing and manage discounts according to their sales requirements. Salesforce Revenue Cloud supports structured pricing calculations, allowing organizations to apply pricing rules consistently across supported sales transactions. Revenue Cloud Advanced (RCA) provides pricing capabilities that help businesses manage product prices, volume discounts, and attribute-based adjustments. Pricing procedures bring these […]

Read More
How to Connect Salesforce with Claude AI Using an MCP Server

Claude AI can make working with Salesforce CRM data much easier. Instead of manually opening records, building reports, or writing SOQL queries, teams can ask Claude questions in plain English and get answers from their Salesforce org. With Salesforce MCP, users can explore CRM information through a conversational interface, helping them find relevant details with […]

Read More
How to Set Up Salesforce Claudeforce Using the Headless 360 MCP Server

Setting up Salesforce Claudeforce requires more than simply connecting Salesforce with Claude. The process involves beta access, the Salesforce Headless 360 MCP Server, an External Client App, plugin configuration, and user-level permissions. Each part of the setup is important because Claude needs controlled access to Salesforce data and actions while still following the user’s existing […]

Read More
How to Extract Data from PDFs Using OCR.space API in Salesforce

Many times it’s crucial to extract information from documents such as loan statements, invoices, applications, identity documents, and scanned forms. When the information is stored as an image or scanned PDF, it cannot be directly read and used as regular text. This is where Salesforce OCR becomes useful. Optical Character Recognition can convert text from […]

Read More
Our Location worldwide
Indian Flag India
7th Floor, A-10, Pegasus Tower, Sector 68, Noida, Uttar Pradesh 201301 +91-1203669505
United States of America Flag USA
333 West Brown Deer Road Unit G – 366 Milwaukee WI, USA 53217 +1(262) 310-7818
United Kingdom Flag UK
7 Bell Yard, London, WC2A 2JR +44 20 3239 9428
CA Flag Canada
HIC Global Solutions INC
6D - 7398 Yonge St #1124 Thornhill, ON L4J 8J2 Canada +1(262) 310-7818