Location Functionality

Multiple locations are a way of creating sub level assortments in your shop. The authentication is still shop based. The products you add will also be on shop level, but you can configure the status (active/inactive) and PDP of that product on a location level. Some use cases could be:

  • You have a different shop in a different location with the same products, but different stock levels.
  • You want different PDPs for different locations. Your dutch could potentially direct to .nl websites while the belgium website can use .be.
  • You have different prices for your webshop in another country.

Adding locations to your shop will be done during onboarding. Provide how many locations you want, and for which countries. To Configure products for multiple locations two CSV (locations/products/csv) calls has been added (POST and PUT) to handle updates in batches. Every row in the CSV represents an update of the product status for that SKU in a provided location. The required fields are:

  • SKU: of the product for which you want to change the status of.
  • ProductStatus: status you want your SKU to have, either being active or inactive.
  • LocationId: the location ID you received from us, for this location we will change the status.

The optional fields are:

  • ProductDetailPage_{language-code}-{COUNTRY-CODE}: multiple product detail pages with different languages can be added for the product at this location. Some examples row names are ‘ProductDetailPage_en-EN’ for English or ‘ProductDetailPage_de-AT for Austrian German. Both language and country codes must be two letters. Language and country codes must be lowercase and uppercase, respectively.
  • Price: number field to indicate how much a product will cost in a location

Consider the following CSV (click here for an example csv):

SKUProductStatusLocationIdProductDetailPage_en-ENProductDetailPage_de-ATPrice
123activeabchttps://example.com/englishhttps://example.com/deutsch99.99

This would set the product status for product “123” in location “abc” to active, sets the price to 99.99 and adds the mentioned product detail pages for languages en-EN and de-AT for this location.

It's very important to mention that this is always a PUT operation, it overwrites the product. Therefore consider the following CSV:

SKUProductStatusLocationId
123inactiveabc

This would set the product status for product “123” in location “abc” to inactive, while also removing the product detail pages and price, as it is not provided.

The calls are further documented in the swagger documentation of the gateway:
https://style-uat.pttrns.ai/eyewear-api/#/Products%20Csv/put_locations_products_csv.
https://style-uat.pttrns.ai/eyewear-api/#/Products%20Csv/post_locations_products_csv.
Both calls share the same functionality. The products that you try to update with this CSV-call should already exist in the database. Every row for which the SKU does not exists, gets ignored. It's therefore not adviced to upload your product location CSV immeadiatly after the main catalogue CSV.

Products that are new, and not yet approved by us can already be configured for your location but they will not appear yet in the recommendations. They will appear after our approval, but it's good to configure them ahead of us.

Using JSON-array to update location products

This is a PUT endpoint for updating multiple location product details in a single API call. The same fields are required here, being: sku, productStatus and locationId. The other fields are optional.

Example body for PUT request:

PUT: https://style-uat.pttrns.ai/eyewear-api/#/Products%20Batch/put_locations_products_batch

[
  {
    "locationId": "6347e7c74d09c31e5526ab5b",
    "sku": "12355",
    "productDetailPages": [
      {
        "url": "www.example.com",
        "language": "en-EN"
      }
    ],
    "price": 15.5,
    "productStatus": "active"
  }
]