Update commodities in a questionnaire via the SAP Ariba APIs

In this blog post I quickly explain how to update the commodities of a commodity type question in a supplier questionnaire.

In the Supplier Data API with Pagination documentation –, it is possible to find details on how to update answers to questions. Unfortunately, it only covers answers to simple questions and attachment type questions but what about commodity type questions?

So, how do I update commodity questions in a supplier questionnaire?

To have an idea of the body structure required by the API for a certificate type question, I used Chromium Developer tools and captured the request sent when updating the question. Within the request I extracted the item that belongs to the commodity type question and used that as a starting point.


Chromium developer tools – submitQuestionnaire

There are limitations on when you are able to update the answers of a questionnaire, e.g. can’t update an answer in any questionnaire that the supplier is currently acting on, make sure you are familiar with them. You can find the limitations here:

Below a sample request to update a commodity type question. Notice that we need to commodity Id and “pack them” in an array as it is a field that allows multiple values.

curl --location --request POST '' \
--header 'Content-Type: application/json' \
--header 'apikey: S9f5ap58UGqw9f5a8ANamn9f5aUEg9f5a' \
--header 'Authorization: Bearer 0bad03e4-1234-1234-6789-f2f835065be1' \
--data-raw '{ "answers": [ { "externalSystemCorrelationId": "KI_1211234", "multiValueAnswer": [ "53", "72" ] } ]

Once updated, we can retrieve the values via the API and there we will see the answers just posted to the API.


Commodity type question updated via API

I hope this quick blog post helps you when battling with the Supplier Data API with Pagination when trying to update commodity type questions :-).