---
title: A detail look at the Salesforce Composite API
description: "So it’s straightforward to implement an integration scenario of sales order with the Composite API and the Advantco Salesforce Adapter.
The sample payload we are using the operation UPSERT it means it already takes care of adding and updating existing, we need to add another subrequest of OrderDetail with an operation DELETE to delete unused order lines."
image: https://blogs.sap.com/wp-content/uploads/2020/03/1.AdvantcoAdapterIntegrationDiagram.png
---

# A detail look at the Salesforce Composite API

[ Dai Bato Quach ](https://resources.advantco.com/knowledge-base/author/dai-bato-quach)  Oct 6, 2021 6:54:26 PM

 

 

![A detail look at the Salesforce Composite API](https://blogs.sap.com/wp-content/uploads/2020/03/1.AdvantcoAdapterIntegrationDiagram.png)

 

Doing data integration with Salesforce is not simple. We have to understand API objects which are analogous to database tables and KSQL to extract data from Salesforce, and different types of API set and when to use appropriately, and the concept of External Id… and limit of API calls.

With the Advantco Salesforce Adapter, we simplify the connectivity and transparently consume different API sets, so it makes the implementation more straightforward and faster.

 

**The problem**

Trying to make multiple API calls for a “simple” task and get exceeded API request limit?

Let examine an example of the sales order. SAP sends an sales order with a header and two order lines. It is not a simple example if we don’t want to say it’s a challenge in integration without adapter support.

We manually take care of the access token for every subsequence request calls to Salesforce by using Netweaver BPM or Java Mapping, and manually create mapping schema for each Salesforce object for REST/SOAP API calls…

To create an order header and several order lines, we need at least two requests to Salesforce. The first is to create the order header. In the second request, it looks up the created order header and then creates order lines. So we have to make sure these two requests execute in the right sequence, no other way.

![A detail look at the Salesforce Composite API](https://blogs.sap.com/wp-content/uploads/2020/03/2.SeparateMapping.png)

The consequence of this restriction makes orders queue up when one of them failed in transmission to Salesforce.

In high throughput time, we may get the error of exceeding the API request limit if the number of requests is not managed well.

 

**The solution**

With the Advantco Salesforce adapter, the adapter supports session reuse to reduce the number of login call to Salesforce. So we maintain the connection and make a subsequent request in a single channel. It makes the integration flow clean, neither BPM needed nor an extra Java mapping to maintain the access token.

The choice of different types of API set is not a problem now. The adapter will do it. It’ll automatically select the appropriate API according to the feature we are using.

The schema is generated from the Advantco Salesforce Workbench, we don’t cover it in this topic, but it provides a ton of features such as Schema generation, SOQL editor, APEX client generator, Outbound Messaging (OBM)…

 

The implementation is faster and easier. But the queue up issue still.

You may know the Composite API. It helps to improve the performance by reducing round trip requests to Salesforce and minimize the number of API calls by batching up multiple calls to a single one.

With the Composite API support, we combine order header and order lines to a single request. It solves the problem. We don’t have to maintain the sequence of separate requests as earlier, so no more queue up and the transaction of each order is free from the other.

More important, it’s a lot easier to have a consistent transaction with the Composite request. Each batch of the Composite request can have up to 25 subrequests, and the batch is rolled back when an error occurs while processing a subrequest. It’s an optional configuration from the adapter.

The channel configuration using the Composite API.

![A detail look at the Salesforce Composite API](https://blogs.sap.com/wp-content/uploads/2020/03/3.ChannelConfigWithComposite.png)

 

The sample payload of the Composite request. The only difference from the payload of another API set is the field “referenceId”.

![A detail look at the Salesforce Composite API](https://blogs.sap.com/wp-content/uploads/2020/03/4.SamplePayloadOfComposite.png)

 

*Look up the order header Id with the syntax “@{refQueryOrder.records[0].Id}”*

The sample of message mapping.

![A detail look at the Salesforce Composite API](https://blogs.sap.com/wp-content/uploads/2020/03/5.MessageMapping.png)

 

**Conclusion**

So it’s straightforward to implement an integration scenario of sales order with the Composite API and the Advantco Salesforce Adapter.

In the real scenario, we may need to delete unused order lines along with adding new order lines and updating the existing lines. The sample payload we are using the operation UPSERT it means it already takes care of adding and updating existing, we need to add another subrequest of OrderDetail with an operation DELETE to delete unused order lines.

**References**

Advantco Salesforce Adapter [https://https://www.advantco.com/sap-integration-adapters/sap-salesforce-integration](https://www.advantco.com/sap-integration-adapters/sap-salesforce-integration)

Salesforce Composite Resource [https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite.htm](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite.htm)

 

Please reach out to our sales team at [sales@advantco.com](mailto:sales@advantco.com) if you have any questions.

[Salesforce](https://resources.advantco.com/knowledge-base/tag/salesforce), [Salesforce PO](https://resources.advantco.com/knowledge-base/tag/salesforce-po), [Salesforce-PO-CPI](https://resources.advantco.com/knowledge-base/tag/salesforce-po-cpi)

## Read On

[![](https://resources.advantco.com/hs-fs/hubfs/Imported_Blog_Media/pic0.png?width=352&name=pic0.png) ](https://resources.advantco.com/knowledge-base/content/advantco-salesforce-apex-addon-exposing-apex-rest-services-in-3-steps)

### [Advantco Salesforce APEX AddOn –exposing APEX REST services in 3 steps](https://resources.advantco.com/knowledge-base/content/advantco-salesforce-apex-addon-exposing-apex-rest-services-in-3-steps)

**Introduction**

The Salesforce adapter for SAP PI/PO or CPI generates schemas for multiple...

### [Advantco SFDC Adapter 1.0 Certified as Powered by SAP NetWeaver®](https://resources.advantco.com/knowledge-base/content/advantcosfdcadapter1.0certified)

### Integration of SAP® Software with Salesforce.comCombine Two Leading Business Solutions to Give...

[![](https://resources.advantco.com/hs-fs/hubfs/Imported_Blog_Media/ws_scenario_290031.jpg?width=352&name=ws_scenario_290031.jpg) ](https://resources.advantco.com/knowledge-base/content/ws-adapter-for-sap-process-orchestration)

### [Web Services Adapter for SAP Process Orchestration](https://resources.advantco.com/knowledge-base/content/ws-adapter-for-sap-process-orchestration)

** Overview **

SAP Process Orchestration is available for awhile and it has been proven a solid...

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Dai Bato Quach",
    "url" : "https://resources.advantco.com/knowledge-base/author/dai-bato-quach"
  },
  "dateModified" : "2022-05-02T18:58:35.765Z",
  "datePublished" : "2021-10-06T22:54:26.000Z",
  "headline" : "A detail look at the Salesforce Composite API",
  "image" : [ "https://blogs.sap.com/wp-content/uploads/2020/03/1.AdvantcoAdapterIntegrationDiagram.png" ],
  "mainEntityOfPage" : {
    "@id" : "https://resources.advantco.com/knowledge-base/a-detail-look-at-the-salesforce-composite-api",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://resources.advantco.com/hubfs/Advantco%20logo%20AAC%20V1%20Ai%20file%201.png"
    },
    "name" : "Advantco International"
  }
}
```

```json
{
  "@context" : "https://schema.org",
  "@type" : "NewsArticle",
  "author" : [ {
    "@type" : "Person",
    "name" : "Dai Bato Quach",
    "url" : "https://resources.advantco.com/knowledge-base/author/dai-bato-quach"
  } ],
  "dateModified" : "2022-05-02T18:58:35",
  "datePublished" : "2021-10-06T22:54:26",
  "headline" : "A detail look at the Salesforce Composite API",
  "image" : [ "https://blogs.sap.com/wp-content/uploads/2020/03/1.AdvantcoAdapterIntegrationDiagram.png" ]
}
```

```json
{
        "@context": "http://schema.org",
        "@type": "Organization",
        "mainEntityOfPage":{
             "@type":"WebPage",
             "@id":"https://resources.advantco.com/knowledge-base/a-detail-look-at-the-salesforce-composite-api",
             "description": "So it’s straightforward to implement an integration scenario of sales order with the Composite API and the Advantco Salesforce Adapter.
The sample payload we are using the operation UPSERT it means it already takes care of adding and updating existing, we need to add another subrequest of OrderDetail with an operation DELETE to delete unused order lines."
        },
        "url": "https://www.advantco.com/",
        "logo": "https://6260070.fs1.hubspotusercontent-na1.net/hubfs/6260070/Advantco%20logo%20AAC%20V1%20Ai%20file%201.png",
        "image": "https://www.advantco.com/hs-fs/hubfs/unnamed%20(2).webp?width=450&height=60&name=unnamed%20(2).webp",
        "name": "Advantco International",
        "alternateName": "advantco",
         "naics": "513210",
         "description": "Feature rich Advantco adapters integrates SAP &amp; Oracle system with top enterprise platforms like Kafka, Salesforce, Azure, and more.",
        "address": {
             "@type": "PostalAddress",
             "streetAddress": "1235 East Blvd, Suite E #382 ",
             "addressLocality": "Charlotte",
             "addressRegion": "NC",
             "addressCountry": "United States",
             "postalCode": "28203"
        },
        "areaServed": {
             "@type": "GeoCircle",
             "geoMidpoint": {
                  "@type": "GeoCoordinates",
                  "latitude": "40.75996223497667",
                  "longitude": "-73.98761007334504"
             },
             "geoRadius": "150 km"
        },
        "telephone": "",
        "email": "webadmin@advantco.com",
        "sameAs": [
             "https://www.linkedin.com/company/advantco-international-llc"
             
        ]
   }
```

```json
{
  "@context" : "https://schema.org",
  "@type" : "WebPage",
  "about" : [ {
    "@id" : "https://resources.advantco.com/knowledge-base/content/advantco-pre-packaged-content-solution",
    "@type" : "WebPage"
  }, {
    "@id" : "https://www.advantco.com/sap-hana-sdi-integration-adapters/sap-hana-sdi-salesforce-integration",
    "@type" : "WebPage"
  }, {
    "@id" : "https://resources.advantco.com/knowledge-base/salesforce-integration-common-requirements-and-use-cases",
    "@type" : "WebPage"
  }, {
    "@id" : "https://resources.advantco.com/knowledge-base/the-top-5-advantages-of-sap-and-salesforce-integration",
    "@type" : "WebPage"
  }, {
    "@id" : "https://www.advantco.com/sap-integration-adapters/sap-salesforce-integration",
    "@type" : "WebPage"
  } ],
  "mainEntity" : {
    "@type" : "WebPage"
  },
  "url" : "https://www.advantco.com/sap-integration-adapters/sap-salesforce-integration"
}
```

```json
{
  "@context" : "https://schema.org",
  "@type" : "WebPage",
  "about" : [ {
    "@id" : "https://resources.advantco.com/knowledge-base/receiving-events-from-dynamics-365-crm-using-webhooks",
    "@type" : "WebPage"
  }, {
    "@id" : "https://resources.advantco.com/knowledge-base/content/microsoft-dynamics-crm-adapter-for-sap-process-orchestration-and-sap-integration-suite-now-available-on-sap-store",
    "@type" : "WebPage"
  }, {
    "@id" : "https://resources.advantco.com/knowledge-base/content/adapters-for-sap-hci-integration-with-ms-dynamics-crm-and-rabbitmq",
    "@type" : "WebPage"
  }, {
    "@id" : "https://resources.advantco.com/knowledge-base/content/sap-cloud-platform-integration-enhancing-the-third-party-application-connectivity-with-new-offerings",
    "@type" : "WebPage"
  } ],
  "mainEntity" : {
    "@type" : "WebPage"
  },
  "url" : "https://www.advantco.com/sap-integration-adapters/sap-microsoft-dynamics-integration"
}
```

```json
{
  "@context" : "https://schema.org",
  "@type" : "WebPage",
  "about" : [ {
    "@id" : "https://resources.advantco.com/knowledge-base/content/sap-cloud-platform-integration-enhancing-the-third-party-application-connectivity-with-new-offerings",
    "@type" : "WebPage"
  }, {
    "@id" : "https://resources.advantco.com/knowledge-base/content/using-advantco-aws-adapter-to-integrate-sap-and-aws-business-environments",
    "@type" : "WebPage"
  }, {
    "@id" : "https://resources.advantco.com/knowledge-base/content/integrating-sap-and-aws-business-environments-with-the-advantco-aws-adapter",
    "@type" : "WebPage"
  }, {
    "@id" : "https://resources.advantco.com/knowledge-base/product/adapter/aws",
    "@type" : "WebPage"
  } ],
  "mainEntity" : {
    "@type" : "WebPage"
  },
  "url" : "https://www.advantco.com/sap-integration-adapters/sap-aws-integration"
}
```

```json
{
  "@context" : "https://schema.org",
  "@type" : "WebPage",
  "about" : [ {
    "@id" : "https://resources.advantco.com/knowledge-base/content/google-cloud-platform-adapter-from-advantco-international-now-available-on-sap-store",
    "@type" : "WebPage"
  }, {
    "@id" : "https://resources.advantco.com/knowledge-base/product/adapter/google-cloud-platform-adapter-for-sap-cpi",
    "@type" : "WebPage"
  }, {
    "@id" : "https://resources.advantco.com/knowledge-base/content/advantco-google-cloud-platform-adapter-integrating-sap-with-gcp",
    "@type" : "WebPage"
  }, {
    "@id" : "https://resources.advantco.com/knowledge-base/content/advantco-google-cloud-platform-adapter-integrating-sap-with-gcp",
    "@type" : "WebPage"
  } ],
  "mainEntity" : {
    "@type" : "WebPage"
  },
  "url" : "https://www.advantco.com/sap-integration-adapters/sap-google-cloud-integration"
}
```

```json
{
  "@context" : "https://schema.org",
  "@type" : "WebPage",
  "about" : [ {
    "@id" : "https://resources.advantco.com/knowledge-base/consumer-electronics-retailer-turns-to-advantco-amqp-azure-adapters",
    "@type" : "WebPage"
  }, {
    "@id" : "https://resources.advantco.com/knowledge-base/content/adapters-for-sap-hci-integration-with-ms-dynamics-crm-and-rabbitmq",
    "@type" : "WebPage"
  }, {
    "@id" : "https://resources.advantco.com/knowledge-base/content/integration-with-microsoft-azure-cloud",
    "@type" : "WebPage"
  }, {
    "@id" : "https://resources.advantco.com/knowledge-base/content/using-rabbitmqamqp-broker-for-extreme-high-volume-integration-with-sap-hybris-commerce-solution-with-sap-pipo",
    "@type" : "WebPage"
  } ],
  "mainEntity" : {
    "@type" : "WebPage"
  },
  "url" : "https://www.advantco.com/sap-integration-adapters/sap-azure-integration"
}
```

```json
{
  "@context" : "https://schema.org",
  "@type" : "WebPage",
  "about" : [ {
    "@id" : "https://resources.advantco.com/knowledge-base/lessons-learned-from-kafka-integrations-using-the-advantco-kafka-adapter-for-sap-integration-suite",
    "@type" : "WebPage"
  }, {
    "@id" : "https://resources.advantco.com/knowledge-base/content/kafka-adapter-for-sap-process-orchestration-and-sap-integration-suite-now-available-on-sap-store",
    "@type" : "WebPage"
  }, {
    "@id" : "https://resources.advantco.com/knowledge-base/content/advantco-kafka-adapter-enables-automobile-leader-to-use-big-data",
    "@type" : "WebPage"
  }, {
    "@id" : "https://resources.advantco.com/knowledge-base/content/kafka-adapter-with-avro-serialization-and-schema-registry",
    "@type" : "WebPage"
  } ],
  "mainEntity" : {
    "@type" : "WebPage"
  },
  "url" : "https://www.advantco.com/sap-integration-adapters/sap-kafka-integration"
}
```

```json
{
  "@context" : "https://schema.org",
  "@type" : "WebPage",
  "about" : [ {
    "@id" : "https://www.advantco.com/sap-integration-adapters/sap-salesforce-integration",
    "@type" : "WebPage"
  }, {
    "@id" : "https://www.advantco.com/sap-integration-adapters/sap-microsoft-dynamics-integration",
    "@type" : "WebPage"
  }, {
    "@id" : "https://www.advantco.com/sap-integration-adapters/sap-aws-integration",
    "@type" : "WebPage"
  }, {
    "@id" : "https://www.advantco.com/sap-integration-adapters/sap-google-cloud-integration",
    "@type" : "WebPage"
  }, {
    "@id" : "https://www.advantco.com/sap-integration-adapters/sap-azure-integration",
    "@type" : "WebPage"
  }, {
    "@id" : "https://www.advantco.com/sap-integration-adapters/sap-kafka-integration",
    "@type" : "WebPage"
  } ],
  "mainEntity" : {
    "@type" : "WebPage"
  },
  "url" : "https://www.advantco.com/"
}
```

```json
{
  "@context" : "https://schema.org/",
  "@type" : "BreadcrumbList",
  "itemListElement" : [ {
    "@type" : "ListItem",
    "item" : "https://advantco.com/",
    "name" : "Home",
    "position" : 1
  } ]
}
```

```json
{
  "@context" : "https://schema.org",
  "@type" : "ProfessionalService",
  "areaServed" : {
    "@type" : "GeoShape",
    "address" : {
      "@type" : "PostalAddress",
      "addressCountry" : "US"
    }
  },
  "description" : "Advantco helps organizations update and transform their integration landscapes by migrating to SAP BTP Integration Suite, enabling secure, scalable, cloud-native connectivity across SAP and non-SAP systems.",
  "image" : "https://www.advantco.com/hs-fs/hubfs/1-2.png?width=2000&height=1015&name=1-2.png",
  "logo" : "https://www.advantco.com/hs-fs/hubfs/unnamed%20(2).webp?width=300&height=40&name=unnamed%20(2).webp",
  "name" : "SAP BTP Integration Suite Migration Services",
  "provider" : {
    "@type" : "Organization",
    "contactPoint" : {
      "@type" : "ContactPoint",
      "availableLanguage" : [ "English" ],
      "contactType" : "customer support",
      "url" : "https://www.advantco.com/contact-us"
    },
    "logo" : "https://www.advantco.com/hs-fs/hubfs/unnamed%20(2).webp?width=300&height=40&name=unnamed%20(2).webp",
    "name" : "Advantco",
    "sameAs" : [ "https://www.linkedin.com/company/advantco-international-llc/", "https://x.com/AdvantcoAdapter" ],
    "url" : "https://www.advantco.com"
  },
  "serviceType" : [ "SAP BTP Integration Suite Migration", "Legacy Middleware Migration", "Clean Core & Customization Rationalization", "ABAP & API Development" ],
  "url" : "https://www.advantco.com/sap-btp-integration-suite-migration"
}
```

```json
{
  "@context" : "https://schema.org",
  "@type" : "ProfessionalService",
  "description" : "Advantco offers secure, scalable, and cost-optimized AWS cloud services — from landing zone setup and migration to managed operations and AI/ML solutions.",
  "image" : "https://www.advantco.com/hs-fs/hubfs/4%20(1)-1.png?width=316&height=300&name=4%20(1)-1.png",
  "logo" : "https://www.advantco.com/hs-fs/hubfs/unnamed%20(2).webp?width=300&height=40&name=unnamed%20(2).webp",
  "name" : "AWS Cloud Services",
  "provider" : {
    "@type" : "Organization",
    "contactPoint" : {
      "@type" : "ContactPoint",
      "availableLanguage" : [ "English" ],
      "contactType" : "customer support",
      "url" : "https://www.advantco.com/contact-us"
    },
    "logo" : "https://www.advantco.com/hs-fs/hubfs/unnamed%20(2).webp?width=300&height=40&name=unnamed%20(2).webp",
    "name" : "Advantco",
    "sameAs" : [ "https://www.linkedin.com/company/advantco-international-llc/", "https://x.com/AdvantcoAdapter" ],
    "url" : "https://www.advantco.com"
  },
  "serviceType" : [ "AWS Landing Zone Setup", "AWS Application Migration", "Managed AWS Cloud Operations", "AWS AI/ML Solutions" ],
  "url" : "https://www.advantco.com/aws-cloud-services"
}
```

```json
{
  "@context" : "https://schema.org",
  "@type" : "ProfessionalService",
  "areaServed" : {
    "@type" : "Country",
    "name" : "Worldwide"
  },
  "description" : "Advantco helps organizations harness the full power of Google Cloud by designing, migrating, and managing secure, scalable, and cost-optimized workloads end-to-end.",
  "image" : "https://www.advantco.com/hs-fs/hubfs/4%20(1)-1.png?width=316&height=300&name=4%20(1)-1.png",
  "logo" : "https://www.advantco.com/hs-fs/hubfs/unnamed%20(2).webp?width=300&height=40&name=unnamed%20(2).webp",
  "name" : "Google Cloud Services",
  "provider" : {
    "@type" : "Organization",
    "contactPoint" : {
      "@type" : "ContactPoint",
      "availableLanguage" : [ "English" ],
      "contactType" : "customer support",
      "url" : "https://www.advantco.com/contact-us"
    },
    "logo" : "https://www.advantco.com/hs-fs/hubfs/unnamed%20(2).webp?width=300&height=40&name=unnamed%20(2).webp",
    "name" : "Advantco",
    "sameAs" : [ "https://www.linkedin.com/company/advantco-international-llc/", "https://x.com/AdvantcoAdapter" ],
    "url" : "https://www.advantco.com"
  },
  "serviceType" : [ "Google Cloud Foundation Setup", "Application Migration & Modernization", "Managed Google Cloud Operations", "Data Analytics & AI/ML Solutions" ],
  "url" : "https://www.advantco.com/google-cloud-services"
}
```