API Reference
Start developing plugins for BizFusion.

 
Customer (CustomerDTO)

BizFusion doesn't make a distinction between debtors and creditors or consumers and vendors.
We register everyone as a customer in BizFusion.

Data Context
A customer plays the role of a consumer/debtor when we place her on an invoice.
Likewise, a customer plays the role of a supplier/creditor when we place her on a purchase invoice.
So the context of a customer determines the role that she plays.

No Duplication
This is different from other systems where you often see the same contact registered as a customer and a vendor.
This creates data duplication and that leads to a whole host of problems.
E.g. you have to update the contact's information in two places if she moves to a different country.

Customer Type
The customer type specifies if the customer is a: Company, Person or Employee.


Properties
property data type reference
CustomerId Int32 Primary Key
CustomerName String
CustomerTypeId Int32 CustomerTypeDTO
Email String
PhoneNumber String
CustomerGroupId Int32 CustomerGroupDTO
VatNumber String
CommerceNumber String
Timestamp String
Address Array of: AddressDTO
ContactPerson Array of: ContactPersonDTO
BankAccount Array of: BankAccountDTO


Methods
method parameters URL
Get
/api/Customer
Get
Int32 id
/api/Customer?id={value}
Get
Int32 pageIndex, Int32 recordsPerPage
/api/Customer?pageIndex={value}&recordsPerPage={value}
Post /api/Customer
Put
Int32 id, CustomerDTO record
/api/Customer?id={value}
Delete
Int32 id, String timestamp
/api/Customer?id={value}&timestamp={value}
GetRecordCount
/api/CustomerSet/RecordCount
GetByCustomerId
Int32 id
/api/CustomerSet/ByCustomerId?id={value}
GetByField
String field, String value
/api/CustomerSet/ByField?field={value}&value={value}
GetAfterId
Int32 id
/api/CustomerSet/AfterId?id={value}
GetBeforeId
Int32 id
/api/CustomerSet/BeforeId?id={value}
GetMaxId
/api/CustomerSet/MaxId


JSON sample
{
  "Timestamp": "AQIDCw==",
  "CustomerId": 2,
  "CustomerName": "Bruce Wayne",
  "CustomerTypeId": 1,
  "Email": null,
  "PhoneNumber": null,
  "CustomerGroupId": 1,
  "VatNumber": null,
  "CommerceNumber": null,
  "Address": [
    {
      "Timestamp": "AQIDDQ==",
      "AddressId": 1,
      "StreetName": "Wayne Manor",
      "BuildingNumber": "1",
      "Zipcode": "1122WM",
      "City": "Gotham City",
      "Province": "New York",
      "CountryId": 1,
      "CustomerId": 2,
      "AddressTypeId": 1
    }
  ],
  "ContactPerson": [
    {
      "Timestamp": "AQIDDg==",
      "ContactPersonId": 1,
      "CustomerId": 2,
      "FirstName": "Bruce",
      "LastName": "Wayne",
      "Initials": "B",
      "GenderId": 1
    }
  ],
  "BankAccount": [
    {
      "BankAccountId": 1,
      "BankAccountNumber": "123456789",
      "BankId": 2,
      "CustomerId": 2,
      "Timestamp": "AQIDDw=="
    }
  ]
}


General Info

- Numbers should be in English format: 124.99
- Dates look like: 2014-12-31T00:00:00
- Time information is ignored.
- Concurrency is handled through timestamps

Create Record (POST)

- Primary keys are not required when doing a post.
- Timestamps are not required when doing a post.
- Provide the JSON record in the body of the post request.

Update Record (PUT)

- Timestamps are required.
- Provide the JSON record in the body of the put request.

Delete Record (DELETE)

- Primary key and Timestamp are required.