Advertisement
Guest User

Untitled

a guest
Feb 21st, 2021
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.59 KB | None | 0 0
  1. {
  2. "$schema": "http://json-schema.org/draft-03/schema#",
  3. "title": "Draft order post schema",
  4. "description": "A schema for creating a draft order.",
  5. "type": "object",
  6. "restdocs": "http://restdocs.e-conomic.com/#post-orders-drafts",
  7. "properties": {
  8. "date": {
  9. "type": "string",
  10. "format": "full-date",
  11. "pattern": "\\d{4}-\\d{2}-\\d{2}",
  12. "required": true,
  13. "description": "Order issue date. Format according to ISO-8601 (YYYY-MM-DD)."
  14. },
  15. "currency": {
  16. "type": "string",
  17. "pattern": "[a-zA-Z]{3}",
  18. "required": true,
  19. "description": "The ISO 4217 3-letter currency code of the order."
  20. },
  21. "exchangeRate": {
  22. "type": "number",
  23. "maxDecimal": 6,
  24. "maximum": 999999999999,
  25. "description": "The desired exchange rate between the order currency and the base currency of the agreement. The exchange rate expresses how much it will cost in base currency to buy 100 units of the order currency. If no exchange rate is supplied, the system will get the current daily rate, unless the order currency is the same as the base currency, in which case it will be set to 100."
  26. },
  27. "dueDate": {
  28. "type": "string",
  29. "format": "full-date",
  30. "pattern": "\\d{4}-\\d{2}-\\d{2}",
  31. "description": "The date the order is due for payment. This property is only used if the terms of payment is of type 'duedate', in which case it is a mandatory property. Format according to ISO-8601 (YYYY-MM-DD)."
  32. },
  33. "grossAmount": {
  34. "type": "number",
  35. "readOnly": true,
  36. "maxDecimal": 2,
  37. "description": "The total order amount in the order currency after all taxes and discounts have been applied."
  38. },
  39. "marginInBaseCurrency": {
  40. "type": "number",
  41. "maxDecimal": 2,
  42. "readOnly": true,
  43. "description": "The difference between the cost price of the items on the order and the sales net order amount in base currency."
  44. },
  45. "marginPercentage": {
  46. "type": "number",
  47. "maxDecimal": 2,
  48. "readOnly": true,
  49. "description": "The margin expressed as a percentage. If the net order amount is less than the cost price this number will be negative."
  50. },
  51. "netAmount": {
  52. "type": "number",
  53. "maxDecimal": 2,
  54. "readOnly": true,
  55. "description": "The total order amount in the order currency before all taxes and discounts have been applied."
  56. },
  57. "roundingAmount": {
  58. "type": "number",
  59. "maxDecimal": 2,
  60. "readOnly": true,
  61. "description": "The total rounding error, if any, on the order in base currency."
  62. },
  63. "vatAmount": {
  64. "type": "number",
  65. "maxDecimal": 2,
  66. "readOnly": true,
  67. "description": "The total amount of VAT on the order in the order currency. This will have the same sign as net amount"
  68. },
  69. "layout": {
  70. "type": "object",
  71. "description": "The layout used by the order.",
  72. "required": true,
  73. "properties": {
  74. "layoutNumber": {
  75. "type": "integer",
  76. "minimum": 1,
  77. "description": "A unique identifier of the layout."
  78. },
  79. "self": {
  80. "type": "string",
  81. "format": "uri",
  82. "description": "A unique reference to the layout resource."
  83. }
  84. }
  85. },
  86. "project": {
  87. "type": "object",
  88. "description": "The project the order is connected to.",
  89. "properties": {
  90. "projectNumber": {
  91. "type": "integer",
  92. "minimum": 1,
  93. "description": "A unique identifier of the project."
  94. },
  95. "self": {
  96. "type": "string",
  97. "format": "uri",
  98. "description": "A unique reference to the project resource."
  99. }
  100. }
  101. },
  102. "paymentTerms": {
  103. "type": "object",
  104. "required": true,
  105. "description": "The terms of payment for the order.",
  106. "properties": {
  107. "paymentTermsNumber": {
  108. "type": "integer",
  109. "minimum": 1,
  110. "description": "A unique identifier of the payment term."
  111. },
  112. "daysOfCredit": {
  113. "readonly": true,
  114. "type": "integer",
  115. "minimum": 0,
  116. "description": "The number of days of credit on the order. This field is only valid if terms of payment is not of type 'duedate"
  117. },
  118. "paymentTermsType": {
  119. "enum": ["net", "invoiceMonth", "paidInCash", "prepaid", "dueDate", "factoring", "invoiceWeekStartingSunday", "invoiceWeekStartingMonday", "creditcard", "avtaleGiro"],
  120. "readonly": true,
  121. "description": "The type the payment term."
  122. },
  123. "self": {
  124. "type": "string",
  125. "format": "uri",
  126. "description": "A unique reference to the payment term resource."
  127. }
  128. }
  129. },
  130. "customer": {
  131. "type": "object",
  132. "required": true,
  133. "description": "The customer of the order.",
  134. "properties": {
  135. "customerNumber": {
  136. "type": "integer",
  137. "maximum": 999999999,
  138. "minimum": 1,
  139. "description": "The customer id number. The customer id number can be either positive or negative, but it can't be zero."
  140. },
  141. "self": {
  142. "type": "string",
  143. "format": "uri",
  144. "description": "A unique reference to the customer resource."
  145. }
  146. }
  147. },
  148. "recipient": {
  149. "type": "object",
  150. "required": true,
  151. "description": "The actual recipient of the order. This may be the same info found on the customer (and will probably be so in most cases) but it may also be a different recipient. For instance, the customer placing the order may be ACME Headquarters, but the recipient of the order may be ACME IT.",
  152. "properties": {
  153. "name": {
  154. "type": "string",
  155. "maxLength": 250,
  156. "required": true,
  157. "description": "The name of the actual recipient."
  158. },
  159. "address": {
  160. "type": "string",
  161. "maxLength": 250,
  162. "description": "The street address of the actual recipient."
  163. },
  164. "zip": {
  165. "type": "string",
  166. "maxLength": 50,
  167. "description": "The zip code of the actual recipient."
  168. },
  169. "city": {
  170. "type": "string",
  171. "maxLength": 250,
  172. "description": "The city of the actual recipient."
  173. },
  174. "country": {
  175. "type": "string",
  176. "maxLength": 50,
  177. "description": "The country of the actual recipient."
  178. },
  179. "ean": {
  180. "type": "string",
  181. "maxLength": 13,
  182. "description": "The 'European Article Number' of the actual recipient."
  183. },
  184. "publicEntryNumber": {
  185. "type": "string",
  186. "maxLength": 40,
  187. "description": "The public entry number of the actual recipient."
  188. },
  189. "attention": {
  190. "type": "object",
  191. "description": "The person to whom this order is addressed.",
  192. "properties": {
  193. "customerContactNumber": {
  194. "type": "integer",
  195. "description": "Unique identifier of the customer employee."
  196. },
  197. "self": {
  198. "type": "string",
  199. "format": "uri",
  200. "description": "A unique reference to the customer employee."
  201. }
  202. }
  203. },
  204. "vatZone": {
  205. "type": "object",
  206. "required": true,
  207. "description": "Recipient vat zone.",
  208. "properties": {
  209. "vatZoneNumber": {
  210. "type": "integer",
  211. "description": "Unique identifier of the vat zone."
  212. },
  213. "self": {
  214. "type": "string",
  215. "format": "uri",
  216. "description": "A unique reference to the vat zone."
  217. }
  218. }
  219. },
  220. "mobilePhone": {
  221. "type": "string",
  222. "description": "The phone number the order was sent to (if applicable)."
  223. },
  224. "nemHandelType": {
  225. "enum": ["ean", "corporateIdentificationNumber", "pNumber", null],
  226. "description": "Chosen NemHandel type used for e-invoicing."
  227. }
  228. }
  229. },
  230. "deliveryLocation": {
  231. "type": "object",
  232. "description": "A reference to the place of delivery for the goods on the order",
  233. "properties": {
  234. "deliveryLocationNumber": {
  235. "type": "integer",
  236. "minimum": 1,
  237. "description": "A unique identifier for the delivery location."
  238. },
  239. "self": {
  240. "type": "string",
  241. "format": "uri",
  242. "description": "A unique reference to the delivery location resource."
  243. }
  244. }
  245. },
  246. "delivery": {
  247. "type": "object",
  248. "description": "The actual place of delivery for the goods on the order. This is usually the same place as the one referenced in the deliveryLocation property, but may be edited as required.",
  249. "properties": {
  250. "address": {
  251. "type": "string",
  252. "maxLength": 255,
  253. "description": "Street address where the goods must be delivered to the customer."
  254. },
  255. "zip": {
  256. "type": "string",
  257. "maxLength": 30,
  258. "description": "The zip code of the place of delivery."
  259. },
  260. "city": {
  261. "type": "string",
  262. "maxLength": 50,
  263. "description": "The city of the place of delivery"
  264. },
  265. "country": {
  266. "type": "string",
  267. "maxLength": 50,
  268. "description": "The country of the place of delivery"
  269. },
  270. "deliveryTerms": {
  271. "type": "string",
  272. "maxLength": 100,
  273. "description": "Details about the terms of delivery."
  274. },
  275. "deliveryDate": {
  276. "type": "string",
  277. "format": "full-date",
  278. "pattern": "\\d{4}-\\d{2}-\\d{2}",
  279. "description": "The date of delivery."
  280. }
  281. }
  282. },
  283. "notes": {
  284. "type": "object",
  285. "description": "Notes on the order.",
  286. "properties": {
  287. "heading": {
  288. "type": "string",
  289. "maxLength": 250,
  290. "description": "The order heading. Usually displayed at the top of the order."
  291. },
  292. "textLine1": {
  293. "type": "string",
  294. "maxLength": 1000,
  295. "description": "The first line of supplementary text on the order. This is usually displayed right under the heading in a smaller font."
  296. },
  297. "textLine2": {
  298. "type": "string",
  299. "maxLength": 1000,
  300. "description": "The second line of supplementary text in the notes on the order. This is usually displayed as a footer on the order."
  301. }
  302. }
  303. },
  304. "references": {
  305. "type": "object",
  306. "description": "Customer and company references related to this order.",
  307. "properties": {
  308. "customerContact": {
  309. "type": "object",
  310. "description": "The customer contact is a reference to the employee at the customer to contact regarding the order.",
  311. "properties": {
  312. "customerContactNumber": {
  313. "type": "integer",
  314. "minimum": 1,
  315. "description": "Unique identifier of the customer contact."
  316. },
  317. "self": {
  318. "type": "string",
  319. "format": "uri",
  320. "description": "A unique reference to the customer contact resource."
  321. }
  322. }
  323. },
  324. "salesPerson": {
  325. "type": "object",
  326. "description": "The primary sales person is a reference to the employee who sold the goods on the order.",
  327. "properties": {
  328. "employeeNumber": {
  329. "type": "integer",
  330. "minimum": 1,
  331. "description": "Unique identifier of the employee."
  332. },
  333. "self": {
  334. "type": "string",
  335. "format": "uri",
  336. "description": "A unique reference to the employee resource."
  337. }
  338. }
  339. },
  340. "vendorReference": {
  341. "type": "object",
  342. "description": "A reference to any second employee involved in the sale.",
  343. "properties": {
  344. "employeeNumber": {
  345. "type": "integer",
  346. "minimum": 1,
  347. "description": "Unique identifier of the employee."
  348. },
  349. "self": {
  350. "type": "string",
  351. "format": "uri",
  352. "description": "A unique reference to the employee resource."
  353. }
  354. }
  355. },
  356. "other": {
  357. "type": "string",
  358. "maxLength": 250,
  359. "description": "A text field that can be used to save any custom reference on the order."
  360. }
  361. }
  362. },
  363. "pdf": {
  364. "type": "object",
  365. "description": "References a pdf representation of this order.",
  366. "readonly": true,
  367. "properties": {
  368. "self": {
  369. "type": "string",
  370. "format": "uri",
  371. "description": "The unique reference of the pdf representation for this draft order."
  372. }
  373. }
  374. },
  375. "lines": {
  376. "title": "order lines",
  377. "type": "array",
  378. "description": "An array containing the specific order lines.",
  379. "items": {
  380. "type": "object",
  381. "description": "An array of the order lines that make up the order.",
  382. "properties": {
  383. "lineNumber": {
  384. "type": "integer",
  385. "description": "The line number is a unique number within the order.",
  386. "minimum": 1
  387. },
  388. "sortKey": {
  389. "type": "integer",
  390. "description": "A sort key used to sort the lines in ascending order within the order.",
  391. "minimum": 1
  392. },
  393. "description": {
  394. "type": "string",
  395. "maxLength": 2500,
  396. "description": "A description of the product or service sold. Please note, that when setting existing products, description field is required. While setting non-existing product, description field can remain empty."
  397. },
  398. "accrual": {
  399. "type": "object",
  400. "description": "The accrual for the order.",
  401. "properties": {
  402. "startDate": {
  403. "type": "string",
  404. "format": "full-date",
  405. "pattern": "\\d{4}-\\d{2}-\\d{2}",
  406. "description": "The start date for the accrual. Format: YYYY-MM-DD."
  407. },
  408. "endDate": {
  409. "type": "string",
  410. "format": "full-date",
  411. "pattern": "\\d{4}-\\d{2}-\\d{2}",
  412. "description": "The end date for the accrual. Format: YYYY-MM-DD."
  413. }
  414. }
  415. },
  416. "unit": {
  417. "type": "object",
  418. "description": "The unit of measure applied to the order line.",
  419. "properties": {
  420. "unitNumber": {
  421. "type": "integer",
  422. "description": "The unique identifier of the unit.",
  423. "minimum": 1
  424. },
  425. "self": {
  426. "type": "string",
  427. "format": "uri",
  428. "description": "A unique reference to the unit resource."
  429. }
  430. }
  431. },
  432. "product": {
  433. "type": "object",
  434. "description": "The product or service offered on the order line.",
  435. "properties": {
  436. "productNumber": {
  437. "type": "string",
  438. "maxLength": 25,
  439. "description": "The unique product number. This can be a stock keeping unit identifier (SKU)."
  440. },
  441. "self": {
  442. "type": "string",
  443. "format": "uri",
  444. "description": "A unique reference to the product resource."
  445. }
  446. }
  447. },
  448. "quantity": {
  449. "type": "number",
  450. "maxDecimal": 2,
  451. "description": "The number of units of goods on the order line."
  452. },
  453. "unitNetPrice": {
  454. "type": "number",
  455. "maxDecimal": 2,
  456. "description": "The price of 1 unit of the goods or services on the order line in the order currency."
  457. },
  458. "discountPercentage": {
  459. "type": "number",
  460. "maxDecimal": 2,
  461. "description": "A line discount expressed as a percentage."
  462. },
  463. "unitCostPrice": {
  464. "type": "number",
  465. "maxDecimal": 2,
  466. "description": "The cost price of 1 unit of the goods or services in the order currency."
  467. },
  468. "marginInBaseCurrency": {
  469. "type": "number",
  470. "maxDecimal": 2,
  471. "description": "The difference between the net price and the cost price on the order line in base currency."
  472. },
  473. "marginPercentage": {
  474. "type": "number",
  475. "maxDecimal": 2,
  476. "description": "The margin on the order line expressed as a percentage."
  477. },
  478. "departmentalDistribution": {
  479. "type": "object",
  480. "description": "A departmental distribution defines which departments this entry is distributed between. This requires the departments module to be enabled.",
  481. "properties": {
  482. "departmentalDistributionNumber": {
  483. "type": "integer",
  484. "minimum": 1,
  485. "description": "A unique identifier of the departmental distribution."
  486. },
  487. "distributionType": {
  488. "type": "string",
  489. "description": "Type of the distribution"
  490. },
  491. "self": {
  492. "type": "string",
  493. "format": "uri",
  494. "description": "A unique reference to the departmental distribution resource."
  495. }
  496. }
  497. }
  498. }
  499. }
  500. }
  501. }
  502. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement