Skip to content

Sending the Stock Update

To submit a stock/price update, the following endpoint is used and the stock update needs to be sent perdiocally to this endpoint:

https://merchants-connector-importer.zalandoapis.com/{Client ID}/{Stock File Name}

HTTP Request

  • PUT method

URL Parameters and Header

Parameter Type Example
Client ID String d329krpq
Stock File Name CSV 20181023_update.csv
API Key (x-api-key) String lXViWTzFic9sM8Qqe9Ew7JME8xTdBAOMJHdIjK7XkjQ00OWr

Requirements (MUST)

The request

  • Must be an HTTP PUT request.
  • Must contain the Client ID in the URL request ({Client ID} would be replaced). Example: d329krpq.
  • Must contain the stock file name that will be received ({Stock File Name} would be replaced), which can be different from your local file name. Example: 20181023_update.csv
  • Must include the stock CSV file.
  • Must contain the API Key in the headers (header name: x-api-key). Example: lXViWTzFic9sM8Qqe9Ew7JME8xTdBAOMJHdIjK7XkjQ00OWr.

Stores in multiple countries

If clients are operating in multiple countries each country will have a separate API Key and Client ID and are required to have separate stock feeds by country.

Code Samples

Shell

curl -v -X PUT https://merchants-connector-importer.zalandoapis.com/d329krpq/20181023_update.csv 
--upload-file 20181023_update.csv 
--header "x-api-key: lXViWTzFic9sM8Qqe9Ew7JME8xTdBAOMJHdIjK7XkjQ00OWr"

Powershell

Invoke-WebRequest `
-UseBasicParsing `
-Uri https://merchants-connector-importer.zalandoapis.com/d329krpq/20181023_update.csv  `
-Method PUT `
-InFile 20181023_update.csv `
-Headers @{'x-api-key'='lXViWTzFic9sM8Qqe9Ew7JME8xTdBAOMJHdIjK7XkjQ00OWr'}

Python

import requests

client_id = "d329krpq"
api_key = "lXViWTzFic9sM8Qqe9Ew7JME8xTdBAOMJHdIjK7XkjQ00OWr"

headers = {
    "x-api-key": api_key,
    "content-type": "application/csv",
    "cache-control": "no-cache",
}

file = "update.csv"
filename = "update.csv"

with open(file, "rb") as f:
    res = requests.put(
        f"https://merchants-connector-importer.zalandoapis.com/{client_id}/{filename}",
        headers=headers,
        data=f.read(),
    )

    if res.status_code == 200:
        print("Success")
    else:
        print("Failed")

Response

Response status of 200 (OK)

If the file upload is successful, the response status will be 200 (OK). A backend process will then pick up the task shortly and perform the updates if the file format and encoding is correct.