Vouchers

Create a voucher

POST api/vouchers


This example creates a voucher with ID TEST123 and Value 5.00 (Main Currency).

Ensure a Voucher Type with ID 1 exists.

{
  "VoucherId": "TEST123",
  "Value": 5,
  "VoucherTypeId": 1
}

Get a voucher

GET /api/vouchers/TEST123


Gets the voucher with ID "TEST123"


{
"Result":{
"VoucherId": "TEST123",
"Value": 5.0000,
"CreatedDate": "2021-04-12T16:19:31.817",
"VoucherTypeId": 1,
"IsActive": true
},
"IsSuccessful": true,
"Message": ""
}


Consume a voucher

A value-based voucher cannot be deleted or consumed. This must be done via transactions api.

POST /api/transactions


Consumes a voucher "TEST123" with transaction type 11 ("Einnahmen")

The remaining value of voucher "TEST123" is now 2.20.

{
  "TransactionTypeId": 11,
  "Amount": 2.8,
  "TransactionArticles": [],
  "TransactionVouchers": [
    {
      "VoucherId": "TEST123",
      "Amount": 2.8
    }
  ]
}

Articlegroup

Create an article group

POST api/articlegroups


{
    "MainGroupTitle": "Sortiment",
    "TradeGroupTitle": "Lebensmittel",
    "ArticleGroupTitle": "Milchprodukte",
    "IsInoperative": false
 }

Customer

Create a customer

POST /api/customers


{
  "CustomerNumber":"123",
  "LanguageId":"de",
  "IsCompany":1,
  "CompanyName":"Sequens IT GmbH",
  "Salutation":"Herr",
  "Firstname":"Travis",
  "Name":"Beltrametti",
  "Street":"Viktoriastrasse",
  "StreetNumber":"84",
  "Zip":"3013",
  "City":"Bern",
  "CountryIsoCode":"CH",
  "ContactMobile":"0797752588",
  "Birthdate":"2010-03-03",
  "Notes":"Wünscht keine Werbung",
  "CustomerProfile": "Standardprofil"
} 

Transactions

Book a transaction

api/transactions


Example for a sale. Not the Transaction-Amount (37.40) must match the total sum of the articles and the total sum of payments + vouchers.

{
  "TransactionTypeId": 1,
  "CustomerId": 123,
  "Amount": 37.4,
  "Remarks": "Beleg behalten",
  "TransactionArticles": [
    {
      "ReceiptPosition": 1,
      "ArticleId": 1,
      "Title": "Spaghetti Barilla 500g",
      "Quantity": 8,
      "TaxRate": 0.025,
      "UnitPrice": 2.8,
      "Discount": 0,
      "DiscountPercent": null,
      "Price": 22.4
    },
    {
      "ReceiptPosition": 2,
      "ArticleId": 2,
      "Title": "Tomaten Sauce 1 Dose",
      "Quantity": 2,
      "TaxRate": 0.025,
      "UnitPrice": 5.2,
      "Discount": 0.4,
      "DiscountPercent": null,
      "Price": 10
    },
    {
      "ReceiptPosition": 3,
      "ArticleId": 5,
      "Title": "Lieferkosten",
      "Quantity": 1,
      "TaxRate": 0.025,
      "UnitPrice": 5,
      "Discount": 0,
      "DiscountPercent": null,
      "Price": 5
    }
  ],
  "TransactionPayments": [
    {
      "PaymentTypeId": 1,
      "Amount": 27.4,
      "ExchangeRate": 1
    }
  ],
  "TransactionVouchers": [
    {
        "VoucherId" : "123",
        "Value" : 5
    },
    {
        "VoucherId" : "321",
         "Value" : 5
    }     
  ]
}