openapi: 3.0.0 servers: - url: 'https://api.qa.se.com/productstocklevelchecker/1.1' description: QA/test environment - url: 'https://api.se.com/productstocklevelchecker/1.1' description: Production server info: title: Product-StockLevelChecker version: '1.1' description: The service providing the stock quantity for a distributor. The data is coming straightly from the ERP without any special SE systems. contact: name: Contact Us email: distributorapiportal.global@se.com url: 'http://se.com' paths: /products/stock-levels: post: responses: '200': description: OK content: application/json: schema: type: object properties: stockLevelDetails: type: array items: $ref: '#/components/schemas/multiple-stock-level-details' '400': $ref: '#/components/responses/Common_Oas3_400' '401': $ref: '#/components/responses/Common_Oas3_401' '403': $ref: '#/components/responses/Common_Oas3_403' '404': $ref: '#/components/responses/Common_Oas3_404' '429': $ref: '#/components/responses/Common_Oas3_429' '500': $ref: '#/components/responses/Common_Oas3_500' summary: 'Get the current stock quantity for multiple products. Supports Nordic countries (Norway, Sweden, Denmark, Finland)' operationId: multipleProductsStockLevel description: Provides the stock quantity for list of product references. requestBody: content: application/json: schema: type: object properties: productsList: type: array items: $ref: '#/components/schemas/multipleProductsList' examples: {} description: Please specify the product you want to know availability of and the type of product ID you have. tags: - stockLevel '/products/{productReference}': get: responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/stockAvailabilities' '400': $ref: '#/components/responses/Common_Oas3_400' '401': $ref: '#/components/responses/Common_Oas3_401' '403': $ref: '#/components/responses/Common_Oas3_403' '404': $ref: '#/components/responses/Common_Oas3_404' '429': $ref: '#/components/responses/Common_Oas3_429' '500': $ref: '#/components/responses/Common_Oas3_500' summary: 'Returns the stock availability for one product reference. Supports customers from US, Russia and India' description: 'This method supports customers from the US, Russia and India' operationId: singleProductStockLevel tags: - stockLevel parameters: - in: path name: productReference required: true schema: type: string - in: query name: shipTo schema: type: string - in: query name: purchaserID schema: type: string tags: - name: stockLevel security: - oauth2: [] components: schemas: multipleProductsList: title: MultipleProductsList type: object description: 'A set of JSON objects - one for each commercial reference. ' properties: productReference: type: string example: MGU2.002.18 description: 'The Schneider Electric product ID as you know it. Don''t forget to define the reference type in the other input field if it''s not Customer Material Number. May be a Customer Material Number, EL Number, EAN Code or SE Material Number.' referenceType: type: integer description: |- Please specify what product ID you are using. 1 = Customer Material Nr 2 = EL Number 3 = EAN Code 4 = Material Number enum: - 1 - 2 - 3 - 4 default: 1 example: 1 multiple-stock-level-details: title: MultipleStockLevelDetails type: object description: 'The response you will be getting from the service. Contains either stock availability or the message if the product is not locally stocked. ' properties: productReference: type: string example: BLVA1230987 description: Just a commercial reference as used for identirying the products. productDescription: type: string example: The very best product description: The description of the product - in your local language (if found) or in English. referenceType: type: integer enum: - 1 - 2 - 3 - 4 description: |- 1 = Customer Material Nr 2 = EL Number 3 = EAN Code 4 = Material Number example: 1 unitOfMeasure: type: string description: A UCUM unit of measure. Can be up to 3 symbols. maxLength: 3 example: M stockLevel: type: number example: 54 description: The available quantity; is returned with respect to your local country commercial rules. statusMessage: type: string example: The product is not locally stocked description: This message will appear if the product is not locally stocked or any other error appears. statusCode: type: string description: |- The status code of processing for this product reference. 200-00: "Stocked product"; please check the "stockLevel" value. 200-01: "Non-stock product"; this product is not stocked in SE plants. The stock level cannot be obtained. 200-02: "Invalid product reference type"; the reference type you've provided does not match the provided product reference. 200-03: "Product reference not found"; the product reference was not found. 200-04: "Internal error"; Please contact your local SE representative with this error code. 200-05: "Internal error"; Please contact your local SE representative with this error code. All the "500" error codes represent different kinds of internal errors. This means, that most likely you're doing everything right, but something is not set up properly on our side. Just let us know which one are you facing. 500-00: Internal error; Please contact your local SE representative with this error code. 500-01: Internal error; Please contact your local SE representative with this error code. 500-02: Internal error; Please contact your local SE representative with this error code. enum: - 200-01 - 200-02 - 200-03 - 200-04 - 200-05 required: - productReference stockAvailabilities: title: SingleProductStockLevelDetails description: This model describes the response of GET method for one reference. type: object properties: productRef: type: string example: A9F79106 description: Product Reference for which availability is requested. shipTo: type: string description: The ID of your address. example: '1000033834' warehouseList: type: array items: type: object properties: name: type: string description: Name of the warehouse example: RU01 Central DC stockLevel: type: integer description: Stock level of the product in the named warehouse example: 1231 Error: type: object title: Error Response description: Error response returned to the consumer when an HTTP error status has occurred. properties: code: type: string example: MISSING_FIELD or 12345 description: |- Service-defined error code which may be numeric or a string. Errors detected by the APIM platform result in the following codes. BAD_REQUEST (for 400) UNAUTHORIZED (for 401) FORBIDDEN (for 403) NOT_FOUND (for 404) GONE (for 410) PRECONDITION_FAILED (for 412) TOO_MANY_REQUESTS (for 429) INTERNAL_SERVER_ERROR (for 500) NOT_IMPLEMENTED (for 501) Any specific service validation errors would replace BAD_REQUEST. userMessage: type: string example: 'Required field is missing: productSku' description: Human-readable general description of the error. developerMessage: type: string description: Optional human-readable description of the error details. example: 'Product master API ParseException: required tag expected' moreInfo: type: string description: 'Optional link to error documentation, which has more information about the error.' format: uri example: 'https://example.com/product-master/v1/error/12345' required: - code - userMessage securitySchemes: oauth2: type: oauth2 description: Oauth2 Application security flows: clientCredentials: tokenUrl: '/token' scopes: get_stock_level: Retrieve stock level responses: Common_Oas3_400: description: 'Request is invalid and cannot be processed due one or more issues such as syntax errors, missing required fields, out of range values, conflicting query parameters, or unknown URI.' content: application/json: schema: $ref: '#/components/schemas/Error' examples: Example: value: code: BAD_REQUEST userMessage: 'Request is invalid and cannot be processed due one or more issues such as syntax errors, missing required fields, out of range values, conflicting query parameters, or unknown URI.' developerMessage: Request content is malformed or exceeded structural limits moreInfo: 'https://example.com/error/123' Common_Oas3_401: description: 'The client is not authorized to perform this request because its identity has not yet been established, or the token is invalid or has expired.' content: application/json: schema: $ref: '#/components/schemas/Error' examples: Example: value: code: UNAUTHORIZED userMessage: 'The client is not authorized to perform this request because its identity has not yet been established, or the token is invalid or has expired.' developerMessage: Invalid Access Token moreInfo: 'https://example.com/error/123' Common_Oas3_403: description: The client does not have permission to perform the requested action e.g. POST or DELETE. content: application/json: schema: $ref: '#/components/schemas/Error' examples: Example: value: code: FORBIDDEN userMessage: The client does not have permission to perform the requested action e.g. POST or DELETE. developerMessage: Http verb DELETE is not supported for path suffix /installed-products/track moreInfo: 'https://example.com/error/123' Common_Oas3_404: description: Requested resource does not exist on the server. It is assumed that the URI is valid for this type of resource. content: application/json: schema: $ref: '#/components/schemas/Error' examples: Example: value: code: NOT_FOUND userMessage: Requested resource does not exist on the server. It is assumed that the URI is valid for this type of resource. developerMessage: Records not found moreInfo: 'https://example.com/error/123' Common_Oas3_429: description: Number of requests has exceeded the client's rate limits. content: application/json: schema: $ref: '#/components/schemas/Error' examples: Example: value: code: TOO_MANY_REQUESTS userMessage: Number of requests has exceeded the client’s rate limits. developerMessage: Spike arrest violation moreInfo: 'https://example.com/error/123' Common_Oas3_500: description: Requested operation encountered an unexpected server error. content: application/json: schema: $ref: '#/components/schemas/Error' examples: Example: value: code: INTERNAL_SERVER_ERROR userMessage: Requested operation encountered an unexpected server error. developerMessage: 'Target service is unavailable, please try again later.' moreInfo: 'https://example.com/error/123'