Loyalty Online API Implementation

API implementation principles

Documentation has moved

The information on this page is no longer updated and may be obsolete. The most current Koshelek documentation is now available at the new address:

https://developers.koshelek.app/en/

A web service implementing the Cardsmobile Loyalty Online API is deployed at the partner's host and must be integrated with partner's CRM system according to Cardsmobile Developers documentation. For messaging, the standard RESTful model is used, the data is transmitted in JSON format via the HTTPS protocol:

As the web service implementing the API is deployed at partner's host, the following data must be presented to Cardsmobile:

ParameterDescription

host:port

Address of the partner's host providing the API.

login:password

Username and password to authorize API requests from Cardsmobile.

API Requests Authorization

The HTTPS protocol is used. HTTP Basic Authentication (RFC 7617) mechanism should be used for API requests authorization. Credentials for authorization are transferred in the Authorization HTTP header.

Encoding Requirements

Both API requests and responses should use the UTF-8 encoding.

API Responses Structure

1. Headers

Answers from the partner's side must contain the following header:

Content-Type: application/json; charset=utf-8;

2. HTTP Codes

Answers from the partner's side must use the following HTTP codes:

CodeDescription

200

API request successfully processed.

422

An error occurred while processing the request.

3. Body

The response body from the partner must comply with the response requirements specified in the description of the corresponding request.

4. Errors

In case of error the partner's side must return a JSON object containing an error code and description.

Response example:

HTTP/1.1 422 Unprocessable Entity
<headers>

{
 "code": "123",
 "description": "DBMS server unavailable"
}

Please note:

The API assumes that all "elementary" fields of JSON objects returned in responses have a string type, even if they contain values of other types (numeric, Boolean, etc.).

See the example of returning a numerical error code above.

Last updated