Setu Recipes: reusable digital workers across every app.Browse templates

Integrations / SAP Cloud for Customer

SAP Cloud for Customer

SAP Cloud for Customer (SAP Sales Cloud and Service Cloud version 1): list and search opportunities and individual customers through the standard OData v2 service c4codataapi, plus guarded generic read, create and update calls for any other collection. Connect with the technical user of a communication arrangement (HTTP basic). Only OpportunityCollection and IndividualCustomerCollection are confirmed by SAP's own pages; the generic calls cover the rest. Setu has not tested this against a live tenant. If Setu runs outside SAP's network allow-list, add its egress addresses to your tenant.

5 actions API key 3 read2 write Calls api.sap.com

Connect

TypeScript
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "sap_c4c" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();

Permissions requested

This toolkit uses a single credential and requests no scopes.

Actions

List individual customersreadsap_c4c.list_individual_customersList or search individual customers (IndividualCustomerCollection) in SAP Cloud for Customer with OData v2 options. SAP's KBA example filters by phone: Mobile eq '%2B1234567890' (a + must be written as %2B). Field names depend on your tenant: check $metadata or an unfiltered $top=1 call first.
InputTypeDescription
filterstringOptionalOData $filter
selectstringOptionalComma-separated fields
topintegerOptionalMaximum rows
skipintegerOptionalRows to skip
TypeScript
await setu.execute({
  userId: "user_1",
  action: "sap_c4c.list_individual_customers",
  input: {},
});
List opportunitiesreadsap_c4c.list_opportunitiesList or search opportunities (OpportunityCollection) in SAP Cloud for Customer. Supports OData v2 options from SAP's KBA: $filter (for example AccountID eq '1234', CreatedOn ge datetimeoffset'2017-01-01T00:00:00Z', startswith(CreatedBy,'P')), $search, $select (OpportunityID,AccountID), $orderby (CloseDate desc), $top, $skip, $expand.
InputTypeDescription
filterstringOptionalOData $filter
searchstringOptionalFree-text search over the search-enabled fields
selectstringOptionalComma-separated fields, e.g. OpportunityID,AccountID
orderbystringOptionale.g. CloseDate desc
topintegerOptionalMaximum rows
skipintegerOptionalRows to skip
expandstringOptionalNavigation property to expand, e.g. AccountMainAddress
TypeScript
await setu.execute({
  userId: "user_1",
  action: "sap_c4c.list_opportunities",
  input: {},
});
Create a record in a C4C collectionwritesap_c4c.odata_createGuarded POST that creates one entity in a collection of the SAP Cloud for Customer standard OData service, with a JSON body of the entity's fields, for example a lead or a service request. Per SAP KBA 2978556, communication arrangement users need no CSRF token for POST. The required fields differ per tenant and are UNVERIFIED here: read them from the tenant's $metadata first and never guess. Confirm with the user before creating.
InputTypeDescription
pathstringRequiredCollection path, e.g. /LeadCollection
bodyobjectRequiredEntity fields as JSON, using the property names from $metadata
TypeScript
await setu.execute({
  userId: "user_1",
  action: "sap_c4c.odata_create",
  input: {
    "path": "<path>",
    "body": {}
  },
});
Read any C4C OData collectionreadsap_c4c.odata_getGuarded GET to any collection of the SAP Cloud for Customer standard OData service (c4codataapi), for example /AccountCollection or /ServiceRequestCollection. Collection and field names for these are UNVERIFIED in SAP documents (third-party guides use AccountCollection, CorporateAccountCollection, LeadCollection, ServiceRequestCollection); check them in your tenant's $metadata. Send OData v2 options in query, such as {"$top": "5", "$format": "json"}. Path starts with /.
InputTypeDescription
pathstringRequiredCollection path, e.g. /LeadCollection or /OpportunityCollection('ObjectID')
queryobjectOptionalPlain OData options, e.g. {"$top": "5", "$format": "json"}
TypeScript
await setu.execute({
  userId: "user_1",
  action: "sap_c4c.odata_get",
  input: {
    "path": "<path>"
  },
});
Update a record in a C4C collectionwritesap_c4c.odata_updateGuarded PATCH that changes fields of one entity of the SAP Cloud for Customer standard OData service, addressed by key, for example /LeadCollection('ObjectID'). Per SAP KBA 2978556, communication arrangement users need no CSRF token for PATCH. Whether the service requires an If-Match ETag is UNVERIFIED: pass if_match (the entity's ETag, or *) only if the tenant answers 412 or 428. Confirm with the user first.
InputTypeDescription
pathstringRequiredEntity path with its key, e.g. /LeadCollection('00163E0A4F1A1EDA8B9F2F5C6E0C0002')
bodyobjectRequiredOnly the fields to change, as JSON
if_matchstringOptionalOptional ETag of the entity, or *
TypeScript
await setu.execute({
  userId: "user_1",
  action: "sap_c4c.odata_update",
  input: {
    "path": "<path>",
    "body": {}
  },
});