Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Startax AS API
- This is the official repository for the Application Program Interface written for Startax AS and its customers.
- ## Features
- ### Product data query
- Provides a customer with basic information of a Startax Product object.
- To be used in conjunction with customer's own warehouse management system.
- #### Request
- ##### Headers
- ```
- "Content-Type": "application/json"
- "UID": "<Unique hash provided by an administrator>"
- ```
- ##### Body
- A list of case insensitive Strings to be queried
- @Min = 1
- @Max = 100
- ```
- {
- "query": ["product code 1", ... , "product code n"]
- }
- ```
- #### Response
- ##### Status codes
- ```
- 200 - OK - Successful request
- 400 - Bad Request - Invalid query
- 401 - Unauthorized - Invalid UID
- ```
- ##### Body
- Two NOT NULL arrays:
- found[Product 1, ..., Product n]
- notFound["product code 1", ..., "product code n"]
- ```
- {
- "found": [ // Empty [] if none found
- {
- "productCode": String,
- "name": String,
- "netRRPrice": Double,
- "customerNetPrice": Double,
- "stockAmount": Double,
- "exportData": Object { // null if not found
- "translation": String,
- "customsCode": String,
- "netWeight": Double,
- "manufacturingCountry": String
- }
- }
- ],
- "notFound": [String] // Empty [] if all found
- }
- ```
- #### Examples
- ##### Single product query returning a found product
- ```
- {
- "query": ["VUK35PUN"]
- }
- ```
- ```
- {
- "found": [
- {
- "productCode": "VUK35PUN",
- "name": "KAABEL PUN 35mm2 100M",
- "netRRPrice": 8.33,
- "customerNetPrice": 2.85,
- "stockAmount": 0,
- "exportData": {
- "translation": "Battery- Welding cable",
- "customsCode": "85443000",
- "netWeight": 0.39,
- "manufacturingCountry": "IT"
- }
- }
- ],
- "notFound": []
- }
- ```
- ##### Single product query returning a notFound product
- ```
- {
- "query": ["VUK38PUN"]
- }
- ```
- ```
- {
- "found": [],
- "notFound": [
- "VUK38PUN"
- ]
- }
- ```
- ##### Multiple product query returning found products
- ```
- {
- "query": ["VUK35PUN", "1605-NS1010", "1700-AT619"]
- }
- ```
- ```
- {
- "found": [
- {
- "productCode": "VUK35PUN",
- "name": "KAABEL PUN 35mm2 100M",
- "netRRPrice": 8.33,
- "customerNetPrice": 2.85,
- "stockAmount": 0,
- "exportData": {
- "translation": "Battery- Welding cable",
- "customsCode": "85443000",
- "netWeight": 0.39,
- "manufacturingCountry": "IT"
- }
- },
- {
- "productCode": "1605-NS1010",
- "name": "LED-KAUGTULI SEEKER10X 9-36V 40W REF. 30",
- "netRRPrice": 165.83,
- "customerNetPrice": 48.05,
- "stockAmount": 0,
- "exportData": null
- },
- {
- "productCode": "1700-AT619",
- "name": "TASKULAMP LEDWISE PRO 4 SUPERBEAM",
- "netRRPrice": 25.83,
- "customerNetPrice": 12.76,
- "stockAmount": -1,
- "exportData": null
- }
- ],
- "notFound": []
- }
- ```
- ##### Multiple product query returning notFound products
- ```
- {
- "query": ["VUK38PUN", "1605-NS2010", "1700-AT689"]
- }
- ```
- ```
- {
- "found": [],
- "notFound": [
- "VUK38PUN",
- "1605-NS2010",
- "1700-AT689"
- ]
- }
- ```
- ##### Multiple product query returning mixed results
- ```
- {
- "query": ["VUK35PUN", "1605-NS2010", "1700-AT619"]
- }
- ```
- ```
- {
- "found": [
- {
- "productCode": "VUK35PUN",
- "name": "KAABEL PUN 35mm2 100M",
- "netRRPrice": 8.33,
- "customerNetPrice": 2.85,
- "stockAmount": 0,
- "exportData": {
- "translation": "Battery- Welding cable",
- "customsCode": "85443000",
- "netWeight": 0.39,
- "manufacturingCountry": "IT"
- }
- },
- {
- "productCode": "1700-AT619",
- "name": "TASKULAMP LEDWISE PRO 4 SUPERBEAM",
- "netRRPrice": 25.83,
- "customerNetPrice": 12.76,
- "stockAmount": -1,
- "exportData": null
- }
- ],
- "notFound": [
- "1605-NS2010"
- ]
- }
- ```
- #### Notes
- All prices are net
- ## Built With
- * SpringMVC - Web framework
- * JPA - Data access framework
- * MySql - Database engine
- * Gradle - Dependency management
- * Tomcat - Hosting
- ## Authors
- * **Valdo Taevere** - <valdo.taevere@startax.net>
- <p align="center">Startax AS 2019</p>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement