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

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":"SAP Test 123",
"ProcessingTypeCode":"ZZZZ",
"InstallationPointID":"222",
"PartyID":"333",
"PartyTypeCode":"111",
"ServiceIssueCategoryID": "A-A-A",
"ServiceRequestItem":[ 
 {
  "ID": "22222",
  "ServiceTransactionProcessingTypeCode": "0001",
  "UserServiceTransactionProcessingTypeCode": "SSS",
  "ProductID": "111111",
     "ExternalPricingRelevantIndicator": false,
         "QuantityMeasureUnitCode": "EA",
         "ServiceRequestExecutionLifeCycleStatusCode": "1",
        "PlannedNetAmount": "0.000000",
        "ProductAvailabilityConfirmationStatusCode": "2",
        "RequestedQuantity": "20.00000000000000"
                    }
          ],
    "ServiceRequestServiceReferenceObject":[
         {
        "ID": "22222",
        "ProductID": "111111"
          }
              ]
         }

2. Contact

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

{
 
"CategoryCode": "1",
 "MiddleName": "V","LastName": "Beckerman",
 "ContactPersonalAddress": [
 {
 "Fax": "+1 6509278731",
 "Phone": "+1 650917431",
 "ContactPersonalPostalAddress": [
 {
 "City": "Hamburg",
 "CountryCode": "DE",
 "HouseNumber": "420",
 "PostalCode": "12345",
 "State": "11",
 "Street": "Eichholz"
 }
 ]
 }
 ]

 

 

Keywords

KBA , SRD-CC , Cross Components , How To

Product

SAP HYBRIS C4C 1705