CURL request to obtain the desired customer information.
curl -XGET -H 'APIKEY: [the_tenant_api_key_string]'
'https://[the_tenant_endpoint]/public-api/client?secondary_id=[secondary_id]'In this request, to obtain the information of a given customer, the argument secondary_id should be changed to a mobile number or a card number.
The request response is a JSON Object containing all the information about the requested client.
There are two more filter that can be used: terciary_id and email.
The terciary_id is the internal card number, which is generated automatically by the system.
The balance request of the client, allows to obtain information about the values of points that the client has at this moment in general, and also subdivided into points by campaigns, in order to have a better view of the general situation client. An important detail is the following: it is in this request that a hash is obtained that serves as validation for the insertion of movements. This hash changes every time a transaction is made.
CURL request to get the balance using secondary_id:
curl -XGET -H 'APIKEY: [the_tenant_api_key_string]'
'https://[the_tenant_endpoint]/public-api/client/[tele-secondary_id]/balance'In this request, to obtain the information of a given customer, the argument secondary_id should be changed to a mobile number or a card number. To identify a mobile number the argument must begin with "tele-".
If the secondary_id is a mobile: Ex: https://[the_tenant_endpoint]/public-api/client/tele-351-961000000/balance'
If the secondary_id is a other card number: Ex: https://[the_tenant_endpoint]/public-api/client/tele-351-100123123/balance'
CURL request to get the balance using terciary_id:
curl -XGET -H 'APIKEY: [the_tenant_api_key_string]'
'https://[the_tenant_endpoint]/public-api/client/[terciary_id]/balance'
Service response in case of error (example: client does not exist):
{
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
"title": "Not Found",
"status": 404,
"detail": "Client not found"
}Service response on success:
{
"quantity": "1298",
"points": "537",
"available": "237",
"total_gain": "1200",
"hash": "Ec5B9j",
"campaign_points": [
{
"campaign_id": "48",
"points": "537",
"available": "237",
"expire_to": "2018-12-22",
"total_gain": "1200",
"expire_from": "2018-10-29",
"amount_next_credit": "200",
"floor": "10"
},
{
"campaign_id": "50",
"points": "0",
"available": "0",
"expire_to": "2019-01-27",
"total_gain": "0",
"expire_from": "2018-10-29",
"amount_next_credit": 0,
"floor": 0
}
],
"campaigns_url": "http://[the_tenant_endpoint]/[xxx]",
"client_profile": "http://[the_tenant_endpoint]/[xxx]"
}The most prominent fields are as follows:
CURL request to insert a new client into the system with mobile number:
curl -XPOST -H 'APIKEY: [the_tenant_api_key_string]' -H "Content-type: application/json" -d '
{
"terciary_id": 234987432981,
"secondary_id": "351-911111111",
"email": "example@mail.com",
"name": "Jonh",
"middle_name": "Lewis",
"last_name": "Smith",
"gender": "M",
"birthdate": "1980-02-12",
"address": "Av. Boulevard Poniente 1313",
"locality": "Los Angeles",
"zipcode":"1234-567",
"created_where":"Store Example",
"status": "active",
"extra_32": "professional"
}' 'https://[the_tenant_endpoint]/public-api/clientIn this request, the only required field is the secondary_id, which corresponds to the client's mobile number.
The request response is a JSON Object containing all elements relating to the created client.
CURL request to update an exist new client:
curl -XPUT -H 'APIKEY: [the_tenant_api_key_string]' -H "Content-type: application/json" -d '
{
"name": "",
"gender": "",
"birthdate": ""
}' 'https://[the_tenant_endpoint]/public-api/client/[client_id]'
In this request, the secondary_id field corresponds to the client's mobile number or card number. All the client's fields can be updated.
To register a client in the platform, the flow is as follows:
The process to update a given client it’s similar to the creation. It’s necessary to send the requested fields (secondary_id and email are not allowed to be changed), and it’s possible to update the other ones.