fortnox-api 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -4
  3. data/fortnox-api.gemspec +4 -4
  4. data/lib/fortnox/api/mappers/article.rb +22 -0
  5. data/lib/fortnox/api/mappers/base/to_json.rb +2 -2
  6. data/lib/fortnox/api/models.rb +1 -0
  7. data/lib/fortnox/api/models/article.rb +133 -0
  8. data/lib/fortnox/api/repositories.rb +1 -0
  9. data/lib/fortnox/api/repositories/article.rb +16 -0
  10. data/lib/fortnox/api/repositories/base/savers.rb +1 -1
  11. data/lib/fortnox/api/types.rb +2 -0
  12. data/lib/fortnox/api/types/enums.rb +5 -2
  13. data/lib/fortnox/api/version.rb +1 -1
  14. data/spec/fortnox/api/mappers/article_spec.rb +15 -0
  15. data/spec/fortnox/api/mappers/base/to_json_spec.rb +1 -1
  16. data/spec/fortnox/api/models/article_spec.rb +7 -0
  17. data/spec/fortnox/api/repositories/article_spec.rb +35 -0
  18. data/spec/fortnox/api/repositories/examples/find.rb +0 -2
  19. data/spec/fortnox/api/repositories/examples/save.rb +4 -5
  20. data/spec/fortnox/api/repositories/examples/save_with_nested_model.rb +1 -0
  21. data/spec/fortnox/api/repositories/examples/save_with_specially_named_attribute.rb +2 -1
  22. data/spec/fortnox/api/repositories/invoice_spec.rb +1 -1
  23. data/spec/fortnox/api/repositories/order_spec.rb +1 -1
  24. data/spec/fortnox/api/repositories/project_spec.rb +3 -3
  25. data/spec/fortnox/api/types/enums_spec.rb +1 -0
  26. data/spec/vcr_cassettes/articles/all.yml +54 -0
  27. data/spec/vcr_cassettes/articles/find_by_hash_failure.yml +45 -0
  28. data/spec/vcr_cassettes/articles/find_failure.yml +45 -0
  29. data/spec/vcr_cassettes/articles/find_id_1.yml +45 -0
  30. data/spec/vcr_cassettes/articles/find_new.yml +46 -0
  31. data/spec/vcr_cassettes/articles/multi_param_find_by_hash.yml +45 -0
  32. data/spec/vcr_cassettes/articles/save_new.yml +45 -0
  33. data/spec/vcr_cassettes/articles/save_old.yml +46 -0
  34. data/spec/vcr_cassettes/articles/save_with_specially_named_attribute.yml +45 -0
  35. data/spec/vcr_cassettes/articles/search_by_name.yml +45 -0
  36. data/spec/vcr_cassettes/articles/search_miss.yml +45 -0
  37. data/spec/vcr_cassettes/articles/search_with_special_char.yml +45 -0
  38. data/spec/vcr_cassettes/articles/single_param_find_by_hash.yml +46 -0
  39. metadata +43 -7
@@ -15,7 +15,7 @@ describe Fortnox::API::Repository::Invoice, order: :defined, integration: true d
15
15
 
16
16
  required_hash = { customer_number: '1' }
17
17
 
18
- include_examples '.save', :comments, required_hash
18
+ include_examples '.save', :comments, additional_attrs: required_hash
19
19
 
20
20
  nested_model_hash = { price: 10, article_number: '0000' }
21
21
  include_examples '.save with nested model',
@@ -14,7 +14,7 @@ describe Fortnox::API::Repository::Order, order: :defined, integration: true do
14
14
 
15
15
  required_hash = { customer_number: '1' }
16
16
 
17
- include_examples '.save', :comments, required_hash
17
+ include_examples '.save', :comments, additional_attrs: required_hash
18
18
 
19
19
  nested_model_hash = { price: 10, article_number: '0000', ordered_quantity: 1 }
20
20
  include_examples '.save with nested model',
@@ -9,9 +9,9 @@ require 'fortnox/api/repositories/examples/save'
9
9
  describe Fortnox::API::Repository::Project, order: :defined, integration: true do
10
10
  subject( :repository ){ described_class.new }
11
11
 
12
- required_attributes = { description: 'Some important project' }
13
-
14
- include_examples '.save', :comments, required_attributes
12
+ include_examples '.save',
13
+ :comments,
14
+ additional_attrs: { description: 'Some important project' }
15
15
 
16
16
  # It is not yet possible to delete Projects. Therefore, expected nr of
17
17
  # Projects when running .all will continue to increase
@@ -3,6 +3,7 @@ require 'fortnox/api/types'
3
3
  require 'fortnox/api/types/examples/enum'
4
4
 
5
5
  describe Fortnox::API::Types do
6
+ it_behaves_like 'enum', 'ArticleType', 'ArticleTypes'
6
7
  it_behaves_like 'enum', 'CountryCode', 'CountryCodes', auto_crop: true
7
8
  it_behaves_like 'enum', 'Currency', 'Currencies', auto_crop: true
8
9
  it_behaves_like 'enum', 'CustomerType', 'CustomerTypes'
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.fortnox.se/3/articles/
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
+ - Sun, 08 Oct 2017 21:51:31 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Connection:
30
+ - close
31
+ Vary:
32
+ - Accept-Encoding
33
+ - Accept-Encoding
34
+ X-Rack-Responsetime:
35
+ - '21'
36
+ X-Uid:
37
+ - 1aa0352f
38
+ X-Build:
39
+ - e1392b4cf7
40
+ body:
41
+ encoding: UTF-8
42
+ string: '{"MetaInformation":{"@TotalResources":12,"@TotalPages":1,"@CurrentPage":1},"Articles":[{"@url":"https:\/\/api.fortnox.se\/3\/articles\/0000","ArticleNumber":"0000","Description":"Testartikel","DisposableQuantity":"0","EAN":"","Housework":false,"PurchasePrice":"0","SalesPrice":null,"QuantityInStock":"0","ReservedQuantity":"0","StockPlace":"","StockValue":"0","Unit":null,"VAT":null,"WebshopArticle":false},{"@url":"https:\/\/api.fortnox.se\/3\/articles\/0001","ArticleNumber":"0001","Description":"Cykelpump","DisposableQuantity":"0","EAN":"","Housework":false,"PurchasePrice":"0","SalesPrice":"100","QuantityInStock":"0","ReservedQuantity":"0","StockPlace":"","StockValue":"0","Unit":null,"VAT":null,"WebshopArticle":false},{"@url":"https:\/\/api.fortnox.se\/3\/articles\/1","ArticleNumber":"1","Description":"Testartikel","DisposableQuantity":"0","EAN":"","Housework":false,"PurchasePrice":"0","SalesPrice":"100","QuantityInStock":"0","ReservedQuantity":"0","StockPlace":"","StockValue":"0","Unit":null,"VAT":null,"WebshopArticle":false},{"@url":"https:\/\/api.fortnox.se\/3\/articles\/2","ArticleNumber":"2","Description":"A
43
+ value","DisposableQuantity":"0","EAN":"","Housework":false,"PurchasePrice":"0","SalesPrice":null,"QuantityInStock":"0","ReservedQuantity":"0","StockPlace":null,"StockValue":"0","Unit":"","VAT":null,"WebshopArticle":false},{"@url":"https:\/\/api.fortnox.se\/3\/articles\/3","ArticleNumber":"3","Description":"Test
44
+ article","DisposableQuantity":"0","EAN":"","Housework":false,"PurchasePrice":"0","SalesPrice":null,"QuantityInStock":"0","ReservedQuantity":"0","StockPlace":null,"StockValue":"0","Unit":"","VAT":null,"WebshopArticle":false},{"@url":"https:\/\/api.fortnox.se\/3\/articles\/4","ArticleNumber":"4","Description":"Test
45
+ article","DisposableQuantity":"0","EAN":"","Housework":false,"PurchasePrice":"0","SalesPrice":null,"QuantityInStock":"0","ReservedQuantity":"0","StockPlace":null,"StockValue":"0","Unit":"","VAT":null,"WebshopArticle":false},{"@url":"https:\/\/api.fortnox.se\/3\/articles\/5","ArticleNumber":"5","Description":"Test
46
+ article","DisposableQuantity":"0","EAN":"5901234123457","Housework":false,"PurchasePrice":"0","SalesPrice":null,"QuantityInStock":"0","ReservedQuantity":"0","StockPlace":null,"StockValue":"0","Unit":"","VAT":null,"WebshopArticle":false},{"@url":"https:\/\/api.fortnox.se\/3\/articles\/6","ArticleNumber":"6","Description":"A
47
+ value","DisposableQuantity":"0","EAN":"","Housework":false,"PurchasePrice":"0","SalesPrice":null,"QuantityInStock":"0","ReservedQuantity":"0","StockPlace":null,"StockValue":"0","Unit":"","VAT":null,"WebshopArticle":false},{"@url":"https:\/\/api.fortnox.se\/3\/articles\/7","ArticleNumber":"7","Description":"Test
48
+ article","DisposableQuantity":"0","EAN":"5901234123457","Housework":false,"PurchasePrice":"0","SalesPrice":null,"QuantityInStock":"0","ReservedQuantity":"0","StockPlace":null,"StockValue":"0","Unit":"","VAT":null,"WebshopArticle":false},{"@url":"https:\/\/api.fortnox.se\/3\/articles\/8","ArticleNumber":"8","Description":"A
49
+ value","DisposableQuantity":"0","EAN":"","Housework":false,"PurchasePrice":"0","SalesPrice":null,"QuantityInStock":"0","ReservedQuantity":"0","StockPlace":null,"StockValue":"0","Unit":"","VAT":null,"WebshopArticle":false},{"@url":"https:\/\/api.fortnox.se\/3\/articles\/9","ArticleNumber":"9","Description":"A
50
+ value","DisposableQuantity":"0","EAN":"","Housework":false,"PurchasePrice":"0","SalesPrice":null,"QuantityInStock":"0","ReservedQuantity":"0","StockPlace":null,"StockValue":"0","Unit":"","VAT":null,"WebshopArticle":false},{"@url":"https:\/\/api.fortnox.se\/3\/articles\/10","ArticleNumber":"10","Description":"Abc
51
+ 123","DisposableQuantity":"0","EAN":"","Housework":false,"PurchasePrice":"0","SalesPrice":null,"QuantityInStock":"0","ReservedQuantity":"0","StockPlace":null,"StockValue":"0","Unit":"","VAT":null,"WebshopArticle":false}]}'
52
+ http_version:
53
+ recorded_at: Sun, 08 Oct 2017 21:51:31 GMT
54
+ 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/articles/?description=Not%20Found
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
+ - Sun, 08 Oct 2017 21:51:44 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Connection:
30
+ - close
31
+ Vary:
32
+ - Accept-Encoding
33
+ - Accept-Encoding
34
+ X-Rack-Responsetime:
35
+ - '20'
36
+ X-Uid:
37
+ - 4b1a3e1d
38
+ X-Build:
39
+ - e1392b4cf7
40
+ body:
41
+ encoding: UTF-8
42
+ string: '{"MetaInformation":{"@TotalResources":0,"@TotalPages":0,"@CurrentPage":1},"Articles":[]}'
43
+ http_version:
44
+ recorded_at: Sun, 08 Oct 2017 21:51:44 GMT
45
+ 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/articles/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
+ - Sun, 08 Oct 2017 21:51:44 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Connection:
30
+ - close
31
+ Vary:
32
+ - Accept-Encoding
33
+ - Accept-Encoding
34
+ X-Rack-Responsetime:
35
+ - '20'
36
+ X-Uid:
37
+ - 9d7a18ed
38
+ X-Build:
39
+ - e1392b4cf7
40
+ body:
41
+ encoding: UTF-8
42
+ string: '{"ErrorInformation":{"Error":1,"Message":"Kan inte hitta artikeln.","Code":2000428}}'
43
+ http_version:
44
+ recorded_at: Sun, 08 Oct 2017 21:51:44 GMT
45
+ 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/articles/1
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
+ - Sun, 08 Oct 2017 21:51: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
+ - '32'
36
+ X-Uid:
37
+ - 8b796198
38
+ X-Build:
39
+ - e1392b4cf7
40
+ body:
41
+ encoding: UTF-8
42
+ string: '{"Article":{"@url":"https:\/\/api.fortnox.se\/3\/articles\/1","ArticleNumber":"1","Bulky":false,"ConstructionAccount":1030,"Depth":null,"Description":"Testartikel","DisposableQuantity":-163995.5,"EAN":"","EUAccount":1030,"EUVATAccount":1030,"ExportAccount":1030,"Height":null,"Housework":false,"HouseworkType":null,"Active":true,"Manufacturer":null,"ManufacturerArticleNumber":null,"Note":"","PurchaseAccount":1030,"PurchasePrice":0,"QuantityInStock":0,"ReservedQuantity":163995.5,"SalesAccount":1030,"StockGoods":false,"StockPlace":"","StockValue":0,"StockWarning":null,"SupplierName":null,"SupplierNumber":null,"Type":"STOCK","Unit":null,"VAT":0,"WebshopArticle":false,"Weight":null,"Width":null,"Expired":false,"SalesPrice":100,"CostCalculationMethod":null,"StockAccount":null,"StockChangeAccount":null,"DirectCost":0,"FreightCost":0,"OtherCost":0}}'
43
+ http_version:
44
+ recorded_at: Sun, 08 Oct 2017 21:51: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/articles/18
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
+ - Mon, 09 Oct 2017 19: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
+ - '25'
36
+ X-Uid:
37
+ - 5191a93e
38
+ X-Build:
39
+ - 5228d322dc
40
+ body:
41
+ encoding: UTF-8
42
+ string: '{"Article":{"@url":"https:\/\/api.fortnox.se\/3\/articles\/18","ArticleNumber":"18","Bulky":false,"ConstructionAccount":0,"Depth":0,"Description":"A
43
+ value","DisposableQuantity":0,"EAN":"","EUAccount":3200,"EUVATAccount":3231,"ExportAccount":3200,"Height":0,"Housework":false,"HouseworkType":null,"Active":true,"Manufacturer":null,"ManufacturerArticleNumber":"","Note":"","PurchaseAccount":3100,"PurchasePrice":0,"QuantityInStock":0,"ReservedQuantity":0,"SalesAccount":1250,"StockGoods":false,"StockPlace":null,"StockValue":0,"StockWarning":0,"SupplierName":null,"SupplierNumber":null,"Type":"STOCK","Unit":null,"VAT":0,"WebshopArticle":false,"Weight":0,"Width":0,"Expired":false,"SalesPrice":null,"CostCalculationMethod":null,"StockAccount":null,"StockChangeAccount":null,"DirectCost":0,"FreightCost":0,"OtherCost":0}}'
44
+ http_version:
45
+ recorded_at: Mon, 09 Oct 2017 19:45:43 GMT
46
+ 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/articles/?articlenumber=1&description=Cykelpump
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
+ - Sun, 08 Oct 2017 21:51:44 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Connection:
30
+ - close
31
+ Vary:
32
+ - Accept-Encoding
33
+ - Accept-Encoding
34
+ X-Rack-Responsetime:
35
+ - '25'
36
+ X-Uid:
37
+ - adbaf2f0
38
+ X-Build:
39
+ - e1392b4cf7
40
+ body:
41
+ encoding: UTF-8
42
+ string: '{"MetaInformation":{"@TotalResources":1,"@TotalPages":1,"@CurrentPage":1},"Articles":[{"@url":"https:\/\/api.fortnox.se\/3\/articles\/0001","ArticleNumber":"0001","Description":"Cykelpump","DisposableQuantity":"0","EAN":"","Housework":false,"PurchasePrice":"0","SalesPrice":"100","QuantityInStock":"0","ReservedQuantity":"0","StockPlace":"","StockValue":"0","Unit":null,"VAT":null,"WebshopArticle":false}]}'
43
+ http_version:
44
+ recorded_at: Sun, 08 Oct 2017 21:51:44 GMT
45
+ 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/articles/
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"Article":{"Description":"A value","SalesAccount":1250}}'
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
+ - Mon, 09 Oct 2017 19:45:43 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Connection:
30
+ - close
31
+ Location:
32
+ - articles
33
+ X-Rack-Responsetime:
34
+ - '52'
35
+ X-Uid:
36
+ - a37e054e
37
+ X-Build:
38
+ - 5228d322dc
39
+ body:
40
+ encoding: UTF-8
41
+ string: '{"Article":{"@url":"https:\/\/api.fortnox.se\/3\/articles\/18","ArticleNumber":"18","Bulky":false,"ConstructionAccount":0,"Depth":0,"Description":"A
42
+ value","DisposableQuantity":0,"EAN":"","EUAccount":3200,"EUVATAccount":3231,"ExportAccount":3200,"Height":0,"Housework":false,"HouseworkType":null,"Active":true,"Manufacturer":null,"ManufacturerArticleNumber":"","Note":"","PurchaseAccount":3100,"PurchasePrice":0,"QuantityInStock":0,"ReservedQuantity":0,"SalesAccount":1250,"StockGoods":false,"StockPlace":null,"StockValue":0,"StockWarning":0,"SupplierName":null,"SupplierNumber":null,"Type":"STOCK","Unit":null,"VAT":0,"WebshopArticle":false,"Weight":0,"Width":0,"Expired":false,"SalesPrice":null,"CostCalculationMethod":null,"StockAccount":null,"StockChangeAccount":null,"DirectCost":0,"FreightCost":0,"OtherCost":0}}'
43
+ http_version:
44
+ recorded_at: Mon, 09 Oct 2017 19:45:43 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/articles/18
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"Article":{"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
+ - Mon, 09 Oct 2017 19:46:17 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Connection:
30
+ - close
31
+ Vary:
32
+ - Accept-Encoding
33
+ - Accept-Encoding
34
+ X-Rack-Responsetime:
35
+ - '49'
36
+ X-Uid:
37
+ - 0f7a1484
38
+ X-Build:
39
+ - 5228d322dc
40
+ body:
41
+ encoding: UTF-8
42
+ string: '{"Article":{"@url":"https:\/\/api.fortnox.se\/3\/articles\/18","ArticleNumber":"18","Bulky":false,"ConstructionAccount":0,"Depth":0,"Description":"Updated
43
+ description","DisposableQuantity":0,"EAN":"","EUAccount":3200,"EUVATAccount":3231,"ExportAccount":3200,"Height":0,"Housework":false,"HouseworkType":null,"Active":true,"Manufacturer":null,"ManufacturerArticleNumber":"","Note":"","PurchaseAccount":3100,"PurchasePrice":0,"QuantityInStock":0,"ReservedQuantity":0,"SalesAccount":1250,"StockGoods":false,"StockPlace":null,"StockValue":0,"StockWarning":0,"SupplierName":null,"SupplierNumber":null,"Type":"STOCK","Unit":null,"VAT":0,"WebshopArticle":false,"Weight":0,"Width":0,"Expired":false,"SalesPrice":null,"CostCalculationMethod":null,"StockAccount":null,"StockChangeAccount":null,"DirectCost":0,"FreightCost":0,"OtherCost":0}}'
44
+ http_version:
45
+ recorded_at: Mon, 09 Oct 2017 19:46:17 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/articles/
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"Article":{"Description":"Test article","EAN":"5901234123457"}}'
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
+ - Mon, 09 Oct 2017 19:39:23 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Connection:
30
+ - close
31
+ Location:
32
+ - articles
33
+ X-Rack-Responsetime:
34
+ - '34'
35
+ X-Uid:
36
+ - 9213a3b9
37
+ X-Build:
38
+ - 5228d322dc
39
+ body:
40
+ encoding: UTF-8
41
+ string: '{"Article":{"@url":"https:\/\/api.fortnox.se\/3\/articles\/16","ArticleNumber":"16","Bulky":false,"ConstructionAccount":0,"Depth":0,"Description":"Test
42
+ article","DisposableQuantity":0,"EAN":"5901234123457","EUAccount":3200,"EUVATAccount":3231,"ExportAccount":3200,"Height":0,"Housework":false,"HouseworkType":null,"Active":true,"Manufacturer":null,"ManufacturerArticleNumber":"","Note":"","PurchaseAccount":3100,"PurchasePrice":0,"QuantityInStock":0,"ReservedQuantity":0,"SalesAccount":3011,"StockGoods":false,"StockPlace":null,"StockValue":0,"StockWarning":0,"SupplierName":null,"SupplierNumber":null,"Type":"STOCK","Unit":null,"VAT":0,"WebshopArticle":false,"Weight":0,"Width":0,"Expired":false,"SalesPrice":null,"CostCalculationMethod":null,"StockAccount":null,"StockChangeAccount":null,"DirectCost":0,"FreightCost":0,"OtherCost":0}}'
43
+ http_version:
44
+ recorded_at: Mon, 09 Oct 2017 19:39:23 GMT
45
+ recorded_with: VCR 3.0.3