--- basePath: "/productavailability/1.0" consumes: - "application/json" definitions: AvailabilityResult: description: "Result of an availability request stating the delivery date of the\ \ product to the ship-to address. The result is send in an array format to consider\ \ countries for which Staging orders are allowed :an order of 40 can be send\ \ in 3 steps, 12 then 10 then 18 like in the provided example" contact: url: "https://www.se.com" name: "Contact Us" email: "distributorapiportal.global@se.com" example: availabilities: - deliveryDate: "2018-05-04T21:00:00Z" quantity: 12 - deliveryDate: "2018-05-15T21:00:00Z" quantity: 10 - deliveryDate: "2018-06-04T21:00:00Z" quantity: 18 productRef: "LXM28AU01M3X" quantity: 40 shipTo: 1000033834 properties: availabilities: items: properties: deliveryDate: description: "Delivery Date (DateTime in UTC) based on calculated availability\ \ date or standard lead time provided by Schneider Electric logistic\ \ Offer" type: "string" quantity: description: "The number of product units that can be delivered at the\ \ associated DeliveryDate" type: "number" type: "object" type: "array" productRef: type: "string" quantity: type: "number" ship-to: description: "The ship to Address code" type: "string" type: "object" Error400: properties: errorCode: example: "BAD_REQUEST" type: "string" errorMessage: example: "Mandatory input missing" type: "string" required: - "errorCode" type: "object" Error401: description: "Missing Credentials" example: fault: code: 900902 description: "Missing Credentials" properties: fault: properties: code: example: 900902 type: "string" description: example: "Missing Credentials" type: "string" type: "object" type: "object" Error404: example: errorCode: "PRODUCT_NOT_FOUND" errorMessage: "This Product reference is not known" properties: errorCode: example: "PRODUCT_NOT_FOUND" type: "string" errorMessage: example: "This Product reference is not known" type: "string" required: - "errorCode" type: "object" Error500: properties: errorCode: example: "INTERNAL SERVER ERROR" type: "string" errorMessage: example: "This information is not available right now" type: "string" required: - "errorCode" type: "object" host: "api.preprod.se.com" info: description: "With Product Availability API v1.0 we are providing an access to our\ \ data 24/7 in real-time bringing higher efficiency while working with us. Having\ \ this API implemented, you will immediately get the date when Schneider Electric\ \ can deliver the requested amount of the product to your address." title: "ProductAvailability" version: "1.0" paths: /products/{productReference}: get: parameters: - description: "Product Reference for which availability is requested. Eg; LXM28AU01M3X" in: "path" name: "productReference" required: true type: "string" x-example: "LXM28AU01M3X" - description: "Quantity of Product for which availability is requested. Eg;\ \ 20, 30" in: "query" name: "quantity" required: true type: "number" x-example: 20 - 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'" in: "query" maxLength: 10 name: "shipTo" pattern: "^[a-zA-Z0-9]*$" required: false type: "string" x-example: "1000033834" - 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'" in: "query" maxLength: 10 name: "purchaserID" pattern: "^[a-zA-Z0-9]*$" required: false type: "string" x-example: "1000053298" - 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'" in: "query" name: "country" pattern: "^[A-Z][A-Z]$" required: false type: "string" x-example: "FR" produces: - "application/json" responses: "200": description: "OK. The result is send in an array format to consider countries\ \ for which Staging orders are allowed :an order of 40 can be send in\ \ 3 steps, 12 then 10 then 18 like in the provided example." schema: $ref: "#/definitions/AvailabilityResult" "400": description: "Mandatory input is missing" schema: $ref: "#/definitions/Error400" "401": description: "Invalid or missing credentials. \n\t Eg;{\"fault\":{\"code\"\ :\"900901,\"description\": \"Invalid credentials\"}} \n\t or \n\t {\"\ fault\":{\"code\":\"900902,\"description\": \"Missing credentials\"}}" schema: $ref: "#/definitions/Error401" "404": description: "\"An error to convey that the Availability could not be retrieved\ \ because of an invalid Product Ref or Purchaser ID or Ship To.\\n The\ \ possible Error Codes are: \n\t PRODUCT_NOT_FOUND \n\t PURCHASER_NOT_FOUND\ \ \n\t PRODUCT_NOT_AVAILABLE \n\t PRODUCT_REPLACED \n\t SHIP_TO_NOT_FOUND\"\ . \n\t Eg; {\"errorCode\":\"PRODUCT_NOT_FOUND,\"errorMessage\": \"This\ \ Product reference is not known\"} \n\t or \n\t {\"errorCode\":\"SHIP_TO_NOT_FOUND\"\ ,\"errorMessage\": \"ShipTo code is not known\"} \n\t or \n\t {\"errorCode\"\ :\"PURCHASER_NOT_FOUND\",\"errorMessage\": \"Purchaser ID does not exist\"\ } \n\t or \n\t {\"errorCode\":\"PRODUCT_NOT_AVAILABLE\",\"errorMessage\"\ : \"Product is not Available for Purchase\"} \n\t or \n\t {\"errorCode\"\ :\"PRODUCT_REPLACED\",\"errorMessage\": \"Product has been replaced\"}" schema: $ref: "#/definitions/Error404" "500": description: "The requested URL does not exists or the API is not available\ \ right now.\n\tEg;{\"errorCode\":\"INTERNAL SERVER ERROR,\"errorMessage\"\ : \"This information is not available right now\"}" schema: $ref: "#/definitions/Error500" summary: "To get Product Availability" tags: - "ProductAvailability" x-auth-type: "Application & Application User" x-code-samples: - lang: "Java" source: "OkHttpClient client = new OkHttpClient();\n\nRequest request = new\ \ Request.Builder()\n.url(\"https://api.qa.se.com/productavailability/1.0/products/{{productReference}}?quantity={{quantity}}&shipTo={{shipTo}}&purchaserID={{purchaserID}}&country={{country}}\"\ )\n.get()\n.addHeader(\"Accept\", \"application/json\")\n.addHeader(\"Content-Type\"\ , \"application/json\")\n.addHeader(\"cache-control\", \"no-cache\")\n.addHeader(\"\ Authorization\", \"Bearer {{Token}}\")\n.build();\n\nResponse response =\ \ client.newCall(request).execute();" - lang: "NodeJS" source: "var request = require(\"request\");\n\nvar options = { method: 'GET',\n\ \ url: 'https://api.qa.se.com/productavailability/1.0/products/{{productReference}}',\n\ \ qs: \n { quantity: '{{quantity}}',\n shipTo: '{{shipTo}}',\n \ \ purchaserID: '{{purchaserID}}',\n country: '{{country}}' },\n headers:\ \ \n { 'Authorization': 'Bearer {{Token}}',\n 'cache-control': 'no-cache',\n\ \ 'Content-Type': 'application/json',\n Accept: 'application/json'\ \ } };\n\nrequest(options, function (error, response, body) {\n if (error)\ \ throw new Error(error);\n\n console.log(body);\n});" - lang: "Ruby" source: "require 'uri'\nrequire 'net/http'\n\nurl = URI(\"https://api.qa.se.com/productavailability/1.0/products/{{productReference}}?quantity={{quantity}}&shipTo={{shipTo}}&purchaserID={{purchaserID}}&country={{country}}\"\ )\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\nhttp.verify_mode\ \ = OpenSSL::SSL::VERIFY_NONE\nrequest = Net::HTTP::Get.new(url)\nrequest[\"\ Accept\"] = 'application/json'\nrequest[\"Content-Type\"] = 'application/json'\n\ request[\"cache-control\"] = 'no-cache'\nrequest[\"Authorization\"] = 'Bearer\ \ {{Token}}'\n\nresponse = http.request(request)\nputs response.read_body" - lang: "PHP" source: "setUrl('https://api.qa.se.com/productavailability/1.0/products/{{productReference}}');\n\ \ $request->setMethod(HTTP_METH_GET);\n \n $request->setQueryData(array(\n\ \ 'quantity' => '{{quantity}}',\n 'shipTo' => '{{shipTo}}',\n 'purchaserID'\ \ => '{{purchaserID}}',\n 'country' => '{{country}}'\n ));\n \n $request->setHeaders(array(\n\ \ 'Authorization' => 'Bearer {{Token}}',\n 'cache-control' => 'no-cache',\n\ \ 'Content-Type' => 'application/json',\n 'Accept' => 'application/json'\n\ \ ));\n \n try {\n $response = $request->send();\n \n echo $response->getBody();\n\ \ } catch (HttpException $ex) {\n echo $ex;\n } ?>" x-throttling-tier: "Unlimited" security: - oauth2: [] produces: - "application/json" schemes: - "https" - "http" securityDefinitions: oauth2: description: "Oauth2 Application security" flow: "application" scopes: read_rebateLines: "access Quote rebate lines" tokenUrl: "https://api.preprod.se.com/token" type: "oauth2" security: - oauth2: [] swagger: "2.0"