Информация о клиенте

Запрос /online/bonuses/customerInfo [POST] - получить информацию о клиенте

Параметры запроса:

  • customerToken - токен клиента
  • type - тип токена:
    • card - карта
    • qrGuest - приложение “QR Guest”
    • pin - PIN-код
    • phone - номер телефона
  • entry - режим ввода токена:
    • trackCode - ввод магнитной полосы карты
    • barCode - ввод штрих-кода карты
    • qrCode - ввод QR-кода с приложения “QR Guest”
    • manual - ручной ввод PIN-кода или номера телефона
  • key - значение токена

Параметры ответа: клиент CRM

Примеры:

  1. Клиент найден
    test@test:~$ curl -i -X POST -u test:test -H "Content-Type:application/json" -d '{"customerToken":{"type":"card","entry":"trackCode","key":"66666600000011=2012"}}' http://test.quickresto.ru/platform/online/bonuses/customerInfo
    HTTP/1.1 200 OK
    Server: nginx/1.4.6 (Ubuntu)
    Date: Mon, 08 Feb 2016 08:42:00 GMT
    Content-Type: application/json
    Transfer-Encoding: chunked
    Connection: keep-alive
    Set-Cookie: JSESSIONID=DEA1D7D7180E7883429C82C30D86F483; Path=/; HttpOnly
    
    {"firstName":"Иван","lastName":"Лобанов","dateOfBirth":"1990-03-07T19:00:00.000Z","sex":"male","contactMethods":[],"tokens":[{"type":"card","entry":"trackCode","key":"66666600000011=2012"},{"type":"card","entry":"trackCode","key":"66666600000013=2012","expirationDate":"2016-02-08T08:39:49.212Z"}],"accounts":[{"accountBalance":{"ledger":1000.0,"available":1000.0,"debitHold":0,"creditHold":0},"accountState":"open","accountType":{"name":"Бонусный счет 1","maxUsage":50.0,"accountGuid":"bonus_account_type-1"}}],"accumulationBalance":{"ledger":0,"available":0,"debitHold":0,"creditHold":0},"customerGuid":"customer_put-160208013135387T"}
  2. Клиент не найден
    test@test:~$ curl -i -X POST -u test:test -H "Content-Type:application/json" -d '{"customerToken":{"type":"card","entry":"trackCode","key":"66666600000012=2012"}}' http://test.quickresto.ru/platform/online/bonuses/customerInfo
    HTTP/1.1 400 Bad Request
    Server: nginx/1.4.6 (Ubuntu)
    Date: Mon, 08 Feb 2016 08:37:18 GMT
    Content-Length: 105
    Connection: keep-alive
    Set-Cookie: JSESSIONID=49AD6AD84CBAB985B533A5B7A663B9DD; Path=/; HttpOnly
    
    {"errorCode":"tokenNotFound","errorDescription":"Token card - trackCode - 66666600000012=2012 not found"}
  3. Срок действия токена истек
    test@test:~$ curl -i -X POST -u test:test -H "Content-Type:application/json" -d '{"customerToken":{"type":"card","entry":"trackCode","key":"66666600000013=2012"}}' http://test.quickresto.ru/platform/online/bonuses/customerInfo
    HTTP/1.1 400 Bad Request
    Server: nginx/1.4.6 (Ubuntu)
    Date: Mon, 08 Feb 2016 08:39:54 GMT
    Content-Length: 116
    Connection: keep-alive
    Set-Cookie: JSESSIONID=0DFB1594A0B8840779E06E62235C9C6A; Path=/; HttpOnly
    
    {"errorCode":"tokenExpired","errorDescription":"Token card - trackCode - 66666600000013=2012 is expired since 2016-01-01"}
Подождите, происходит установка и настройка вашего облака.