API Reference
Start developing plugins for BizFusion.

 
Invoice (InvoiceDTO)

Most of you will probably use our API to register invoices that were created in other systems.
E.g. you can use our API to import invoices from a POS system.

Address
You can specify an invoice and/or shipping address on an invoice, but that's not required.
Addresses are completely optional on invoices.

Discount
The discount amount is a discount on the total amount of the invoice.

Notes
Everything that you put in field 'invoice note', is printed on the invoice of the customer.

Invoice Number
The field 'Invoice Number' is automatically set when you save the invoice.
Invoice Number is the reference number for customers.

Fulfill Invoice
You can ship all items on an invoice by using the 'PostFulfill' method.
You can only use this method on posted invoices.
Use the 'CanFulfill' method to check if there's enough stock available.


Properties
property data type reference
OpenAmount Decimal
InvoiceId Int32 Primary Key
InvoiceDate DateTime
CustomerId Int32 CustomerDTO
InvoiceNumber Int32
CreditTermId Int32 CreditTermDTO
InvoiceNote String
DiscountAmount Decimal
Timestamp String
InvoiceAddress Array of: InvoiceAddressDTO
InvoiceLine Array of: InvoiceLineDTO


Methods
method parameters URL
Get
/api/Invoice
Get
Int32 id
/api/Invoice?id={value}
Get
Int32 pageIndex, Int32 recordsPerPage
/api/Invoice?pageIndex={value}&recordsPerPage={value}
Post /api/Invoice
Put
Int32 id, InvoiceDTO record
/api/Invoice?id={value}
Delete
Int32 id, String timestamp
/api/Invoice?id={value}&timestamp={value}
PostFulfill
Int32 id
/api/InvoiceSet/Fulfill?id={value}
GetCanFulfill
Int32 id
/api/InvoiceSet/CanFulfill?id={value}
GetJournalTransactionId
Int32 id
/api/InvoiceSet/JournalTransactionId?id={value}
GetByYear
Int32 year
/api/InvoiceSet/ByYear?year={value}
GetByPeriod
DateTime startDate, DateTime endDate
/api/InvoiceSet/ByPeriod?startDate={value}&endDate={value}
GetRecordCount
/api/InvoiceSet/RecordCount
PostCashPayment
Int32 journalTransactionId
/api/InvoiceSet/CashPayment?journalTransactionId={value}
GetPayments
Int32 id
/api/InvoiceSet/Payments?id={value}
GetByCustomerId
Int32 id
/api/InvoiceSet/ByCustomerId?id={value}
PutUnpost
Int32 id, String timestamp
/api/InvoiceSet/Unpost?id={value}&timestamp={value}
PutUnpostAndDelete
Int32 id, String timestamp
/api/InvoiceSet/UnpostAndDelete?id={value}&timestamp={value}
GetByField
String field, String value
/api/InvoiceSet/ByField?field={value}&value={value}
GetAfterId
Int32 id
/api/InvoiceSet/AfterId?id={value}
GetBeforeId
Int32 id
/api/InvoiceSet/BeforeId?id={value}
GetMaxId
/api/InvoiceSet/MaxId


JSON sample
{
  "OpenAmount": 0.0,
  "InvoiceId": 1,
  "InvoiceDate": "2015-12-31T00:00:00",
  "CustomerId": 2,
  "InvoiceNumber": 100,
  "CreditTermId": 1,
  "InvoiceNote": null,
  "DiscountAmount": 0.0,
  "Timestamp": "AQIDFw==",
  "InvoiceAddress": [
    {
      "InvoiceAddressId": 1,
      "StreetName": "Wayne Manor",
      "BuildingNumber": "1",
      "Zipcode": "1122WM",
      "City": "Gotham City",
      "Province": "New York",
      "CountryId": 1,
      "InvoiceId": 1,
      "AddressTypeId": 2,
      "Timestamp": "AQIDGQ=="
    }
  ],
  "InvoiceLine": [
    {
      "InvoiceLineId": 0,
      "InvoiceId": 1,
      "ProductId": 1,
      "Description": "Playstation 4",
      "Quantity": 1,
      "Price": 299.0,
      "VatLineId": 1,
      "Timestamp": "AQIDGA==",
      "InvoiceVariant": []
    }
  ]
}


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.