REST API addresses are incomplete
When adding a complete address including city, street etc. the attributes aren’t present in the API response.
The response:
“billingaddress”=>
{“links”=>
[{“rel”=>”self”,
“href”=>
“https://xxx-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/invoice/11073/billingaddress”}],
“addrText”=>”Netherlands”,
“country”=>”NL”,
“override”=>false},
How can I also fetch the city, addr1 fields? They should be present according to https://system.netsuite.com/help/helpcenter/en_US/APIs/REST_API_Browser/record/v1/2020.1/index.html#/definitions/invoice-billingaddress
Do a GET on https://xxx-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/invoice/11073/billingaddress
or if performance isn’t a premium, use expandSubResources
This is the result after expanding battk. A GET on https://xxx-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/invoice/11073/billingaddress has the same results
I, [2020-07-02T15:15:45.264663 #76193] INFO — : get https://xxx-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/invoice/11073/billingaddress
ETHON: performed EASY effective_url=https://xxx-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/invoice/11073/billingaddress response_code=200 return_code=ok total_time=1.566763
I, [2020-07-02T15:15:46.836352 #76193] INFO — Status: 200
=> “{\”links\”:[{\”rel\”:\”self\”,\”href\”:\”https://xxx-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/invoice/11073/billingaddress\”}],\”addrText\”:\”Netherlands\”,\”country\”:\”NL\”,\”override\”:false}\n”
Are you sure the address is actually set on the invoice and not the customer?
Setting it on the invoice works, it was empty before and thought it would automatically fallback to the customer billing address.
I have not yet found a way to fetch the billing address from the customer. I can see the field “defaultAddress” is filled with the specified address, but would expect a billingaddress entry / addressbook entry in the expanded “entity” in the response of an invoice.
There should be a long trail to follow from the addressbook on the customer