fortnox-api 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -4
- data/fortnox-api.gemspec +2 -2
- data/lib/fortnox/api/mappers.rb +1 -1
- data/lib/fortnox/api/mappers/value/{country_code_string.rb → country_string.rb} +3 -3
- data/lib/fortnox/api/models/document.rb +2 -2
- data/lib/fortnox/api/types.rb +20 -8
- data/lib/fortnox/api/types/shim/{country_code_string.rb → country_string.rb} +1 -1
- data/lib/fortnox/api/version.rb +1 -1
- data/spec/fortnox/api/mappers/base_spec.rb +2 -2
- data/spec/fortnox/api/repositories/customer_spec.rb +27 -0
- data/spec/fortnox/api/types/country_code_spec.rb +10 -44
- data/spec/fortnox/api/types/country_spec.rb +67 -0
- data/spec/vcr_cassettes/customers/save_new_with_country_code_SE.yml +56 -0
- data/spec/vcr_cassettes/invoices/save_new_with_country.yml +18 -8
- data/spec/vcr_cassettes/invoices/save_new_with_country_GB.yml +18 -8
- data/spec/vcr_cassettes/invoices/save_new_with_country_KR.yml +18 -8
- data/spec/vcr_cassettes/invoices/save_new_with_country_Norge.yml +18 -8
- data/spec/vcr_cassettes/invoices/save_new_with_country_Norway.yml +18 -8
- data/spec/vcr_cassettes/invoices/save_new_with_country_Sverige.yml +18 -8
- data/spec/vcr_cassettes/invoices/save_new_with_country_VA.yml +18 -8
- data/spec/vcr_cassettes/invoices/save_new_with_country_VI.yml +18 -8
- data/spec/vcr_cassettes/invoices/save_new_with_country_empty_string.yml +18 -8
- data/spec/vcr_cassettes/invoices/save_new_with_country_nil.yml +18 -8
- data/spec/vcr_cassettes/invoices/save_old_with_empty_country.yml +19 -9
- data/spec/vcr_cassettes/invoices/save_old_with_nil_country.yml +19 -9
- metadata +11 -9
- data/spec/support/matchers/type/have_country_code_matcher.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a553a96a17c448e49472e1b41e703382defbda6a54427709145b8d60e02f34f
|
4
|
+
data.tar.gz: d7b3e147ad14c689c1fd24c7cf3529d3f951281c16d22bcbbf3c641ef2191d6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cef6687c30dca772585b966158dd94b17983c6393ca7e96fe619c154c0c312d7b4982978310a70469f0a4ddda0db2306a2fc6e9fc62ac31f45c2eb85930eb12f
|
7
|
+
data.tar.gz: 597a1bbf5704b5a020d6add724ac1a7e375ab610d19ab0c2ca342148a4727a1fe22ca75de82d69581366d5bc345259c211570f5a93b019ded657c11a73ba8ffc
|
data/CHANGELOG.md
CHANGED
@@ -4,15 +4,30 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [0.7.1]
|
8
|
+
### Fixed
|
9
|
+
- Invalid validation for Customer's country attributes
|
10
|
+
|
7
11
|
## [0.7.0]
|
8
12
|
### Added
|
9
|
-
- Adds build test for Ruby 2.6.0
|
13
|
+
- Adds build test for Ruby `2.6.0`, `2.6.3` and `2.7.0-preview`.
|
10
14
|
|
11
15
|
### Removed
|
12
|
-
- Drops support for Ruby < 2.4.0 since they are deprecated
|
16
|
+
- Drops support for Ruby < `2.4.0` since they are deprecated
|
13
17
|
|
14
18
|
### Fixed
|
15
|
-
- Country attribute for Invoice and Order is now validated correctly.
|
19
|
+
- Country attribute for `Invoice` and `Order` is now validated correctly.
|
16
20
|
- Fixes deprecation warnings
|
21
|
+
- Unlocks pinned `HTTParty` version
|
22
|
+
- Invalid email validation
|
23
|
+
|
24
|
+
## [0.6.3]
|
25
|
+
### Changed
|
26
|
+
- Pins `dry-types` to `< 0.13.0` due to breaking changes
|
27
|
+
|
28
|
+
### Fixed
|
29
|
+
- Model attribute `url` is no longer null
|
17
30
|
|
18
|
-
[0.7.
|
31
|
+
[0.7.1]: https://github.com/accodeing/fortnox-api/compare/v0.7.0...v0.7.1
|
32
|
+
[0.7.0]: https://github.com/accodeing/fortnox-api/compare/v0.6.3...v0.7.0
|
33
|
+
[0.6.3]: https://github.com/accodeing/fortnox-api/compare/v0.6.2...v0.6.3
|
data/fortnox-api.gemspec
CHANGED
@@ -9,13 +9,13 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
|
|
9
9
|
spec.name = 'fortnox-api'
|
10
10
|
spec.version = Fortnox::API::VERSION
|
11
11
|
spec.authors = ['Jonas Schubert Erlandsson', 'Hannes Elvemyr', 'Felix Holmgren']
|
12
|
-
spec.email = ['info@
|
12
|
+
spec.email = ['info@accodeing.com']
|
13
13
|
spec.summary = 'Gem to use Fortnox REST API in Ruby.'
|
14
14
|
spec.description = 'This gem uses the HTTParty library to abstract away the REST calls. It gives you access to a '\
|
15
15
|
'number of objects that behave a lot like ActiveRecord instances, giving you access to methods '\
|
16
16
|
'like `all`, `find`, `find_by_...` and so on. And each individual instance can be easily'\
|
17
17
|
'persistable to Fortnox again using the `save` method.'
|
18
|
-
spec.homepage = 'http://github.com/
|
18
|
+
spec.homepage = 'http://github.com/accodeing/fortnox-api'
|
19
19
|
spec.license = 'LGPL-3.0'
|
20
20
|
|
21
21
|
spec.files = `git ls-files -z`.split("\x0")
|
data/lib/fortnox/api/mappers.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
require 'fortnox/api/types'
|
4
4
|
|
5
5
|
require 'fortnox/api/mappers/value/array'
|
6
|
-
require 'fortnox/api/mappers/value/
|
6
|
+
require 'fortnox/api/mappers/value/country_string'
|
7
7
|
require 'fortnox/api/mappers/value/date'
|
8
8
|
require 'fortnox/api/mappers/value/hash'
|
9
9
|
require 'fortnox/api/mappers/value/identity'
|
@@ -5,10 +5,10 @@ require 'fortnox/api/mappers/base/canonical_name_sym'
|
|
5
5
|
module Fortnox
|
6
6
|
module API
|
7
7
|
module Mapper
|
8
|
-
class
|
8
|
+
class CountryString
|
9
9
|
extend CanonicalNameSym
|
10
10
|
|
11
|
-
|
11
|
+
CountryMapper = lambda do |code|
|
12
12
|
next code if code.nil? || code == ''
|
13
13
|
|
14
14
|
# Fortnox only supports Swedish country name for Sweden
|
@@ -17,7 +17,7 @@ module Fortnox
|
|
17
17
|
::ISO3166::Country[code].translations['en']
|
18
18
|
end
|
19
19
|
|
20
|
-
Registry.register(canonical_name_sym,
|
20
|
+
Registry.register(canonical_name_sym, CountryMapper)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
@@ -44,7 +44,7 @@ module Fortnox
|
|
44
44
|
attribute :contribution_value, Types::Nullable::Float.is(:read_only)
|
45
45
|
|
46
46
|
# Country Country for the document address.
|
47
|
-
attribute :country, Types::
|
47
|
+
attribute :country, Types::Country
|
48
48
|
|
49
49
|
# CostCenter Code of the cost center.
|
50
50
|
attribute :cost_center, Types::Nullable::String
|
@@ -74,7 +74,7 @@ module Fortnox
|
|
74
74
|
attribute :delivery_city, Types::Sized::String[1024]
|
75
75
|
|
76
76
|
# DeliveryCountry Country for the document delivery address.
|
77
|
-
attribute :delivery_country, Types::
|
77
|
+
attribute :delivery_country, Types::Country
|
78
78
|
|
79
79
|
# DeliveryDate Date of delivery.
|
80
80
|
attribute :delivery_date, Types::Nullable::Date
|
data/lib/fortnox/api/types.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
require 'dry-struct'
|
4
4
|
require 'dry-types'
|
5
5
|
require 'countries'
|
6
|
-
require 'fortnox/api/types/shim/
|
6
|
+
require 'fortnox/api/types/shim/country_string'
|
7
7
|
|
8
8
|
module Dry
|
9
9
|
module Types
|
@@ -47,21 +47,33 @@ module Fortnox
|
|
47
47
|
.optional
|
48
48
|
.constructor(EnumConstructors.default)
|
49
49
|
|
50
|
+
Country = Strict::String
|
51
|
+
.optional
|
52
|
+
.constructor do |value|
|
53
|
+
next value if value.nil? || value == ''
|
54
|
+
|
55
|
+
# Fortnox only supports Swedish translation of Sweden
|
56
|
+
next CountryString.new('SE') if value =~ /^s(e$|we|ve)/i
|
57
|
+
|
58
|
+
country = ::ISO3166::Country[value] ||
|
59
|
+
::ISO3166::Country.find_country_by_name(value) ||
|
60
|
+
::ISO3166::Country.find_country_by_translated_names(value)
|
61
|
+
|
62
|
+
raise Dry::Types::ConstraintError.new('value violates constraints', value) if country.nil?
|
63
|
+
|
64
|
+
CountryString.new(country.alpha2)
|
65
|
+
end
|
66
|
+
|
50
67
|
CountryCode = Strict::String
|
51
68
|
.optional
|
52
69
|
.constructor do |value|
|
53
70
|
next value if value.nil? || value == ''
|
54
71
|
|
55
|
-
|
56
|
-
next CountryCodeString.new('SE') if value =~ /^s(e$|we|ve)/i
|
57
|
-
|
58
|
-
country = ::ISO3166::Country[value] ||
|
59
|
-
::ISO3166::Country.find_country_by_name(value) ||
|
60
|
-
::ISO3166::Country.find_country_by_translated_names(value)
|
72
|
+
country = ::ISO3166::Country[value]
|
61
73
|
|
62
74
|
raise Dry::Types::ConstraintError.new('value violates constraints', value) if country.nil?
|
63
75
|
|
64
|
-
|
76
|
+
country.alpha2
|
65
77
|
end
|
66
78
|
|
67
79
|
Currency = Strict::String
|
data/lib/fortnox/api/version.rb
CHANGED
@@ -117,10 +117,10 @@ describe Fortnox::API::Mapper::Base do
|
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
120
|
-
describe '
|
120
|
+
describe 'Country' do
|
121
121
|
subject { mapper.call('GB') }
|
122
122
|
|
123
|
-
let(:mapper) { Fortnox::API::Registry[:
|
123
|
+
let(:mapper) { Fortnox::API::Registry[:countrystring] }
|
124
124
|
|
125
125
|
it { is_expected.to eq('United Kingdom') }
|
126
126
|
|
@@ -40,4 +40,31 @@ describe Fortnox::API::Repository::Customer, order: :defined, integration: true
|
|
40
40
|
|
41
41
|
# When recording new VCR casettes, expected matches must be increased
|
42
42
|
include_examples '.search', :name, 'Test', 30
|
43
|
+
|
44
|
+
describe 'country reference' do
|
45
|
+
describe 'with valid country code \'SE\'' do
|
46
|
+
subject(:customer) do
|
47
|
+
VCR.use_cassette("#{vcr_dir}/save_new_with_country_code_SE") do
|
48
|
+
repository.save(
|
49
|
+
described_class::MODEL.new(
|
50
|
+
name: 'Customer with Swedish country code',
|
51
|
+
country_code: 'SE'
|
52
|
+
)
|
53
|
+
)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
describe 'country code' do
|
58
|
+
subject { customer.country_code }
|
59
|
+
|
60
|
+
it { is_expected.to eq('SE') }
|
61
|
+
end
|
62
|
+
|
63
|
+
describe 'country' do
|
64
|
+
subject { customer.country }
|
65
|
+
|
66
|
+
it { is_expected.to eq('Sverige') }
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
43
70
|
end
|
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
4
|
require 'fortnox/api/types'
|
5
|
-
require 'fortnox/api/types/examples/types'
|
6
5
|
|
7
6
|
describe Fortnox::API::Types::CountryCode do
|
8
7
|
context 'with nil' do
|
@@ -21,54 +20,21 @@ describe Fortnox::API::Types::CountryCode do
|
|
21
20
|
it 'accepts country codes' do
|
22
21
|
expect(described_class['NO']).to eq 'NO'
|
23
22
|
end
|
24
|
-
|
25
|
-
it 'accepts nil' do
|
26
|
-
expect(described_class[nil]).to eq nil
|
27
|
-
end
|
28
|
-
|
29
|
-
it 'accepts empty string' do
|
30
|
-
expect(described_class['']).to eq ''
|
31
|
-
end
|
32
|
-
|
33
|
-
it 'translates English country names to country code' do
|
34
|
-
expect(described_class['Norway']).to eq 'NO'
|
35
|
-
end
|
36
|
-
|
37
|
-
it 'translates Swedish country names to country code' do
|
38
|
-
expect(described_class['Norge']).to eq 'NO'
|
39
|
-
end
|
40
|
-
|
41
|
-
describe 'special cases' do
|
42
|
-
valid_sweden_inputs = [
|
43
|
-
'SE', 'se', 'Sweden', 'sweden', 'Sverige', 'sverige',
|
44
|
-
:SE, :se, :Sweden, :sweden, :Sverige, :sverige
|
45
|
-
].freeze
|
46
|
-
|
47
|
-
valid_sweden_inputs.each do |sweden_input|
|
48
|
-
it "converts \"#{sweden_input}\" to \"SE\"" do
|
49
|
-
expect(described_class[sweden_input]).to eq 'SE'
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
it 'accepts country code for El Salvador' do
|
54
|
-
expect(described_class['SV']).to eq 'SV'
|
55
|
-
end
|
56
|
-
|
57
|
-
it 'translated Switzerland to ' do
|
58
|
-
expect(described_class['Switzerland']).to eq 'CH'
|
59
|
-
end
|
60
|
-
end
|
61
23
|
end
|
62
24
|
|
63
25
|
context 'with invalid input' do
|
64
|
-
|
65
|
-
|
66
|
-
|
26
|
+
describe 'valid country name' do
|
27
|
+
it do
|
28
|
+
expect do
|
29
|
+
described_class['Norway']
|
30
|
+
end.to raise_error(Dry::Types::ConstraintError)
|
31
|
+
end
|
32
|
+
end
|
67
33
|
|
68
|
-
|
69
|
-
it
|
34
|
+
describe 'invalid country code' do
|
35
|
+
it do
|
70
36
|
expect do
|
71
|
-
described_class[
|
37
|
+
described_class['XX']
|
72
38
|
end.to raise_error(Dry::Types::ConstraintError)
|
73
39
|
end
|
74
40
|
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
require 'fortnox/api/types'
|
5
|
+
|
6
|
+
describe Fortnox::API::Types::Country do
|
7
|
+
context 'with nil' do
|
8
|
+
subject { described_class[nil] }
|
9
|
+
|
10
|
+
it { is_expected.to be_nil }
|
11
|
+
end
|
12
|
+
|
13
|
+
context 'with empty string' do
|
14
|
+
subject { described_class[''] }
|
15
|
+
|
16
|
+
it { is_expected.to eq('') }
|
17
|
+
end
|
18
|
+
|
19
|
+
context 'with valid input' do
|
20
|
+
it 'accepts country codes' do
|
21
|
+
expect(described_class['NO']).to eq 'NO'
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'translates English country names to country code' do
|
25
|
+
expect(described_class['Norway']).to eq 'NO'
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'translates Swedish country names to country code' do
|
29
|
+
expect(described_class['Norge']).to eq 'NO'
|
30
|
+
end
|
31
|
+
|
32
|
+
describe 'special cases' do
|
33
|
+
valid_sweden_inputs = [
|
34
|
+
'SE', 'se', 'Sweden', 'sweden', 'Sverige', 'sverige',
|
35
|
+
:SE, :se, :Sweden, :sweden, :Sverige, :sverige
|
36
|
+
].freeze
|
37
|
+
|
38
|
+
valid_sweden_inputs.each do |sweden_input|
|
39
|
+
it "converts \"#{sweden_input}\" to \"SE\"" do
|
40
|
+
expect(described_class[sweden_input]).to eq 'SE'
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'accepts country code for El Salvador' do
|
45
|
+
expect(described_class['SV']).to eq 'SV'
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'translated Switzerland to ' do
|
49
|
+
expect(described_class['Switzerland']).to eq 'CH'
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
context 'with invalid input' do
|
55
|
+
invalid_inputs = [
|
56
|
+
'SEA', 'S', 'nonsense', :s
|
57
|
+
].freeze
|
58
|
+
|
59
|
+
invalid_inputs.each do |invalid_input|
|
60
|
+
it "#{invalid_input} raises Dry::Types::ConstraintError" do
|
61
|
+
expect do
|
62
|
+
described_class[invalid_input]
|
63
|
+
end.to raise_error(Dry::Types::ConstraintError)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.fortnox.se/3/customers/
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"Customer":{"CountryCode":"SE","Name":"Customer with Swedish country
|
9
|
+
code"}}'
|
10
|
+
headers:
|
11
|
+
Content-Type:
|
12
|
+
- application/json
|
13
|
+
Accept:
|
14
|
+
- application/json
|
15
|
+
Client-Secret:
|
16
|
+
- 9aBA8ZgsvR
|
17
|
+
Access-Token:
|
18
|
+
- ccaef817-d5d8-4b1c-a316-54f3e55c5c54
|
19
|
+
response:
|
20
|
+
status:
|
21
|
+
code: 201
|
22
|
+
message: Created
|
23
|
+
headers:
|
24
|
+
Server:
|
25
|
+
- nginx
|
26
|
+
Date:
|
27
|
+
- Sat, 31 Aug 2019 18:40:48 GMT
|
28
|
+
Content-Type:
|
29
|
+
- application/json
|
30
|
+
Connection:
|
31
|
+
- close
|
32
|
+
Location:
|
33
|
+
- customers
|
34
|
+
X-Rack-Responsetime:
|
35
|
+
- '1007'
|
36
|
+
X-Uid:
|
37
|
+
- d8955922
|
38
|
+
X-Build:
|
39
|
+
- b1e7c74853
|
40
|
+
Strict-Transport-Security:
|
41
|
+
- max-age=31536000; includeSubdomains
|
42
|
+
X-Xss-Protection:
|
43
|
+
- 1; mode=block
|
44
|
+
X-Content-Type-Options:
|
45
|
+
- nosniff
|
46
|
+
X-Frame-Options:
|
47
|
+
- sameorigin
|
48
|
+
Referrer-Policy:
|
49
|
+
- strict-origin-when-cross-origin
|
50
|
+
body:
|
51
|
+
encoding: UTF-8
|
52
|
+
string: '{"Customer":{"@url":"https:\/\/api.fortnox.se\/3\/customers\/230","Address1":null,"Address2":null,"City":null,"Country":"Sverige","Comments":null,"Currency":"SEK","CostCenter":null,"CountryCode":"SE","Active":true,"CustomerNumber":"230","DefaultDeliveryTypes":{"Invoice":"PRINT","Order":"PRINT","Offer":"PRINT"},"DefaultTemplates":{"Order":"DEFAULTTEMPLATE","Offer":"DEFAULTTEMPLATE","Invoice":"DEFAULTTEMPLATE","CashInvoice":"DEFAULTTEMPLATE"},"DeliveryAddress1":null,"DeliveryAddress2":null,"DeliveryCity":null,"DeliveryCountry":null,"DeliveryCountryCode":null,"DeliveryFax":null,"DeliveryName":null,"DeliveryPhone1":null,"DeliveryPhone2":null,"DeliveryZipCode":null,"Email":"","EmailInvoice":"","EmailInvoiceBCC":"","EmailInvoiceCC":"","EmailOffer":"","EmailOfferBCC":"","EmailOfferCC":"","EmailOrder":"","EmailOrderBCC":"","EmailOrderCC":"","ExternalReference":null,"Fax":null,"GLN":null,"GLNDelivery":null,"InvoiceAdministrationFee":null,"InvoiceDiscount":null,"InvoiceFreight":null,"InvoiceRemark":"","Name":"Customer
|
53
|
+
with Swedish country code","OrganisationNumber":"","OurReference":"","Phone1":null,"Phone2":null,"PriceList":"A","Project":"","SalesAccount":null,"ShowPriceVATIncluded":false,"TermsOfDelivery":"","TermsOfPayment":"","Type":"COMPANY","VATNumber":"","VATType":"SEVAT","VisitingAddress":null,"VisitingCity":null,"VisitingCountry":null,"VisitingCountryCode":null,"VisitingZipCode":null,"WayOfDelivery":"","WWW":"","YourReference":"","ZipCode":null}}'
|
54
|
+
http_version:
|
55
|
+
recorded_at: Sat, 31 Aug 2019 18:40:48 GMT
|
56
|
+
recorded_with: VCR 4.0.0
|
@@ -23,7 +23,7 @@ http_interactions:
|
|
23
23
|
Server:
|
24
24
|
- nginx
|
25
25
|
Date:
|
26
|
-
-
|
26
|
+
- Sun, 01 Sep 2019 07:02:19 GMT
|
27
27
|
Content-Type:
|
28
28
|
- application/json
|
29
29
|
Connection:
|
@@ -31,16 +31,26 @@ http_interactions:
|
|
31
31
|
Location:
|
32
32
|
- invoices
|
33
33
|
X-Rack-Responsetime:
|
34
|
-
- '
|
34
|
+
- '87'
|
35
35
|
X-Uid:
|
36
|
-
-
|
36
|
+
- 6b4d3446
|
37
37
|
X-Build:
|
38
|
-
-
|
38
|
+
- b1e7c74853
|
39
|
+
Strict-Transport-Security:
|
40
|
+
- max-age=31536000; includeSubdomains
|
41
|
+
X-Xss-Protection:
|
42
|
+
- 1; mode=block
|
43
|
+
X-Content-Type-Options:
|
44
|
+
- nosniff
|
45
|
+
X-Frame-Options:
|
46
|
+
- sameorigin
|
47
|
+
Referrer-Policy:
|
48
|
+
- strict-origin-when-cross-origin
|
39
49
|
body:
|
40
50
|
encoding: UTF-8
|
41
|
-
string: '{"Invoice":{"@url":"https:\/\/api.fortnox.se\/3\/invoices\/
|
42
|
-
name","CustomerNumber":"1","DeliveryAddress1":"","DeliveryAddress2":"","DeliveryCity":"","DeliveryCountry":"","DeliveryDate":null,"DeliveryName":"","DeliveryZipCode":"","DocumentNumber":"
|
43
|
-
{no} bifogas","EmailBody":" "},"EUQuarterlyReport":false,"ExternalInvoiceReference1":"","ExternalInvoiceReference2":"","Freight":0,"FreightVAT":0,"Gross":0,"HouseWork":false,"InvoiceDate":"2019-
|
51
|
+
string: '{"Invoice":{"@url":"https:\/\/api.fortnox.se\/3\/invoices\/144","@urlTaxReductionList":"https:\/\/api.fortnox.se\/3\/taxreductions?filter=invoices&referencenumber=144","AdministrationFee":0,"AdministrationFeeVAT":0,"Address1":"","Address2":"","Balance":0,"BasisTaxReduction":0,"Booked":false,"Cancelled":false,"City":"","Comments":"","ContractReference":0,"ContributionPercent":0,"ContributionValue":0,"Country":"Sverige","CostCenter":"","Credit":"false","CreditInvoiceReference":0,"Currency":"SEK","CurrencyRate":1,"CurrencyUnit":1,"CustomerName":"Old
|
52
|
+
name","CustomerNumber":"1","DeliveryAddress1":"","DeliveryAddress2":"","DeliveryCity":"","DeliveryCountry":"","DeliveryDate":null,"DeliveryName":"","DeliveryZipCode":"","DocumentNumber":"144","DueDate":"2019-09-01","EDIInformation":{"EDIGlobalLocationNumber":"","EDIGlobalLocationNumberDelivery":"","EDIInvoiceExtra1":"","EDIInvoiceExtra2":"","EDIOurElectronicReference":"","EDIYourElectronicReference":""},"EmailInformation":{"EmailAddressFrom":null,"EmailAddressTo":"","EmailAddressCC":null,"EmailAddressBCC":null,"EmailSubject":"Faktura
|
53
|
+
{no} bifogas","EmailBody":" "},"EUQuarterlyReport":false,"ExternalInvoiceReference1":"","ExternalInvoiceReference2":"","Freight":0,"FreightVAT":0,"Gross":0,"HouseWork":false,"InvoiceDate":"2019-09-01","InvoicePeriodStart":"","InvoicePeriodEnd":"","InvoiceReference":0,"InvoiceRows":[],"InvoiceType":"INVOICE","Labels":[],"Language":"SV","LastRemindDate":null,"Net":0,"NotCompleted":false,"NoxFinans":false,"OCR":"14456","OfferReference":0,"OrderReference":0,"OrganisationNumber":"860101-8735","OurReference":"","PaymentWay":"","Phone1":"","Phone2":"","PriceList":"A","PrintTemplate":"st","Project":"","WarehouseReady":true,"OutboundDate":"2019-09-01","Remarks":"","Reminders":0,"RoundOff":0,"Sent":false,"TaxReduction":null,"TermsOfDelivery":"","TermsOfPayment":0,"Total":0,"TotalToPay":0,"TotalVAT":0,"VATIncluded":false,"VoucherNumber":null,"VoucherSeries":null,"VoucherYear":null,"WayOfDelivery":"","YourOrderNumber":"","YourReference":"","ZipCode":"","AccountingMethod":"ACCRUAL","FinalPayDate":null}}'
|
44
54
|
http_version:
|
45
|
-
recorded_at:
|
55
|
+
recorded_at: Sun, 01 Sep 2019 07:02:19 GMT
|
46
56
|
recorded_with: VCR 4.0.0
|