openapi: 3.0.1 x-stoplight: id: ececw6vnw6xeg info: title: Product-Availability description: |- Product Availability API provides the date when a required quantity of product can be delivered to the defined address (ShipTo). Consequently, when using the service with your business process, you must inquire a SE Product Reference, a quantity of this product you want Schneider Electric to deliver, and the delivery address ID : ShipTo. contact: url: 'https://se.com' name: Contact Us email: distributorapiportal.global@se.com version: '2.1' servers: - url: 'https://api.qa.se.com/v2/sales-operation/product-availability' description: QA/test environment - url: 'https://api.se.com/v2/sales-operation/product-availability' description: Production server tags: - name: ProductAvailability paths: '/products/{product-reference}': get: tags: - ProductAvailability summary: To get Product Availability description: To get the availability of the product operationId: getProductAvailability parameters: - name: product-reference in: path description: Product Reference for which availability is requested. Eg; LXM28AU01M3X required: true schema: type: string example: LXM28AU01M3X - name: quantity in: query description: 'Quantity of Product for which availability is requested. Eg; 20, 30' required: true schema: type: number example: 20 - name: ship-to in: query description: 'This parameter is not mandatory, restricted to some countries. It represents the Ship to Address. The list of valid codes will be provided by your Schneider Electric contact. Eg; ''1000033834''' schema: maxLength: 10 pattern: '^[a-zA-Z0-9]*$' type: string example: '1000033834' - name: purchaser-id in: query description: 'This parameter is not mandatory and is only needed if you have multiple different Account ID as indicated by your Schneider Electric contact. Otherwise, please ignore this parameter. Eg; ''1000053298''' schema: maxLength: 10 pattern: '^[a-zA-Z0-9]*$' type: string example: '1000053298' - name: country in: query description: This parameter is not mandatory and is only required if your account spans over multiple countries. The expected value is an ISO country two letters' code. Eg; 'FR' schema: pattern: '^[A-Z][A-Z]$' type: string example: FR responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/AvailabilityResult' examples: example-1: value: availabilities: - deliveryDate: '2018-05-04T21:00:00.000Z' quantity: 12 - deliveryDate: '2018-05-15T21:00:00.000Z' quantity: 10 - deliveryDate: '2018-06-04T21:00:00.000Z' quantity: 18 productRef: LXM28AU01M3X quantity: 40 shortage: true currLeadTime: 15 shipTo: '1000033834' example: example: availabilities: - deliveryDate: '2018-05-04T21:00:00.000Z' quantity: 12 - deliveryDate: '2018-05-15T21:00:00.000Z' quantity: 10 - deliveryDate: '2018-06-04T21:00:00.000Z' quantity: 18 productRef: LXM28AU01M3X quantity: 40 shipTo: '1000033834' '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/ErrorResponse' Example: example: 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' '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/ErrorResponse' Example: example: 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' '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/ErrorResponse' Example: example: 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' '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/ErrorResponse' Example: example: 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' '429': description: Number of requests has exceeded the client's rate limits. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' Example: example: 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' '500': description: Requested operation encountered an unexpected server error. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' Example: example: 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' x-auth-type: Application & Application User x-code-samples: - lang: Java source: |- OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api-prd.schneider-electric.com/productavailability/1.0/products/{{productReference}}?quantity={{quantity}}&shipTo={{shipTo}}&purchaserID={{purchaserID}}&country={{country}}") .get() .addHeader("Accept", "application/json") .addHeader("Content-Type", "application/json") .addHeader("cache-control", "no-cache") .addHeader("Authorization", "Bearer {{Token}}") .build(); Response response = client.newCall(request).execute(); - lang: NodeJS source: |- var request = require("request"); var options = { method: 'GET', url: 'https://api-prd.schneider-electric.com/productavailability/1.0/products/{{productReference}}', qs: { quantity: '{{quantity}}', shipTo: '{{shipTo}}', purchaserID: '{{purchaserID}}', country: '{{country}}' }, headers: { 'Authorization': 'Bearer {{Token}}', 'cache-control': 'no-cache', 'Content-Type': 'application/json', Accept: 'application/json' } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); }); - lang: Ruby source: |- require 'uri' require 'net/http' url = URI("https://api-prd.schneider-electric.com/productavailability/1.0/products/{{productReference}}?quantity={{quantity}}&shipTo={{shipTo}}&purchaserID={{purchaserID}}&country={{country}}") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) request["Accept"] = 'application/json' request["Content-Type"] = 'application/json' request["cache-control"] = 'no-cache' request["Authorization"] = 'Bearer {{Token}}' response = http.request(request) puts response.read_body - lang: PHP source: |- setUrl('https://api-prd.schneider-electric.com/productavailability/1.0/products/{{productReference}}'); $request->setMethod(HTTP_METH_GET); $request->setQueryData(array( 'quantity' => '{{quantity}}', 'shipTo' => '{{shipTo}}', 'purchaserID' => '{{purchaserID}}', 'country' => '{{country}}' )); $request->setHeaders(array( 'Authorization' => 'Bearer {{Token}}', 'cache-control' => 'no-cache', 'Content-Type' => 'application/json', 'Accept' => 'application/json' )); try { $response = $request->send(); echo $response->getBody(); } catch (HttpException $ex) { echo $ex; } ?> x-throttling-tier: Unlimited components: schemas: AvailabilityResult: type: object description: 'Product Availability API includes 2 levels of services, according to the availability policy in the country referred, those are link to a predefine account number and country: Requested delivery date of a quantity of product (one element, Requested delivery date of a quantity of product (several elements according the order staging when imlemented :an order of 40 can be send in 3 steps, 12 then 10 then 18 like in the provided example)' example: availabilities: - deliveryDate: '2018-05-04T21:00:00.000Z' quantity: 12 - deliveryDate: '2018-05-15T21:00:00.000Z' quantity: 10 - deliveryDate: '2018-06-04T21:00:00.000Z' quantity: 18 productRef: LXM28AU01M3X quantity: 40 shipTo: '1000033834' x-examples: example-1: availabilities: - deliveryDate: '2018-05-04T21:00:00.000Z' quantity: 12 - deliveryDate: '2018-05-15T21:00:00.000Z' quantity: 10 - deliveryDate: '2018-06-04T21:00:00.000Z' quantity: 18 productRef: LXM28AU01M3X quantity: 40 shipTo: 1000033834 properties: productRef: type: string quantity: type: number shortage: type: boolean currLeadTime: type: integer availabilities: type: array items: type: object properties: deliveryDate: type: string description: Delivery Date (DateTime in UTC) based on calculated availability date or standard lead time provided by Schneider Electric logistic Offer quantity: type: number description: The number of product units that can be delivered at the associated DeliveryDate shipTo: type: string description: The ship to Address code ErrorResponse: title: Error Response - OAS2 required: - code - userMessage type: object properties: code: type: string 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. example: MISSING_FIELD or 12345 userMessage: type: string description: Human-readable general description of the error. example: 'Required field is missing: productSku' 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' description: Error response returned to the consumer when an HTTP error status has occurred. responses: Common_Oas2_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/ErrorResponse' Example: example: 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_Oas2_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/ErrorResponse' Example: example: 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_Oas2_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/ErrorResponse' Example: example: 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_Oas2_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/ErrorResponse' Example: example: 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_Oas2_429: description: Number of requests has exceeded the client's rate limits. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' Example: example: 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_Oas2_500: description: Requested operation encountered an unexpected server error. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' Example: example: 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' securitySchemes: OAuth2: type: oauth2 description: Oauth2 Application security flows: clientCredentials: tokenUrl: /token scopes: {} security: - OAuth2: []