SAP Knowledge Base Article - Public

2489933 - How to Create an Inline Payload Using OData Services?

Symptom

You have a requirment to add Service Request with Service Request Item and Service Request Service Reference Object or to add a Contact with Contact Personal Address and Contact Personal Postal Address but you are not sure about structure of payload

Resolution

You can create Inline Payload for your requirment. Below are few example to create the same

Note 1: The below payload is only for reference. You should create your own payload

Note 2:  If the cardinality between the two entity is multiple then brace will be array [{ }]
              If cardinality is single normal braces will work { }

 

1. Service Request

URL= <Tenant URL>/sap/c4c/Odata/v1/<Custom/Standard OData Service name>/ServiceRequestCollection

{
"Name":"Test Name",
"ProcessingTypeCode":"ABC",
"InstallationPointID":"123",
"PartyID":"123",
"PartyTypeCode":"123",
"ServiceIssueCategoryID": "A-B-C",
"ServiceRequestItem":[ 
 {
  "ID": "22222",
  "ServiceTransactionProcessingTypeCode": "0001",
  "UserServiceTransactionProcessingTypeCode": "SSS",
  "ProductID": "111111",
     "ExternalPricingRelevantIndicator": false,
         "QuantityMeasureUnitCode": "EA",
         "ServiceRequestExecutionLifeCycleStatusCode": "1",
        "PlannedNetAmount": "0.000000",
        "ProductAvailabilityConfirmationStatusCode": "2",
        "RequestedQuantity": "20.0"
                    }
          ],
    "ServiceRequestServiceReferenceObject":[
         {
        "ID": "22222",
        "ProductID": "111111"
          }
              ]
         }

2. Contact

URL= <Tenant URL>/sap/c4c/Odata/v1/<Custom/Standard OData Service name>/ContactCollection

{
 
"CategoryCode": "1",
 "MiddleName": "Middle","LastName": "Name",
 "ContactPersonalAddress": [
 {
 "Fax": "+123456789",
 "Phone": "+123456789",
 "ContactPersonalPostalAddress": [
 {
 "City": "Hamburg",
 "CountryCode": "DE",
 "HouseNumber": "123",
 "PostalCode": "12345",
 "State": "11",
 "Street": "TestStreet"
 }
 ]
 }
 ]

 

 

Keywords

KBA , LOD-CRM-INT-API , OData API (C4C Only) , How To

Product

SAP Cloud for Customer add-ins all versions