Getting Started

METRO Webshop API

The purpose of this guide is to walk through basic process follow to start using METRO api.

Authentication and apijwt

Client JWT
METRO API calls are secured using JWT tokens. The tokens are received by calling client Login API.

HTTP
                          POST https://sandbox.metro-cc.com/webshop/v1/login/client
                          Content-Type: application/json
                          
                          {apiUser:, apiPw:}
                        

Customer JWT
Some of API calls needs to be done in scope of a customer, for those calls an additional customer JWT token is needed.

HTTP
                          POST https://sandbox.metro-cc.com/webshop/v1/login/user
                          Content-Type: application/json
                          
                          {username:, password:}
                        

Sample Usage
We've included an example usage of the API Search for articles: /webshop/v1/search – GET The API-JWT and Customer-JWT must be set as a HTTP header or as a Cookie. GET Parameters:

HTTP
                          GET https://sandbox.metro-cc.com/webshop/v1/search?storeId={storeId}
                          &customerId={customerId}&language=de-DE&country=DE&query={query}&rows=10&page=1
                          
                          customerjwt:{customerjwt}&apijwt={apijwt}
                        

Response Sample

ParamValueDescription
storeId{storeId}
customerID{customerID}
countryde-DE
query
rows10
page1
JSON
                          {
                            amount: 1828
                            page: 1
                            query: "query1"
                            rows: 10
                            totalPages: 183
                            results: [
                              {
                                bettyVariantId: "xxx-xxxxxxxxx",
                                name: "xxxxxxxxx",
                                imageUrl: "https://metro.scene7.com/is/image/metroDE/DE_PIM_178112001001_01",
                                bundles: [
                                  {
                                    bettyBundleId: " xxx-xxxxxxxxx ",
                                    description: " xxxxxxxxx ",
                                    isWeightArticle: false,
                                    longDescription: "xxxxxxxxx xxxxxxxxx xxxxxxxxx xxxxxxxxx xxxxx",
                                    sellingPriceInfo: {
                                      articleGross: 0.4,
                                      articleNet: 0.37,
                                      articleVatAmount: 0.03,
                                      currency: "EUR"
                                    }
                                  },
                                ]
                              },
                            ]
                          }
                        

Postman Collections

Postman is a popular API client that makes it easy for developers to create, share, test and document APIs.

Postman tool provides collections which lets you group individual requests together. Collections can organise these requests into folders which helps to document and test the API’s.

We have created the Webshop and Article availability API collections.

The postman collection for Webshop API can be downloaded from here and the environment file related to Webshop API can be downloaded from here

The postman collection for Article availability can be downloaded from here and the environment file realted to Article Availability API can be downloaded from here

How to Import and use the Collection

  • Download and install the Postman native app from Postman Website.
  • Click on Import at the top left corner of Postman app and import the collection and the environment json files.
  • Execute the Login folder API’s first by putting your credentials in the manage environment section on the top right corner and selecting the environment to get the API token. If you haven't requested for API key yet, you can get it here
  • Enjoy the world of METRO API’s :)

More information on importing and managing postman environments can be found here