Contacts

Contacts (or contactpersons) are normally linked to customers or suppliers, but can also exist as loosely coupled entities.

Contacts share the same structure as customers and suppliers where the name, addresses, phones and emails are located in the “BusinessRelation” sub-structure.

This means that the Contact itself is very simple, and most of the details are located in the “Info” property of the Contact entity.

GET

List of contacts:

GET /api/biz/contacts

Suggested arguments to expand address, phone and email and limit result to 10 rows with no hypermedia (hateoas) in response:

?expand=Info,Info.InvoiceAddress,Info.DefaultPhone,Info.DefaultEmail,Info.DefaultAddress&hateoas=false&top=10

Example response:

[{
	"ID": 1,
	"InfoID": 87,
	"Info": {
		"ID": 87,
		"DefaultEmailID": 8,
		"DefaultPhoneID": 41,
		"InvoiceAddressID": 107,
		"Name": "Mikke Mus Kontaktperson",
		"DefaultPhone": {
			"ID": 41,
			"BusinessRelationID": 0,
			"CountryCode": "+999",
			"Description": "Mobile",
			"Number": "999-999-999",
			"Type": "0",
		},
		"DefaultEmail": {
			"ID": 8,
			"BusinessRelationID": 0,
			"Deleted": false,
			"Description": null,
			"EmailAddress": "mikke@mus.com",
		},
		"InvoiceAddress": {
			"ID": 107,
			"AddressLine1": "Andebygaten 33b",
			"AddressLine2": "2 etg.",
			"AddressLine3": "",
			"BusinessRelationID": 0,
			"City": "Andeby",
			"Country": "DisneyWorld",
			"CountryCode": "DW",
			"PostalCode": "341234-A",
			"Region": null,
		}
	}
	"Comment": "First comment",
	}
]

Fetch single contact

GET /api/biz/contacts/1

Will return a single contact with ID = 1.

Suggested arguments

?expand=Info,Info.InvoiceAddress,Info.DefaultPhone,Info.DefaultEmail,Info.DefaultAddress

POST

Create contact:

POST /api/biz/contacts

Payload

{
  "Info": {
    "Name": "Mikke Mus Kontaktperson",
    "InvoiceAddress": {
        "AddressLine1": "Andebygaten 33b",
        "AddressLine2": "2 etg.",
        "AddressLine3": "",
        "City": "Andeby",
        "Country": "DisneyWorld",
        "CountryCode": "DW",
        "PostalCode": "341234-A",
      },
    "DefaultPhone": {
        "CountryCode": "+999",
        "Description": "Mobile",
        "Number": "999-999-999",
      },
    "DefaultEmail": {
        "EmailAddress": "mikke@mus.com",
      }
  },
  "Comment": "Her har vi en splitter ny kontaktperson"
}