What is API service for eCommerce sites, and what is its function?
Since the actions performed on commerce sites are essentially purchases, usually of the same merchandise offered for sale in the chain’s stores, all transactions performed by the customer on the site take place in the chain’s stores as well, using the cash register software. The API service is, in essence, exposure of all functions, capabilities and routines of a cash register through the use of a software interface instead of a human interface.
In addition, every transaction is registered by the API component in the retail database, enabling reporting capabilities, customer service and treatment of transactions and returns. It should be noted that the API component can provide the same services for any software asking to use the services that exist in the product, and not only for eCommerce sites.
Every API interface has two sides:
Server Side – the side that exposes the functions, enabling other software programs to request and receive services from it.
Client Side – the side that sends input to the server and receives replies and errors corresponding to the input sent.
The information transmitted between server and client is usually contained in text files or XML files, in which the information passing between the two sides is stored. The conversation between the parties may be conducted in two different ways: the first is a one-way conversation in which the client side transmits a request, without waiting for a reply, whereas the other way is that after transmitting the request, the client side waits to receive a reply from the server.
Synchronic Interface – the client side does not disconnect communication with the server until receiving a reply or a time-out.
Time-Out – a predetermined period of time in which to wait for reply. If no reply is given by the server within this time, the client disconnects communication with the server for the particular enquiry.
A synchronic Interface – the client side transmits a request, is given confirmation that the request was received, but does not wait for reply. In this type of interface, the client side opens a new request in which he awaits reply by the server.
The absolute majority of interfaces in the API system in this document, are of the synchronic type.