Cambia lingua

Introduction

This documentation lists the public functions which you can send and receive data from SimplyDevelop applications through the service WService using REST API calls, with data exchanged in JSon format.

 

API calls must be sent to the WService through TCP port 3055

 

https://<WService_IP_Address>:3055

 

E.g. localhost url https://127.0.0.1:3055

 

Each API request must include a SessionCode.

The session expires 30 minutes after the last call or immediately after a new login by the same user with a new SessionCode.

 

Available Operations

 

Method

Description

GET

Retrieve records

POST

Create or update records

DELETE

Delete records 

Authentication

Authentication is Basic Auth type, wwith username and password as specified in WService inside the user management of the Midware section. Otherwise with username and password, but via POST request.

 

Authentication can be done using the standard GET or POST request, as shown in the examples below.

 

Method

Url

GET

/api/login

 

Method

Url

Body Text

POST

/api/login

{

   "User": "midwareadmin"

   "Password": "password"

}

Example Response

 

{

    "ResponseRequest": "login",

    "SuccessStatus": true,

    "SessionCode": "KG0RNCAYLFDVPNDZHT",

    "User": "midwareadmin"

    "Data": "",

    "LastLogin": "1899-12-30T00:00:00.000+01:00"

}

Departments

Available Fields

 

Element

Description

Type

Max.

Size

Req’d

Read

Only

DEPARTMENTS

iddepartment

Department ID

INTEGER

 

 

 

departmentcode

Department Code

INTEGER

 

 

 

departmentname

Department Description

STRING

40

 

idvat

VAT ID

INTEGER

 

 

 

vatcode

VAT Code

STRING

 

 1

 

vatname

VAT Description

STRING

100

 

 

vatpercentage

VAT Percentage Value

FLOAT

 

 1

 

tickets

Accepts Tickets

BOOLEAN

 

 

 

discounts

Accepts Discounts

BOOLEAN

 

 

 

promotions

Accepts Promotions

BOOLEAN

 

 

 

points

Accepts Points

BOOLEAN

 

 

 

 

Legenda

 

1 If it is not present, will be insert. 

Read

Department records can be retrieved via standard GET requests, or alternatively via POSTrequest, using the GET prefix as shown in the examples below.

 

Method

Url

GET

/api/departments/{SessionCode}

GET

/api/departments/{SessionCode}?iddepartment={id}

 

Method

Url

Body Text

POST

/api/getdepartments/{SessionCode}

 

POST

/api/getdepartments/{SessionCode}?iddepartment={id}

 

POST

/api/getdepartments

{

   "SessionCode": "KG..HT"

   "iddepartment": "id"

}

Example Response

 

{

    "ResponseRequest": "departments",

    "SuccessStatus": true,

    "departments": [

        {

            "iddepartment": 1,

            "departmentcode": 1,

            "departmentname": "REPARTO PROVA",

            "idvat": 1,

            "vatcode": "22",

            "vatname": "IVA 22%",

            "vatpercentage": 22,

            "tickets": true,

            "discounts": true,

            "promotions": false,

            "points": true

        }

    ]

}

Write

Insert operations for departments can be done using POST requests as shown in the relevant table below.

 

Method

Url

Body Text

POST

/api/setdepartments

{

   "SessionCode": "KG..HT"

   "iddepartment": "id"

}

Delete

Delete operations can be done using the standard DELETE method, or alternatively via POSTrequest, using the DEL prefix as shown in the examples below.

 

Method

Url

DELETE

/api/departments/{SessionCode}?iddepartment={id}

 

Method

Url

Body Text

POST

/api/deldepartments/{SessionCode}?iddepartment={id}

 

POST

/api/deldepartments

{

   "SessionCode": "KG..HT"

   "iddepartment": "id"

}

Products

Available Fields

 

Element

Description

Type

Max.

Size

Req’d

Read

Only

PRODUCTS

idproduct

Product ID

INTEGER

 

 1

 

productcode

Product Code

STRING

20

 1

 

productname

Product Description

STRING

40

 1

 

referencename

Alternative Description (web)

STRING

20

 

 

extendedproductname

Extended Product Description

STRING

1000

 

 

iddepartment

Department ID

INTEGER

 

 2

 

departmentcode

Department Code

STRING

 

 2

 

departmentname

Department Description

STRING

40

 

 

idvat

VAT ID

INTEGER

 

 

 

vatcode

VAT Code

STRING

10

 3

 

vatname

VAT Description

STRING

100

 

 

vatpercentage

VAT Percentage Value

FLOAT

 

 3

 

netproductcost

Net Product Cost

CURRENCY

 

 

 

boxquantity

Quantity per Package (Packaging)

FLOAT

 

 

 

idum

Unit Measure ID

INTEGER

 

 

 

umcode

Unit Measure Code

STRING

10

 

 

idlabelum

Label Unit Measure ID

INTEGER

 

 

 

labelumcode

Label Unit Measure Code

STRING

10

 

 

idbrand

Manufacturer ID

INTEGER

 

 

 

brandname

Manufacturer Description

STRING

50

 

 

idproducttypolgy

Product Type ID

INTEGER

 

 

 

producttyplogyname

Product Type Description

STRING

50

 

 

zeroprice

Sellable at “Zero Price”

BOOLEAN

 

 

 

variableprice

Sellable at “Variable Price”

BOOLEAN

 

 

 

tickets

Accepts Tickets

BOOLEAN

 

 

 

discounts

Accepts Discounts

BOOLEAN

 

 

 

promotions

Accepts Promotions

BOOLEAN

 

 

 

points

Accepts Points

BOOLEAN

 

 

 

insertdate

Insert Date (Creation Date)

DATETIME

 

 

lastmodifydate

Last Modification Date

DATETIME

 

 

PRICES

idprice

Price List ID

INTEGER

 

 

 

pricevalue

List Price

CURRENCY

 

 

 

pricename

Price List Description

STRING

100

 

 

pricecode

Price List Code

STRING

4

 

 

BARCODES

idbarcodeproduct

Product EAN ID

INTEGER

 

 

 

barcode

EAN Code4

STRING

13

 

 

packquantity

Quantity per Package

FLOAT

 

 

 

 

Legend

 

1 If idproduct is not provided, the system will search by productcode. 

If not found, it will hooked the first product find via barcode (in order of EAN).

If not found and there is no EAN with empty productcode, it is searched for productname.

 

2 Numeric type string. If omitted on new product, it will be assigned the default department settled in the Tracciati Import. 

 

If omitted, it is inherited from the Department. If not present in the archive, it will be insert.

 

If empty, it will be generated automatically.

Read

Products records can be retrieved via standard GET requests, or alternatively via POSTrequest, using the GET prefix as shown in the examples below.

 

Method

Url

GET

/api/products/{SessionCode}

GET

/api/products/{SessionCode}?idproduct={id}

 

Method

Url

Body Text

POST

/api/getproducts/{SessionCode}

 

POST

/api/getproducts/{SessionCode}?idproduct={id}

 

POST

/api/getproducts

{

   "SessionCode": "KG..HT"

   "idproduct": "id"

}

Example Response

 

{

    "idproduct ": 1,

    "productcode": "0001",

    "productname": "Prodotto Prova",

    "referencename": "Prodotto Prova Web",

    "extendedproductname": "Prodotto Prova Esteso",

    "iddepartment": 1,

    "departmentcode": "0001",

    "departmentname": "Reparto Prova",

    "idvat": 1,

    "vatcode": "22",

    "vatname": "IVA 22%",

    "vatpercentage": 22.00,

    "netcostproduct": 1.20,

    "boxquantity": 1.00,

    "idum": 1,

    "umcode": "PZ",

    "idlabelum": 1,

    "labelumcode": "PZ",

    "idbrand": 1,

    "brandname": "Produttore Prova", 

    "idproducttyplogy": 1,

    "producttyplogyname": "Tipologia Prova",

    "zeroprice": false,

    "variableprice": true,

    "tickets": true,

    "discounts": true,

    "promotions": false,

    "points": true,

    "insertdate": "2021-01-01T08:00:00",

    "lastmodifydate": "2025-03-01T12:00:00",

    "PRICES": [ 

        {

            "idprice": 1,

            "pricevalue": 2.50,

            "pricename": "Listino Prova",

            "pricecode": "0001"

        }

    ],

    "BARCODES": [ 

        {

            "idbarcodeproduct": 1234,

            "barcode": "1234567891234",

            "packquantity": 1.00

        }

    ]

}

Write

Insert operations for products can be performed using POST requests as shown in the relevant table below.

 

Method

Url

Body Text

POST

/api/setproducts

{

   "SessionCode": "KG..HT"

   "idproduct": "id"

}

Delete

Delete operations can be done using the standard DELETE method, or alternatively via POSTrequest, using the DEL prefix as shown in the examples below.

 

Method

Url

DELETE

/api/products/{SessionCode}?idproduct={id}

 

Method

Url

Body Text

POST

/api/delproducts/{SessionCode}?idproduct={id}

 

POST

/api/delproducts

{

   "SessionCode": "KG..HT"

   "idproduct": "id"

}

Documenti

Available Fields

 

Element

Description

Type

Max.

Size

Req’d

Read

Only

Filter

documents

idmovement

Movement ID

INTEGER

 

 

 

 

documenttype

Document Type. For receipt, calculated automatically from MovementCode (See Table 1)

STRING

3

 

 

 

origintype

Origin Type. Default receipt=POS (See Table 2)

STRING

3

 

 

 

idcompany

Company ID

INTEGER

 

 

 

 

idmovementcode

Movement Code ID. If filled, takes priority over MovementCode

INTEGER

 

 

 

 

movementcodename

Movement Code Description. Search for the Movement Code and automatically fill in the unvalued fields (Automatically fills fields with "---")

STRING

 

 

 

 

receipttype

Receipt Type. Using internal Movement Codes (See Table 3)

STRING

1

 

 

 

cussup

Customer/Supplier. C=Customer; S=Supplier

STRING

1

 

 

 

inout

In/Out. I=In; O=Out (autocomplete)

STRING

1

 

 

 

depositdocument

Down payment document

BOOLEAN

 

 

 

 

movementdate

Movement Date. Default insert date (Now)

DATETIME

 

 

 

 

year

Year

INTEGER

 

 

 

 

month

Month

INTEGER

 

 

 

 

week

Week

INTEGER

 

 

 

 

documentnumber

Document Number (For receipts: receipt number)

INTEGER

 

 

 

 

localdocumentnumber

Local Document Number

INTEGER

 

 

 

 

documenttransactionnumber

Transaction Document Number. Formatted document number; for receipts: transaction number

STRING

100

 

 

 

documentdate

Document Date. Default: Movement Date

DATETIME

 

 

 

 

idorigin

Source ID. Default: POS Number or Company Number

INTEGER

 

 

 

 

originname

Source Description

STRING

250

 

 

 

taxcode

Tax Code

STRING

16

 

 

 

vatcode

VAT Number

STRING

16

 

 

 

address

Address

STRING

100

 

 

 

zipcode

ZIP Code

STRING

5

 

 

 

city

City

STRING

20

 

 

 

country

Province

STRING

2

 

 

 

phonenumber

Phone Number

STRING

30

 

 

 

faxnumber

Fax Number

STRING

30

 

 

 

destination

Destination

STRING

250

 

 

 

destinationaddress

Destination Address

STRING

100

 

 

 

destinationzipcode

Destination ZIP Code

STRING

5

 

 

 

destinationcity

Destination City

STRING

50

 

 

 

destinationcountry

Destination Province

STRING

2

 

 

 

destinationphonenumber

Destination Phone Number

STRING

30

 

 

 

destinationfaxnumber

Destination Fax Number

STRING

30

 

 

 

taxabletotal

Taxable Total

CURRENCY

 

 

 

 

vattotal

VAT Total

CURRENCY

 

 

 

 

documenttotal

Document Total

CURRENCY

 

 

 

 

idpaymentmethod

Payment Method ID

INTEGER

 

 

 

 

idpaymenttype

Payment Type ID

INTEGER

 

 

 

 

notes

Notes

STRING

1500

 

 

 

canceleddocument

Document Deletion Date

DATETIME

 

 

 

 

idpos

POS ID

INTEGER

 

 

 

 

idcashier

Cashier ID. For POS sales

INTEGER

 

 

 

 

suspendedreceipt

Suspended Receipt. For POS sales

BOOLEAN

 

 

 

 

pec

Certified Email (PEC)

STRING

100

 

 

 

cashmachineserialnumber

Fiscal Device Serial Number

STRING

15

 

 

 

documentrows

idrowmovement

Movement Row ID

INTEGER

 

 

 

 

documentdate

Document Date. From header

DATETIME

 

 

 

 

registrationdate

Registration Date. Now

DATETIME

 

 

 

 

qtymovement

Quantity Movement. -1=Out; 1=In; 0=No Movement

INTEGER

 

 

 

 

valmovement

Value Movement. -1=Out; 1=In; 0=No Movement

INTEGER

 

 

 

 

insertmethod

Insert Method. Default=N (see Table 4)

STRING

1

 

 

 

rowtype

Row Type. Default=P (see Table 5)

STRING

1

 

 

 

productcode

Product Code. Scratch Card Lot Code

STRING

30

 

 

 

rowdescription

Row Description. Product Name; Discount Description...

STRING

1000

 

 

 

producttype

Product Type. Default "PRD" if idproduct>0, "REP" if iddepartment>0, otherwise "NIL" (see Table 6)

STRING

3

 

 

 

idproduct

Product ID

INTEGER

 

 

 

 

idbarcodeproduct

Product EAN ID

INTEGER

 

 

 

 

barcode

EAN Code

STRING

13

 

 

 

qtycode

Quantity Code. If empty, taken from MovementCode

STRING

 

 

 

 

qtymovement

Movement Quantity. Row quantity

DOUBLE

 

 

 

 

vatpercentage

VAT Percentage Value. Used to calculate amounts

DOUBLE

 

 

 

 

netprice

Net Price

CURRENCY

 

 

 

 

vatprice

VAT on Price

CURRENCY

 

 

 

 

price

Price

CURRENCY

 

 

 

 

netpricelist

Net List Price

CURRENCY

 

 

 

 

vatpricelist

VAT on List Price

CURRENCY

 

 

 

 

pricelist

List Price

CURRENCY

 

 

 

 

nettotalprice

Total Net Price

CURRENCY

 

 

 

 

vattotalprice

Total VAT Price

CURRENCY

 

 

 

 

totalprice

Total Price

CURRENCY

 

 

 

 

netcost

Net Cost

CURRENCY

 

 

 

 

vatcost

VAT on Cost

CURRENCY

 

 

 

 

cost

Cost

CURRENCY

 

 

 

 

nettotalcost

Total Net Cost

CURRENCY

 

 

 

 

vattotalcost

Total VAT Cost

CURRENCY

 

 

 

 

totalcost

Total Cost

CURRENCY

 

 

 

 

canceledrow

Row Cancelled by POS

DATETIME

 

 

 

 

closingdate

Unvalued Row. Cancelled or closed by Inventory (If cancelled, automatically marked as Cancelled Row)

DATETIME

 

 

 

 

tobeinvoiced

To be Invoiced

SMALLINT

 

 

 

 

invoicedqty

Invoiced Quantity

DOUBLE

 

 

 

 

iddepartment

Department ID

INTEGER

 

 

 

 

idlist

Price List ID. Default=0

INTEGER

 

 

 

 

idvat

VAT ID

INTEGER

 

 

 

 

vatcode

VAT Code

STRING

10

 

 

 

vatname

VAT Description

STRING

100

 

 

 

idstock

Stock ID

INTEGER

 

 

 

 

stockcode

Stock Code

STRING

20

 

 

 

stnetchange

ST Net Change

STRING

50

 

 

 

netpercentagechange

Net Percentage Change

DOUBLE

 

 

 

 

stchange

ST Change

STRING

50

 

 

 

percentagechange

Percentage Change

DOUBLE

 

 

 

 

notes

Notes

STRING

150

 

 

 

roworder

Row Order. Position in the document

INTEGER

 

 

 

 

vatmovements

idvat

VAT ID

INTEGER

 

 

 

 

vatcode

VAT Code

STRING

10

 

 

 

vatname

VAT Description

STRING

100

 

 

 

vatpercentage

VAT Percentage Value

FLOAT

 

 

 

 

taxabletotal

Taxable Total

CURRENCY

 

 

 

 

vattotal

VAT Total

CURRENCY

 

 

 

 

payments

idpaymentmovement

Payment Movement ID

INTEGER

 

 

 

 

paymentcode

Payment Method Code

STRING

20

 

 

 

paymenttype

Payment Method

STRING

50

 

 

 

totalpayment

Total Payment

CURRENCY

 

 

 

 

idpaymentmethod

Payment Method ID

INTEGER

 

 

 

 

 

Notes

Table 1

 

DOCUMENT TYPES

DCC

Delivery Note for Customer

DUC

Customer Document

DUF

Supplier Document

DUI

Internal Document

CAR

Inbound Movements

RAF

Supplier Return

RDC

Customer Return

MTM

Warehouse Transfers

VEN

Sales Receipts

VEA

Canceled Sales Receipts

VES

Suspended Sales Receipts

MIV

VAT Movements

SCA

Goods Unloading

RAP

Reports and Printouts

ORD

Orders

PRE

Quote

BIL

Scale

CHF

POS Fiscal Closure

ORS

Suspended Orders

COM

Poldo Order

 

Table 2

 

ORIGIN TYPES

AZI

Company/Warehouse

AZP

Manufacturers

DIS

Distributors

PRO

External Professionals

DIP

Employees

FOR

Service Providers

CLI

Customers

MAG

Warehouse

POS

POS Sales

BIL

Scale Sales

GED

Publishing Group

TEA

Teachers

TAV

Table

 

Table 3

 

RECEIPT TYPES

S

Fiscal Receipt

R

Restaurant Fiscal Receipt

F

Restaurant Invoice

N

Non-Fiscal

P

Preliminary Receipt

C

POS Goods Unload Documents

 

Table 4

 

INSERT METHODS

M

Manual Entry (M, N, null)

S

Scanner

P

PLU Button

T

Handheld Terminal

B

Scale

W

Web

D

Vending Machine

G

ERP

I

Import

E

External

O

Free (Automatic)

 

Table 5

 

ROW TYPES

P

Product or Department Row

R

Return Row

D

Description Row

S

Value Discount Row

V

Percentage Discount Row

A

Cancelled Row printed on receipt

T

Voided Row printed

O

Free Row

C

Closure

 

Table 6

 

PRODUCT TYPES

PRD

Product

REP

Department

GEV

Scratch Card

CPN

Coupon

TOT

Subtotal

null

Undefined

 

Webhook Configuration Parameters

For receive new issued documents, it is necessary to set the WebhookDocUrl parameter in the [midware] section of the WService.ini file, with the URL to which the application will have to send them.
The WebhookDocBasicAuthUsername and WebhookDocBasicAuthPassword parameters can be used when the Url required a Basic Auth. 

 

Optionally, always in the same section of the configuration file, is WebhookDocSuccessKey. This allows you to verify the "content" of the response with the indicated string that must be present in the response itself. If the parameter is omitted, will be considered valid any response that is not "empty".

 

After the first configuration, the transmission, for default, will start from the last document issued, after which it will wait and transmit any new documents with a check every 5 seconds. 
The ID of the last transmitted number will be saved in the configuration file, in the midware section at the WebhookDocLastIDMov. parameter.

In case you wish to transmit previous documents, it's necessary modify this parameter by inserting the ID of the last movement preceding those to be re-transmitted.

Read

Documents records can be retrieved via standard GET requests, or alternatively via POST, using the GET prefix as shown in the examples below.

 

Method

Url

GET

/api/documents/{SessionCode}?iddocument={id}

 

Method

Url

Body Text

POST

/api/getdocuments/{SessionCode}?iddocument={id}

 

POST

/api/getdocuments

{

   "SessionCode": "KG..HT"

   "iddocument": "id"

}

Esempio Risposta

 

{

    "ResponseRequest": "documents",

    "SuccessStatus": true,

    "documents": [

        {

            "idmovement": 1000,

            "documenttype": "VEN",

            "origintype": "POS",

            "idcompany": 1,

            "idmovementcode": 0,

            "movementcodename": "VENDITA",

            "receipttype": "S",

            "cussup": "C",

            "inout": "U",

            "depositdocument": false,

            "movementdate": "2025-04-01T11:34:16.000+02:00",

            "year": 2025,

            "month": 4,

            "week": "202514",

            "documentnumber": 1,

            "localdocumentnumber": 1,

            "documenttransactionnumber": "2990000000000",

            "documentdate": "2025-04-01T11:34:16.000+02:00",

            "idorigin": 1,

            "originname": "POS: 1. CASSA 1 GP1",

            "taxabletotal": 5.74,

            "vattotal": 1.26,

            "documenttotal": 7,

            "canceleddocument": "1899-12-30T00:00:00.000+01:00",

            "idpos": 1,

            "idcashier": 1,

            "suspendedreceipt": false,

            "cashmachineserialnumber": "00ABC000000",

            "documentrows": [

                {

                    "idrowmovement": 10000,

                    "documentdate": "2025-04-01T11:34:16.000+02:00",

                    "registrationdate": "2025-04-01T11:34:16.000+02:00",

                    "qtymovement": -1,

                    "valmovement": 1,

                    "insertmethod": "P",

                    "rowtype": "P",

                    "productcode": "000001",

                    "rowdescription": "PRODOTTO PROVA",

                    "producttype": "PRD",

                    "idproduct": 1,

                    "idbarcodeproduct": 1,

                    "barcode": "2500000000000",

                    "qtycode": "VENDUTA",

                    "qtymovement": 1,

                    "vatpercentage": 22,

                    "netprice": 5.7377,

                    "vatprice": 1.2623,

                    "price": 7,

                    "netpricelist": 5.7377,

                    "vatpricelist": 1.2623,

                    "pricelist": 7,

                    "nettotalprice": 5.7377,

                    "vattotalprice": 1.2623,

                    "totalprice": 7,

                    "netcost": 0.82,

                    "vatcost": 0.1804,

                    "cost": 1.0004,

                    "nettotalcost": 0.82,

                    "vattotalcost": 0.1804,

                    "totalcost": 1.0004,

                    "iddepartment": 1,

                    "idlist": 0,

                    "idvat": 1,

                    "vatcode": "22",

                    "vatname": "IVA 22%",

                    "idstock": 1,

                    "stockcode": "MAG 1",

                    "roworder": 0

                }

            ],

            "vatmovements": [

                {

                    "idvat": 1,

                    "vatcode": "22",

                    "vatname": "IVA 22%",

                    "vatpercentage": 22,

                    "taxabletotal": 5.74,

                    "vattotal": 1.26

                }

            ],

            "payments": [

                {

                    "idpaymentmovement": 1,

                    "paymentcode": "1",

                    "paymenttype": "CONTANTI",

                    "totalpayment": 7,

                    "idpaymentmethod": 1

                }

            ]

        }

    ]

}