• API. Create customers & accrue bonus points addCustomerPointMessage
    The command is designed to add customers and award them bonus points, but, unlike the addBonusExtQuick command, it allows to create an initially inactive account and send informative messages to the customer. Activation takes place at any subsequent action of both customer and organiser of bonus program (first authorisation, first accrual of points, etc.).

    Request:

{
    "add":[
        {
            "amount":200.00,
            "guid":"9803d32e-8fcd-4984-a736-9f02f726b3c0",
            "email":null,
            "phone":null,
            "uniqId":"12345678",
            "info":null,
            "message":"Message for customer",
            "showCount":3,
            "showTill":"2019-10-23T18:25:43.511Z",
            "eventId":"123456",
            "eventDate":"2015-01-01T00:00:00+03",
            "eventType":"operation",
            "operationType":"purchase",
            "operationAmount":100.0000,
            "merchantName":"TZUM",
            "bankProduct":"Gold card",
            "mcc":"Petrol station"        
        }      
    ],
    "typeOfCommand":"addCustomerPointMessage"
}
Request parameters:
Object AddBonus:
Response:

{
    "results":[
         {
            "login":"12345678",
            "guid":"9803d32e-8fcd-4984-a736-9f02f726b3c0",
            "status":"Success",
            "error":null
         }
            ] 
}
Request parameters:
Object AddStatus:
Object Error:
Features of operation and use

1. The command works in asynchronous mode
1.1 At the first stage, when the command is called, primary data validation is performed, which guarantees correct format of information transmitted:
1.1.1. The format of the sent command should be the correct JSON format
1.1.2. All the properties necessary for the work of the command (marked as obligatory in the “Add Bonus object” table) must be transmitted
The real enrollment and checking for command's correspondence to application's business logic (e.g. no duplicated identifiers) is done by the background process; the checks performed are described below in section 1.2
1.1.3 A check of correct properties format is performed:
  • Conformity of the 'e-mail' field to the standard e-mail address format
  • Conformity of the transmitted phone number format with the requirements described for the “phone” parameter in the 'AddBonus' table
  • In the case of string parameters of enumerated types, a check is performed to ensure that the value transferred is correct
  • Empty decimal parameter values must be passed as 0.
An error is returned if the properties are formatted incorrectly.
2. In the second step, the accruals are executed.
3. How to use the command efficiently is described here: Data processing speed.
3.1 If only uniqId, phone and email parameters are passed in the addCustomerPointMessage command, the account with the 'new' status is created.
3.2 Customers can have statuses
  • New
  • Active
  • Blocked
3.3 ‘New’ Customer accounts are converted to ‘Active’ in the following cases
transfer of charges by any commands
creation of charges as a result of processing of events transferred by any commands
authorisation of a customer by clicking on a unique link
independent authorisation of the customer
3.4 The customers previously blocked with the blockCustomers command are unblocked only with the activateCustomers command.
3.5 If no amount is transmitted, the passed values of the optional or “yes, if amount is passed” parameters are not accepted.
4. The information messages sent with this command (parameter 'message') will be displayed a specified number of times with each customer authorisation as a standard information message in the bonus window.
Frequently asked questions (FAQ)

1. Question: Can I send a message without making an accrual?
Answer: Yes, you can.
2 Question: How is the message displayed?
Answer: The message is displayed for an authorized user as a standard information message in the bonus window.
3 Question: If I pass a new phone number for a previously created customer, will the phone number be replaced and will the reward be applied?
Answer: Yes, the customer's phone number will be replaced with the new number if the new number does not belong to another customer and the points will be accrued. Otherwise the new phone number will not be replaced and no points will be accrued.
4 Question: Will a new customer be created if a new unique ID is passed, while the phone number passed belongs to an already created customer?
Answer: No, it will not be created. No accrual will be made to any customer.
5 Question: If I pass the new email address for the previously created customer, will the email address be updated?
Answer: Yes, it will (even if it is the same email address as the other customer's). If a value of parameter 'email' is passed that does not correspond to the requirements described in the table “AddBonus object” for that parameter, the accrual will not be performed, the email will not be updated for the customer (if a new customer is created and the described error is reproduced, it will not be created).
6 Question: How do I check the result of the accrual?
Answer: 1) Record the amount of accruals to be performed and the estimated time of the transaction.
2) Execute a set of commands that meet the requirements of the Data Processing Speed article.
3) After expiration of time section 1, execute the set of commands getBonusOperationExt, which correspond to the requirements of the article Speed of data processing and are limited by the type of operation “Accrual of bonuses”.
4) Compare the received result with the sum of the section 1 by programmatic method.
The possible reasons of discrepancy of the received result and the sum of the section 1
a) Processing of addCustomerPointMessage commands is not completed yet.
b) Phone numbers have been assigned that belong to previously registered other users.
7 Question: Will a new customer be created if a not unique email address is passed and what email address will he get?
Answer: No, it will not be created. Points will be accrued to the customer whom email address will be found.

Back