www.sunsoft.gr

External Connection Web API

HTTP method POST

Try calls using method HTTP POST

URL Endpoint

/api/Order

GetPortionInfo

Call example: http://localhost:5600/api/Order/GetPortionInfo?SerialFormat=json&ClientVersion=4.01.000&DeviceTicket=18249903&CachedVersion&UserId=1&StationId=2&StationNo=2

Summary

Gets a list of items with their portion info (available quantity, is quantity critical). Service response containing a list of items with their portion information. Only items that are set (in parameterization) to have portion will be returned.

Method Parameters

NAME TYPE REQUIRED EXAMPLE NOTES
SerialFormat string yes json Form of the serialized data. (json/xml)
ClientVersion string yes 4.01.000 Service Version
DeviceTicket long yes 18249903 Ticket for user. Returned from login
CachedVersion string no - Hash data used in previous call
UserId int yes 1 User id (returned from login)
StationId int yes 2 Station id
StationNo int no* 2 Station number. *Ignored if station id is provided
ItemWeb int? no 1 ItemWeb value of returned items

Success Response

HTTP 200 OK
{
	"Items ": [
		{
		"ItemUniqueId ": 474,
		"AvailableQuantity ": 9,
		"IsAvailableQtyCritical ": false,
		"CriticalStockLimit ": 2
		}
	]
}

Items

NAME TYPE EXPLANATION
ItemUniqueId int Item Unique Code
AvailableQuantity int Portions Left
IsAvailableQtyCritical bool Flags When Critical Quantity Reached
CriticalStockLimit Int How many Portions is Critical Quantity

Error Response

HTTP 500 Internal Server Error
Error Message
Go to top...

GetOrderStatus

Call example: http://localhost:5600/api/Order/GetOrderStatus?SerialFormat=json&ClientVersion=4.01.000&DeviceTicket=18249903&OrderId=2

Summary

Gets specified order/note status. Service response containing selected order status.
Values returned: 1. Received (Open Order) 2. Ready (Reciept) 3. Closed (Payed) 4. Not Found 5. Canceled

Method Parameters

NAME TYPE REQUIRED EXAMPLE NOTES
SerialFormat string yes json Form of the serialized data. (json/xml)
ClientVersion string yes 4.01.000 Service Version
DeviceTicket long yes 18249903 Ticket for user. Returned from login
OrderId int yes 2 Order/Note id


Success Response

HTTP 200 OK

Error Response

HTTP 500 Internal Server Error
Error Message
Go to top...

UpdateSimpleOrder

Call example: http://localhost:5600/api/Order/UpdateSimpleOrder?SerialFormat=json&ClientVersion=5.01.002&DeviceTicket=18249903&UserId=11
OrderData: Body raw parameter with json data in string (without coupon)

'{"OrderType": "takeaway","StationNo": 4,"CustomerId": 2,"MemberCode": 2233,"IssueInvoice": "false","LoyaltyId": "LoyaltyId", "Items":[{"ItemUniqueId": 43,"Quantity": 1.0, "UnitPrice": 1.0000,"ComboGroupUniqueId": "", "ItemDiscountValue": 1.4999,"TotalItemDiscount": 0.0000,"Amount": 1.0000, "Remarks": [],"SubItems": []}]}'

Summary

Creates or updates an order in the database. Service response containing the new order.

Method Parameters

NAME TYPE REQUIRED EXAMPLE NOTES
SerialFormat string yes json Form of the serialized data. (json/xml)
ClientVersion string yes 5.01.002 Service Version
DeviceTicket long yes 18249903 Ticket for user. Returned from login
UserId int yes 11 User id
OrderData string yes Body raw parameter
With Coupon
'{ "OrderType": "takeaway", "StationNo": 2, "CustomerId": 1, "MemberCode": 2233, "IssueInvoice": "false", "LoyaltyId": "LoyaltyId", "Items":[ { "ItemUniqueId": 71, "Quantity": 1.0, "UnitPrice": 1.0000, "ComboGroupUniqueId": "", "ItemDiscountPercent": 0.0, "ItemDiscountValue": 0.0000, "TotalItemDiscount": 0.0000, "Amount": 1.0000, "Remarks": [], "SubItems": [] } ], "Coupons":[ { "CouponId": 1, "CouponNumber": "", "TransactionValue": 0.0, "TransactionPercentage": 10.00, "TransactionAmount": 0.10, "TransactionGuid":"76c24b80-8c16-4f40-881a-eda1a0621120" } ] }'
Without Coupon
'{"OrderType": "takeaway","StationNo": 4,"CustomerId": 2,"MemberCode": 2233,"IssueInvoice": "false","LoyaltyId": "LoyaltyId","Items":[{"ItemUniqueId": 43,"Quantity": 1.0, "UnitPrice": 1.0000,"ComboGroupUniqueId": "", "ItemDiscountValue": 1.4999,"TotalItemDiscount": 0.0000,"Amount": 1.0000, "Remarks": [],"SubItems": []}]}'
Serialized order data

Method Parameters

NAME TYPE REQUIRED EXAMPLE NOTES
SerialFormat string yes json Form of the serialized data. (json/xml)
ClientVersion string yes 5.01.002 Service Version
DeviceTicket long yes 18249903 Ticket for user. Returned from login
UserId int yes 11 User id
OrderData json yes Body raw parameter *Extra Examples Below
Without Coupon
'{"OrderType": "takeaway", "StationNo": 4, "CustomerId": 2, "MemberCode": 2233,"IssueInvoice": "false" ,"Items":[ {"ItemUniqueId": 43,"Quantity": 1.0, "UnitPrice": 1.0000, "ComboGroupUniqueId": "",
"ItemDiscountValue": 1.4999,"TotalItemDiscount": 0.0000,"Amount": 1.0000, "Remarks": [],"SubItems": []} ]}'
Serialized order data

Order Data Attributes

NAME TYPE REQUIRED EXAMPLE NOTES
OrderType string yes Values: 'delivery' or 'takeaway' or 'tables' Type of order
StationNo int yes 4 Order's POS
CustomerId int no* 11 *Required for delivery, If empty a default customer is selected
MemberCode int no* 2233 *Required for customer's subsidy information
IssueInvoice bool yes false True for Invoice
OrderDiscountPercent double no 12.0000 basket percentage discount
OrderDiscountValue decimal no 15.0 basket value discount
OrderRemarks string no Some Remarks Order Remarks nvarchar 1000
LoyaltyId string no 123123123 For Loyalty Companies
TableId int no* 20 Used only if we want to send Order to specific table. Required if type is 'tables'
Items[] OrderItem yes [{"ItemUniqueId": 43,"Quantity": 1.0, "UnitPrice": 1.0000,"ComboGroupUniqueId": "", "ItemDiscountValue": 1.4999,
"TotalItemDiscount": 0.0000,"Amount": 1.0000, "Remarks": [],"SubItems": []}]
All properties of item
Coupons[] Coupon no [ { "CouponId": 1, "CouponNumber": "", "TransactionValue": 0.0, "TransactionPercentage": 10.00, "TransactionAmount": 0.10,
"TransactionGuid":"76c24b80-8c16-4f40-881a-eda1a0621120" } ]
Coupon attributes
DeliverDate DateTime no 2019-09-30 11:22 Date with format "yyyy/mm/dd", Date should be the day of the order
PaymentMethodName string no VISA Payment Method

Order Item Attributes

NAME TYPE REQUIRED EXAMPLE NOTES
-> ItemUniqueId int yes 220 ItemUniqueCode
-> Quantity double yes 2.0 Quantity of item
-> UnitPrice decimal yes 2.0000 Item's unit price
-> ComboGroup UniqueId string no* guid of combo group *Required if parent is ComboItem
-> ItemDiscount Percent double no 33.3 Discount percentage of item
-> ItemDiscountValue decimal no 10.0000 Discount value of item, Ignored if ItemDiscountPercent>0
-> Remarks[] Remark no [{"Remark": "Some Remark"},{"Remark": "Another Remark"}] List of item's remarks
-> SubItems[] OrderItem no [{"ItemUniqueId": 43,"Quantity": 1.0, "UnitPrice": 1.0000,"ComboGroupUniqueId": "", "ItemDiscountValue": 1.4999,
"TotalItemDiscount": 0.0000,"Amount": 1.0000, "Remarks": [],"SubItems": []}]
List of item's sub items

Coupon Attributes

NAME TYPE REQUIRED EXAMPLE NOTES
-> CouponId int yes 10 Coupons unique code
-> CouponNumber string no 12344561 Coupon Serial Number
-> TransactionPercentage double no 0.0 Percentage of coupon's discount
-> TransactionValue decimal no 12.0000 Values of coupon's discount
-> TransactionAmount decimal no 10.00 Transaction amount
-> TransactionGuid string no {690512F6-7510-4452-B432-16BA7A7A1847} Transaction GUID

Remark Attributes

NAME TYPE REQUIRED EXAMPLE NOTES
->Remark string no Some remark here Remark nvarchar 300

With Item Discount and Sub Items and Remarks

                        
'{
	"OrderType":"takeaway",
	"StationNo":864,
	"CustomerId":2,
        "MemberCode":2233,
	"IssueInvoice":"false",
	"PaymentMethodName":"Μετρητά ",
	"OrderRemarks":" ΣΧΟΛΙΑ ΠΕΛΑΤΗ: προσφορα ΤΡΟΠΟΣ ΠΛΗΡΩΜΗΣ: Μετρητά ",
	"DeliverDate":"2019-09-25 16:40",
	"Items":[
		{
			"ItemUniqueId":3198,
			"Quantity":1,
			"UnitPrice":0.00,
			"ComboGroupUniqueId":null,
                        "ItemDiscountValue":1,
                        "Remarks":[{"Remark":"ΟΛΙΚΗΣ"}],
                        "SubItems":[
				{
					"Remarks":[],
					"SubItems":[],
					"ItemUniqueId":277,
					"Quantity":1,
					"UnitPrice":1.00,
					"ComboGroupUniqueId":null,
					"ItemDiscountValue":0
				},
				{
                                        "Remarks":[{"Remark":"ΛΙΓΟ"}],
					"SubItems":[],
					"ItemUniqueId":293,
					"Quantity":1,
					"UnitPrice":0.85,
					"ComboGroupUniqueId":null,
					"ItemDiscountValue":0
				},
				{
					"Remarks":[],
					"SubItems":[],
					"ItemUniqueId":1678,
					"Quantity":1,
					"UnitPrice":1.00,
					"ComboGroupUniqueId":null,
					"ItemDiscountValue":0
				},
				{
					"Remarks":[],
					"SubItems":[],
					"ItemUniqueId":280,
					"Quantity":1,
					"UnitPrice":0.55,
					"ComboGroupUniqueId":null,
					"ItemDiscountValue":0
				},
				{
					"Remarks":[],
					"SubItems":[],
					"ItemUniqueId":284,
					"Quantity":1,
					"UnitPrice":0.80,
					"ComboGroupUniqueId":null,
					"ItemDiscountValue":0
				}
                        ]
		}
	]
}'                      


With Coupon

                        
'{
	"OrderType":"takeaway",
	"StationNo":2,
	"CustomerId":1,
        "MemberCode":2233,
	"IssueInvoice":"false",
	"Items":[
		{
			"ItemUniqueId":71,
			"Quantity":1.0,
			"UnitPrice":1.0000,
			"ComboGroupUniqueId":"",
			"ItemDiscountPercent":0.0,
			"ItemDiscountValue":0.0000,
			"TotalItemDiscount":0.0000,
			"Amount":1.0000,
			"Remarks":[],
			"SubItems":[]
		}
	],
	"Coupons":[
		{
			"CouponId":1,
			"CouponNumber":"",
			"TransactionValue":0.0,
			"TransactionPercentage":10.00,
			"TransactionAmount":0.10,
			"TransactionGuid":"76c24b80-8c16-4f40-881a-eda1a0621120"
		}
	]
}' 


With Basket Discount

                        
'{
	"OrderType":"delivery",
	"StationId":2,
	"StationNo":0,
	"CustomerId":2,
         "MemberCode":2233,
        "OrderDiscountPercent":10.0,
	"OrderDiscountValue":0.0,
	"OrderRemarks":null,
	"Items":[
		{
			"ItemUniqueId":220,
			"Quantity":2.0,
			"UnitPrice":1.0,
			"ComboGroupUniqueId":"",
			"ItemDiscountPercent":0.0,
			"ItemDiscountValue":0.0,
			"TotalItemDiscount":0.0,
			"Amount":1.0,
			"Remarks":[],
			"SubItems":[]
		}
	],
	"Coupons":[],
	"DeliverDate":"2019-04-27 15:50",
	"IssueInvoice":false,
	"PaymentMethodName":"Εμφάνιση στο web"
}'                      

Success Response

(Without Coupon)
HTTP 200 OK

Success Response

(With Coupon)
HTTP 200 OK

Error Response

HTTP 500 Internal Server Error
Error Message
Go to top...

SetItemAvailabilityInfo

Call example: http://localhost:5600/api/Order/SetItemAvailabilityInfo?SerialFormat=json&clientVersion=5.04.000&deviceTicket=12345&StationId=2&ItemUniqueId=219&Status=1

Summary

Updates Temporary availability of sent Item. Status parameter sets Item available or unavailable in all WareHouses of the selected station
Service response containing "Success" or the Error Message

Method Parameters

NAME TYPE REQUIRED EXAMPLE NOTES
SerialFormat string yes json Form of the serialized data. (json/xml)
ClientVersion string yes 5.04.000 Service Version
DeviceTicket long yes 18249903 Ticket for user. Returned from login
StationId int yes 2 Station id
ItemUniqueID long yes 219 Item's Unique Code
Status int yes 1 0 or 1. 0 for available, 1 for unavailable

Success Response

HTTP 200 OK

Error Response

HTTP 500 Internal Server Error
Error Message
Go to top...

GetItemAvailabilityInfo

Call example: http://localhost:5600/api/Order/GetItemAvailabilityInfo?SerialFormat=json&clientVersion=5.04.000&deviceTicket=12345&CachedVersion&StationId=2&StationNo=2

Summary

Gets a list of all items in the selected Sales Station and their availability. Service response containing a list of items with their availability information.
Response contains a triplet of ShopItemId, ItemUniqueId, ShopItemTemporaryUnavailable (0 for available, 1 for unavailable) for each item.

Method Parameters

NAME TYPE REQUIRED EXAMPLE NOTES
SerialFormat string yes json Form of the serialized data. (json/xml)
ClientVersion string yes 5.04.000 Service Version
DeviceTicket long yes 18249903 Ticket for user. Returned from login
CachedVersion string no - Hash data used in previous call
StationId int yes 2 Station id
StationNo int no* 2 Station number. *Ignored if station id is provided

Success Response

HTTP 200 OK

Error Response

HTTP 500 Internal Server Error
Error Message
Go to top...