Main API Requests
Loyalty cards issuance and maintenance
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:
Search a Loyalty Card on User's Profile Data
GET
https://<base-URL>/v1/card
A Koshelek app user and a customer's loyalty card are corresponding as "one-to-one" and are presented as a single entity.
If the partner's loyalty program allows one customer to own several loyalty cards (active or not), the partner should define logic of selection of loyalty cards accessible for the user to issue in the Koshelek app.
Query Parameters
Example of the request:
Request processing rules
Search parameters are combined by Boolean OR operator.
Search parameters unknown to the partner must be ignored.
If search parameters return several loyalty cards, the conflict must be resolved on partner's side. It is possible to return an error; in this case the Koshelek app will recommend that a user contact partner's customer service.
If search parameters return blocked loyalty card and the partner forbids issuing a card (new one or with user-specified number) under this condition, the response must be error
422: Unprocessable Entity
instead of the blocked card data.
Update List of Communication Channels Allowed by the User
PUT
https://<base-URL>/v1/card/{cardNumber}/communication
The request is transmitted during issuance of a loyalty card (the user selects allowed communication ways on the Koshelek app screen). Possible values (call, email, sms, etc.) are transmitted in an array field.
Path Parameters
Request Body
Example of the request:
Update Customer Personal Data
POST
https://<base-URL>/v1/card/{cardNumber}
Transfer the changed personal data of a user owning the loyalty card to the partner. Usually, when a card is issued in the Koshelek app, the following field values are transmitted: phone
, email
, surname
, firstname
, sex
, birthDate
.
Path Parameters
Request Body
Transferring additional parameters
Additional parameters, if available, are transmitted as an array of JSON objects AdditionalParameter. The object consists of the following fields:
Example of the request:
This request should be expected:
During the card issuing scenario, if the card number was found in partner's database (see Search a loyalty card on user's profile data).
After the card issuing, when user updates their personal data in the Koshelek app profile (in this case the request contains changed data only).
If card issuance requires any additional parameters beside personal data, these additional data is sent in the additionalParameters
array of objects (one object per one additional parameter). List and format of such parameters are pre-agreed with Cardsmobile.
Issue a Card with the User-Specified Number
POST
https://<base-URL>/v1/card/provided/{cardNumber}
To issue a card, user's personal data is transmitted to the partner. Usually the following field values are transmitted: phone
, email
, surname
, firstname
, sex
, birthDate
.
Path Parameters
Request Body
Example of the request:
The card number is used in the request as it is specified by the user, without any validation on the Cardsmobile side. It is expected that if such card does not exist in the system or it is non-anonymous (i.e. related to another user) or blocked, an error is returned.
If card issuance requires any additional parameters beside personal data, this additional data is sent in the
additionalParameters
array of objects (one object for one additional parameter). List and format of such parameters are pre-agreed with Cardsmobile.
Reserve New Anonymous Card
GET
https://<base-URL>/v1/card/anonymous
Requesting a partner to reserve a new loyalty card that is not associated with any customer of the loyalty program. The reservation starts in case if the loyalty card with user's personal data was not found (i.e. the user is not a customer of the loyalty program). After this request, partner's side should wait the request for issuing a loyalty card with the reserved number of an anonymous card (below).
Example of the request:
Request processing rule
Implementation on partner's side must guarantee that the returned card number will stay reserved (not available for re-usage) at least for one hour.
Issue a Card by Pre-Reserved Number of Anonymous Card
POST
https://<base-URL>/v1/card/anonymous/{cardNumber}
This requests contains the pre-reserved number of an anonymous card received in answer to the request above. To issue a card, user's personal data is transmitted to the partner. Usually the following field values are transmitted: phone
, email
, surname
, firstname
, sex
, birthDate
.
Path Parameters
Request Body
Example of the request:
If card issuance requires any additional parameters beside personal data, this additional data is sent in the additionalParameters
array of objects (one object for one additional parameter). List and format of such parameters are previously agreed with Cardsmobile.
Request processing rule
Information on the card balance must be available right after the card is assigned to a user.
Get Loyalty Card Information by Number
GET
https://<base-URL>/v1/card/{cardNumber}
The request is used to get information on balance and status of the card by its number. The information is requested when issuing the card as well as when requesting its balance. Returned data are transmitted to a balance screen of the user's card in the Koshelek app.
Path Parameters
Example of the request:
Example of a response containing data on an existing loyalty card:
Please note:
The fields listed below should contain a string presentation of numbers (both integers and numbers with a fractional part are allowed):
discountPercent
,totalPurchaseAmount
,statusConfirmAmount
(status object);discountPercent
,totalPurchaseAmount
(nextStatus object);total
,available
,bonuses[].amount
(bonus object).
The
bonuses[].validUntil
field (bonus object) should contain a date in the format YYYY-MM-DD.
Request Purchase History by Card Number for Specified Period
GET
https://<base-URL>/v1/card/{cardNumber}/purchases
The request contains the start and end dates of the period are received from the Koshelek app.
Path Parameters
Example of the request:
Please note:
The response fields
amount
,quantity
andbonuses
should contain a string representation of the number (both integers and the fractional part are allowed).The response fields
date
,item
,amount
andquantity
are mandatory (empty values are not allowed).The response fields
location
andbonuses
can contain empty values (for example, if they are not supported by the loyalty program).
Request Special Promotional Offers by Card Number
GET
https://<base-URL>/v1/card/{cardNumber}/specials
The request is called when a user activates the screen of the issued loyalty card. The request allows the Koshelek app to receive and display a list of special promotional offers of the loyalty program operator that are available for the loyalty card owners.
Path Parameters
Example of the request:
Response requirements:
startDate
,endDate
fields: on the Cardsmobile server side, it is expected that the start and end dates of the promotion will be formed by the partner depending on the region where the client is present at the time of the card issuance (transmitted in thelocality
field — see the issuance scenarios) and using the corresponding time zone.description
field: detailed description of the offer can contain subset of HTML tags to format and markup the description:
Example of a response containing data on special promotional offers:
Last updated