Updating Supplier Custom Fields Using the Risk Category Information API for Supplier Risk Exposure

Use these steps to add custom field data to the existing suppliers in your risk solution.

Prerequisites

  1. Best practice is to create a new draft version in the configuration editor, create your custom fields, and activate the draft version before executing your API updates. The configuration interface allows you to add up to 300 custom fields. The custom fields can contribute to the risk exposure, or they can be displayed as information only and not contribute to the risk exposure.

  2. For each supplier, determine the SM Vendor ID as follows:

    1. From the dashboard, navigate to SM Administration. Available paths depend on the groups to which your user belongs.

      • In sites that include SM Administration, members of the SM Ops Administrator, SM ERP Admin, or Customer Administrator group can select Start of the navigation pathManage  Next navigation step SM AdministrationEnd of the navigation path.

      • Members of the Supplier Risk Manager group can access SM Administration from the SAP Ariba Supplier Risk dashboard: click the gear-shaped settings icon, then choose Start of the navigation pathImport data Next navigation step  Link to SM adminEnd of the navigation path.

    2. Click Data import or export.

    3. Depending whether you use SLP or SIPM, from the File type dropdown choose one of the following:

      • If you use SLP, choose Suppliers.

      • If you use SIPM, choose Suppliers from Sourcing.

    4. Click Export to generate a CSV file. You can find the SM vendor ID for each vendor in this file.

Context

Once your SAP Ariba Supplier Risk configuration is complete and you have the SM Vendor IDs of all relevant suppliers, construct a client application as follows to update supplier custom field values.

Procedure

  1. Construct a JSON query body to set the value for each supplier's custom fields, as follows:
    "value":[
    {
    	"smVendorId":"vendor_id_1",
    	"customFields":[
    		{
    			"fieldName":"FIELD_04",
    			"value":"value_of_field_04"
    		},
    		{
    			"fieldName":"FIELD_02",
    			"value":"value_of_field_02"
    		},
    		...
    		{
    			"fieldName":"FIELD_19",
    			"value":"value_of_field_19"
    		}
    	]
    },
    {
    	"smVendorId":"vendor_id_N",
    	"customFields":[
    		{
    			"fieldName":"FIELD_01",
    			"value":"value_of_field_01"
    		}, ...
    	]
    }	
    ]
    SMVendorId
    The SM Vendor ID that identifies the specific supplier. You found this ID in the prerequisite steps above.
    customFields
    This block contains pairs of fieldName/value pairs that assign values to each custom field for the specified supplier.
    fieldName
    Identifies which custom field value belongs to. Field names can include letters, numbers, and underscore.
    value
    The value of the custom field specified in fieldName. Ensure that this value matches the data type of the custom field as configured in the UI.
  2. Update the values of your suppliers' custom fields by using the PATCH /suppliers endpoint, passing the JSON body constructed earlier:
    PATCH {{runtime_url}}/suppliers?realm=myRealm
    {	
    	"value":[
    		{
    			"smVendorId":"Vendor123",
    			"customFields":[
    				{
    					"fieldName":"FIELD_01",
    					"value":"123454"
    				}
    			]
    		}
    	
    ]
    }
    This query assigns the value of the Vendor123 custom field assigned to field 1 in the UI, replacing the current value, if any, with 123454. If additional custom fields have been configured for Vendor123, the values for those custom fields are erased. Remember to assign values to all relevant custom fields.

Results

On success, the response includes a 201 success code. Within SAP Ariba Supplier Risk the values specified in your PATCH /suppliers request are assigned to their respective custom fields. If you assign a new value to a custom field that already had a value, the new value replaces the old one.

On failure, the response includes an error message. See Risk Category Information API for Supplier Risk Exposure Custom Field Data Error Messages for a list of possible errors.