Deleting Sales Layer Records Using the API

In order to delete data through API requests, it is necessary to configure an import connector on the cloud side of the Sales Layer PIM.

The best way to delete items in Sales Layer is sending the status of the item with the value X and mapping the field in the connector as shown in the following example:

“input_data” = [

	“products” = [

		[
			”product_reference” = “{unique register ID in Sales Layer}”
			“status” = “X”
		],
		…
	]
]
1

Using version 1.18 of the API, you can delete by creating a new structure called delete_data and sending it in the body of the call:

“delete_data” = [

	“{table name}” = [

		[
			“REF” = “{unique register reference}”
		],
		…
	],
	...
]

 

Responses and Errors

The response to the data update request will arrive within the JSON / XML parameter “input_response”. 

“input_response” = [
    “result”= (0 = unmodified, 1 = update completed, 2 = update denied)
    “errors” = [
        0 = “{error description}”,
        {n} = …
    ],
    “items_affected” = [
        “{table}” = {number of modified fields},
    ]
]