Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.78 KB | None | 0 0
  1. # Startax AS API
  2. This is the official repository for the Application Program Interface written for Startax AS and its customers.
  3.  
  4. ## Features
  5. ### Product data query
  6. Provides a customer with basic information of a Startax Product object.
  7. To be used in conjunction with customer's own warehouse management system.
  8.  
  9. #### Request
  10. ##### Headers
  11. ```
  12. "Content-Type": "application/json"
  13. "UID": "<Unique hash provided by an administrator>"
  14. ```
  15.  
  16. ##### Body
  17.  
  18. A list of case insensitive Strings to be queried
  19. @Min = 1
  20. @Max = 100
  21. ```
  22. {
  23. "query": ["product code 1", ... , "product code n"]
  24. }
  25. ```
  26.  
  27. #### Response
  28. ##### Status codes
  29.  
  30. ```
  31. 200 - OK - Successful request
  32. 400 - Bad Request - Invalid query
  33. 401 - Unauthorized - Invalid UID
  34. ```
  35.  
  36. ##### Body
  37.  
  38. Two NOT NULL arrays:
  39.  
  40. found[Product 1, ..., Product n]
  41.  
  42. notFound["product code 1", ..., "product code n"]
  43. ```
  44. {
  45. "found": [ // Empty [] if none found
  46. {
  47. "productCode": String,
  48. "name": String,
  49. "netRRPrice": Double,
  50. "customerNetPrice": Double,
  51. "stockAmount": Double,
  52. "exportData": Object { // null if not found
  53. "translation": String,
  54. "customsCode": String,
  55. "netWeight": Double,
  56. "manufacturingCountry": String
  57. }
  58. }
  59. ],
  60. "notFound": [String] // Empty [] if all found
  61. }
  62. ```
  63.  
  64. #### Examples
  65. ##### Single product query returning a found product
  66. ```
  67. {
  68. "query": ["VUK35PUN"]
  69. }
  70. ```
  71.  
  72. ```
  73. {
  74. "found": [
  75. {
  76. "productCode": "VUK35PUN",
  77. "name": "KAABEL PUN 35mm2 100M",
  78. "netRRPrice": 8.33,
  79. "customerNetPrice": 2.85,
  80. "stockAmount": 0,
  81. "exportData": {
  82. "translation": "Battery- Welding cable",
  83. "customsCode": "85443000",
  84. "netWeight": 0.39,
  85. "manufacturingCountry": "IT"
  86. }
  87. }
  88. ],
  89. "notFound": []
  90. }
  91. ```
  92.  
  93. ##### Single product query returning a notFound product
  94. ```
  95. {
  96. "query": ["VUK38PUN"]
  97. }
  98. ```
  99.  
  100. ```
  101. {
  102. "found": [],
  103. "notFound": [
  104. "VUK38PUN"
  105. ]
  106. }
  107. ```
  108. ##### Multiple product query returning found products
  109. ```
  110. {
  111. "query": ["VUK35PUN", "1605-NS1010", "1700-AT619"]
  112. }
  113. ```
  114.  
  115. ```
  116. {
  117. "found": [
  118. {
  119. "productCode": "VUK35PUN",
  120. "name": "KAABEL PUN 35mm2 100M",
  121. "netRRPrice": 8.33,
  122. "customerNetPrice": 2.85,
  123. "stockAmount": 0,
  124. "exportData": {
  125. "translation": "Battery- Welding cable",
  126. "customsCode": "85443000",
  127. "netWeight": 0.39,
  128. "manufacturingCountry": "IT"
  129. }
  130. },
  131. {
  132. "productCode": "1605-NS1010",
  133. "name": "LED-KAUGTULI SEEKER10X 9-36V 40W REF. 30",
  134. "netRRPrice": 165.83,
  135. "customerNetPrice": 48.05,
  136. "stockAmount": 0,
  137. "exportData": null
  138. },
  139. {
  140. "productCode": "1700-AT619",
  141. "name": "TASKULAMP LEDWISE PRO 4 SUPERBEAM",
  142. "netRRPrice": 25.83,
  143. "customerNetPrice": 12.76,
  144. "stockAmount": -1,
  145. "exportData": null
  146. }
  147. ],
  148. "notFound": []
  149. }
  150. ```
  151. ##### Multiple product query returning notFound products
  152. ```
  153. {
  154. "query": ["VUK38PUN", "1605-NS2010", "1700-AT689"]
  155. }
  156. ```
  157.  
  158. ```
  159. {
  160. "found": [],
  161. "notFound": [
  162. "VUK38PUN",
  163. "1605-NS2010",
  164. "1700-AT689"
  165. ]
  166. }
  167. ```
  168. ##### Multiple product query returning mixed results
  169. ```
  170. {
  171. "query": ["VUK35PUN", "1605-NS2010", "1700-AT619"]
  172. }
  173. ```
  174. ```
  175. {
  176. "found": [
  177. {
  178. "productCode": "VUK35PUN",
  179. "name": "KAABEL PUN 35mm2 100M",
  180. "netRRPrice": 8.33,
  181. "customerNetPrice": 2.85,
  182. "stockAmount": 0,
  183. "exportData": {
  184. "translation": "Battery- Welding cable",
  185. "customsCode": "85443000",
  186. "netWeight": 0.39,
  187. "manufacturingCountry": "IT"
  188. }
  189. },
  190. {
  191. "productCode": "1700-AT619",
  192. "name": "TASKULAMP LEDWISE PRO 4 SUPERBEAM",
  193. "netRRPrice": 25.83,
  194. "customerNetPrice": 12.76,
  195. "stockAmount": -1,
  196. "exportData": null
  197. }
  198. ],
  199. "notFound": [
  200. "1605-NS2010"
  201. ]
  202. }
  203. ```
  204.  
  205. #### Notes
  206. All prices are net
  207.  
  208. ## Built With
  209. * SpringMVC - Web framework
  210. * JPA - Data access framework
  211. * MySql - Database engine
  212. * Gradle - Dependency management
  213. * Tomcat - Hosting
  214.  
  215. ## Authors
  216. * **Valdo Taevere** - <valdo.taevere@startax.net>
  217.  
  218. <p align="center">Startax AS 2019</p>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement