Skip to Content
0
Apr 29 at 06:19 PM

API call to update a product using JSON request

191 Views

Hi,

I have been trying to update a product line in SAP Commissions using a PUT API call that takes request message in JSON format. Though I have mentioned the correct effective dates(product present in commissions in this effective dates, cross checked using a GET API call) in the request message, it throws an error as "There is no matching version for the given dates." a 400 bad request. Below is the request JSON message which I tried in postman.

JSON request:

[

{ "effectiveEndDate": "2200-01-01T00:00:00.000-08:00", "genericAttribute7": "BA", "genericAttribute6": null, "genericAttribute5": "updateGA5", "classifierId": "TEST_API4_005", "description": "Description updated for TEST_API4_005", "businessUnits": [], "classifierSeq": "3659174698603803", "name": "TEST_API4_005", "effectiveStartDate": "2020-11-01T01:00:00.000-08:00", "genericAttribute4": "updateGA4", "genericAttribute3": "TEST_API", "genericAttribute2": "TEST_API-HPE Complete 1", "genericDate1": "2021-02-04T00:00:00.000-08:00", "genericAttribute1": "2483"}]Also below is the JSON response message received successfully for this product's GET API call.{ "effectiveEndDate": "2200-01-01T00:00:00.000-08:00", "genericAttribute7": "BA", "selectorId": null, "genericAttribute6": null, "genericAttribute5": null, "classifierId": "TEST_API4_005", "description": "Description for TEST_API4_005", "businessUnits": [], "createdBy": "SAPC_Batch_User", "classifierSeq": "3659174698603803", "name": "TEST_API4_005", "effectiveStartDate": "2020-11-01T01:00:00.000-08:00", "modifiedBy": null, "etag": "1651250430145", "genericAttribute4": null, "genericAttribute3": "TEST_API", "genericAttribute2": "TEST_API-HPE Complete 1", "genericDate1": "2021-02-04T00:00:00.000-08:00", "createDate": "2022-04-21T10:32:02.000-07:00", "genericAttribute1": "2483"}
So even though I have mentioned the correct effective dates in the PUT call based on the response of GET call, it still throws me an error "There is no matching version for the given dates"May I know the mistake am making here or is there a different way to update a product?