Skip to content

kaskadi/stocks-api

Repository files navigation

GitHub Actions workflows status

Deploy status Build status Docs generation status

CodeClimate


API endpoints

The origin and root path for this API is: https://api.klimapartner.net/stocks

The following endpoints are defined in this API:

/amz/request-update

Supported methods:

GET (target lambda → request-amz-stock-update)

Description:

This endpoint initialize a stock update for all Amazon stocks of Klimapartner GmbH.

Authorization:

Type Identity source
Cognito
  • method.request.header.Authorization

Query string parameters:

Key Default Description
code The code of the marketplace you would like to refresh stocks for. If nothing is specified, this will start an update process for all marketplaces.

Request body:

No body found for this method.

Examples:

Example #1

Request:

GET https://api.klimapartner.net/stocks/amz/request-update?code=DE

Headers:
  Authorization: Bearer COGNITO_ACCESS_TOKEN

Response:

Status code:
  200

Headers:
  Access-Control-Allow-Origin: *

Body:
  {
    "message": "Stock update successfully requested!"
  }
Example #2

Request:

GET https://api.klimapartner.net/stocks/amz/request-update

Headers:
  Authorization: Bearer COGNITO_ACCESS_TOKEN

Response:

Status code:
  200

Headers:
  Access-Control-Allow-Origin: *

Body:
  {
    "message": "Stock update successfully requested!"
  }
Example #3

Request:

GET https://api.klimapartner.net/stocks/amz/request-update?code=WRONG_MARKETPLACE_CODE

Headers:
  Authorization: Bearer COGNITO_ACCESS_TOKEN

Response:

Status code:
  400

Headers:
  Access-Control-Allow-Origin: *

Body:
  {
    "message": "Please provide a valid country code in your query string."
  }

/klima/request-update

Supported methods:

GET (target lambda → request-klima-stock-update)

Description:

This endpoint initialize a stock update for all in-house stocks at Klimapartner GmbH.

Authorization:

Type Identity source
Cognito
  • method.request.header.Authorization

Query string parameters:

No query string parameters found for this method.

Request body:

No body found for this method.

Examples:

Example #1

Request:

GET https://api.klimapartner.net/stocks/klima/request-update

Headers:
  Authorization: Bearer COGNITO_ACCESS_TOKEN

Response:

Status code:
  200

Headers:
  Access-Control-Allow-Origin: *

Body:
  {
    "message": "Stock update successfully requested!"
  }

API resources

The following lambda functions are used in this API:

The following layers are used in this API:

request-amz-stock-update

Name Sources Timeout Handler Layers
request-amz-stock-update
  • HTTP (GET)
  • SCHEDULE
30s handler

See configuration file for more details.

request-klima-stock-update

Name Sources Timeout Handler Layers
request-klima-stock-update
  • HTTP (GET)
  • SCHEDULE
30s handler

See configuration file for more details.

stocks-api-layer

Description

Layer for stocks-api

Dependencies

  • collmex-client, version: 1.12.1 (see on NPM)
  • mws-client, version: 1.1.3 (see on NPM)
  • kaskadi-stocks-utils (local utility)

See configuration file for more details.

Stack tags

You can use any tags (and their respective values) visible below to find ressources related to this stack on AWS. See here for more details.

Tag Value
app kaskadi
service stocks-api
logical-unit stocks
type schedule and http