Managing Inventory

Creating Units

Once you have added an item to the real.de Onlineshop (see the Managing Product Data page), or if the item already exists on the site, you need to add your inventory information. There are two ways to do this:

  1. REST API: use the /units/ endpoint to upload inventory data one item at a time.
  2. CSV Files: use the /import-files/ REST API endpoint to send inventory data for multiple items at once.

Adding new inventory with the REST API

The simplest way to update your inventory data is to send JSON requests to the /units/ REST API endpoint. However, you can only update one item at a time this way, so far large volumes of changes, sending CSV files is more efficient.

To use this endpoint, you need to send a POST request with a JSON object that describes your inventory. Here's an example JSON object:

{
	"id_item": 35903281,
	"ean": "4011905437873",
	"condition": "new",
	"listing_price": 5999,
	"minimum_price": 5100,
	"amount": 200,
	"note": "Important notes for the customer",
	"location": "DE",
	"id_offer": "AB1234",
	"delivery_time_min": 2,
	"delivery_time_max": 5,
	"warehouse": "Superversand GmbH - Lager: 1",
	"shipping_group": "paket"
}

Here are explanations for each property of the object:

If you get a 201 response code, then the unit was created successfully. Otherwise, you should get a JSON object back with an error message in the message property, for example:

{
	"message": "Can not decode body"
}

Note: The POST /units/ endpoint should be used to add new units to an item. However, if you send data for an item for which you already have a unit, it might update the existing unit, instead of creating a new unit. Here are the rules for what happens:

When a new unit is created:

When an existing unit is updated:

Updating inventory with CSV files

Since you can only add or update one item at a time through the /units/ REST API endpoint, it can be more efficient to send a batch file with many units in it. There are two types if inventory CSV files:

  1. DUMP file: a full dump of your entire inventory. Details about this type of file are available on the Inventory CSV Files page.
  2. COMMAND file: a list of commands to alter your existing inventory in the real.de Onlineshop system. Details about this type of file are available on the Inventory CSV Files page.

Retrieving Units

You can get a list of all of your own units by sending a GET request to the /units/seller/ endpoint. Note: it can take several minutes for units to show up in this list after they are created.

Updating Units

To update a single unit, send a PATCH request to the /units/{id_unit}/ REST API endpoint, replacing {id_unit} in the URL with the internal real.de Onlineshop ID of the unit. The body of the request should contain a JSON object, similar to the JSON you send to create a new unit, with one difference: you cannot change the id_item or id_offer of a unit. To change those properties, you must delete the unit and create a new one.

Note: you can also update units by sending a POST request to the /units/ endpoint. See the above note on updating with a POST request for details.

Deleting Units

To delete a unit, send a DELETE request to the /units/{id_unit}/ endpoint, replacing {id_unit} in the URL with the internal real.de Onlineshop ID of the unit.

Retrieving Single Units

You can get the stored information for a single unit if you have its ID. Just send a GET request to the /units/{id_unit}/ endpoint, replacing {id_unit} in the URL with the internal real.de Onlineshop ID of the unit.