fortnox-api 0.5.2 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (192) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/.rubocop.yml +9 -1104
  4. data/.travis.yml +22 -2
  5. data/Gemfile +3 -1
  6. data/Guardfile +4 -2
  7. data/README.md +2 -2
  8. data/Rakefile +3 -1
  9. data/bin/console +17 -3
  10. data/fortnox-api.gemspec +32 -27
  11. data/lib/fortnox/api.rb +17 -16
  12. data/lib/fortnox/api/circular_queue.rb +13 -7
  13. data/lib/fortnox/api/mappers.rb +29 -25
  14. data/lib/fortnox/api/mappers/article.rb +7 -6
  15. data/lib/fortnox/api/mappers/base.rb +18 -16
  16. data/lib/fortnox/api/mappers/base/from_json.rb +37 -30
  17. data/lib/fortnox/api/mappers/base/to_json.rb +39 -37
  18. data/lib/fortnox/api/mappers/customer.rb +7 -7
  19. data/lib/fortnox/api/mappers/default_delivery_types.rb +4 -2
  20. data/lib/fortnox/api/mappers/default_templates.rb +5 -4
  21. data/lib/fortnox/api/mappers/edi_information.rb +5 -4
  22. data/lib/fortnox/api/mappers/email_information.rb +5 -4
  23. data/lib/fortnox/api/mappers/invoice.rb +10 -8
  24. data/lib/fortnox/api/mappers/invoice_row.rb +12 -7
  25. data/lib/fortnox/api/mappers/order.rb +10 -7
  26. data/lib/fortnox/api/mappers/order_row.rb +13 -6
  27. data/lib/fortnox/api/mappers/project.rb +6 -4
  28. data/lib/fortnox/api/mappers/terms_of_payments.rb +17 -0
  29. data/lib/fortnox/api/mappers/unit.rb +17 -0
  30. data/lib/fortnox/api/models.rb +9 -5
  31. data/lib/fortnox/api/models/article.rb +68 -67
  32. data/lib/fortnox/api/models/base.rb +52 -36
  33. data/lib/fortnox/api/models/customer.rb +95 -94
  34. data/lib/fortnox/api/models/document.rb +186 -0
  35. data/lib/fortnox/api/models/invoice.rb +44 -44
  36. data/lib/fortnox/api/models/label.rb +5 -3
  37. data/lib/fortnox/api/models/order.rb +8 -8
  38. data/lib/fortnox/api/models/project.rb +10 -8
  39. data/lib/fortnox/api/models/terms_of_payments.rb +28 -0
  40. data/lib/fortnox/api/models/unit.rb +24 -0
  41. data/lib/fortnox/api/repositories.rb +9 -5
  42. data/lib/fortnox/api/repositories/article.rb +6 -4
  43. data/lib/fortnox/api/repositories/base.rb +49 -46
  44. data/lib/fortnox/api/repositories/base/loaders.rb +32 -36
  45. data/lib/fortnox/api/repositories/base/savers.rb +23 -21
  46. data/lib/fortnox/api/repositories/customer.rb +6 -4
  47. data/lib/fortnox/api/repositories/invoice.rb +6 -4
  48. data/lib/fortnox/api/repositories/order.rb +6 -4
  49. data/lib/fortnox/api/repositories/project.rb +6 -4
  50. data/lib/fortnox/api/repositories/terms_of_payments.rb +17 -0
  51. data/lib/fortnox/api/repositories/unit.rb +17 -0
  52. data/lib/fortnox/api/request_handling.rb +12 -12
  53. data/lib/fortnox/api/types.rb +62 -11
  54. data/lib/fortnox/api/types/default_delivery_types.rb +5 -3
  55. data/lib/fortnox/api/types/default_templates.rb +3 -1
  56. data/lib/fortnox/api/types/defaulted.rb +2 -2
  57. data/lib/fortnox/api/types/document_row.rb +41 -42
  58. data/lib/fortnox/api/types/edi_information.rb +10 -8
  59. data/lib/fortnox/api/types/email_information.rb +10 -8
  60. data/lib/fortnox/api/types/enums.rb +60 -47
  61. data/lib/fortnox/api/types/invoice_row.rb +8 -8
  62. data/lib/fortnox/api/types/model.rb +14 -10
  63. data/lib/fortnox/api/types/nullable.rb +7 -7
  64. data/lib/fortnox/api/types/order_row.rb +5 -5
  65. data/lib/fortnox/api/types/required.rb +5 -5
  66. data/lib/fortnox/api/types/sized.rb +14 -6
  67. data/lib/fortnox/api/version.rb +3 -1
  68. data/spec/fortnox/api/mappers/article_spec.rb +3 -1
  69. data/spec/fortnox/api/mappers/base/from_json_spec.rb +15 -13
  70. data/spec/fortnox/api/mappers/base/to_json_spec.rb +4 -3
  71. data/spec/fortnox/api/mappers/base_spec.rb +40 -35
  72. data/spec/fortnox/api/mappers/contexts/json_conversion.rb +12 -11
  73. data/spec/fortnox/api/mappers/customer_spec.rb +3 -1
  74. data/spec/fortnox/api/mappers/default_delivery_types_spec.rb +3 -1
  75. data/spec/fortnox/api/mappers/edi_information_spec.rb +4 -2
  76. data/spec/fortnox/api/mappers/email_information_spec.rb +4 -2
  77. data/spec/fortnox/api/mappers/examples/mapper.rb +17 -9
  78. data/spec/fortnox/api/mappers/invoice_row_spec.rb +8 -3
  79. data/spec/fortnox/api/mappers/invoice_spec.rb +4 -1
  80. data/spec/fortnox/api/mappers/order_row_spec.rb +9 -2
  81. data/spec/fortnox/api/mappers/order_spec.rb +4 -1
  82. data/spec/fortnox/api/mappers/project_spec.rb +3 -1
  83. data/spec/fortnox/api/mappers/terms_of_payments_spec.rb +16 -0
  84. data/spec/fortnox/api/mappers/unit_spec.rb +57 -0
  85. data/spec/fortnox/api/models/article_spec.rb +2 -0
  86. data/spec/fortnox/api/models/base_spec.rb +46 -38
  87. data/spec/fortnox/api/models/customer_spec.rb +2 -0
  88. data/spec/fortnox/api/models/examples/document_base.rb +5 -3
  89. data/spec/fortnox/api/models/examples/model.rb +12 -9
  90. data/spec/fortnox/api/models/invoice_spec.rb +2 -0
  91. data/spec/fortnox/api/models/order_spec.rb +2 -0
  92. data/spec/fortnox/api/models/project_spec.rb +2 -0
  93. data/spec/fortnox/api/models/terms_of_payments_spec.rb +9 -0
  94. data/spec/fortnox/api/models/unit_spec.rb +31 -0
  95. data/spec/fortnox/api/repositories/article_spec.rb +7 -5
  96. data/spec/fortnox/api/repositories/base_spec.rb +121 -100
  97. data/spec/fortnox/api/repositories/customer_spec.rb +7 -5
  98. data/spec/fortnox/api/repositories/examples/all.rb +5 -4
  99. data/spec/fortnox/api/repositories/examples/find.rb +50 -41
  100. data/spec/fortnox/api/repositories/examples/only.rb +14 -13
  101. data/spec/fortnox/api/repositories/examples/save.rb +23 -29
  102. data/spec/fortnox/api/repositories/examples/save_with_nested_model.rb +11 -11
  103. data/spec/fortnox/api/repositories/examples/save_with_specially_named_attribute.rb +11 -10
  104. data/spec/fortnox/api/repositories/examples/search.rb +15 -15
  105. data/spec/fortnox/api/repositories/invoice_spec.rb +8 -6
  106. data/spec/fortnox/api/repositories/order_spec.rb +8 -6
  107. data/spec/fortnox/api/repositories/project_spec.rb +7 -5
  108. data/spec/fortnox/api/repositories/terms_of_payments_spec.rb +30 -0
  109. data/spec/fortnox/api/repositories/unit_spec.rb +34 -0
  110. data/spec/fortnox/api/types/account_number_spec.rb +12 -9
  111. data/spec/fortnox/api/types/default_delivery_types_spec.rb +6 -4
  112. data/spec/fortnox/api/types/edi_information_spec.rb +9 -7
  113. data/spec/fortnox/api/types/email_information_spec.rb +8 -6
  114. data/spec/fortnox/api/types/email_spec.rb +27 -14
  115. data/spec/fortnox/api/types/enums_spec.rb +3 -1
  116. data/spec/fortnox/api/types/examples/document_row.rb +10 -8
  117. data/spec/fortnox/api/types/examples/enum.rb +29 -22
  118. data/spec/fortnox/api/types/examples/types.rb +8 -4
  119. data/spec/fortnox/api/types/housework_types_spec.rb +68 -0
  120. data/spec/fortnox/api/types/invoice_row_spec.rb +3 -1
  121. data/spec/fortnox/api/types/model_spec.rb +12 -9
  122. data/spec/fortnox/api/types/nullable_spec.rb +8 -6
  123. data/spec/fortnox/api/types/order_row_spec.rb +4 -2
  124. data/spec/fortnox/api/types/required_spec.rb +4 -2
  125. data/spec/fortnox/api/types/sized_spec.rb +18 -16
  126. data/spec/fortnox/api_spec.rb +45 -43
  127. data/spec/spec_helper.rb +9 -6
  128. data/spec/support/helpers.rb +3 -1
  129. data/spec/support/helpers/configuration_helper.rb +2 -0
  130. data/spec/support/helpers/dummy_class_helper.rb +7 -8
  131. data/spec/support/helpers/repository_helper.rb +2 -0
  132. data/spec/support/helpers/when_performing_helper.rb +3 -1
  133. data/spec/support/matchers.rb +2 -0
  134. data/spec/support/matchers/type.rb +3 -1
  135. data/spec/support/matchers/type/attribute_matcher.rb +15 -14
  136. data/spec/support/matchers/type/enum_matcher.rb +9 -7
  137. data/spec/support/matchers/type/have_account_number_matcher.rb +11 -9
  138. data/spec/support/matchers/type/have_country_code_matcher.rb +6 -4
  139. data/spec/support/matchers/type/have_currency_matcher.rb +4 -2
  140. data/spec/support/matchers/type/have_customer_type_matcher.rb +6 -4
  141. data/spec/support/matchers/type/have_default_delivery_type_matcher.rb +4 -2
  142. data/spec/support/matchers/type/have_discount_type_matcher.rb +4 -2
  143. data/spec/support/matchers/type/have_email_matcher.rb +11 -9
  144. data/spec/support/matchers/type/have_housework_type_matcher.rb +9 -0
  145. data/spec/support/matchers/type/have_nullable_date_matcher.rb +29 -29
  146. data/spec/support/matchers/type/have_nullable_matcher.rb +23 -21
  147. data/spec/support/matchers/type/have_nullable_string_matcher.rb +30 -32
  148. data/spec/support/matchers/type/have_sized_float_matcher.rb +4 -2
  149. data/spec/support/matchers/type/have_sized_integer_matcher.rb +4 -2
  150. data/spec/support/matchers/type/have_sized_string_matcher.rb +16 -15
  151. data/spec/support/matchers/type/have_vat_type_matcher.rb +4 -2
  152. data/spec/support/matchers/type/numeric_matcher.rb +25 -23
  153. data/spec/support/matchers/type/require_attribute_matcher.rb +36 -37
  154. data/spec/support/matchers/type/type_matcher.rb +18 -16
  155. data/spec/support/vcr_setup.rb +2 -0
  156. data/spec/vcr_cassettes/orders/{house_work_type_babysitting.yml → housework_type_babysitting.yml} +9 -10
  157. data/spec/vcr_cassettes/orders/{house_work_type_cleaning.yml → housework_type_cleaning.yml} +9 -10
  158. data/spec/vcr_cassettes/orders/{house_work_type_construction.yml → housework_type_construction.yml} +9 -10
  159. data/spec/vcr_cassettes/orders/{house_work_type_cooking.yml → housework_type_cooking.yml} +7 -7
  160. data/spec/vcr_cassettes/orders/{house_work_type_electricity.yml → housework_type_electricity.yml} +9 -10
  161. data/spec/vcr_cassettes/orders/{house_work_type_gardening.yml → housework_type_gardening.yml} +9 -10
  162. data/spec/vcr_cassettes/orders/{house_work_type_glassmetalwork.yml → housework_type_glassmetalwork.yml} +9 -10
  163. data/spec/vcr_cassettes/orders/{house_work_type_grounddrainagework.yml → housework_type_grounddrainagework.yml} +9 -10
  164. data/spec/vcr_cassettes/orders/{house_work_type_hvac.yml → housework_type_hvac.yml} +9 -10
  165. data/spec/vcr_cassettes/orders/{house_work_type_masonry.yml → housework_type_masonry.yml} +9 -10
  166. data/spec/vcr_cassettes/orders/{house_work_type_othercare.yml → housework_type_othercare.yml} +9 -10
  167. data/spec/vcr_cassettes/orders/{house_work_type_othercosts.yml → housework_type_othercosts.yml} +9 -10
  168. data/spec/vcr_cassettes/orders/{house_work_type_paintingwallpapering.yml → housework_type_paintingwallpapering.yml} +9 -10
  169. data/spec/vcr_cassettes/orders/{house_work_type_snowplowing.yml → housework_type_snowplowing.yml} +9 -10
  170. data/spec/vcr_cassettes/orders/{house_work_type_textileclothing.yml → housework_type_textileclothing.yml} +9 -10
  171. data/spec/vcr_cassettes/orders/{house_work_type_tutoring.yml → housework_type_tutoring.yml} +7 -7
  172. data/spec/vcr_cassettes/termsofpayments/all.yml +51 -0
  173. data/spec/vcr_cassettes/termsofpayments/find_failure.yml +45 -0
  174. data/spec/vcr_cassettes/termsofpayments/find_id_1.yml +46 -0
  175. data/spec/vcr_cassettes/termsofpayments/find_new.yml +46 -0
  176. data/spec/vcr_cassettes/termsofpayments/save_new.yml +45 -0
  177. data/spec/vcr_cassettes/termsofpayments/save_old.yml +46 -0
  178. data/spec/vcr_cassettes/units/all.yml +48 -0
  179. data/spec/vcr_cassettes/units/find_failure.yml +45 -0
  180. data/spec/vcr_cassettes/units/find_id_1.yml +46 -0
  181. data/spec/vcr_cassettes/units/find_new.yml +48 -0
  182. data/spec/vcr_cassettes/units/save_new.yml +47 -0
  183. data/spec/vcr_cassettes/units/save_old.yml +48 -0
  184. data/spec/vcr_cassettes/units/save_with_specially_named_attribute.yml +47 -0
  185. metadata +127 -88
  186. data/docs/account.rb +0 -59
  187. data/docs/extraction_script.js +0 -23
  188. data/docs/generation_script.rb +0 -43
  189. data/docs/json/account.json +0 -77
  190. data/lib/fortnox/api/models/document_base.rb +0 -189
  191. data/spec/fortnox/api/types/house_work_types_spec.rb +0 -64
  192. data/spec/support/matchers/type/have_house_work_type_matcher.rb +0 -7
@@ -23,7 +23,7 @@ http_interactions:
23
23
  Server:
24
24
  - nginx
25
25
  Date:
26
- - Tue, 25 Oct 2016 10:21:53 GMT
26
+ - Thu, 01 Mar 2018 13:58:14 GMT
27
27
  Content-Type:
28
28
  - application/json
29
29
  Connection:
@@ -31,17 +31,16 @@ http_interactions:
31
31
  Location:
32
32
  - orders
33
33
  X-Rack-Responsetime:
34
- - '88'
34
+ - '1015'
35
35
  X-Uid:
36
- - ac6f14d8
36
+ - be309de7
37
37
  X-Build:
38
- - 76600b8d0c
38
+ - bec4a33b2e
39
39
  body:
40
40
  encoding: UTF-8
41
- string: '{"Order":{"@url":"https:\/\/api.fortnox.se\/3\/orders\/207","@urlTaxReductionList":"https:\/\/api.fortnox.se\/3\/taxreductions?filter=orders&referencenumber=207","AdministrationFee":0,"AdministrationFeeVAT":0,"Address1":"","Address2":"","BasisTaxReduction":0,"Cancelled":false,"City":"","Comments":"","ContributionPercent":0,"ContributionValue":0,"CopyRemarks":false,"Country":"","CostCenter":"","Currency":"SEK","CurrencyRate":1,"CurrencyUnit":1,"CustomerName":"Old
42
- name","CustomerNumber":"1","DeliveryAddress1":"","DeliveryAddress2":"","DeliveryCity":"","DeliveryCountry":"","DeliveryDate":null,"DeliveryName":"","DeliveryZipCode":"","DocumentNumber":"207","EmailInformation":{"EmailAddressFrom":null,"EmailAddressTo":"","EmailAddressCC":null,"EmailAddressBCC":null,"EmailSubject":"Order
43
- {no} bifogas","EmailBody":" "},"ExternalInvoiceReference1":"","ExternalInvoiceReference2":"","Freight":0,"FreightVAT":0,"Gross":0,"HouseWork":false,"InvoiceReference":0,"Labels":[],"Language":"SV","Net":0,"NotCompleted":false,"OfferReference":0,"OrderDate":"2016-10-25","OrderRows":[{"AccountNumber":1250,"ArticleNumber":"0000","ContributionPercent":0,"ContributionValue":0,"CostCenter":"","DeliveredQuantity":"0.00","Description":"Testartikel","Discount":0,"DiscountType":"PERCENT","HouseWork":false,"HouseWorkHoursToReport":null,"HouseWorkType":"SNOWPLOWING","OrderedQuantity":"1.00","Price":0,"Project":"","Total":0,"Unit":"","VAT":0}],"OrganisationNumber":"860101-8735","OurReference":"En
44
- Appstudio","Phone1":"","Phone2":"","PriceList":"A","PrintTemplate":"oc","Project":"","Remarks":"","RoundOff":0,"Sent":false,"TaxReduction":null,"TermsOfDelivery":"","TermsOfPayment":0,"Total":0,"TotalToPay":0,"TotalVAT":0,"VATIncluded":false,"WayOfDelivery":"","YourReference":"","YourOrderNumber":"","ZipCode":""}}'
41
+ string: '{"Order":{"@url":"https:\/\/api.fortnox.se\/3\/orders\/285","@urlTaxReductionList":"https:\/\/api.fortnox.se\/3\/taxreductions?filter=orders&referencenumber=285","AdministrationFee":0,"AdministrationFeeVAT":0,"Address1":"","Address2":"","BasisTaxReduction":0,"Cancelled":false,"City":"","Comments":"","ContributionPercent":0,"ContributionValue":0,"CopyRemarks":false,"Country":"","CostCenter":"","Currency":"SEK","CurrencyRate":1,"CurrencyUnit":1,"CustomerName":"Old
42
+ name","CustomerNumber":"1","DeliveryState":"delivery","DeliveryAddress1":"","DeliveryAddress2":"","DeliveryCity":"","DeliveryCountry":"","DeliveryDate":null,"DeliveryName":"","DeliveryZipCode":"","DocumentNumber":"285","EmailInformation":{"EmailAddressFrom":null,"EmailAddressTo":"","EmailAddressCC":null,"EmailAddressBCC":null,"EmailSubject":"Order
43
+ {no} bifogas","EmailBody":" "},"ExternalInvoiceReference1":"","ExternalInvoiceReference2":"","Freight":0,"FreightVAT":0,"Gross":0,"HouseWork":false,"InvoiceReference":0,"Labels":[],"Language":"SV","Net":0,"NotCompleted":false,"OfferReference":0,"OrderDate":"2018-03-01","OrderRows":[{"AccountNumber":1250,"ArticleNumber":"0000","ContributionPercent":0,"ContributionValue":0,"CostCenter":"","DeliveredQuantity":"0.00","Description":"Testartikel","Discount":0,"DiscountType":"PERCENT","HouseWork":false,"HouseWorkHoursToReport":null,"HouseWorkType":"SNOWPLOWING","OrderedQuantity":"1.00","Price":0,"Project":"","ReservedQuantity":0,"StockPointCode":null,"Total":0,"Unit":"","VAT":0}],"OrganisationNumber":"860101-8735","OurReference":"","Phone1":"","Phone2":"","PriceList":"A","PrintTemplate":"oc","Project":"","WarehouseReady":true,"OutboundDate":"2018-03-01","Remarks":"","RoundOff":0,"Sent":false,"TaxReduction":null,"TermsOfDelivery":"","TermsOfPayment":0,"Total":0,"TotalToPay":0,"TotalVAT":0,"VATIncluded":false,"WayOfDelivery":"","YourReference":"","YourOrderNumber":"","ZipCode":""}}'
45
44
  http_version:
46
- recorded_at: Tue, 25 Oct 2016 10:21:53 GMT
47
- recorded_with: VCR 3.0.1
45
+ recorded_at: Thu, 01 Mar 2018 13:58:14 GMT
46
+ recorded_with: VCR 3.0.3
@@ -23,7 +23,7 @@ http_interactions:
23
23
  Server:
24
24
  - nginx
25
25
  Date:
26
- - Tue, 25 Oct 2016 10:21:55 GMT
26
+ - Thu, 01 Mar 2018 13:58:18 GMT
27
27
  Content-Type:
28
28
  - application/json
29
29
  Connection:
@@ -31,17 +31,16 @@ http_interactions:
31
31
  Location:
32
32
  - orders
33
33
  X-Rack-Responsetime:
34
- - '120'
34
+ - '83'
35
35
  X-Uid:
36
- - 1aef1edd
36
+ - ec54131e
37
37
  X-Build:
38
- - 76600b8d0c
38
+ - bec4a33b2e
39
39
  body:
40
40
  encoding: UTF-8
41
- string: '{"Order":{"@url":"https:\/\/api.fortnox.se\/3\/orders\/214","@urlTaxReductionList":"https:\/\/api.fortnox.se\/3\/taxreductions?filter=orders&referencenumber=214","AdministrationFee":0,"AdministrationFeeVAT":0,"Address1":"","Address2":"","BasisTaxReduction":0,"Cancelled":false,"City":"","Comments":"","ContributionPercent":0,"ContributionValue":0,"CopyRemarks":false,"Country":"","CostCenter":"","Currency":"SEK","CurrencyRate":1,"CurrencyUnit":1,"CustomerName":"Old
42
- name","CustomerNumber":"1","DeliveryAddress1":"","DeliveryAddress2":"","DeliveryCity":"","DeliveryCountry":"","DeliveryDate":null,"DeliveryName":"","DeliveryZipCode":"","DocumentNumber":"214","EmailInformation":{"EmailAddressFrom":null,"EmailAddressTo":"","EmailAddressCC":null,"EmailAddressBCC":null,"EmailSubject":"Order
43
- {no} bifogas","EmailBody":" "},"ExternalInvoiceReference1":"","ExternalInvoiceReference2":"","Freight":0,"FreightVAT":0,"Gross":0,"HouseWork":false,"InvoiceReference":0,"Labels":[],"Language":"SV","Net":0,"NotCompleted":false,"OfferReference":0,"OrderDate":"2016-10-25","OrderRows":[{"AccountNumber":1250,"ArticleNumber":"0000","ContributionPercent":0,"ContributionValue":0,"CostCenter":"","DeliveredQuantity":"0.00","Description":"Testartikel","Discount":0,"DiscountType":"PERCENT","HouseWork":false,"HouseWorkHoursToReport":null,"HouseWorkType":"TEXTILECLOTHING","OrderedQuantity":"1.00","Price":0,"Project":"","Total":0,"Unit":"","VAT":0}],"OrganisationNumber":"860101-8735","OurReference":"En
44
- Appstudio","Phone1":"","Phone2":"","PriceList":"A","PrintTemplate":"oc","Project":"","Remarks":"","RoundOff":0,"Sent":false,"TaxReduction":null,"TermsOfDelivery":"","TermsOfPayment":0,"Total":0,"TotalToPay":0,"TotalVAT":0,"VATIncluded":false,"WayOfDelivery":"","YourReference":"","YourOrderNumber":"","ZipCode":""}}'
41
+ string: '{"Order":{"@url":"https:\/\/api.fortnox.se\/3\/orders\/295","@urlTaxReductionList":"https:\/\/api.fortnox.se\/3\/taxreductions?filter=orders&referencenumber=295","AdministrationFee":0,"AdministrationFeeVAT":0,"Address1":"","Address2":"","BasisTaxReduction":0,"Cancelled":false,"City":"","Comments":"","ContributionPercent":0,"ContributionValue":0,"CopyRemarks":false,"Country":"","CostCenter":"","Currency":"SEK","CurrencyRate":1,"CurrencyUnit":1,"CustomerName":"Old
42
+ name","CustomerNumber":"1","DeliveryState":"delivery","DeliveryAddress1":"","DeliveryAddress2":"","DeliveryCity":"","DeliveryCountry":"","DeliveryDate":null,"DeliveryName":"","DeliveryZipCode":"","DocumentNumber":"295","EmailInformation":{"EmailAddressFrom":null,"EmailAddressTo":"","EmailAddressCC":null,"EmailAddressBCC":null,"EmailSubject":"Order
43
+ {no} bifogas","EmailBody":" "},"ExternalInvoiceReference1":"","ExternalInvoiceReference2":"","Freight":0,"FreightVAT":0,"Gross":0,"HouseWork":false,"InvoiceReference":0,"Labels":[],"Language":"SV","Net":0,"NotCompleted":false,"OfferReference":0,"OrderDate":"2018-03-01","OrderRows":[{"AccountNumber":1250,"ArticleNumber":"0000","ContributionPercent":0,"ContributionValue":0,"CostCenter":"","DeliveredQuantity":"0.00","Description":"Testartikel","Discount":0,"DiscountType":"PERCENT","HouseWork":false,"HouseWorkHoursToReport":null,"HouseWorkType":"TEXTILECLOTHING","OrderedQuantity":"1.00","Price":0,"Project":"","ReservedQuantity":0,"StockPointCode":null,"Total":0,"Unit":"","VAT":0}],"OrganisationNumber":"860101-8735","OurReference":"","Phone1":"","Phone2":"","PriceList":"A","PrintTemplate":"oc","Project":"","WarehouseReady":true,"OutboundDate":"2018-03-01","Remarks":"","RoundOff":0,"Sent":false,"TaxReduction":null,"TermsOfDelivery":"","TermsOfPayment":0,"Total":0,"TotalToPay":0,"TotalVAT":0,"VATIncluded":false,"WayOfDelivery":"","YourReference":"","YourOrderNumber":"","ZipCode":""}}'
45
44
  http_version:
46
- recorded_at: Tue, 25 Oct 2016 10:21:55 GMT
47
- recorded_with: VCR 3.0.1
45
+ recorded_at: Thu, 01 Mar 2018 13:58:18 GMT
46
+ recorded_with: VCR 3.0.3
@@ -23,21 +23,21 @@ http_interactions:
23
23
  Server:
24
24
  - nginx
25
25
  Date:
26
- - Tue, 25 Oct 2016 10:21:52 GMT
26
+ - Thu, 01 Mar 2018 13:58:13 GMT
27
27
  Content-Type:
28
28
  - application/json
29
29
  Connection:
30
30
  - close
31
31
  X-Rack-Responsetime:
32
- - '39'
32
+ - '291'
33
33
  X-Uid:
34
- - 9b83de03
34
+ - 66f15c22
35
35
  X-Build:
36
- - 76600b8d0c
36
+ - bec4a33b2e
37
37
  body:
38
38
  encoding: UTF-8
39
39
  string: '{"ErrorInformation":{"error":1,"message":"Skattereduktion f\u00f6r
40
- en av de valda husarbetestyperna har upph\u00f6rt.","code":2003151}}'
40
+ den valda typen av husarbete har upph\u00f6rt.","code":2003157}}'
41
41
  http_version:
42
- recorded_at: Tue, 25 Oct 2016 10:21:52 GMT
43
- recorded_with: VCR 3.0.1
42
+ recorded_at: Thu, 01 Mar 2018 13:58:13 GMT
43
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,51 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.fortnox.se/3/termsofpayments/
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept:
13
+ - application/json
14
+ Client-Secret:
15
+ - 9aBA8ZgsvR
16
+ Access-Token:
17
+ - ccaef817-d5d8-4b1c-a316-54f3e55c5c54
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Sat, 24 Feb 2018 06:23:28 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Connection:
30
+ - close
31
+ Vary:
32
+ - Accept-Encoding
33
+ - Accept-Encoding
34
+ X-Rack-Responsetime:
35
+ - '18'
36
+ X-Uid:
37
+ - a4f6e251
38
+ X-Build:
39
+ - bec4a33b2e
40
+ body:
41
+ encoding: UTF-8
42
+ string: '{"MetaInformation":{"@TotalResources":9,"@TotalPages":1,"@CurrentPage":1},"TermsOfPayments":[{"@url":"https:\/\/api.fortnox.se\/3\/termsofpayment\/0","Code":"0","Description":"0
43
+ dagar"},{"@url":"https:\/\/api.fortnox.se\/3\/termsofpayment\/10","Code":"10","Description":"10
44
+ dagar"},{"@url":"https:\/\/api.fortnox.se\/3\/termsofpayment\/15","Code":"15","Description":"15
45
+ dagar"},{"@url":"https:\/\/api.fortnox.se\/3\/termsofpayment\/20","Code":"20","Description":"20
46
+ dagar"},{"@url":"https:\/\/api.fortnox.se\/3\/termsofpayment\/30","Code":"30","Description":"30
47
+ dagar"},{"@url":"https:\/\/api.fortnox.se\/3\/termsofpayment\/K","Code":"K","Description":"Kontant"},{"@url":"https:\/\/api.fortnox.se\/3\/termsofpayment\/PF","Code":"PF","Description":"Postf\u00f6rskott"},{"@url":"https:\/\/api.fortnox.se\/3\/termsofpayment\/AG","Code":"AG","Description":"Autogiro"},{"@url":"https:\/\/api.fortnox.se\/3\/termsofpayment\/30DAYS","Code":"30DAYS","Description":"Updated
48
+ description"}]}'
49
+ http_version:
50
+ recorded_at: Sat, 24 Feb 2018 06:23:28 GMT
51
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,45 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.fortnox.se/3/termsofpayments/123456789
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept:
13
+ - application/json
14
+ Client-Secret:
15
+ - 9aBA8ZgsvR
16
+ Access-Token:
17
+ - ccaef817-d5d8-4b1c-a316-54f3e55c5c54
18
+ response:
19
+ status:
20
+ code: 404
21
+ message: Not Found
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Sat, 24 Feb 2018 06:45:43 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Connection:
30
+ - close
31
+ Vary:
32
+ - Accept-Encoding
33
+ - Accept-Encoding
34
+ X-Rack-Responsetime:
35
+ - '11'
36
+ X-Uid:
37
+ - 0d0076fc
38
+ X-Build:
39
+ - bec4a33b2e
40
+ body:
41
+ encoding: UTF-8
42
+ string: '{"ErrorInformation":{"Error":1,"Message":"Kan inte hitta betalningsvillkoret.","Code":2000429}}'
43
+ http_version:
44
+ recorded_at: Sat, 24 Feb 2018 06:45:43 GMT
45
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.fortnox.se/3/termsofpayments/15DAYS
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept:
13
+ - application/json
14
+ Client-Secret:
15
+ - 9aBA8ZgsvR
16
+ Access-Token:
17
+ - ccaef817-d5d8-4b1c-a316-54f3e55c5c54
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Sat, 24 Feb 2018 06:45:42 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Connection:
30
+ - close
31
+ Vary:
32
+ - Accept-Encoding
33
+ - Accept-Encoding
34
+ X-Rack-Responsetime:
35
+ - '14'
36
+ X-Uid:
37
+ - c1bdddd4
38
+ X-Build:
39
+ - bec4a33b2e
40
+ body:
41
+ encoding: UTF-8
42
+ string: '{"TermsOfPayment":{"@url":"https:\/\/api.fortnox.se\/3\/termsofpayment\/15DAYS","Code":"15DAYS","Description":"Updated
43
+ description"}}'
44
+ http_version:
45
+ recorded_at: Sat, 24 Feb 2018 06:45:42 GMT
46
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.fortnox.se/3/termsofpayments/15DAYS
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept:
13
+ - application/json
14
+ Client-Secret:
15
+ - 9aBA8ZgsvR
16
+ Access-Token:
17
+ - ccaef817-d5d8-4b1c-a316-54f3e55c5c54
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Sat, 24 Feb 2018 06:45:42 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Connection:
30
+ - close
31
+ Vary:
32
+ - Accept-Encoding
33
+ - Accept-Encoding
34
+ X-Rack-Responsetime:
35
+ - '13'
36
+ X-Uid:
37
+ - 2f628904
38
+ X-Build:
39
+ - bec4a33b2e
40
+ body:
41
+ encoding: UTF-8
42
+ string: '{"TermsOfPayment":{"@url":"https:\/\/api.fortnox.se\/3\/termsofpayment\/15DAYS","Code":"15DAYS","Description":"A
43
+ value"}}'
44
+ http_version:
45
+ recorded_at: Sat, 24 Feb 2018 06:45:42 GMT
46
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,45 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.fortnox.se/3/termsofpayments/
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"TermsOfPayment":{"Code":"15DAYS","Description":"A value"}}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept:
13
+ - application/json
14
+ Client-Secret:
15
+ - 9aBA8ZgsvR
16
+ Access-Token:
17
+ - ccaef817-d5d8-4b1c-a316-54f3e55c5c54
18
+ response:
19
+ status:
20
+ code: 201
21
+ message: Created
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Sat, 24 Feb 2018 06:45:42 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Connection:
30
+ - close
31
+ Location:
32
+ - paymentterms
33
+ X-Rack-Responsetime:
34
+ - '28'
35
+ X-Uid:
36
+ - c6e19b56
37
+ X-Build:
38
+ - bec4a33b2e
39
+ body:
40
+ encoding: UTF-8
41
+ string: '{"TermsOfPayment":{"@url":"https:\/\/api.fortnox.se\/3\/termsofpayment\/15DAYS","Code":"15DAYS","Description":"A
42
+ value"}}'
43
+ http_version:
44
+ recorded_at: Sat, 24 Feb 2018 06:45:42 GMT
45
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: https://api.fortnox.se/3/termsofpayments/15DAYS
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"TermsOfPayment":{"Description":"Updated description"}}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept:
13
+ - application/json
14
+ Client-Secret:
15
+ - 9aBA8ZgsvR
16
+ Access-Token:
17
+ - ccaef817-d5d8-4b1c-a316-54f3e55c5c54
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Sat, 24 Feb 2018 06:45:42 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Connection:
30
+ - close
31
+ Vary:
32
+ - Accept-Encoding
33
+ - Accept-Encoding
34
+ X-Rack-Responsetime:
35
+ - '23'
36
+ X-Uid:
37
+ - 3639a56a
38
+ X-Build:
39
+ - bec4a33b2e
40
+ body:
41
+ encoding: UTF-8
42
+ string: '{"TermsOfPayment":{"@url":"https:\/\/api.fortnox.se\/3\/termsofpayment\/15DAYS","Code":"15DAYS","Description":"Updated
43
+ description"}}'
44
+ http_version:
45
+ recorded_at: Sat, 24 Feb 2018 06:45:42 GMT
46
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,48 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.fortnox.se/3/units/
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept:
13
+ - application/json
14
+ Authorization-Code:
15
+ - ea3862b0-189c-464b-8e23-1b9702365ea1
16
+ Client-Secret:
17
+ - 9aBA8ZgsvR
18
+ Access-Token:
19
+ - ccaef817-d5d8-4b1c-a316-54f3e55c5c54
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - nginx
27
+ Date:
28
+ - Thu, 22 Feb 2018 14:59:55 GMT
29
+ Content-Type:
30
+ - application/json
31
+ Connection:
32
+ - close
33
+ Vary:
34
+ - Accept-Encoding
35
+ - Accept-Encoding
36
+ X-Rack-Responsetime:
37
+ - '13'
38
+ X-Uid:
39
+ - 1cc7190f
40
+ X-Build:
41
+ - bec4a33b2e
42
+ body:
43
+ encoding: UTF-8
44
+ string: '{"MetaInformation":{"@TotalResources":6,"@TotalPages":1,"@CurrentPage":1},"Units":[{"@url":"https:\/\/api.fortnox.se\/3\/units\/f%C3%B6rp","Code":"f\u00f6rp","Description":"f\u00f6rpackning"},{"@url":"https:\/\/api.fortnox.se\/3\/units\/h","Code":"h","Description":"timmar"},{"@url":"https:\/\/api.fortnox.se\/3\/units\/km","Code":"km","Description":"Kilometer"},{"@url":"https:\/\/api.fortnox.se\/3\/units\/st","Code":"st","Description":"styck"},{"@url":"https:\/\/api.fortnox.se\/3\/units\/test","Code":"test","Description":"A
45
+ value"},{"@url":"https:\/\/api.fortnox.se\/3\/units\/utl","Code":"utl","Description":"Utl\u00e4gg"}]}'
46
+ http_version:
47
+ recorded_at: Thu, 22 Feb 2018 14:59:56 GMT
48
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,45 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.fortnox.se/3/units/123456789
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept:
13
+ - application/json
14
+ Client-Secret:
15
+ - 9aBA8ZgsvR
16
+ Access-Token:
17
+ - ccaef817-d5d8-4b1c-a316-54f3e55c5c54
18
+ response:
19
+ status:
20
+ code: 404
21
+ message: Not Found
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Mon, 26 Feb 2018 05:15:26 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Connection:
30
+ - close
31
+ Vary:
32
+ - Accept-Encoding
33
+ - Accept-Encoding
34
+ X-Rack-Responsetime:
35
+ - '14'
36
+ X-Uid:
37
+ - '44868723'
38
+ X-Build:
39
+ - bec4a33b2e
40
+ body:
41
+ encoding: UTF-8
42
+ string: '{"ErrorInformation":{"Error":1,"Message":"Kan inte hitta enheten.","Code":2000432}}'
43
+ http_version:
44
+ recorded_at: Mon, 26 Feb 2018 05:15:25 GMT
45
+ recorded_with: VCR 3.0.3