API Reference
Start developing plugins for BizFusion.

 
Variant (VariantDTO)

You use variants to register product options.
E.g. a T-Shirt has the product options Size and Color.
You register Size and Color as variant records.

The variant values array contains the values that the user can choose from.
E.g. Size can have the values: S, M, L and XL.

Variant is part of the following relationships:
1. Invoice > Invoice Line > Invoice Variant > Variant Value > Variant
2. Product > Product Variant > Variant > Variant Value

Generic or Specific
You can create generic variants or product specific variants.
Set Product ID to null when you want to create a generic variant that can be
used on multiple products.


Properties
property data type reference
VariantId Int32 Primary Key
VariantName String
Timestamp String
ProductId Int32? (optional) ProductDTO
VariantValue Array of: VariantValueDTO


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


JSON sample
{
  "Timestamp": "AQIDFA==",
  "VariantId": 1,
  "VariantName": "Size",
  "ProductId": null,
  "VariantValue": [
    {
      "VariantValueId": 1,
      "VariantId": 1,
      "Value": "S",
      "Timestamp": "AQIDAA=="
    },
    {
      "VariantValueId": 2,
      "VariantId": 1,
      "Value": "M",
      "Timestamp": "AQIDAQ=="
    },
    {
      "VariantValueId": 3,
      "VariantId": 1,
      "Value": "L",
      "Timestamp": "AQIDAg=="
    },
    {
      "VariantValueId": 4,
      "VariantId": 1,
      "Value": "XL",
      "Timestamp": "AQIDAw=="
    },
    {
      "VariantValueId": 5,
      "VariantId": 1,
      "Value": "XXL",
      "Timestamp": "AQIDBA=="
    }
  ]
}


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.