NAV
json

Release Updates

This section provides the quarterly breakup of existing API updates and new API releases.

Q2 Releases (2020)

Q4 Releases (2019-20)

Introduction

Capillary RESTful APIs are be consumed by Capillary and other brands that are registered with Capillary/MartJack to manage their CRM. Capillary V2 and V3 APIs support multiple sources such as InStore, MartJack, Facebook, and WeChat.

This document provides detailed information on all the APIs and guides in how to each API with the appropriate samples.

Source

Source is an entry through which a customer is registered. Unlike v1.1 APIs, v2.0 APIs provide extended support for multiple sources, i.e., you can now manage accounts of different sources such as InStore, MartJack, WeChat, e-commerce and Facebook.

V2.0 APIs also support multiple accounts of a single source. For example, an org could have multiple accounts of WeChat and Facebook. Each account will have a different account id. You would need to pass the respective account id when making API calls.

Account IDs

An organization can have multiple accounts of a source (such as WeChat). Each account will have a unique account id. You can manage customers from different accounts by passing the respective account id along with the source.

Identifiers

A customer identifier is a unique identifier that is used for registering in a source such as mobile number, email id, or external id. Identifier are also used to lookup customers and retrieve their capillary unique ids.

Capillary V2.0 APIs merge accounts automatically when a same identifier is registered in different sources.For example, assume that a customer has registered on InStore using his mobile number and e-commerce site using his email id. Now, if the customer registers the same mobile number in e-commerce site, the accounts will be merged automatically to a single customer id. You can retrieve the customer details from various sources of an organization using the unique customer id.

Before starting with v2.0 APIs, it is important to understand different official accounts created for each source and the respective account ids.

Organization Setup

The following sub-sections guides you in authenticating your organization to use Capillary v2.0 APIs.

Authentication

Capillary supports two types of authentication.

Capillary APIs can be accessed either using Basic auth (TILL/Store Center credentials), or OAuth (Client key and secret associated with a Till/Store Center). Please note that it is mandatory to use only the store-specific Till/Store Center credentials as the data in the API response depends on this identification

To configure your API keys, see API Authentication Configuration.

When to use Basic & OAuth?

Basic oAuth
Can be used for POS integrations where API requests come to Capillary server directly from POS front end or POS store server. Shall be used for backend integrations (from one backend to another backend). For example, POS integrations where API requests come to Capillary server from API gateway or a central server; FTP integrations where backend service need to be authenticated; 3rd party integration where API requests come to Capillary from a backend platform.

Process 1: Basic Authentication

Authorization Header is used for validating authentication credentials. The Authorization Header is constructed as shown below:

Authorization: Basic <Base64 encoded (username: md5(password)>

In the Authorization Header pass the Base64 decoded form of username and md5 formatted password.

For example, if the username is “store.server” and the password is ‘server123’, md5 of the password is 8a16a6b70505eb1f1ff7cdc0cd5559a7

Encode the username and md5 password to Base64, then the header is formed as shown below

Authorization: Basic c3RvcmUuc2VydmVyOjhhMTZhNmI3MDUwNWViMWYxZmY3Y2RjMGNkNTU1OWE3

Now, v2 API supports submitting requests on behalf of other TILLs (active TILLs). In db the combination of attribution_lookup and lookup_code are mapped to TILL ids and org ids. When a new POST request is placed with the combination of a lookup name and lookup code, the data will be inserted in the db on behalf of the TILL that is mapped to the specified combination.

To submit requests on behalf of other TILLs, include the following code along with the HEADER:

X-CAP-API-ATTRIBUTION-LOOKUP-TYPE:<name> X-CAP-API-ATTRIBUTION-LOOKUP:<value>(value is case sensitive)

Headers Required for Basic Authentication

Process 2: OAuth

OAuth provides better security and helps you create secure passages to access your org’s data through Capillary APIs. To generate oAuth client key and secret see OAuth Documentation.

Generate Access Token

Once you get key and secret, you can generate access token or JWT (JSON Web Token) using the token/generate API. JWT is a compact URL and JSON-based used to transfer data securely between two parties.

Resource Information

URI /oauth/token/generate
API Version v3
HTTP Method POST
Authentication Required? No
Batch Support? No

Endpoint

https://{host}/v3/oauth/token/generate

POST Request Schema

{ "key": "", "secret": "" }

Sample Request

https://eu.api.capillarytech.com/v3/oauth/token/generate

Sample POST Request

{
  "key": "WnCygRI1Fmlf6YudKwTxQq1LI",
  "secret": "hoqSBz6VwefECaZA8Q3oNx4V4H3pMDITksarZVES"
}

Sample Response

{
    "data": {
     "accessToken": "eyJraWQiOiJrMSIsImFsZyI6IlJTMjU2In0.eyJpc3MiOiJDYXBpbGxhcnkiLCJleHAiOjE1NzUyNzAyNzAsImp0aSI6IjJaX2FqUjcwYzJABChVUjlDVTVpUlEiLCJpYXQiOjE1NzUyNjk5NzAsInN1YiI6Im5hbWVfODQzNjIwODIwMSIsImNsaWVudF9pZCI6MjEsIm9yZ19pZCI6MTExNSwidG9rZW5fdXNlIjoidG9rZW5fYWNjZXNzIn0.Ala1-XTDlPtrHFQfCtJKsXe3h_WVyq4QOGI3ZnLNJqOa-yJc1UPGbypUysWemzEaiQC_BJ0n9G68SYkVZGi4CSVOhHRNA_dILe8y1Sa90YZKwHVHogJmIKzLmksJrTbjn8s8hSMePBaaUcEdUZ1XssxdFrZhEHHN1fWVYtkdb74PB3sZ7OMDqKUysON8YTNQxLgKOJ3kq0o2QUUDQo1q3gxXFuswate6-jj3oBkcdd1ohhXkPIWZlAb_1lRcLr-ECaaBfh473gayeMVV_6khdKJ7cXrUQ3CXppkrPIzBb7rS6I93iWZw0IlmWbaGduTmPPOhLX6HZLOb84Y28st-cw",
        "ttlSeconds": 300
    },
    "errors": null
}

Other Headers Required

Using Access Token

Once you generate the access token, you can use it to authenticate API calls as shown below.

Set the authentication to No Auth and pass the following headers.

Required Headers

Header Value
X-CAP-API-OAUTH-TOKEN* Generated access token. If the token expires, you need to regenerate the access token.
Content-Type* This should be set as application/json
Accept* This should also be set as application/json
X-CAP-API-ATTRIBUTION-ENTITY-TYPE Till or store from which you want to post the data. Supported Values: TILL, STORE_CODE, STORE_NAME, STORE_EXTERNAL_ID, STORE_EXTERNAL_ID_1, STORE_EXTERNAL_ID_2. The default value is TILL.
X-CAP-API-ATTRIBUTION-ENTITY-CODE Pass the entity value based on the entity type. For example, if X-CAP-API-ATTRIBUTION-ENTITY-TYPE is STORE_CODE, then X-CAP-API-ATTRIBUTION-ENTITY-CODE is the store code that you want to tag to POST data. By default, it considers the Till associated with the client key and secret.

For example, to get transaction details, you can use the following details. Before making a API call, make sure the token has access to the required resource.

Headers

Accept | application/json Content-Type | application/json X-CAP-API-OAUTH-TOKEN | eyJraWQiOiJrMSIsImFsZyI6IlJTMjU2In0.wiOlwiV1JJ…

Sample Request URL html https://eu.api.capillarytech.com/v2/transaction/38233952?type=REGULAR

Request URL Format

https://{host}/v2/{resource}/{endpoint}?{query params}

Entry Description
Host The server to which the API calls are made, usually the cluster URL.
* India: apac.intouch.capillary.co.in
* APAC2: apac2.intouch.capillarytech.com
* EU: eu.intouch.capillarytech.com
* US: us.intouch.capillarytech.com
* CN: intouch.capillarytech.cn.com
BasePath v2 or v3(API version)
Resource Provide the appropriate entity based on the action to be performed. Supported Resources: customers, communications, coupon, organization, points, product, store, transaction, goodwill requests, add events, integration resources, referral, request and other resources.
HTTP Methods The Capillary Cloud REST APIs support the standard HTTP methods GET, PUT, DELETE and POST.
Response Format JSON. All V2 and V3 APIs support only JSON response.

Response Codes

The following are global success and error codes. The response codes of each resource are provided in the respective sections.

Code Description
200 Global request success.
201 One or more requests have failed due to errors.
400 Invalid input. Please check request body parameters or input xml/json.
Invalid path parameter.
Invalid X-CAP-API-ATTRIBUTION-LOOKUP-TYPE specified.
Error with range passed or array in indexing.
401 Authentication failed. Please check username and password.
403 V2 is not enabled for the org.
Mandatory field is missing. Field {x} is mandatory.
404 Incorrect resource or resource not found.
405 The operation is not supported for the resource.
415 Unsupported media type.
461 Search Engine is busy or unable to respond. Please try after some time.
500 Requests have failed due to errors.
521 Multiple actions are running for the same customer. Please try after some time.
1060 Batch limit size exceeded.
1061 X-CAP-API-ATTRIBUTION-LOOKUP-TYPE header required with X-CAP-API-ATTRIBUTION-LOOKUP header.
1062 Invalid test and control status.
1064 Invalid org ID passed.

Customer

A customer is an individual who is either enrolled in the org’s loyalty program or subscribed to the org’s newsletters. An org is a business firm that is registered with Capillary - a retail store, hospital, pharmacy, restaurant, or any other firm.

Register Customer

Sample Request



https://us.api.capillarytech.com/v2/customers?source=MOBILE_APP&accountId=400

Sample POST Request

{ 
   "loyaltyInfo":{ 
      "loyaltyType":"loyalty"
   },
   "associatedWith":"bukl.till",
   "profiles":[ 
      { 
         "commChannels":[ 
            { 
               "type":"mobilePush",
               "meta":{ 
                  "lastViewedDate":"2019-10-10T22:04:38+05:30",
                  "residence": false,
                  "office": false
               },
               "verified":"true",
               "primary":"true",
               "value":"abc123456"
            },
            {  
               "type":"mobile",
               "value":"91901000001",
               "primary":true,
               "verified":true,
               "meta":{  
                 "lastViewedDate": "",
                  "residence":true,
                  "office":false
               }
            }
         ],
         "firstName":"Tom",
         "lastName":"Sawyer",
         "customerIdentifiers":[ 
            { 
               "type":"email",
               "value":"tom.sawyer@example.com"
            },
            { 
               "type":"mobile",
               "value":"91901000001"
            }
         ],
         "source":"MOBILE_APP",
         "fields":{ 
            "employee":"true",
            "dateofbirth":"22-10-2000"
         },
         "accountId":"400"
      }
   ],
   "extendedFields":{ 
      "gender":"Male",
      "city":"Bangalore"
   },
   "loyaltyProgramEnrollments":[{
     "programId":1016,
     "tierNumber": 234,
    "loyaltyPoints": 75,
    "tierExpiryDate": "2022-02-11T16:36:17+05:30",
    "pointsExpiryDate": "2022-02-11T16:36:17+05:30"
}]
}

Sample Response

{
    "createdId": 130713699,
    "warnings": [],
    "sideEffects": [
        {
            "awardedPoints": 100,
            "type": "points"
        },
        {
            "id": 263244517,
            "couponType": "PE",
            "couponCode": "HL1FALGQ",
            "validTill": "2120-02-11T23:59:59Z",
            "description": "Test Offer 20",
            "discountCode": "NO_VALUE",
            "trimmedCouponCode": "HL1FALGQ",
            "type": "coupon"
        }
    ]
}

If the customer is registered in a different source

{
    "createdId": 342963216,
    "warnings": [
        {
            "status": false,
            "code": 8050,
            "message": "Same Customer found in other sources,Combining"
        }
    ],
    "sideEffects": [
        {
            "awardedPoints": 100,
            "type": "points"
        },
        {
            "id": 263244517,
            "couponType": "PE",
            "couponCode": "HL1FALGQ",
            "validTill": "2120-02-11T23:59:59Z",
            "description": "Test Offer 20",
            "discountCode": "NO_VALUE",
            "trimmedCouponCode": "HL1FALGQ",
            "type": "coupon"
        }
    ]
}

Lets you register customers in the org’s loyalty program or just register their identifiers across sources such as InStore, Facebook,Webengage, WeChat, Martjack, TMall, Taobao, JD, ecommerce, Line, Website, and Mobile app. You can also add customer-level extended and custom field details.

The Customer Register API functions as follows.

Prerequisites

Following are the prerequisites to use customer registration API:

Resource Information

URI ?source={Source Name}&accountId={account id}
Authentication Yes
HTTP Method POST
Batch Support No

Request URL

https://{host}/v2/customers?source={SourceName}&accountId={accountId}

Request Query Parameters

Parameter Type Description
source* enum Source in which you want to register a customer. Value: FACEBOOK, WEB_ENGAGE, WECHAT, INSTORE, MARTJACK, TMALL, TAOBAO, JD, ECOMMERCE, WEBSITE, LINE, MOBILE_APP. You can add customers on different sources.
accountId** string For sources that support multiple accounts, provide the account ID. For example, FACEBOOK, WEB_ENGAGE, WECHAT, MOBILE_APP.

Request Body Parameters

Parameter Type Description
loyaltyType* enum Loyalty status of the customer. Value: loyalty, non_loyalty.
profiles obj Meta information of the customer.
customerIdentifiers* obj Identifiers of the customer in type and value. Supported types: mobile, email, externalId, wechat,martjackId, fbId mobile, tmall_uname, cuid, ali_uname, jd_uname, vip_uname, mobilePush, and line.
commChannels obj Available communication channels of the customer. Value: mobile, email, wechat, ios, android, line, mobilePush.
Firstname string First name of the customer.
Lastname string Last name of the customer.
attributionV2 createDate Time and date of registration in YYYY-MM-DDTHH:MM:SS+HH:MM format. Example: 2016-06-23T19:11:18+08:00
associatedWith The TILL code to which you want to associate the customer
extendedFields obj Customer level extended field details of the customer in key:value pairs. You can only pass extended fields that are enabled for your org with the respective datatypes for values.
fields obj Custom field details of customers in key-value pairs.
lastViewedDate** Date Date when the customer recently opened the app. Applicable for the channel mobilePush.
loyaltyProgramEnrollments obj Lets you enroll new customers in the loyalty program.
programId int Unique ID of the loyalty program in which you want to enroll.
tierNumber int Sequence number of the tier that you want to allocate to the customer. For example, 1 for the lowest tier, 2 for the subsequent tier, and so on.
loyaltyPoints int Loyalty points to credit in customer’s account.
tierExpiryDate date-time Expiry date and time of the specified tier. Supported Format: YYYY-MM-DDTHH:MM:SS+/-(time-zone).
pointsExpiryDate date-time Expiry date and time of the points issued. Supported Format: YYYY-MM-DDTHH:MM:SS+/-(time-zone).

Update Customer Details

Sample Request


https://us.api.capillarytech.com/v2/customers/329?source=WECHAT&accountId=22232

Sample PUT request

{  
   "profiles":[  
      {  
         "firstName":"Tom",
         "lastName":"Sawyer",
         "fields":{  
            "gender":"Male",
            "city":"Bangalore"
         },
         "customerIdentifiers":[  
            {  
               "type":"mobile",
               "value":919111111111
            },
            {  
               "type":"email",
               "value":"tom.sawyer@example.com"
            },
            {  
               "type":"wechat",
               "value":"wc_2"
            }
         ],
         "commChannels":[  
            {  
               "type":"email",
               "value":"tom.sawyer@example.com",
               "primary":"true",
               "verified":"false",
               "meta":{  
                  "residence":true
               }
            },
            {  
               "type":"wechat",
               "value":"wc_2",
               "primary":"true",
               "verified":"true",
               "meta":{  
                  "residence":true
               }
            }
         ],
         "source":"WECHAT",
         "accountId":"1234"
      }
   ],
   "loyaltyInfo":{  
      "loyaltyType":"loyalty"
   },
   "extendedFields":  
      {  
         "gender":"MALE",
         "city":"Bangalore"
      },
     "loyaltyProgramEnrollments":[{
     "programId":1016,
     "tierNumber": 234,
    "loyaltyPoints": 75,
    "tierExpiryDate": "2022-02-11T16:36:17+05:30",
    "pointsExpiryDate": "2022-02-11T16:36:17+05:30"
}]

}

# Sample Schema of mobilePush
{  
    "type":"mobilePush",
    "value":"abcd12343434", //This is an FCM Token
    "primary":true,
    "verified":true,
    "meta":{
      “lastViewedDate” : "2019-10-25"
    }
}

Sample Response

{
"createdId": 329,
"warnings":[] 
}

Allows updating customer details on any source - FACEBOOK, WEB_ENGAGE, WECHAT, INSTORE, MARTJACK, TMALL, TAOBAO, JD, ECOMMERCE, WEBSITE or LINE. You can update profile information, extended field values, communication details, custom field values, and loyalty status (only non loyalty to loyalty).

Limitations of the customer update API:

Prerequisites

The following are the prerequisites for updating customer details:

Resource Information

URI /{customerId}?{queryParam}={paramValue}
Authentication Yes
HTTP Method PUT
Batch Support No

Request URL

For sources with single accounts

https://{host}/v2/customers/{customerId}?source={sourceName}

For sources with multiple accounts https://{host}/v2/customers/{customerId}?source={sourceName}&accountId={accountId}

Request Query Parameters

Parameter Description
customerId* Unique ID of the customer whose details need to be updated
source* Specify the source in which you want to update the customer details - FACEBOOK, WEB_ENGAGE, WECHAT, INSTORE, MARTJACK, TMALL, TAOBAO, JD, ECOMMERCE, WEBSITE, LINE, MOBILE_APP. For sources with multiple accounts such as WECHAT, FACEBOOK, MOBILE_APP, or LINE, you also need to provide the respective account id.
accountId Account in which you want to update the customer details (Required only for sources with multiple accounts)

Request Body Parameters

Parameter Type Description
loyaltyType enum Loyalty status of the customer. Value: loyalty, non_loyalty.
commChannels obj Communication channels of the customer.
type enum Type of the communication channel. Value: mobile, email, wechat, ios, android, line, mobilePush.
value string Based on the channel type enter the channel value. Example, mobile number is the value for type:mobile, firebase token for type:mobilePush. mobilePush is supported for sources mobile_app, Instore, Martjack, Ecommerce, and Website
primary boolean Whether the current identifier is the primary identifier of the customer (primary identifier as per the org’s configuration).
lastViewedDate date Date when the customer recently opened the app. Applicable for the channel ‘mobilePush’.
verified boolean Whether the current identifier is verified or not. For example, through OTP.
profiles obj Profile information of the customer.
meta obj Additional information of the identifier.
Firstname string First name of the customer.
Lastname string Last name of the customer.
customerIdentifiers obj Identifiers of the customer that you want to add in type and value. Supported types: mobile, email, externalId, wechat,martjackId, fbId mobile, tmall_uname, cuid, ali_uname, jd_uname, vip_uname, and line.
profiles fields Custom field details (only that configured for the organization)
extendedFields obj Extended field details of the customer in key:value pairs. You can only pass extended fields that are enabled for your org with the respective datatypes for values.
fields obj Custom field details of the customer in key:value pairs.
loyaltyProgramEnrollments obj Lets you enroll new customers in the loyalty program.
programId int Unique ID of the loyalty program in which you want to enroll. You cannot update details if the customer is already enrolled in the loyalty program.
tierNumber int Sequence number of the tier that you want to allocate to the customer. For example, 1 for the lower tier, 2 for the next tier, and so on.
loyaltyPoints int Loyalty points to credit in customer’s account.
tierExpiryDate date-time Expiry date and time of the specified tier. Supported Format: YYYY-MM-DDTHH:MM:SS+/-(time-zone).
pointsExpiryDate date-time Expiry date and time of the points issued. Supported Format: YYYY-MM-DDTHH:MM:SS+/-(time-zone).

Update Customer Identifiers

Sample Request

https://us.api.capillarytech.com/v2/customers/418/changeIdentifier?source=WECHAT&accountId=22232

Sample POST Request

{
"add": [{
"type": "wechat",
"value": "ray11"
}],
"remove": [{
"type": "email",
"value": "tom.sawyer@example.com"
}]
}

Sample Response

{
"success": true,
"warnings":[]
}

Allows adding/removing identifiers of a customer in different sources, i.e., you can either add a new identifier or remove an existing identifier of a customer in a source.

Identifiers: “mobile”, “email”, “externalId”, “wechat”,“martjackId”, “fbId” “mobile”, “tmall_uname”, “cuid”, “ali_uname”, “jd_uname”, “vip_uname”, “line”

Limitations of the customer identifier update API: * Only identifiers can be updated using this API * Identifiers should be unique within a source for single account sources and unique within an account for multiple account sources. * If an identifier that you add already exists in a different source/account, the account will be automatically merged into the existing account maintaining different entries of each source. The new account will be a victim account and the existing account is a survivor account.

Prerequisites

Resource Information

URI `/{customerId}/changeIdentifier?source={source}&accountId={accountId}’
Authentication Yes
HTTP Method POST
Batch Support No

Request URL

https://{host}/v2/customers/{customerId}/changeIdentifier?source={source}&accountId={accountId}

Request Query Parameters

Parameter Type Description
customerId* int Unique ID of the customer whose identifiers need to be updated
source* enum Source in which you want to update customer identifier(s) - FACEBOOK, WEB_ENGAGE, WECHAT, INSTORE, MARTJACK, TMALL, TAOBAO, JD, ECOMMERCE, WEBSITE. For sources that support multiple accounts, you also need to provide the associated account id.
accountId** string Account for which you want to update the customer identifier (Required only for sources with multiple accounts)

Request Body Parameters

Attributes Type Description
add** obj New identifier that you want to add to the existing account. Pass the identifiers as a key value pair.
{“type": "wechat", "value": "TS11"}
remove** obj Existing Identifier that you want to remove from the specified account. {"type": "email", "value": "tom.sawyer@example.com"}
type* enum Type of the identifier that you want to add or remove. For example, email, mobile, and wechat.
value* string Value of the specified type. For example, if type is email, then pass the email id that you want to add or remove in value.

Error Codes

CODE DESCRIPTION
8007 Unable to update. The identifier is already registered in the same source.
8008 The new identifier already exists in the same source.
8009 Unable to identify the customer. Customer id is invalid.
8051 Same identifier found in other source. Merging into the account with user id X.
8053 Each identifier is registered with a different customer in other source. Unable to merge accounts.
8053 Same identifier is registered on other source. The account is already merged with user id X.
8064 External id validation failed.
8066 Unable to combine,User id already used in same source.
8067 Same customer found in other source. The account is already merged with user id X.
8059 Unable to push customer to solr.
8058 Invalid mobile number passed in the communication channel.
8057 Invalid email id passed in the communication channel.
8056 Invalid mobile number.
8055 Invalid email id.
8045 Account id is not passed.
8010 communication channel is invalid.

Sample Request

http://eu.api.capillarytech.com/v2/customers/search?limit=10&offset=0&q=tom

Sample Response

{
  "pagination": {
    "limit": 10,
    "offset": 0,
    "total": 33
  },
  "data": [
    {
      "userId": 261504789,
      "matchedIdentifiers": [
        {
          "idType": "firstName",
          "idValue": "Tom",
          "source": "INSTORE",
          "accountId": ""
        }
      ],
      "profiles": [
        {
          "source": "INSTORE",
          "firstName": "Tom",
          "lastName": "Sawyer"
        }
      ]
    },
    {
      "userId": 261506099,
      "matchedIdentifiers": [
        {
          "idType": "firstName",
          "idValue": "Tom",
          "source": "INSTORE",
          "accountId": ""
        }
      ],
      "profiles": [
        {
          "source": "INSTORE",
          "firstName": "Tom",
          "lastName": "Sawyer"
        }
      ]
    },
    {
      "userId": 261504579,
      "matchedIdentifiers": [
        {
          "idType": "firstName",
          "idValue": "Tom",
          "source": "INSTORE",
          "accountId": ""
        }
      ],

      "profiles": [
        {
          "source": "INSTORE",
          "firstName": "Tom",
          "lastName": "Sawyer"
        }
      ]
    },
    {
      "userId": 261506077,
      "matchedIdentifiers": [
        {
          "idType": "firstName",
          "idValue": "Tom",
          "source": "INSTORE",
          "accountId": ""
        }
      ],
      "profiles": [
        {
          "source": "INSTORE",
          "firstName": "Tom",
          "lastName": "Sawyer"
        }
      ]
    }
  ],
  "warnings": [],
  "errors": []
}

Allows fetching customers from all sources using query string. For example, you can fetch customers whose identifiers starting with 99455, or name that starts with ‘john’ and so on.

Resource Information

URI `/search?q={search keyword}’
Authentication Yes
HTTP Method GET
Batch Support No

Request URL

https://{host}/v2/customers/search?q={search keyword}

Request Parameter

Parameter Description
q Enter the keyword based on which you want to fetch customers. It will fetch customers whose first name, last name, or registered identifiers start with keyword that you pass.

Fetch Customer ID

Sample Request


https://eu.api.capillarytech.com/v2/customers/lookup?source=INSTORE&identifierName=mobile&identifierValue=919111111111

Sample Response

# Entity is the unique id of the customer

{
"entity": 306,
"warnings":[]
}

Lets you fetch unique customer id of a customer which is required to fetch customer details, update customer details, manage subscription details and other activities.

Resource Information

URI `/lookup?{query parameters}’
Authentication Yes
HTTP Method GET
Batch Support No

Request URL

https://{host}/v2/customers/lookup?source={SourceName}&accountId={accountId}&identifierName={IdentifierName}&identifierValue={IdentifierValue}

Request Parameter

Parameter Datatype Description
source* enum Specify the source from which you want to fetch the customer details. Values: FACEBOOK, WEB_ENGAGE, WECHAT, INSTORE, MARTJACK, TMALL, TAOBAO, JD, ECOMMERCE, WEBSITE, LINE, ALL
accountId string Specify the account id of the specific source if the source has multiple accounts. accountId is required for sources with multiple accounts such as WeChat or Facebook.
identifierName* enum Identifier based on which you want to fetch the customer id. Values: “mobile”, “email”, “externalId”, “wechat”,“martjackId”, or “fbId”
identifierValue* string Pass the respective identifier value.

Error Codes

CODE DESCRIPTION
8015 No customer found with the given identifier.
8065 No customer found in the given source with the given identifier.
8045 Account id is not passed.
8013 Customer identifier is invalid. Also check if the parameter identifierName is passed correctly.
8011 Invalid source account passed.

Fetch Customer Details

Sample Request

https://eu.api.capillarytech.com/v2/customers/17742?source=WECHAT&accountId=22232

Sample Response

{
   "id": 17742,
   "profiles": [
       {
           "firstName": "Tom",
           "lastName": "Sawyer",
           "attribution": {
               "createDate": "2016-06-23T19:11:18+08:00",
               "createdBy": {
                   "code": "rr.till",
                   "description": "",
                   "name": "rr.till",
                   "type": "TILL"
               },
               "modifiedBy": {
                   "code": "rr.till",
                   "description": "",
                   "name": "rr.till",
                   "type": "TILL"
               },
               "modifiedDate": "2016-08-12T18:50:23+08:00"
           },
           "fields": {
               "Gender": "Male",
               "Favorite Color": "Green"
           },
           "customerIdentifiers": [
               {
                   "type": "email",
                   "value": "tom.sawyer@example.com"
               }
           ],
           "commChannels": [
               {
                   "type": "wechat",
                   "value": "ojOPTwFOX-aBmdRlE9MHptPjt2w19",
                   "primary": true,
                   "verified": true,
                   "meta": {
                       "residence": false,
                       "office": false
                   }
               }
           ],
           "source": "WECHAT",
           "userId": 17742,
           "conflictingProfileList": [
           ],
           "autoUpdateTime": "2016-08-12T18:50:23+08:00"
       }
   ],
   "loyaltyInfo": {
       "loyaltyType": "non_loyalty",
       "attributionV2": {
           "createDate": "2016-06-23T19:11:18+08:00",
           "createdBy": {
               "code": "rr.till",
               "name": "rr.till"
           },
           "modifiedBy": {
               "code": "rr.till",
               "name": "rr.till"
           },
           "modifiedDate": "2016-08-12T18:50:23+08:00"
       },
       "lifetimePurchases": 230
   },
   "segments": {
   },
    "extendedFields": {
       "ethnicity": "Bangalore",
       "religion": "Hindu"
   },
     "extendedFields": {
        "city": "Bangalore",
        "gender": "Male"
    },
   "warnings": [
   ]
}

When embed=“points”

"pointsSummary": {
"adjusted": 0.0, 
"cumulativePurchases": 0.0, 
"currentSlab": "Platinum", 
"expired": 0.0, 
"lifetimePoints": 0.0, 
"loyaltyId": 51373283, 
"loyaltyPoints": 0.0, 
"nextSlab": "", 
"nextSlabDescription": "", 
"nextSlabSerialNumber": -1, 
"redeemed": 0.0, 
"returned": 0.0, 
"slabExpiryDate": "2116-12-07T23:59:59+05:30", 
"slabSNo": 3
}

When embed=“subscriptions”

...

"subscriptionInfo": {
        "subscriptions": [
            {
                "channel": "EMAIL",
                "priority": "TRANS",
                "type": "OPTIN"
            },
            {
                "channel": "SMS",
                "priority": "TRANS",
                "type": "OPTIN"
            },
            {
                "channel": "ANDROID",
                "priority": "TRANS",
                "type": "OPTIN"
            },
            {
                "channel": "IOS",
                "priority": "TRANS",
                "type": "OPTIN"
            },
            {
                "channel": "EMAIL",
                "priority": "BULK",
                "type": "OPTIN"
            },
            {
                "channel": "SMS",
                "priority": "BULK",
                "type": "OPTIN"
            },
            {
                "channel": "ANDROID",
                "priority": "BULK",
                "type": "OPTIN"
            },
            {
                "channel": "IOS",
                "priority": "BULK",
                "type": "OPTIN"
            }
        ],
...

When embed=mlp, you will see each loyalty program details of the customer.

...
"loyaltyProgramDetails": [
        {
            "redeemed": 8600,
            "expired": 100,
            "returned": 500,
            "adjusted": 0,
            "lifetimePoints": 10500,
            "loyaltyPoints": 1000,
            "cumulativePurchases": 103000,
            "loyaltyId": 52350728,  
            "currentSlab": "Silver",
            "nextSlab": "Gold",
            "nextSlabSerialNumber": 3,
            "nextSlabDescription": "Gold tier",
            "slabSNo": 2,
            "slabExpiryDate": "2118-12-29T23:59:59+05:30",
            "programId": 1219
        },
        {
            "redeemed": 100,
            "expired": 0,
            "returned": 10,
            "adjusted": 0,
            "lifetimePoints": 400,
            "loyaltyPoints": 300,
            "cumulativePurchases": 8800,
            "loyaltyId": 52350728,
            "currentSlab": "Tier1",
            "nextSlab": "Tier2",
            "nextSlabSerialNumber": -1,
            "nextSlabDescription": "",
            "slabSNo": 1,
            "slabExpiryDate": "2118-12-29T23:59:59+05:30",
            "programId": 1223
        }
    ],
...

Retrieves details of a specific customer such as:

Resource Information

URI `/{customerId}’
Authentication Yes
HTTP Method GET
Batch Support No

Request URL

https://{host}/v2/customers/{customerId}?source={sourceName}&accountId={accountId}

To fetch customer details from a specific account of a source (source with multiple accounts), you need to provide the respective account id.

Additional Header

Header Description
language Specify the ISO language code to get customer level extended field details in your preferred language. For example, zh for Chinese, id for Indonesian, ar for Arabic. English is the default language.

Request Query Parameters

Parameter Datatype Description
id* int Unique identifier of the customer that you want to fetch.
source* enum Pass the source from which you want to fetch details. Value: INSTORE, MARTJACK, WECHAT, ALL ( to fetch details from all sources. For sources with multiple accounts, you also need to pass the specific accountId.
accountId string For sources with multiple accounts, pass the specific accountId.
embed enum To get details of loyalty points, subscription, multiple loyalty program details of the customer. Value: points, subscriptions, mlp. Usage: https://{ClusterURL}/v2/customers/{CustomerId}/source=WECHAT&accountId={WeChat account id}&embed=”points”
embed=usergroup - Retrieves user group details if the customer is in a user group.

Error Codes

Code Description
8069 The customer is merged into another account.
8065 No customer found in the given source with the given identifier.
8015 No customer found with the given identifier.
8063 Unable to fetch segmentation details.
8062 Unable to fetch loyalty points.
8045 Account id is not passed.
8012 Invalid source passed.

Fetch Customer Loyalty Details

Sample Request

http://eu.api.capillarytech.com/v2/customers/29372667/loyaltyDetails

Sample Response

{
    "data": [
        {
            "redeemed": 200,
            "expired": 0,
            "returned": 1100.2139892578125,
            "adjusted": 50,
            "lifetimePoints": 500,
            "loyaltyPoints": 350,
            "cumulativePurchases": 8500,
            "loyaltyId": 52350728,
            "currentSlab": "Gold",
            "nextSlab": "Platinum",
            "nextSlabSerialNumber": 3,
            "nextSlabDescription": "Platinum tier",
            "slabSNo": 2,
            "slabExpiryDate": "2117-12-29T23:59:59+05:30",
            "programId": 1219
        },
        {
            "redeemed": 2500,
            "expired": 300,
            "returned": 102.68399810791016,
            "adjusted": 30,
            "lifetimePoints": 5000,
            "loyaltyPoints": 2200,
            "cumulativePurchases": 43560,
            "loyaltyId": 52350728,
            "currentSlab": "Platinum",
            "nextSlab": "Star",
            "nextSlabSerialNumber": -1,
            "nextSlabDescription": "Top level tier",
            "slabSNo": 1,
            "slabExpiryDate": "2117-12-29T23:59:59+05:30",
            "programId": 1223
        }
    ],
    "warnings": [],
    "errors": []
}

Retrieves the loyalty information of a customer across all loyalty programs of the org . You can also fetch details of a specific loyalty program.

Resource Information

URI /{customerId}/loyaltyDetails
Authentication Yes
HTTP Method GET
Batch Support No

Request URL

https://{host}/v2/customers/{customerId}/loyaltyDetails

Request Parameters

Parameter Description
customerId* It is the unique ID that is generated internally for a customer. Pass the unique id of a customer whose loyalty details you want to fetch
programId Pass the loyalty program ID to get details of that particular program (Applicable only if the org has multiple loyalty programs). Pass the id of the program that you want to fetch.

Update Subscription Details

Sample Request


https://eu.api.capillarytech.com/v2/customers/17742/subscriptions

Sample POST Request


{
    "communicationId": -1,
    "campaignId": -1,
    "reason": "Example reason",
    "scope": {
        "scope": "USER", 
        "subScope": "NONE"
    }, 
    "subscriptions": [
        {
            "channel": "EMAIL",
            "accountId": "",
            "priority": "BULK",
            "type": "OPTOUT"
        },
        {
            "channel": "MOBILE",
            "accountId": "",
            "priority": "BULK",
            "type": "OPTOUT"
        }, 
        {
            "channel": "EMAIL",
            "accountId": "",
            "priority": "TRANS",
            "type": "OPTIN"
        },
        {
            "channel": "MOBILE",
            "accountId": "123",
            "priority": "TRANS",
            "type": "OPTIN"
        }
    ]
}

Sample Response

{
  "scope": {
    "scopeId": 0,
    "scope": "USER",
    "subScope": "NONE",
    "setCreatedOn": false,
    "setPriority": false,
    "setScopeId": false,
    "setScope": true,
    "setSubScope": true
  },
  "subscriptions": [
    {
      "channel": "EMAIL",
      "accountId": "",
      "priority": "BULK",
      "type": "OPTOUT"
    },
    {
      "channel": "EMAIL",
      "accountId": "",
      "priority": "TRANS",
      "type": "OPTIN"
    },
    {
      "channel": "SMS",
      "accountId": "123",
      "priority": "TRANS",
      "type": "OPTIN"
    }
  ],
  "campaignId": -1,
  "communicationId": -1,
  "reason": "Sample reason",
  "warnings": []
}

Subscription represents communication channels to which a customer has subscribed. Capillary supports the following channels - mobile, email, wechat, whatsapp, ios, android, and line.

This API allows updating (opt-in or opt-out) subscription status of transactional and bulk messaging services for a customer.

Resource Information

URI /{customerId}/subscriptions
Authentication Yes
HTTP Method POST
Batch Support No

Request URL

https://{host}/v2/customers/{customerId}/subscriptions

Request Parameters

Parameter Description
customerId* Unique ID of the customer whose subscription details you want to modify
channel Pass the communication channel that you want to update. Value: mobile, email, wechat, whatsapp, ios, android, and line.
priority Type of service for which you want to modify the subscription details.TRANS for personalized messages and BULK for campaign or bulk messages
type OPTIN to subscribe and OPTOUT to unsubscribe

Retrieve Subscription Details

Sample Request


https://eu.api.capillarytech.com/v2/customers/17742/subscriptions

Sample Response


{
   "subscriptions": [
       {
           "channel": "EMAIL",
           "priority": "TRANS",
           "type": "OPTIN"
       },
       {
           "channel": "SMS",
           "priority": "TRANS",
           "type": "OPTIN"
       },
       {
           "channel": "EMAIL",
           "priority": "BULK",
           "type": "OPTIN"
       },
       {
           "channel": "SMS",
           "priority": "BULK",
           "type": "OPTIN"
       }
   ],
   "campaignId": 0,
   "communicationId": 0,
   "warnings": [
   ]
}

Allows retrieving the subscription details of a customer to SMS, email and WeChat. The status will be OPTIN for subscribed and OPTOUT for unsubscribed.

Entry Description
URI /{customerId}/subscriptions
Rate Limited? Yes
Authentication Yes
HTTP Method GET
Batch Support No

Request URL

https://{host}/v2/customers/{customerId}/subscriptions

Request Query Parameters

Parameter Description
id* Pass the unique ID of the customer to fetch the subscription details

Get Points Transfer Summary of Customer

Retrieves points transfer summary of a customer. Points transfer summary consists of points that are transferred from the customer account to another customer’s account (Deduction) or points that are received from another customer’s account (Addition).

Sample Request

https://eu.api.capillarytech.com/v2/customers/343015431/pointsTransfers

Sample Response

{ 
   "data":[ 
      { 
         "pointsTransferDate":"2019-10-16 15:53:42",
         "pointsTransferred":15.0,
         "transferId":100,
         "transferType":"DEDUCTION",
         "transferredFrom":{ 
            "userId":343015431,
            "firstName":"Tom",
            "lastName":"Sawyer"
         },
         "transferredTo":{ 
            "userId":343015432,
            "firstName":"James",
            "lastName":"Thomas"
         },
         "notes":"",
         "programName":"Nightly_ApiAutoDefaultProgram"
      },
      { 
         "pointsTransferDate":"2019-10-26 10:23:42",
         "pointsTransferred":5.0,
         "transferId":100,
         "transferType":"ADDITION",
         "transferredFrom":{ 
            "userId":343015432,
            "firstName":"James",
            "lastName":"Thomas"
         },
         "transferredTo":{ 
            "userId":343015431,
            "firstName":"Tom",
            "lastName":"Sawyer"
         },
         "notes":"",
         "programName":"Nightly_ApiAutoDefaultProgram"
      }
   ],
   "warnings":[ 

   ],
   "errors":[ 

   ]
}

Resource Information

URI /{userId}/pointsTransfers
Rate Limited? No
Authentication Yes
HTTP Methods GET
Batch Support No

Request URL

https://{host}/v2/customers/{userId}/pointsTransfers

Request Query Parameters

Parameter Type Description
userId* int Unique ID of the customer whose points transfer summary needs to fetch.

Get Change Requests

Retrieves the summary of change in identifiers and other details such as email ID, mobile number, external ID, account merge, address change, mobile number reallocation, tier, and retro transactions.

Sample Request

http://us.api.capillarytech.com/v2/customers/368881003/retroRequest

Sample Response

{
    "pagination": {
        "limit": 10,
        "offset": 0,
        "total": 5
    },
    "data": [
        {
            "id": 5,
            "status": "REJECTED",
            "enteredBy": {
                "id": 15091433,
                "code": "till.india1",
                "description": "",
                "name": "till.india1",
                "type": "TILL",
                "adminType": "GENERAL",
                "isActive": true,
                "isOuEnabled": false,
                "timeZoneId": 0,
                "currencyId": 0,
                "languageId": 0
            },
            "enteredByParent": {
                "id": 15091431,
                "code": "store_india",
                "description": "",
                "name": "StoreIndia",
                "type": "STORE",
                "adminType": "GENERAL",
                "isActive": true,
                "isOuEnabled": false,
                "timeZoneId": 0,
                "currencyId": 23,
                "languageId": 148
            },
            "enteredBy": {
                "id": 8730028,
                "code": "Patel",
                "name": "Nayan Kumar",
                "type": "ADMIN_USER",
                "adminType": "GENERAL",
                "isActive": true,
                "isOuEnabled": false,
                "timeZoneId": 0,
                "currencyId": 0,
                "languageId": 0
            },
            "addedOn": "2015-07-22T15:48:15+05:30",
            "updatedOn": "2015-10-13T16:04:38+05:30",
            "userId": 9113108,
            "requestId": 116681,
            "baseType": "RETRO",
            "reason": "_memcare(\"Insufficient validation from requestor d",
            "comments": "操作已失败于服务器。错误讯",
            "transactionId": 2866,
            "warnings": [
            ],
            "reqAdd": true,
            "oneStep": false
        },
        {
            "id": 4,
            "status": "APPROVED",
            "enteredBy": {
                "id": 15091433,
                "code": "till.india1",
                "description": "",
                "name": "till.india1",
                "type": "TILL",
                "adminType": "GENERAL",
                "isActive": true,
                "isOuEnabled": false,
                "timeZoneId": 0,
                "currencyId": 0,
                "languageId": 0
            },
            "enteredByParent": {
                "id": 15091431,
                "code": "store_india",
                "description": "",
                "name": "StoreIndia",
                "type": "STORE",
                "adminType": "GENERAL",
                "isActive": true,
                "isOuEnabled": false,
                "timeZoneId": 0,
                "currencyId": 23,
                "languageId": 148
            },
            "enteredBy": {
                "id": 8730028,
                "code": "Patel",
                "name": "Nayan Kumar",
                "type": "ADMIN_USER",
                "adminType": "GENERAL",
                "isActive": true,
                "isOuEnabled": false,
                "timeZoneId": 0,
                "currencyId": 0,
                "languageId": 0
            },
            "addedOn": "2019-07-22T15:47:22+05:30",
            "updatedOn": "2019-10-13T16:12:54+05:30",
            "userId": 9113108,
            "requestId": 116679,
            "baseType": "RETRO",
            "reason": "",
            "comments": "",
            "transactionId": 2865,
            "warnings": [
            ],
            "reqAdd": true,
            "oneStep": false
        },
        {
            "id": 3,
            "status": "REJECTED",
            "enteredBy": {
                "id": 15091433,
                "code": "till.india1",
                "description": "",
                "name": "till.india1",
                "type": "TILL",
                "adminType": "GENERAL",
                "isActive": true,
                "isOuEnabled": false,
                "timeZoneId": 0,
                "currencyId": 0,
                "languageId": 0
            },
            "enteredByParent": {
                "id": 15091431,
                "code": "store_india",
                "description": "",
                "name": "StoreIndia",
                "type": "STORE",
                "adminType": "GENERAL",
                "isActive": true,
                "isOuEnabled": false,
                "timeZoneId": 0,
                "currencyId": 23,
                "languageId": 148
            },
            "enteredBy": {
                "id": 15091437,
                "code": "till.sg",
                "description": "",
                "name": "till.sg",
                "type": "TILL",
                "adminType": "GENERAL",
                "isActive": true,
                "isOuEnabled": false,
                "timeZoneId": 0,
                "currencyId": 23,
                "languageId": 148
            },
            "addedOn": "2019-07-22T14:30:23+05:30",
            "updatedOn": "2019-07-22T14:31:56+05:30",
            "userId": 9113108,
            "requestId": 116669,
            "baseType": "RETRO",
            "transactionId": 2863,
            "warnings": [
            ],
            "reqAdd": true,
            "oneStep": false
        },
        {
            "id": 2,
            "status": "APPROVED",
            "enteredBy": {
                "id": 15091433,
                "code": "till.india1",
                "description": "",
                "name": "till.india1",
                "type": "TILL",
                "adminType": "GENERAL",
                "isActive": true,
                "isOuEnabled": false,
                "timeZoneId": 0,
                "currencyId": 0,
                "languageId": 0
            },
            "enteredByParent": {
                "id": 15091431,
                "code": "store_india",
                "description": "",
                "name": "StoreIndia",
                "type": "STORE",
                "adminType": "GENERAL",
                "isActive": true,
                "isOuEnabled": false,
                "timeZoneId": 0,
                "currencyId": 23,
                "languageId": 148
            },
            "enteredBy": {
                "id": 15091437,
                "code": "till.sg",
                "description": "",
                "name": "till.sg",
                "type": "TILL",
                "adminType": "GENERAL",
                "isActive": true,
                "isOuEnabled": false,
                "timeZoneId": 0,
                "currencyId": 23,
                "languageId": 148
            },
            "addedOn": "2019-07-22T14:20:56+05:30",
            "updatedOn": "2019-07-22T14:27:20+05:30",
            "userId": 9113108,
            "requestId": 116668,
            "baseType": "RETRO",
            "transactionId": 2862,
            "warnings": [
            ],
            "reqAdd": true,
            "oneStep": false
        },
        {
            "id": 1,
            "status": "REJECTED",
            "enteredBy": {
                "id": 15091433,
                "code": "till.india1",
                "description": "",
                "name": "till.india1",
                "type": "TILL",
                "adminType": "GENERAL",
                "isActive": true,
                "isOuEnabled": false,
                "timeZoneId": 0,
                "currencyId": 0,
                "languageId": 0
            },
            "enteredByParent": {
                "id": 15091431,
                "code": "store_india",
                "description": "",
                "name": "StoreIndia",
                "type": "STORE",
                "adminType": "GENERAL",
                "isActive": true,
                "isOuEnabled": false,
                "timeZoneId": 0,
                "currencyId": 23,
                "languageId": 148
            },
            "enteredBy": {
                "id": 8730028,
                "code": "Patel",
                "name": "Nayan Kumar",
                "type": "ADMIN_USER",
                "adminType": "GENERAL",
                "isActive": true,
                "isOuEnabled": false,
                "timeZoneId": 0,
                "currencyId": 0,
                "languageId": 0
            },
            "addedOn": "2015-07-22T14:06:14+05:30",
            "updatedOn": "2015-10-13T16:12:43+05:30",
            "userId": 9113108,
            "requestId": 116663,
            "baseType": "RETRO",
            "reason": "_memcare(\"Insufficient validation from requestor d",
            "comments": "Sample comments;",
            "transactionId": 2861,
            "warnings": [
            ],
            "reqAdd": true,
            "oneStep": false
        }
    ],
    "warnings": [
    ],
    "errors": [
    ]
}

Resource Information

URI /{customerId}/retroRequest?{query parameters}
Rate Limited? Yes
Authentication Yes
Response Formats JSON
HTTP Method GET
Batch Support No

Request URL

https://{host}/v2/customers/{customerId}/retroRequest?{query parameters}

Request Query Parameters

Parameter Type Description
changeType enum Lets you filter requests by type. Value: EMAIL (for email id changes), MOBILE (for mobile number change history), EXTERNAL_ID (for external ID change history), MERGE (for account merge history), ADDRESS (for address change history), MOBILE_REALLOC (for mobile reallocations), COUPON, POINTS, TIER (for tier change history), and RETRO (for retro transactions).
startDate string Filter results by date-range. Pass the start date in YYYY-MM-DD format.
endDate string Filter results by date-range. Pass the end date in YYYY-MM-DD format.
startId long Filter results by sequence ID (sequence in which a change happened). For example, get lists from startId 200
endId long Filter results by sequence ID (sequence in which a change happened). For example, get lists from startId 200 until endId 400.
offset long Number of rows that you want omit from showing.
limit int Pass the number of results that you want to see.

Get Identifier Change Requests

Retrieves the details of identifiers (mobile number/email ID/external ID)change requests. You can also fetch change requests of a specific identifier type using the query parameters.

Sample Request

https://eu.api.capillarytech.com/v2/customers/130238908/changeRequest?source=INSTORE

Sample Response

{
    "pagination": {
        "limit": 10,
        "offset": 0,
        "total": 1
    },
    "data": [
        {
            "id": 560739,
            "status": "APPROVED",
            "addedBy": {
                "id": 75030996,
                "code": "1552291147_",
                "description": "",
                "name": "Henry",
                "type": "ADMIN_USER",
                "adminType": "GENERAL",
                "isActive": true,
                "isOuEnabled": false,
                "timeZoneId": 0,
                "currencyId": 0,
                "languageId": 0
            },
            "updatedBy": {
                "id": 75030996,
                "code": "1552291147",
                "description": "",
                "name": "Henry",
                "type": "ADMIN_USER",
                "adminType": "GENERAL",
                "isActive": true,
                "isOuEnabled": false,
                "timeZoneId": 0,
                "currencyId": 0,
                "languageId": 0
            },
            "addedOn": "2020-02-12T09:58:41Z",
            "updatedOn": "2020-02-12T09:58:41Z",
            "userId": 130238908,
            "changeType": "EMAIL",
            "changeIdentifiers": {
                "add": [
                    {
                        "type": "EMAIL",
                        "value": "iwan.gold@example.com"
                    }
                ],
                "remove": [
                    {
                        "type": "EMAIL",
                        "value": "dore.gold@example
                        .com"
                    }
                ]
            },
            "comments": "auto approved by 75030996",
            "secUserId": 0,
            "oneStep": false
        }
    ],
    "warnings": [],
    "errors": []
}

Resource Information

URI /{customerId}/changeRequest
Authentication Yes
HTTP Method GET
Batch Support No

Request URL

`https://{host}/v2/customers/{customerId}/changeRequest?queryParams

Request Query Parameters

Parameter Datatype Description
customerId* long Unique ID of the customer to get the details of change requests.
limit int Limit the number of results to retrieve.
offset int Fetches change requests > the offset number. Offset is the position of the lead in the db record. The value is assigned based on the sequence of creation. . For example, offset=10 retrieves all the leads from record number 11.
source enum Source in which want to fetch details. Values: INSTORE, FACEBOOK, WEB_ENGAGE, WECHAT, MARTJACK, TMALL, TAOBAO, JD, ECOMMERCE, WEBSITE, LINE, MOBILE_APP. For sources with multiple accounts such as WECHAT, FACEBOOK, MOBILE_APP, or LINE,
changeType enum Fetch details of a specific identifier change. Values: EMAIL, MOBILE, EXTERNAL_ID, MERGE, MOBILE_REALLOC, COUPON, POINTS, TIER, RETRO.
limit int Limit the number of results to retrieve.
sortBy enum Lets you sort the list by created date, createdon or last updated date, lastUpdatedOn.
sortOrder Sort the results in ascending, ASC or descending, DESC order of sortBy
startDate date-time Fetch change requests added on or after a specific date. Pass the date in YYYY-MM-DD format.
endDate date-time Fetch change requests added on or before a specific date. Pass the date in YYYY-MM-DD format.
startId long Fetch change requests greater than or equal to a specific request ID range.
endId long Fetch change requests less than or equal to a specific request ID range.

Get Customer Goodwill Requests

Retrieves the history of goodwill points of a customer.

Sample Request

http://api.capillary.co.in/v2/customers/343040815/goodwillRequest
{
    "pagination": {
        "limit": 10,
        "offset": 0,
        "total": 2
    },
    "data": [
        {
            "id": 43114,
            "enteredBy": {
                "id": 15000449,
                "code": "1371622280_919866643044",
                "description": "",
                "name": "1371622280_Ashish",
                "type": "ADMIN_USER",
                "adminType": "GENERAL",
                "isActive": true,
                "isOuEnabled": false,
                "timeZoneId": 0,
                "currencyId": 0,
                "languageId": 0
            },
            "enteredBy": {
                "id": 15000449,
                "code": "1371622280_919866643044",
                "description": "",
                "name": "1371622280_Ashish",
                "type": "ADMIN_USER",
                "adminType": "GENERAL",
                "isActive": true,
                "isOuEnabled": false,
                "timeZoneId": 0,
                "currencyId": 0,
                "languageId": 0
            },
            "addedOn": "2019-11-04T15:18:23+05:30",
            "updatedOn": "2019-11-04T15:18:23+05:30",
            "userId": 343040815,
            "requestId": 770197,
            "goodwillType": "POINTS",
            "goodwillStatus": "APPROVED",
            "comments": "sample",
            "reason": " ",
            "approvedValue": "450",
            "updatedComments": "sample; AUTO_APPROVED",
            "oneStep": false
        },
        {
            "id": 43113,
            "enteredBy": {
                "id": 15000449,
                "code": "1371622280_919866643044",
                "description": "",
                "name": "1371622280_Ashish",
                "type": "ADMIN_USER",
                "adminType": "GENERAL",
                "isActive": true,
                "isOuEnabled": false,
                "timeZoneId": 0,
                "currencyId": 0,
                "languageId": 0
            },
            "enteredBy": {
                "id": 15000449,
                "code": "1371622280_919866643044",
                "description": "",
                "name": "1371622280_Ashish",
                "type": "ADMIN_USER",
                "adminType": "GENERAL",
                "isActive": true,
                "isOuEnabled": false,
                "timeZoneId": 0,
                "currencyId": 0,
                "languageId": 0
            },
            "addedOn": "2019-11-04T15:17:55+05:30",
            "updatedOn": "2019-11-04T15:17:55+05:30",
            "userId": 343040815,
            "requestId": 770196,
            "goodwillType": "POINTS",
            "goodwillStatus": "PENDING",
            "comments": "",
            "reason": " ",
            "oneStep": false
        }
    ],
    "warnings": [],
    "errors": []
}


Resource Information

URI /{customerId}/goodwillRequest
Authentication Yes
HTTP Method GET
Batch Support No

Request URL

`https://{host}/v2/customers/{customerId}/goodwillRequest

Request Query Parameters

Parameter Datatype Description
currencyId* long Pass the unique ID of the customer whose goodwill request details you want to fetch.
requestId long Unique id of the goodwill request that you want to fetch.
is_one_step_change boolean Pass true to fetch goodwill points or coupon requests that are issued instantly (one step issual).
programId string Get requests of a specific loyalty program. Pass the unique loyalty program ID.
autoApprove boolean Pass true to fetch requests that are auto-approved - without the involvement of the back-end team.

Get Customer Coupons

Retrieves coupon history of a customer.

Sample Request

http://api.capillary.co.in/v2/customers/343040815/coupons

Sample Response



Resource Information

URI /{customerId}/coupons
Authentication Yes
HTTP Method GET
Batch Support No

Request URL

https://{host}/v2/customers/{customerId}/coupons

Request Query Parameters

Parameter Datatype Description
customerId* long Unique ID of the customer to fetch coupons.

Response Codes

Success Codes

Code Description
1000 Customer registered successfully.
Customer retrieved successfully.
Subscription updated successfully.
Subscription retrieved successfully.
Customer updated successfully.
Coupons retrieved successfully.
Customer notes added/updated successfully.
Customer notes retrieved successfully.
Customer preferences retrieved successfully.
Customer preferences updated successfully.
1000 Referral statistics retrieved successfully.
Referrals are invited successfully.
1040 Customer id change request has submitted successfully.
1061 Customer recommendations fetched successfully.
1052 Transactions fetched successfully.
1300 Ticket retrieved successfully.
Ticket added successfully.

Error Codes

Code Description
500 All requests failed due to errors.
400 Input is invalid. Please check request parameters or input xml/json; No identifier provided to get loyalty users.
618 Not allowed - customer is marked as fraud.
816 Customer not found for organization.
1001 Unable to register. Invalid mobile number.
1002 Unable to register. Invalid email id.
1003 Unable to register. Invalid external id.
1004 Failed to populate store.
1006 Unable to register. Mobile number is required.
1007 Unable to register customer. No valid primary identifier mobile number, email ID, or external ID passed.
1008/ 1038 Unable to register with external id.
1009 Unable to add registered customer to MLM.
1010 Unable to update loyalty points of the customer.
1011 Cannot find customer for provided identifier.
1012 Cannot find customer with the provided mobile number/external ID/e-mail ID.
1013 Customer is not registered for the loyalty Program.
1014 Customer is registered already.
1015 No identifier provided to get loyalty users.
1016 Unable to register. Email provided already exists for some other user.
1017 Provided Custom Field is invalid.
1018 Unable to update custom field.
1019 Mobile number or external id is required along with the email Id to register.
1020 The customer is not registered for loyalty program.
1021 Invalid validation code.
1023 Unable to register customer to loyalty program.
1024 Unable to update customer profile.
1025 Mandatory fields are not matching for customer identity update.
1026 Count of optional fields match is less than required.
1027 Field name provided for verification is invalid.
1028 No customer notes are available.
1029 Unable to retrieve customer preferences.
1030 Unable to update customer preferences.
1031 No preferences set for this customer.
1032 A customer already exists with the same mobile number.
1033 A customer already exists with the same external id.
1034 Unable to register. Registration date is not within the allowed past or future date limit.
1035 Unable to update few customer preferences.
1036 One or more notes could not be added/updated for customer.
1037 Unable to add/update customer notes.
1039 Unable to register. Email ID is required.
1041 Customer id change request failed.
1042 Invalid mobile no/email id/external id.
1043 Unable to register. Customer’s external id is required.
1044 You do not have sufficient permission to view the customer details.
1045 No valid identifier (mobile/email) passed for non-loyalty customer.
1046 Conversion of loyalty customer to non-loyalty is not allowed.
1047 Customer’s primary identifier not matching with other identifiers.
1048 Customer’s email id is required to convert to loyalty customer.
1049 Customer’s external id is required to convert to loyalty customer.
1051 No transactions or recommendations found for the customer.
1053 Preferred store specified is not found.
1060 Batch limit exceeded.
1062 Invalid Test & Control status.
1088 Unable to issue points. Please report to capillary support.
1099 Unable to fetch tracker data for the customer.
1101 Invalid channel type.
1102 Invalid priority type.
1103 Invalid scope.
1104 Invalid identifier or no identifier passed.
1105 Multiple scopes are not allowed.
1106 Invalid subscription status passed.
1107 Invalid campaign id passed.
1108 Invalid outbox id passed.
1109 Unable to add, update or fetch subscription details.
1150 Invalid store ID passed.
1110 Unable to update subscription details.
1222 Internal error occurred with the referral system.
1202 Invalid campaign token.
1203 Invalid campaign configured.
1204 The customer may not be eligible for the referral program.
1205 Unable to find the referrer in the specific campaign.
1206 Failed to add referral. Referral type is not supported.
1222 Internal error occurred with the referral system.
1301 A ticket already exists with the same subject.
1302 Ticket registration failed.
1303 Ticket subject should not be empty.
10001 Failed to add customer.
10002 Failed to update customer details.
91001 Failed to get point details.
91002 Failed to get subscription details.
91003 Validation failed.
91004 Failed to get segmentation details.
91005 {x} is Primary Key, {y} cannot be updated.
91006 {x} update is not allowed.
91007 {x} is already occupied by some other user, ignoring it.
91009 Retrieved survivor account for the requested merge victim.
91010 Downgrade strategy is not configured.
91011 Customer is already in the lowest slab.
91012 Customer is already in the highest slab.
91013 Call to Points Engine for tier upgrade criteria has failed {x}.
91014 Call to Points Engine for tier renewal criteria has failed {x}.
91015 Failed to update extended fields; or field {x} length too long.
91016 WECHAT profile is not available for the customer.
91017 WEB_ENGAGE profile is not available for the customer.
91018 Unable to load WeChat notifications.
91019 Unable to load Web Engage notifications.
91020 Invalid TILL passed for registration.
91021 Invalid attribution TILL passed.
91022 Failed to update subscription for {x} channel and priority {y}.

Transaction

A transaction represents a purchase or return event.

Transactions are classified into the following types:

Add Transaction

Lets you add one or more loyalty transactions to the Capillary system.

Prerequisites

Before using transaction APIs, understand the transaction configurations of your organization. You can see the transaction related settings on InTouch > Settings > Systems & Deployment > InTouch PoS Configuration > Billing.

The transaction/add API lets you do the following.

Variant Product: A same product having different variations in terms of common properties such as size, and color.

Product Bundle: A group of items that are sold as a single pack. This can include Combo items (Example: pack of 2, combo offers), Split items (Example: a necklace having gold rate, store rate, making charge, wastage charge and so on) and add-on items (Example: Pizza with extra cheese, and personalized toppings)

Sample Request

https://eu.intouch.capillarytech.com/v2/transactions/bulk

Sample POST Request

[
  {
    "identifierType": "mobile",
    "identifierValue": "919740000000",
    "source": "INSTORE",
    "accountId": "",
    "type": "REGULAR",
    "billNumber": "num-668288857749",
    "discount": "10",
    "billAmount": "200",
    "note": "this is test",
    "grossAmount": "110",
    "deliveryStatus": "SHIPPED",
    "paymentModes": [
      {
        "attributes": {
          "name": "BankNameAPI",
          "value": "value_6555444"
        },
        "notes": "notes_6555444",
        "mode": "CHECKAPI",
        "value": "500"
      }
    ],
    "extendedFields": {
      "ship_first_name": "22.02",
      "ship_last_name": "10.50"
    },
    "customFields": {
      "trans_cf_a": "abc"
    },
    "lineItemsV2": [
      {
        "itemCode": "sku_486741_2",
        "amount": 100.5,
        "rate": 100.5,
        "qty": 1,
        "extendedFields": {
          "MetalRate": "22.02",
          "GrossWeight": "10.50"
        }
      },
      {
        "itemCode": "sku_486741_2",
        "amount": 100.5,
        "rate": 100.5,
        "qty": 1,
        "extendedFields": {
          "MetalRate": "22.02",
          "GrossWeight": "10.50"
        }
      },
      {
        "itemCode": "sku_486741_3",
        "amount": 100.5,
        "rate": 100.5,
        "qty": 1,
        "extendedFields": {
          "gender": "Male",
          "marital_status": "Married"
        },
        "customFields": {
          "cashierid": "jim2345",
          "city": "Bangalore"
        }
      },
      {
        "itemCode": "sku_486741_4",
        "amount": 100.5,
        "rate": 100.5,
        "qty": 1,
        "extendedFields": {
          "MetalRate": "22.02",
          "GrossWeight": "10.50"
        }
      },
      {
        "itemCode": "sku_486741_5",
        "amount": 100.5,
        "rate": 100.5,
        "qty": 1,
        "extendedFields": {
          "MetalRate": "22.02",
          "GrossWeight": "10.50"
        }
      },
      {
        "itemCode": "sku_486741_6",
        "amount": 100.5,
        "rate": 100.5,
        "qty": 1,
        "extendedFields": {
          "MetalRate": "22.02",
          "GrossWeight": "10.50"
        }
      },
      {
        "itemCode": "sku_486741_7",
        "amount": 100.5,
        "rate": 100.5,
        "qty": 1,
        "extendedFields": {
          "MetalRate": "22.02",
          "GrossWeight": "10.50"
        }
      },
      {
        "itemCode": "sku_486741_8",
        "amount": 100.5,
        "rate": 100.5,
        "qty": 1,
        "extendedFields": {
          "MetalRate": "22.02",
          "GrossWeight": "10.50"
        }
      },
      {
        "itemCode": "sku_486741_9",
        "amount": 100.5,
        "rate": 100.5,
        "qty": 1,
        "extendedFields": {
          "MetalRate": "22.02",
          "GrossWeight": "10.50"
        }
      },
      {
        "itemCode": "sku_486741_10",
        "amount": 100.5,
        "rate": 100.5,
        "qty": 1,
        "extendedFields": {
          "MetalRate": "22.02",
          "GrossWeight": "10.50"
        }
      }
    ]
  },
  {
    "identifierType": "mobile",
    "identifierValue": "919740000000",
    "source": "INSTORE",
    "accountId": "",
    "type": "REGULAR",
    "billNumber": "num-668288857765",
    "discount": "10",
    "billAmount": "200",
    "note": "this is test",
    "grossAmount": "110",
    "deliveryStatus": "SHIPPED",
    "paymentModes": [
      {
        "attributes": {
          "name": "BankNameAPI",
          "value": "value_6555444"
        },
        "notes": "notes_6555444",
        "mode": "CHECKAPI",
        "value": "500"
      }
    ],
    "extendedFields": {
      "ship_first_name": "22.02",
      "ship_last_name": "10.50"
    },
    "customFields": {
      "trans_cf_a": "abc"
    },
    "lineItemsV2": [
      {
        "itemCode": "sku_486741_2",
        "amount": 100.5,
        "rate": 100.5,
        "qty": 1,
        "extendedFields": {
          "MetalRate": "22.02",
          "GrossWeight": "10.50"
        }
      },
      {
        "itemCode": "sku_486741_2",
        "amount": 100.5,
        "rate": 100.5,
        "qty": 1,
        "extendedFields": {
          "MetalRate": "22.02",
          "GrossWeight": "10.50"
        }
      },
      {
        "itemCode": "sku_486741_3",
        "amount": 100.5,
        "rate": 100.5,
        "qty": 1,
        "extendedFields": {
          "MetalRate": "22.02",
          "GrossWeight": "10.50"
        }
      },
      {
        "itemCode": "sku_486741_4",
        "amount": 100.5,
        "rate": 100.5,
        "qty": 1,
        "extendedFields": {
          "MetalRate": "22.02",
          "GrossWeight": "10.50"
        }
      },
      {
        "itemCode": "sku_486741_5",
        "amount": 100.5,
        "rate": 100.5,
        "qty": 1,
        "extendedFields": {
          "MetalRate": "22.02",
          "GrossWeight": "10.50"
        }
      },
      {
        "itemCode": "sku_486741_6",
        "amount": 100.5,
        "rate": 100.5,
        "qty": 1,
        "extendedFields": {
          "MetalRate": "22.02",
          "GrossWeight": "10.50"
        }
      },
      {
        "itemCode": "sku_486741_7",
        "amount": 100.5,
        "rate": 100.5,
        "qty": 1,
        "extendedFields": {
          "MetalRate": "22.02",
          "GrossWeight": "10.50"
        }
      },
      {
        "itemCode": "sku_486741_8",
        "amount": 100.5,
        "rate": 100.5,
        "qty": 1,
        "extendedFields": {
          "gender": "Male",
          "marital_status": "Married"
        },
        "customFields": {
          "cashierid": "jim2345",
          "city": "Bangalore"
        }
      },
      {
        "itemCode": "sku_486741_9",
        "amount": 100.5,
        "rate": 100.5,
        "qty": 1,
        "extendedFields": {
          "MetalRate": "22.02",
          "GrossWeight": "10.50"
        }
      },
      {
        "itemCode": "sku_486741_10",
        "amount": 100.5,
        "rate": 100.5,
        "qty": 1,
        "extendedFields": {
          "MetalRate": "22.02",
          "GrossWeight": "10.50"
        }
      }
    ]
  }
]

Sample Response

{
  "response": [
    {
      "result": {
        "identifierType": "mobile",
        "identifierValue": "919740390065",
        "source": "INSTORE",
        "accountId": "",
        "extendedFields": {
          "ship_first_name": "22.02",
          "ship_last_name": "10.50"
        },
        "deliveryStatus": "SHIPPED",
        "type": "REGULAR",
        "billAmount": 200,
        "billNumber": "num-668288857749",
        "discount": 10,
        "grossAmount": 110,
        "note": "this is test",
        "lineItemsV2": [
          {
            "amount": 100.5,
            "itemCode": "sku_486741_2",
            "qty": 1,
            "rate": 100.5,
            "returnable": true,
            "returnableDays": -1,
            "comboDetails": [],
            "addOnDetails": [],
            "splitDetails": [],
            "extendedFields": {
              "GrossWeight": "10.50",
              "MetalRate": "22.02"
            }
          },
          {
            "amount": 100.5,
            "itemCode": "sku_486741_2",
            "qty": 1,
            "rate": 100.5,
            "returnable": true,
            "returnableDays": -1,
            "comboDetails": [],
            "addOnDetails": [],
            "splitDetails": [],
            "extendedFields": {
              "GrossWeight": "10.50",
              "MetalRate": "22.02"
            }
          },
          {
            "amount": 100.5,
            "itemCode": "sku_486741_3",
            "qty": 1,
            "rate": 100.5,
            "returnable": true,
            "returnableDays": -1,
            "comboDetails": [],
            "addOnDetails": [],
            "splitDetails": [],
            "extendedFields": {
              "GrossWeight": "10.50",
              "MetalRate": "22.02"
            }
          },
          {
            "amount": 100.5,
            "itemCode": "sku_486741_4",
            "qty": 1,
            "rate": 100.5,
            "returnable": true,
            "returnableDays": -1,
            "comboDetails": [],
            "addOnDetails": [],
            "splitDetails": [],
            "extendedFields": {
              "GrossWeight": "10.50",
              "MetalRate": "22.02"
            }
          },
          {
            "amount": 100.5,
            "itemCode": "sku_486741_5",
            "qty": 1,
            "rate": 100.5,
            "returnable": true,
            "returnableDays": -1,
            "comboDetails": [],
            "addOnDetails": [],
            "splitDetails": [],
            "extendedFields": {
              "GrossWeight": "10.50",
              "MetalRate": "22.02"
            }
          },
          {
            "amount": 100.5,
            "itemCode": "sku_486741_6",
            "qty": 1,
            "rate": 100.5,
            "returnable": true,
            "returnableDays": -1,
            "comboDetails": [],
            "addOnDetails": [],
            "splitDetails": [],
            "extendedFields": {
              "GrossWeight": "10.50",
              "MetalRate": "22.02"
            }
          },
          {
            "amount": 100.5,
            "itemCode": "sku_486741_7",
            "qty": 1,
            "rate": 100.5,
            "returnable": true,
            "returnableDays": -1,
            "comboDetails": [],
            "addOnDetails": [],
            "splitDetails": [],
            "extendedFields": {
              "GrossWeight": "10.50",
              "MetalRate": "22.02"
            }
          },
          {
            "amount": 100.5,
            "itemCode": "sku_486741_8",
            "qty": 1,
            "rate": 100.5,
            "returnable": true,
            "returnableDays": -1,
            "comboDetails": [],
            "addOnDetails": [],
            "splitDetails": [],
            "extendedFields": {
              "GrossWeight": "10.50",
              "MetalRate": "22.02"
            }
          },
          {
            "amount": 100.5,
            "itemCode": "sku_486741_9",
            "qty": 1,
            "rate": 100.5,
            "returnable": true,
            "returnableDays": -1,
            "comboDetails": [],
            "addOnDetails": [],
            "splitDetails": [],
            "extendedFields": {
              "GrossWeight": "10.50",
              "MetalRate": "22.02"
            }
          },
          {
            "amount": 100.5,
            "itemCode": "sku_486741_10",
            "qty": 1,
            "rate": 100.5,
            "returnable": true,
            "returnableDays": -1,
            "comboDetails": [],
            "addOnDetails": [],
            "splitDetails": [],
            "extendedFields": {
              "GrossWeight": "10.50",
              "MetalRate": "22.02"
            }
          }
        ],
        "customFields": {
          "trans_cf_a": "abc"
        },
        "paymentModes": [
          {
            "mode": "CHECKAPI",
            "value": "500",
            "notes": "notes_6555444",
            "attributes": {
              "name": "BankNameAPI",
              "value": "value_6555444"
            }
          }
        ],
        "billingDate": "2020-04-28T10:44:15+05:30"
      },
      "errors": [
        {
          "status": false,
          "code": 8015,
          "message": "Customer not found for the given identifiers"
        }
      ],
      "warnings": []
    },
    {
      "entityId": 38236696,
      "result": {
        "identifierType": "mobile",
        "identifierValue": "919740390055",
        "source": "INSTORE",
        "accountId": "",
        "extendedFields": {},
        "deliveryStatus": "SHIPPED",
        "type": "REGULAR",
        "billAmount": 200,
        "billNumber": "num-668288857765",
        "discount": 10,
        "grossAmount": 110,
        "note": "this is test",
        "lineItemsV2": [
          {
            "amount": 100.5,
            "itemCode": "sku_486741_2",
            "qty": 1,
            "rate": 100.5,
            "returnable": true,
            "returnableDays": -1,
            "comboDetails": [],
            "addOnDetails": [],
            "splitDetails": [],
            "extendedFields": {}
          },
          {
            "amount": 100.5,
            "itemCode": "sku_486741_2",
            "qty": 1,
            "rate": 100.5,
            "returnable": true,
            "returnableDays": -1,
            "comboDetails": [],
            "addOnDetails": [],
            "splitDetails": [],
            "extendedFields": {}
          },
          {
            "amount": 100.5,
            "itemCode": "sku_486741_3",
            "qty": 1,
            "rate": 100.5,
            "returnable": true,
            "returnableDays": -1,
            "comboDetails": [],
            "addOnDetails": [],
            "splitDetails": [],
            "extendedFields": {}
          },
          {
            "amount": 100.5,
            "itemCode": "sku_486741_4",
            "qty": 1,
            "rate": 100.5,
            "returnable": true,
            "returnableDays": -1,
            "comboDetails": [],
            "addOnDetails": [],
            "splitDetails": [],
            "extendedFields": {}
          },
          {
            "amount": 100.5,
            "itemCode": "sku_486741_5",
            "qty": 1,
            "rate": 100.5,
            "returnable": true,
            "returnableDays": -1,
            "comboDetails": [],
            "addOnDetails": [],
            "splitDetails": [],
            "extendedFields": {}
          },
          {
            "amount": 100.5,
            "itemCode": "sku_486741_6",
            "qty": 1,
            "rate": 100.5,
            "returnable": true,
            "returnableDays": -1,
            "comboDetails": [],
            "addOnDetails": [],
            "splitDetails": [],
            "extendedFields": {}
          },
          {
            "amount": 100.5,
            "itemCode": "sku_486741_7",
            "qty": 1,
            "rate": 100.5,
            "returnable": true,
            "returnableDays": -1,
            "comboDetails": [],
            "addOnDetails": [],
            "splitDetails": [],
            "extendedFields": {}
          },
          {
            "amount": 100.5,
            "itemCode": "sku_486741_8",
            "qty": 1,
            "rate": 100.5,
            "returnable": true,
            "returnableDays": -1,
            "comboDetails": [],
            "addOnDetails": [],
            "splitDetails": [],
            "extendedFields": {}
          },
          {
            "amount": 100.5,
            "itemCode": "sku_486741_9",
            "qty": 1,
            "rate": 100.5,
            "returnable": true,
            "returnableDays": -1,
            "comboDetails": [],
            "addOnDetails": [],
            "splitDetails": [],
            "extendedFields": {}
          },
          {
            "amount": 100.5,
            "itemCode": "sku_486741_10",
            "qty": 1,
            "rate": 100.5,
            "returnable": true,
            "returnableDays": -1,
            "comboDetails": [],
            "addOnDetails": [],
            "splitDetails": [],
            "extendedFields": {}
          }
        ],
        "customFields": {
          "trans_cf_a": "abc"
        },
        "paymentModes": [
          {
            "mode": "CHECKAPI",
            "value": "500",
            "notes": "notes_6555444",
            "attributes": {
              "name": "BankNameAPI",
              "value": "value_6555444"
            }
          }
        ],
        "billingDate": "2020-04-28T10:44:15+05:30"
      },
      "errors": [],
      "warnings": []
    }
  ],
  "totalCount": 2,
  "failureCount": 1
}

Resource Information

URI /v2/transactions/bulk
HTTP Method POST
API Version v2
Batch Support Yes
Rate Limited Yes

Request URL

https://{host}/v2/transactions/bulk

Request Body Parameters

Parameter Datatype Description
identifierType* enum Pass any of the registered identifier name of the customer. Values: mobile, email, externalId, wechat,martjackId, or fbId (Facebook ID).
identifierValue* string Pass the respective identifier value. For example if identifierType is mobile, identifierValue is mobile number.
source* enum Pass the source from which the transaction is made. Values: INSTORE( for InStore), WECHAT (WeChat), MARTJACK(AnywhereCommerce), WEB_ENGAGE (Web-engage integration), ECOMMERCE (ECOMMERCE), JD (JD), TAOBAO (Taobao), TMALL (TMall), FACEBOOK (Facebook), WEBSITE (other website), OTHERS (any other source).
accountId string For sources with multiple accounts (such as MARTJACK, WECHAT), pass the respective account ID.
extendedFields obj Valid transaction level extended field details in name and value pairs. You can also pass line-item level extended field details in line_item object.
currencyCode string ISO currency code of the transaction. For example, INR for Indian Rupee, SGD for Singapore Dollar, EUR for Euro, IQD for Iraqi Dinar.
addWithLocalCurrency boolean Pass true to add a transaction in local currency.
deliveryStatus enum Delivery status of the item. Values: DELIVERED, SHIPPED.
type* enum Type of transaction. Supported value: regular for loyalty transactions. ‘RETURN’ for return transactions. Currently, there is no not-interested transactions support in V2.
billAmount* double Net transaction amount.
billNumber* string Unique transaction number. The uniqueness either at till, store, or org, depends on the configuration CONF_LOYALTY_BILL_NUMBER_UNIQUE_IN_DAYS set on InTouch Settings > System & Deployment > InTouch POS Configuration > Billing.
currency string ISO currency code of the transaction. Org’s base currency is considered by default. For example, INR for Indian Rupee, SGD for Singapore Dollar, EUR for Euro, IQD for Iraqi Dinar.
discount double Discount availed for the transaction (discount amount).
grossAmount double Transaction amount before discount.
note string Additional information about the transaction.
lineItemsV2 obj Details of line-items.
amount double Net transaction amount
description string One or two liner description of the line-item.
itemCode string Unique code of the transaction line-item.
qty double Quantity of the current line-item.
rate double Price of each line-item.
serial string Serial number of the line-item.
returnable boolean Pass true if the item can be returned.
returnableDays int Maximum number of days in which the item is allowed to return.
customFields obj Transaction or line-item level custom field details.
imgUrl string URL of the product image.
attributes obj Attributes of the product in name-value pairs.
comboDetails obj Details of combo or bundle items. For example, buy 1 shirt get one free, shirt+pant, pack of 5 soaps
itemCode string Unique line-item code.
quantity double Quantity of the current combo item.
description string One or two liner description of add-on, split, or combo item.
value double Item price excluding discount.
comboType string Type of the combo. For example, buy 1 shirt get one free, shirt+pant, pack of 5 soaps.
addOnDetails obj Details of add-on item.
splitDetails obj Details of split item.
parentBillNumber string Details of the actual transaction number. This is applicable only for return transactions.
purchaseTime date-time Date and time of purchase in YYYY-MM-DDTHH:MM:SS format.
customFields obj Details of transaction level or transaction line-item level custom fields.
loyaltyPromotionIdentifiers array
id
redemptions obj Details of points and coupon redemptions for the transaction.
pointsRedemptions array array
couponRedemptions array Unique coupon redemption id(s) that you want to apply for the transaction. For example, [727272, 237878]
paymentModes obj Payment details used for the transaction.
mode string Mode of payment.
value double Amount paid through the current mode.
notes string Additional information related to the payment mode.
attributes obj Attributes of the payment mode in names and value pairs.

Response Parameters

Parameter Datatype Description
entityId long Unique transaction ID generated.
billingDate date-time Date and time of the transaction in HH-MM-DDThh:mm:ssTZD

Get Transaction Details

Sample Request

https://eu.api.capillarytech.com/v2/transactions/38236823?type=REGULAR

Sample Response

{
    "attribution": {
        "createDate": "2020-04-28T17:04:13+05:30",
        "enteredBy": {
            "id": 50006796,
            "code": "mobilepush.1",
            "description": "",
            "name": "mobilepush.1",
            "type": "TILL",
            "adminType": "GENERAL",
            "isActive": true,
            "isOuEnabled": false,
            "timeZoneId": 0,
            "currencyId": 216,
            "languageId": 1
        },
        "modifiedBy": {},
        "modifiedDate": "2020-04-28T17:04:13+05:30"
    },
    "billDetails": {
        "amount": 200.0,
        "billingStore": {
            "id": 50006795,
            "code": "storecode",
            "description": "webenagestore",
            "name": "webstore1",
            "type": "STORE",
            "adminType": "GENERAL",
            "isActive": true,
            "isOuEnabled": false,
            "timeZoneId": 0,
            "currencyId": 216,
            "languageId": 1
        },
        "billNumber": "num-6682858599",
        "billingTime": "2020-04-28T17:04:13+05:30",
        "discount": 10.0,
        "grossAmount": 110.0,
        "note": "this is test",
        "returnDetails": {
            "canceled": false
        },
        "niReturnDetails": {},
        "invalidBill": false
    },
    "customFields": {
        "cashierid": "jim2345"
    },
    "addWithLocalCurrency": false,
    "async": false,
    "useV2": false,
    "customerId": 316726161,
    "id": 38236823,
    "lineItems": [
        {
            "id": 2151509718,
            "customerId": 0,
            "details": {
                "amount": 100.5,
                "description": "",
                "discount": 0.0,
                "itemCode": "sku_486741_2",
                "qty": 1.0,
                "rate": 100.5,
                "serial": 0,
                "value": 0.0,
                "returnable": true,
                "returnableDays": -1,
                "attributes": {},
                "extendedFields": {},
                "rateSupportingNull": 100.5,
                "valueSupportingNull": 0.0,
                "qtySupportingNull": 1.0,
                "attributesSet": [],
                "discountSupportingNull": 0.0,
                "extendedFieldsSet": []
            },
            "outlierStatus": "NORMAL",
            "returnDetails": {},
            "valid": true,
            "returnLineItemsDtos": [],
            "niReturnLineItemsDtos": [],
            "addonDetails": [],
            "splitItemsDetails": [],
            "niReturn": false
        },
        {
            "id": 2151509719,
            "customerId": 0,
            "details": {
                "amount": 100.5,
                "description": "",
                "discount": 0.0,
                "itemCode": "sku_486741_2",
                "qty": 1.0,
                "rate": 100.5,
                "serial": 0,
                "value": 0.0,
                "returnable": true,
                "returnableDays": -1,
                "attributes": {},
                "extendedFields": {},
                "rateSupportingNull": 100.5,
                "valueSupportingNull": 0.0,
                "qtySupportingNull": 1.0,
                "attributesSet": [],
                "discountSupportingNull": 0.0,
                "extendedFieldsSet": []
            },
            "outlierStatus": "NORMAL",
            "returnDetails": {},
            "valid": true,
            "returnLineItemsDtos": [],
            "niReturnLineItemsDtos": [],
            "addonDetails": [],
            "splitItemsDetails": [],
            "niReturn": false
        },
        {
            "id": 2151509720,
            "customerId": 0,
            "details": {
                "amount": 100.5,
                "description": "",
                "discount": 0.0,
                "itemCode": "sku_486741_3",
                "qty": 1.0,
                "rate": 100.5,
                "serial": 0,
                "value": 0.0,
                "returnable": true,
                "returnableDays": -1,
                "attributes": {},
                "extendedFields": {},
                "rateSupportingNull": 100.5,
                "valueSupportingNull": 0.0,
                "qtySupportingNull": 1.0,
                "attributesSet": [],
                "discountSupportingNull": 0.0,
                "extendedFieldsSet": []
            },
            "outlierStatus": "NORMAL",
            "returnDetails": {},
            "valid": true,
            "returnLineItemsDtos": [],
            "niReturnLineItemsDtos": [],
            "addonDetails": [],
            "splitItemsDetails": [],
            "niReturn": false
        },
        {
            "id": 2151509721,
            "customerId": 0,
            "details": {
                "amount": 100.5,
                "description": "",
                "discount": 0.0,
                "itemCode": "sku_486741_4",
                "qty": 1.0,
                "rate": 100.5,
                "serial": 0,
                "value": 0.0,
                "returnable": true,
                "returnableDays": -1,
                "attributes": {},
                "extendedFields": {},
                "rateSupportingNull": 100.5,
                "valueSupportingNull": 0.0,
                "qtySupportingNull": 1.0,
                "attributesSet": [],
                "discountSupportingNull": 0.0,
                "extendedFieldsSet": []
            },
            "outlierStatus": "NORMAL",
            "returnDetails": {},
            "valid": true,
            "returnLineItemsDtos": [],
            "niReturnLineItemsDtos": [],
            "addonDetails": [],
            "splitItemsDetails": [],
            "niReturn": false
        },
        {
            "id": 2151509722,
            "customerId": 0,
            "details": {
                "amount": 100.5,
                "description": "",
                "discount": 0.0,
                "itemCode": "sku_486741_5",
                "qty": 1.0,
                "rate": 100.5,
                "serial": 0,
                "value": 0.0,
                "returnable": true,
                "returnableDays": -1,
                "attributes": {},
                "extendedFields": {},
                "rateSupportingNull": 100.5,
                "valueSupportingNull": 0.0,
                "qtySupportingNull": 1.0,
                "attributesSet": [],
                "discountSupportingNull": 0.0,
                "extendedFieldsSet": []
            },
            "outlierStatus": "NORMAL",
            "returnDetails": {},
            "valid": true,
            "returnLineItemsDtos": [],
            "niReturnLineItemsDtos": [],
            "addonDetails": [],
            "splitItemsDetails": [],
            "niReturn": false
        },
        {
            "id": 2151509723,
            "customerId": 0,
            "details": {
                "amount": 100.5,
                "description": "",
                "discount": 0.0,
                "itemCode": "sku_486741_6",
                "qty": 1.0,
                "rate": 100.5,
                "serial": 0,
                "value": 0.0,
                "returnable": true,
                "returnableDays": -1,
                "attributes": {},
                "extendedFields": {},
                "rateSupportingNull": 100.5,
                "valueSupportingNull": 0.0,
                "qtySupportingNull": 1.0,
                "attributesSet": [],
                "discountSupportingNull": 0.0,
                "extendedFieldsSet": []
            },
            "outlierStatus": "NORMAL",
            "returnDetails": {},
            "valid": true,
            "returnLineItemsDtos": [],
            "niReturnLineItemsDtos": [],
            "addonDetails": [],
            "splitItemsDetails": [],
            "niReturn": false
        },
        {
            "id": 2151509724,
            "customerId": 0,
            "details": {
                "amount": 100.5,
                "description": "",
                "discount": 0.0,
                "itemCode": "sku_486741_7",
                "qty": 1.0,
                "rate": 100.5,
                "serial": 0,
                "value": 0.0,
                "returnable": true,
                "returnableDays": -1,
                "attributes": {},
                "extendedFields": {},
                "rateSupportingNull": 100.5,
                "valueSupportingNull": 0.0,
                "qtySupportingNull": 1.0,
                "attributesSet": [],
                "discountSupportingNull": 0.0,
                "extendedFieldsSet": []
            },
            "outlierStatus": "NORMAL",
            "returnDetails": {},
            "valid": true,
            "returnLineItemsDtos": [],
            "niReturnLineItemsDtos": [],
            "addonDetails": [],
            "splitItemsDetails": [],
            "niReturn": false
        },
        {
            "id": 2151509725,
            "customerId": 0,
            "details": {
                "amount": 100.5,
                "description": "",
                "discount": 0.0,
                "itemCode": "sku_486741_8",
                "qty": 1.0,
                "rate": 100.5,
                "serial": 0,
                "value": 0.0,
                "returnable": true,
                "returnableDays": -1,
                "attributes": {},
                "extendedFields": {},
                "rateSupportingNull": 100.5,
                "valueSupportingNull": 0.0,
                "qtySupportingNull": 1.0,
                "attributesSet": [],
                "discountSupportingNull": 0.0,
                "extendedFieldsSet": []
            },
            "outlierStatus": "NORMAL",
            "returnDetails": {},
            "valid": true,
            "returnLineItemsDtos": [],
            "niReturnLineItemsDtos": [],
            "addonDetails": [],
            "splitItemsDetails": [],
            "niReturn": false
        },
        {
            "id": 2151509726,
            "customerId": 0,
            "details": {
                "amount": 100.5,
                "description": "",
                "discount": 0.0,
                "itemCode": "sku_486741_9",
                "qty": 1.0,
                "rate": 100.5,
                "serial": 0,
                "value": 0.0,
                "returnable": true,
                "returnableDays": -1,
                "attributes": {},
                "extendedFields": {},
                "rateSupportingNull": 100.5,
                "valueSupportingNull": 0.0,
                "qtySupportingNull": 1.0,
                "attributesSet": [],
                "discountSupportingNull": 0.0,
                "extendedFieldsSet": []
            },
            "outlierStatus": "NORMAL",
            "returnDetails": {},
            "valid": true,
            "returnLineItemsDtos": [],
            "niReturnLineItemsDtos": [],
            "addonDetails": [],
            "splitItemsDetails": [],
            "niReturn": false
        },
        {
            "id": 2151509727,
            "customerId": 0,
            "details": {
                "amount": 100.5,
                "description": "",
                "discount": 0.0,
                "itemCode": "sku_486741_10",
                "qty": 1.0,
                "rate": 100.5,
                "serial": 0,
                "value": 0.0,
                "returnable": true,
                "returnableDays": -1,
                "attributes": {},
                "extendedFields": {},
                "rateSupportingNull": 100.5,
                "valueSupportingNull": 0.0,
                "qtySupportingNull": 1.0,
                "attributesSet": [],
                "discountSupportingNull": 0.0,
                "extendedFieldsSet": []
            },
            "outlierStatus": "NORMAL",
            "returnDetails": {},
            "valid": true,
            "returnLineItemsDtos": [],
            "niReturnLineItemsDtos": [],
            "addonDetails": [],
            "splitItemsDetails": [],
            "niReturn": false
        }
    ],
    "outlierStatus": "NORMAL",
    "type": "REGULAR",
    "warnings": [],
    "lifeTimePurchases": 0,
    "ignorePoints": false,
    "extendedFields": {},
    "autoUpdateTime": "2020-04-28T17:04:13+05:30",
    "returnDetails": {
        "canceled": false
    },
    "extendedFieldsSet": [],
    "customFieldsSet": [
        {
            "cashierid": "jim2345"
        }
    ],
    "niReturnDetails": {},
    "basketSize": 10.0,
    "warnings": []
}

Retrieves the details of a specific transaction.

Resource Information

URI v2/transactions/{id}
HTTP Method GET
API Version v2
Rate Limited Yes
Batch Support NA

Request URL

https://{host}/v2/transactions/{id}

Request Query Parameters

Parameter Datatype Description
id* long Unique transaction id to fetch details.
type* enum Type of transaction to fetch. Value: REGULAR, RETURN.

Customer Labels

Customer labels are used for tagging customers based on their activities or loyalty histories. Tags are used in loyalty, campaigns and Essential Insights. You can add new labels and tag labels to customers using APIs of organization and customers mentioned here.

Add Labels

Lets you add a new customer tag to the organization. You cannot add tags beyond the limit set for the org.

Sample Request

https://api.us.capillarytech.com/v2/organization/labels

Sample POST Request

{
  "orgLabels": [
    {
      "name": "Premium",
      "description": "Customers whose purchase value is more than $4000"
    },
    {
      "name": "GadgetFreak",
      "description": "Interested in gadgets and new technology"
    }
  ]
}

Sample Response

{
    "entity": 1779,
    "warnings": []
}

Resource Information

URI organization/labels
Rate Limited? No
Authentication Yes
HTTP Methods POST
Batch Support No

Request URL

https://{host}/v2/organization/labels

Request Body Parameters

Parameter Datatype Description
name* string Name of the tag or labels.
description* string Brief description about the tag.

Get Org Labels

Retrieves all customers labels created for that specific org.

Sample Request

https://eu.api.capillarytech.com/v2/organization/labels

Sample Response

{
    "data": [
        {
            "id": 2,
            "orgId": 1779,
            "description": "Loves new trends and collections in fashion",
            "lastUpdatedBy": 15000449,
            "name": "Fashion",
            "active": true
        },
        {
            "id": 8,
            "orgId": 1779,
            "description": "High loyal customer with spending more than $13000",
            "lastUpdatedBy": 15000449,
            "name": "Premium",
            "active": true
        },
        {
            "id": 1,
            "orgId": 1779,
            "description": "Loves new gadgets and technology",
            "lastUpdatedBy": 15000449,
            "name": "GadgetFreak",
            "active": true
        },
        {
            "id": 3,
            "orgId": 1779,
            "description": "汉语",
            "lastUpdatedBy": 15000449,
            "name": "汉语",
            "active": true
        }
    ],
    "warnings": [],
    "errors": []
}

Resource Information

URI organization/labels
Rate Limited? No
Authentication Yes
HTTP Methods GET
Batch Support No

Request URL

https://{host}/v2/organization/labels

Tag Customers (to Labels)

Lets you tag a customer to one or more customer labels or remove an existing label.

Sample Request

https://eu.api.capillarytech.com/v2/customers/249598560/changeLabels

Sample POST Request

{
  "add": [
     {
       "labelName": "GadgetFreak"
    },
    {
       "labelName": "Premium"
    }
  ],
  "remove":[
  {
      "labelName": "book"
   }
 ]
}

Sample Response

{
    "entity": 249598560,
    "warnings": []
}

Resource Information

URI customers/{userId}/changeLabels
Rate Limited? No
Authentication Yes
HTTP Methods POST
Batch Support No

Request URL

https://{host}/v2/customers/{userId}/changeLabels

Request Parameters

Parameter Type Description
userId* Path Unique id of the user that you want to add customer label
labelName* Body Label name that you want to tag to the customer

Fetch Labels of a Customer

Retrieves the list of labels tagged to a customer.

Sample Request

https://eu.api.capillarytech.com/v2/customers/249598560/labels

Sample Response

{
    "data": [
        {
            "id": 5,
            "orgId": 0,
            "addedBy": 15147364,
            "labelId": 3,
            "userId": 249598560,
            "labelName": "GadgetFreak",
            "deleted": false
        }
    ],
    "warnings": [],
    "errors": []
}

Resource Information

URI /customers/{userId}/labels
Rate Limited? No
Authentication Yes
Response Formats JSON
HTTP Methods GET
Batch Support No

Request URL

https://{host}/v2/customers/{userId}/labels

Request Path Parameters

Parameter Description
userId* Unique id of the customer for which you want to fetch tagged labels

Search Customers by Labels

Retrieves the list of customers who are tagged to a specific label. You can also search by partial label name. By default you will see a maximum of 10 records.

Sample Request

https://eu.api.capillarytech.com/v2/customers/labels/search?q=premium

Sample Response

{
    "pagination": {
        "limit": 10,
        "offset": 0,
        "total": 2
    },
    "data": [
        {
            "userId": 316481804,
            "customerLabels": [
                {
                    "orgId": 0,
                    "labelId": 3,
                    "userId": 316481804,
                    "labelName": "book"
                }
            ]
        },
        {
            "userId": 249598560,
            "customerLabels": [
                {
                    "orgId": 0,
                    "labelId": 3,
                    "userId": 249598560,
                    "labelName": "book"
                }
            ]
        }
    ],
    "warnings": [],
    "errors": []
}

Resource Information

URI /customers/labels/search?q={LabelName}
Rate Limited? No
Authentication Yes
HTTP Methods GET
Batch Support No

Request URL

https://{host}/v2/customers/labels/search?q={LabelName}

Request Query Parameters

Parameter Description
q* Specify the label name by which you want to fetch customers. You can also pass partial string. For example pre to fetch customers in all labels that starts with pre.

OTP

This section consists of APIs related to OTPs that are used to validate customers for registration or points/coupon redemption.

The functionality of OTPs depends on the configuration set on InTouch

Generate OTP

Sample Request

https://us.api.capillarytech.com/v2/otp/generate

Sample POST Request

{
   "entityType":"email",
   "entityValue":"tom.sawyer@example.com",
   "action":"REGISTRATION",
   "template":"Hi user.Your OTP for validation is {{ validation_code }}.Enjoy",
   "emailTemplate":{
      "subject":"Validation Code",
      "body":"Dear Customer, The validation code for your request is: {{ validation_code }}. You will also receive the validation code by SMS on your registered mobile number shortly."
   },
   "channels":[
      {
         "type":"SMS",
         "value":"9191919191"
      },
      {
         "type":"EMAIL",
         "value":"tom.sawyer@example.com"
      },
      {
         "type":"PHONE",
         "value":"9191919191"
      }
   ]
}

Sample Response


# Success Response
{
    "createdId": 10,
    "warnings": []
}


# Failure Response
{
    "errors": [
        {
            "status": false,
            "code": 600,
            "message": "\"Invalid or Null action passed\""
        },
        {
            "status": false,
            "code": 602,
            "message": "\"Invalid or Null entity value passed\""
        }
    ]
}

Issues validation code (OTP) to the customer’s mobile number and/or email id for redeeming points/coupons, and registration.

Resource Information

URI otp/generate
Rate Limited? Yes
HTTP Method POST
Batch Support No

Request URL

https://{host}/v2/otp/generate

Request Body Parameters

Parameter Datatype Description
entityType* enum Specify MOBILE to identify customer by mobile number, or EMAIL to identify customer by email id.
entityValue* string Specify the registered mobile number or email id of the customer based on the entityType passed.
action* enum Choose the action for which the OTP has to be issued. Values: COUPON (for coupon redemption), POINTS (for points redemption), REGISTRATION, USERGROUP, SUBSCRIPTION, GENERIC (for other purposes).
channels* enum Specify the channels through which you want to issue OTP for redemption or registration. Value: EMAIL, SMS, PHONE (phone call). You can use Phone to generate OTP through a voice call to the specified number.

Response Parameters

Parameter Datatype Description
createdId long Unique internal reference ID generated for the current request.

Validate OTP

Sample Request

https://us.api.capillarytech.com/v2/otp/validate

Sample POST Request

{
   "entityType":"email",
   "entityValue":"tom.sawyer@example.com",
   "code":"A2WX11I",
   "action":"GENERIC"
}

Sample Success Response


{
    "entity": true,
    "warnings": []
}


Sample Failure Response


{ 
  "entity": false, 
  "warnings":[] 
}

Lets you authenticate customer by validating the OTP sent to the customer through SMS or email and proceed with the necessary action such as redeeming points/coupons, and registering customer.

Resource Information

URI /validate
Rate Limited? Yes
Authentication Yes
HTTP Method POST
Batch Support No

Request URL

https://{host}/v2/otp/validate

Request Body Parameters

Parameter Datatype Description
entityType* enum Specify MOBILE to identify customer by mobile number or EMAIL to identify customer by email id.
entityValue* string Specify the registered mobile number or email id of the customer based on the entityType passed.
code* string Pass the validation code received by the customer.
action* enum Specify the action to be performed on successful validation. Values: COUPON (for coupon redemption), POINTS (for points redemption), REGISTRATION, USERGROUP, SUBSCRIPTION, GENERIC (for other purposes).

Response Parameters

Parameter Datatype Description
entity boolean The value will betrue if the OTP validation is successful, false if the validation fails.

Get OTP

Sample Request

https://us.api.capillarytech.com/v2/otp?source=WECHAT&accountId=WECHAT-API1&identifierName=mobile&identifierValue=8799361139&threshold=60&scope=POINTS

Sample Response

{
   "orgId":966,
   "userId":313302314,
   "code":"538AD87",
   "validUpto":"2017-08-07T21:44:20+05:30",
   "warnings":[

   ]
}

Allows fetching recent OTP issued to a customer. For now, OTP is issued for redeeming points/coupons and customer registration. If there is more than one valid OTP available for the customer, this API fetches the recently issued OTP.

Resource Information

URI /otp
Rate Limited? Yes
Authentication Yes
HTTP Method GET
Batch Support No

Request URL

https://{host}/v2/otp?source={source}&accountId={account}&{identifierName}={value}&scope={POINTS/COUPONS}

Request Path Parameters

Parameter Datatype Description
identifierName* enum Pass any of the registered identifier type of the customer. Values: mobile, email, external_id, wechat.
identifierValue* string Specify the value of the specified identifierType
source enum Source in which the customer is registered.
accountId string Account ID of the source such as WeChat and Facebook. Required for sources with multiple accounts.
threshold long Specify the validity of the OTP (in seconds) that you want to fetch.
scope* enum Specify the scope of the issued OTP. Values: COUPON (for coupon redemption), POINTS (for points redemption), REGISTRATION, USERGROUP, SUBSCRIPTION, GENERIC (for other purposes).

Response Parameters

Parameter Datatype Description
orgId long Unique ID of the org (the current org) from which the OTP is generated.
userId long Unique ID of the customer to whom the OTP is sent.
code string The OTP, or validation code, sent to the customer.
validUpto date-time The validity of the OTP in YYYY:MM:DDTHH:MM:SS+[Time Zone]

Response Codes

Success Code

Code Description
610 OTP is validated successfully.

Error Codes

Code Description
600 Invalid or null action passed.
601 Invalid or null entity_type passed.
602 Invalid or null entity_value passed.
603 Invalid or null communication channel value passed.
604 No OTP passed.
605 OTP is either invalid, expired, or null.
606 Unable to generate OTP at the moment.
874 Unable to generate validation code (OTP).
875 Unable to generate validation code (OTP).
876 OTP Validation Failed
9001 No valid OTP found.

Coupon

Coupon represents store promotions or discounts created through Capillary Campaign Manager. A single campaign could contain one or more coupons or coupon series. Coupons are issued to loyalty or non-loyalty customers through SMS or email.

You cannot create new coupons using coupon APIs. You can just send or retrieve coupons that are already created in your campaigns. Hence, it is important to note the coupon code, coupon id or coupon series id for making API calls.

You cannot create new coupons using coupon APIs; instead, you can send or retrieve coupons that are already created in your campaigns. Hence, it is important to note the coupon code, coupon id or coupon series id to use coupon APIs.

The V2 coupon entity just allows you to:

For any other coupon related APIs, please use v1.1 APIs.

Redeem Coupons

Sample Request

http://api.capillary.co.in/v2/coupon/redeem 

Sample POST Request

{
   "billAmount":"2000",
   "transactionNumber":"numbr9227550121",
   "user":{
      "mobile":"9177121900000"
   },
   "redemptionTime":"2019-04-04 11:49:59",
   "redemptionRequestList":[
      {
         "code":"9NUF8THR"
      }
   ]
}

Sample Response

{
    "redemption": [
        {
            "id": 33138363,
            "warnings": [],
            "appendedErrorMessage": "",
            "code": "JL07UAZ3",
            "discountCode": "MobilePush",
            "seriesCode": 14162,
            "isAbsolute": false,
            "couponValue": 10.0
        }
    ],
    "redemptionStatus": {
        "status": true,
        "code": 700,
        "message": "Coupon processing successful"
    },
    "customer": {
        "id": 342963216,
        "profiles": [
            {
                "firstName": "Tom",
                "lastName": "Sawyer",
                "fields": {},
                "identifiers": [
                    {
                        "type": "mobile",
                        "value": "919999000000"
                    }
                ],
                "commChannels": [],
                "userId": 342963216,
                "accountId": "",
                "autoUpdateTime": "2019-10-31T17:41:25+05:30"
            }
        ]
    },
    "warnings": []
}

This API allows you to redeem active coupons of a loyalty customer. You can pass multiple coupons at once.

Resource Information

URI coupon/redeem
Authentication Yes
HTTP Method POST
Batch Support No

Request URL

http://{host}/v2/coupon/redeem

Request Body Parameters

Parameter Datatype Description
billAmount* float Transaction amount of the bill.
transactionNumber* string Transaction number against which the coupon needs to be redeemed
user* enum Specify any identifier of the user who wants to redeem coupons. Values: mobile, email, externalId
redemptionTime date-time Date and time when the coupon has to be redeemed in YYYY-MM-DD HH:MM:SS format.
code* string Coupon code to be redeemed.

Check if Coupon is Redeemable

# Sample Request
http://us.intouch.capillarytech.com/v2/coupon/is_redeemable?mobile=917601000000&code=6B88U6ED,V080OLI6&details=false

Sample Response

{
   "customer":{
      "id":325666373,
      "profiles":[
         {
            "accountId":"",
            "autoUpdateTime":"2019-04-04T11:47:28+05:30",
            "commChannels":[

            ],
            "fields":{

            },
            "firstName":"firstName_667095",
            "identifiers":[
               {
                  "type":"email",
                  "value":"autoemail7601667095@gmail.com"
               },
               {
                  "type":"externalId",
                  "value":"ext_id7601667095"
               },
               {
                  "type":"mobile",
                  "value":"917601667095"
               }
            ],
            "lastName":"lastName_667095",
            "userId":325666373
         }
      ]
   },
   "redemption":[
      {
         "appendedErrorMessage":"",
         "code":"6B88U6ED",
         "isAbsolute":false,
         "isRedeemable":true,
         "numberOfRedemptionsByUser":0,
         "redemptionsLeft":-1,
         "warnings":[

         ]
      },
      {
         "appendedErrorMessage":"",
         "code":"V080OLI6",
         "isAbsolute":false,
         "isRedeemable":true,
         "numberOfRedemptionsByUser":0,
         "redemptionsLeft":-1,
         "warnings":[

         ]
      }
   ],
   "redemptionStatus":{
      "code":700,
      "message":"Coupon isRedeem successful",
      "status":true
   },
   "warnings":[

   ]
}

Lets you check whether a set of coupons can be redeemed or not.

Resource Information

URI /is_redeemable?{customerIdentifier}&code={value1},{value2}...&details={true/extended}
Authentication Yes
HTTP Method GET
Batch Support Yes

Request URL

http://{host}/v2/coupon/is_redeemable?{customerIdentifier}&code={value1},{value2}...&details={true/extended}

Request Query Parameters

Parameter Datatype Description
user* obj Pass the identifier of the customer to check if his/her coupon is redeemable.
mobile/email/externalId/id* string Pass any of the identifiers of the customer.
code* string Pass the coupon code that you want to check for redemption. You can also pass multiple coupon codes separating each with a comma ,
details boolean Pass =true to retrieve the details of the coupon series.
details=extended - Retrieves the details of coupon configurations (set on campaign) of that specific coupon series.

Points

Points represent loyalty points issued to customers through Loyalty+, Engage+, GoodWill (Member Care), or Data Import. Customers can redeem the points within the validity period and can also transfer their points to other loyalty customers.

Check if Points Transferrable

Checks if specific points of a customer can be transferred to an other customer. You can also issue OTP that is used to authenticate customer to transfer points (pointsTransfer API).

Sample Request

https://eu.api.capillarytech.com/v2/points/isTransferrable

Sample POST Request

{
  "pointsTobeTransferred": 10,
  "fromCustomerIdentifier": {
    "type": "MOBILE",
    "value": "7799497290"
  },
  "toCustomerIdentifier": {
    "type": "ID",
    "value": "342953257"
  },
  "issueOtp": true
}

Sample Response

{ 
   "data":[ 
      { 
         "pointsTobeTransferred":10,
         "transferFrom":{ 
            "id":32429961,
            "profiles":[ 
               { 
                  "firstName":"Tom",
                  "lastName":"Sawyer",
                  "attribution":{ 
                     "createDate":"2018-03-05T15:52:47+05:30",
                     "createdBy":{ 
                        "id":15041276,
                        "code":"org2.till1",
                        "name":"org2.till1",
                        "type":"TILL"
                     },
                     "modifiedBy":{ 
                        "id":15041276,
                        "code":"org2.till1",
                        "name":"org2.till1",
                        "type":"TILL"
                     },
                     "modifiedDate":"2019-08-14T12:48:31+05:30"
                  },
                  "fields":{ 

                  },
                  "identifiers":[ 
                     { 
                        "type":"mobile",
                        "value":"919111111111"
                     }
                  ],
                  "commChannels":[ 
                     { 
                        "type":"mobile",
                        "value":"919111111111",
                        "primary":true,
                        "verified":false,
                        "meta":{ 
                           "residence":false,
                           "office":false
                        },
                        "attributes":{ 

                        }
                     }
                  ],
                  "source":"INSTORE",
                  "userId":32429961,
                  "accountId":"",
                  "conflictingProfileList":[ 

                  ],
                  "autoUpdateTime":"2019-09-24T02:29:31+05:30"
               }
            ],
            "loyaltyInfo":{ 
               "loyaltyType":"loyalty",
               "attributionV2":{ 
                  "createDate":"2018-03-05T15:52:47+05:30",
                  "createdBy":{ 
                     "id":15041276,
                     "code":"org2.till1",
                     "name":"org2.till1",
                     "type":"TILL"
                  },
                  "modifiedBy":{ 
                     "id":15041276,
                     "code":"org2.till1",
                     "name":"org2.till1",
                     "type":"TILL"
                  },
                  "modifiedDate":"2019-08-14T12:48:31+05:30"
               }
            },
            "segments":{ 

            },
            "extendedFields":{ 

            }
         },
         "transferTo":{ 
            "id":342953257,
            "profiles":[ 
               { 
                  "firstName":"autofn_9294476894",
                  "lastName":"autoln_9294476894",
                  "attribution":{ 
                     "createDate":"2019-09-18T16:40:10+05:30",
                     "createdBy":{ 
                        "id":15041276,
                        "code":"org2.till1",
                        "name":"org2.till1",
                        "type":"TILL"
                     },
                     "modifiedBy":{ 
                        "id":15041276,
                        "code":"org2.till1",
                        "name":"org2.till1",
                        "type":"TILL"
                     },
                     "modifiedDate":"2019-09-18T16:40:10+05:30"
                  },
                  "fields":{ 

                  },
                  "identifiers":[ 
                     { 
                        "type":"email",
                        "value":"james.f@example.com"
                     },
                     { 
                        "type":"mobile",
                        "value":"919294111111"
                     },
                     { 
                        "type":"externalId",
                        "value":"ext_id92944768"
                     }
                  ],
                  "commChannels":[ 
                     { 
                        "type":"email",
                        "value":"james.f@example.com",
                        "primary":true,
                        "verified":false,
                        "meta":{ 
                           "residence":false,
                           "office":false
                        },
                        "attributes":{ 

                        }
                     },
                     { 
                        "type":"mobile",
                        "value":"919294476894",
                        "primary":true,
                        "verified":false,
                        "meta":{ 
                           "residence":false,
                           "office":false
                        },
                        "attributes":{ 

                        }
                     }
                  ],
                  "source":"INSTORE",
                  "userId":342953257,
                  "accountId":"",
                  "conflictingProfileList":[ 

                  ],
                  "autoUpdateTime":"2019-09-24T02:29:31+05:30"
               }
            ],
            "loyaltyInfo":{ 
               "loyaltyType":"loyalty",
               "attributionV2":{ 
                  "createDate":"2019-09-18T16:40:10+05:30",
                  "createdBy":{ 
                     "id":15041276,
                     "code":"org2.till1",
                     "name":"org2.till1",
                     "type":"TILL"
                  },
                  "modifiedBy":{ 
                     "id":15041276,
                     "code":"org2.till1",
                     "name":"org2.till1",
                     "type":"TILL"
                  },
                  "modifiedDate":"2019-09-18T16:40:10+05:30"
               }
            },
            "segments":{ 

            },
            "extendedFields":{ 

            }
         },
         "transferrable":true
      }
   ],
   "warnings":[ 

   ],
   "errors":[ 

   ]
}

Resource Information

URI /isTransferrable
Rate Limited? No
Authentication Yes
Response Formats JSON
HTTP Methods POST
Batch Support No

Request URL

https://{host}/v2/points/isTransferrable

Request Body Parameters

Parameter Type Description
pointsTobeTransferred* int Number of points that customer wants to transfer.
fromCustomerIdentifier* obj Details of source customer - customer that wants to transfer points.
toCustomerIdentifier* obj Details of destination customer - customer to whom the points have to be transferred.
type* enum Customer identifier type. Values: ID (user id of the customer), MOBILE, EXTERNAL_ID, EMAIL.
value* string The value of the specified identifier.
issueOtp Boolean Sends OTP to the fromCustomer if the specified points are transferrable. Use this to issue OTP (used to authenticate fromCustomer to transfer points) if isPointsTransferrable is successful. The default value is false.

Reverse Redeemed Points

Lets you reverse a set of points that are redeemed in a transaction. For example, you can use this API to reverse points redeemed for a transaction if the transaction is returned.

Prerequisites:

The following configurations are required for points/reverse API

Sample Request

https://eu.api.capillarytech.com/v2/points/reverse

Sample POST Request

{
"redemptionId":"54ZNkA",
"pointsToBeReversed": 10,
"identifier":
    {
    "type":"mobile",
    "value":"919740000000"
    }
}

Sample Response

{
    "redemptionId": "54ZNkA",
    "pointsToBeReversed": 20.0,
    "orgId": 100458,
    "identifier": {
        "type": "mobile",
        "value": "919740000000"
    },
    "customerId": 98662653,
    "pointsReversed": 20.0,
    "reversalId": "5wyOZM",
    "warnings": []
}  

Resource Information

URI /reverse
Rate Limited? No
Authentication Yes
HTTP Methods POST
Batch Support No

Request URL

https://{host}/v2/points/reverse

Request Body Parameters

Parameter Type Description
redemptionId* long Unique reference ID generated for redeeming the points.
Identifier obj Customer details associated to the redemption.
type* enum Pass any of the registered identifiers of the customer. Supported values: mobile, email, externalId.
value* string Pass the respective identifier value. This should match with the identifier tagged to the redemption id
pointsToBeReversed int The number of points be reversed.

Transfer Points

Transfers points from one customer account to another customer account by validating the OTP issued for the points transfer.

Sample Request

https://eu.api.capillarytech.com/v2/points/transfer

Sample POST Request

{ 
   "pointsTobeTransferred":123,
   "fromCustomerIdentifier":{ 
      "type":"MOBILE",
      "value":"7799000000"
   },
   "toCustomerIdentifier":{ 
      "type":"ID",
      "value":"342953257"
   },
   "notes":"Transfer points to James",
   "code":"X12Y3Z"
}

Sample Response

{ 
   "data":[ 
      { 
         "pointsTransferDate":"2019-10-16 15:53:42",
         "pointsTransferred":15.0,
         "transferId":100,
         "transferType":"DEDUCTION",
         "transferredFrom":{ 
            "userId":343015431,
            "firstName":"Tom",
            "lastName":"Sawyer"
         },
         "transferredTo":{ 
            "userId":342953257,
            "firstName":"James",
            "lastName":"Thomas"
         },
         "notes":"Transfer points to James",
         "programName":"Nightly_ApiAutoDefaultProgram"
      }
      ]
}

Resource Information

URI /transfer
Rate Limited? No
Authentication Yes
Response Formats JSON
HTTP Methods POST
Batch Support No

Request URL

https://{host}/v2/points/transfer

Request Body Parameters

Parameter Type Description
pointsTobeTransferred* int Number of points to be transferred.
fromCustomerIdentifier* obj Details of source customer - customer that wants to transfer points.
toCustomerIdentifier* obj Details of destination customer - customer to whom the points have to be transferred.
type* enum Customer identifier type. Values: ID (user id of the customer), MOBILE, EXTERNAL_ID, EMAIL.
value* string The value of the specified identifier.
notes string Specify the reason or any notes for this points transfer.
code* string Pass the OTP received by the fromCustomer for the current points transfer. To issue OTP, use either /isPointsTransferrable or /issuePointsTransferOtp.

Error Codes

Code Description
412 Configuration key CONF_FRAUD_STATUS_CHECK_POINTS_TRANSFERin the config_keys table is not set properly.
413 Problem fetching the configuration key CONF_FRAUD_STATUS_CHECK_POINTS_TRANSFER
414 Destination customer status is fraud. Points cannot be transferred to customers with fraud status.
415 Source customer status is fraud. Points cannot be transferred by customers with fraud status.
416 Points related validation failed from Thrift.
417 Customer with fraud status exists.
418 From and To customers are same.
419 Merged customer found with id: {x}, where x is the user id of the customer.
686 User is from campaign and has not enrolled in the loyalty program. Points redemption is not applicable for the user.
804 Insufficient current points.
805 Insufficient lifetime points.
806 Insufficient lifetime purchases amount.
807 Redemptions points not divisible.
809 Customer is marked as fraud.
818 Current points are less than points requested for redemption.
819 Points to redeem exceeds the threshold limit (maximum points that can be redeemed in a transaction).
821 Points you are trying to redeem are less than the minimum points allowed.
886 Unable to process points. Please try again later.
887 Unable to process points. Please try again later.
888 Invalid configuration. Please report to capillary support.
895 Loyalty program is not configured for the org.
896 Unable to process points. Please try again later.
898 Unable to process points. Please try again later.
899 Invalid configuration. Please report to capillary support.
901 Invalid points or points redemption Id passed.
902 Redemption ID does not exist.
903 Unable to redeem points.
904 Invalid customer details passed.

Survey

Create a Survey

Sample Request

http://us.api.capillarytech.com/v2/survey/v2/survey

Sample POST Request

{
        "title": "Product feedback survey",
        "surveyType": "online",
        "source": "Cloudcherry/Capillary",
        "brandLogo": "http://biz-colostate.files/starbucks-coffee.gif",
        "brandWebsite": "www.starbuck.com",
        "externalRefId":"123"
}

Sample Response

{
   "createdId": 328,
   "warnings": [
   ]
}

Allows creating a new survey.

Resource Information

Information Value
URI /survey
Authentication Yes
HTTP Method POST
Batch Support No

Request URL

http://<cluster url>/v2/survey

Request Attributes

Attribute Description
title* Specify the title of the survey form
surveyType product survey, store survey, cloud cherry
source* Source where the survey is hosted - Cloudcherry/Capillary
brandLogo Provide the path of the brand logo
brandWebsite Provide the official web site link of the org
externalRefId* Unique reference id of the survey that comes from the vendor

Update Survey Details

Sample Request

http://us.api.capillarytech.com/v2/survey/v2/survey?extRefId=123

Sample PUT Request

{
        "brandLogo": "http://biz-google.files/starbucks-coffee.gif",
        "brandWebsite": "www.google.com",
        "title":"Sample survey title"
}


Sample Response

{
    "createdId": 98,
    "warnings": [
    ]
}

Lets you update the details of an existing survey.

Resource Information

Information Value
URI /survey?{extRefId/surveyId}={value}
Authentication Yes
HTTP Method PUT
Batch Support No

Request URL

http://<cluster url>/v2/survey?extRefId=<value>

http://<cluster url>/v2/survey?surveyId=<value>

Request Attributes

Attribute Description
title Specify the new title of the survey form
brandLogo Provide the new path of the brand logo
brandWebsite Provide the new official website link of the org

Add Questions to a Survey

Sample Request

http://us.api.capillarytech.com/v2/survey/questions?surveyId=112

Sample POST Request

[
  {
 "tag": "nps",
 "fieldType": "nps",
 "question": "How do you feel about the store?",
 "qxnExternalId":"112",
 "fieldOptions": "{\r\n\"opt1\": \"product not available\",\r\n\"opt2\": \"price too high \",\r\n\"opt3 \": \"I just don\u2019t like your store\"\r\n}",
 "parentId": 0,
 "params": ""
  }
]

Sample Response

{
   "data": [
       {
           "id": 433,
           "qxnExternalId": "102",
           "question": "What is your feedback about the product?",
           "fieldOptions": "{\r\n\"opt1\": \"product not available\",\r\n\"opt2\": \"price too high \",\r\n\"opt3 \": \"I just don’t like your store\"\r\n}",
           "fieldType": "Checkboxes",
           "tag": "Nps",
           "parentId": 0,
           "params": ""
       }
   ],
   "warnings": [
   ],
   "errors": [
   ]
}

Allows adding questions to an existing survey.

Resource Information

Information Value
URI /survey/questions?{surveyId/extRefId}
Authentication Yes
HTTP Method POST
Batch Support Yes

Request URL

http://<cluster url>/v2/survey/questions?surveyId={survey id}

http://<cluster url>/v2/survey/questions?extRefId={external reference id}

Request Attributes

Attribute Description
tag Possible values: Nps, CSAT, Comments, or Feedback
fieldType* Specify the type of the field - TextBlock, TextAreaBlock, Multiple Choice, Checkboxes, Scale, Star Rating, multiquestion, Add Call us back question, and nps
question* Specify the survey question
qxnExternalId* Pass the external id of the question provided by the vendor
fieldOptions Specify the options you want to provide for each question. Not applicable for TextBlock, TextAreaBlock
parentId Survey questions can have sub questions. Example: The value will be 0 by default. If it is a sub-question, parent id will a positive value
params

Update Survey Questions

Sample Request

http://us.api.capillarytech.com/v2/survey/question?questionId=112

Sample PUT Request

  {
    "question": "HOW do you rate your transaction?",
    "isActive":false,
    "params":"",
    "fieldOptions":"Very Good",
    "fieldType":"Radio",
    "tag":"Feedback"  
  }

Sample Response

{
    "createdId": 233,
    "warnings": [
    ]
}

Lets you update an existing question of a survey.

Resource Information

Information Value
URI /survey/question?questionId={value}
Authentication Yes
HTTP Method PUT
Batch Support No

Request URL

http://<cluster url>/v2/survey/question?questionId={value}

Request Attributes

Attribute Description
tag Possible values: Nps, CSAT, Comments, or Feedback
fieldType Specify the new field type - TextBlock, TextAreaBlock, Multiple Choice, Checkboxes, Scale, Star Rating, multiquestion, Add Call us back question, and nps
question* Specify the updated survey question
fieldOptions Specify the new options you want to have for the question. Not applicable for TextBlock, TextAreaBlock
params
isActive Add or remove a question. Value: true/false

Add Survey Responses

Sample Request

http://us.api.capillarytech.com/v2/survey/responses?surveyId=112

Sample POST Request

[{
        "surveyQuestionId": "233",
        "userId": 134223,
        "formId":123,
        "tokenId":1,
        "fieldValue":"Sample answer",
        "entityType": "feedback",
        "entityId": 222,
        "responseChannel": "Email"
}]

Sample Response

{
   "data": [
       {
           "id": 146,
           "surveyQuestionId": 233,
           "entityId": 222,
           "entityType": "feedback",
           "fieldValue": "Sample answer",
           "formId": 123,
           "responseChannel": "Email",
           "userId": 134223,
           "tokenId": 1,
           "lastUpdatedOn": "2017-12-12T15:18:23+05:30"
       }
   ],
   "warnings": [
   ],
   "errors": [
   ]
}

Allows you to add customer responses to a survey.

Resource Information

Information Value
URI /survey/responses?surveyId/extRefId={value}
Authentication Yes
HTTP Method POST
Batch Support Yes

Request URL

http://<cluster url>/v2/survey/responses?surveyId={survey id}

http://<cluster url>/v2/survey/responses?extRefId={external reference id}

Request Attributes

Attribute Description
surveyQuestionId* Pass the id of the survey question
userId* Provide the user id of the customer responded to the survey
formId* Provide the unique form id of the survey campaign
tokenId* Provide the unique id assigned to a customer to submit a survey
fieldValue* Specify the value/answer chosen for the question
entityType Specify the entity type of the survey - transaction, complaint, or feedback
entityId Pass the id of the respective entity type
responseChannel Specify the response channel - Email, Call Center, Social, or Instore

Update Survey Responses

Sample Request

http://us.api.capillarytech.com/v2/survey/responses?responseId=173

Sample POST Request

{
        "fieldValue":"Very happy with the after sales support"
}

Sample Response

{
    "createdId": 173,
    "warnings": [
    ]
}

Lets you update an existing response of a survey.

Resource Information

Information Value
URI /survey/responses?responseId={value}
Authentication Yes
HTTP Method PUT
Batch Support No

Request URL

http://<cluster url>/v2/survey/responses?responseId={value}

Request Attributes

Attribute Description
fieldValue* Specify the new response value for the question

Retrieve Survey Details

Sample Request

http://us.intouch.capillarytech.com/v2/survey?extRefId=123

Sample Response

{
"id": 101,
"brandLogo": "http://biz-colostate.files/starbucks-coffee.gif",
"brandWebsite": "www.samplebramd.com",
"source": "Cloudcherry/Capillary",
"surveyType": "Online",
"title": "Feedback Survey",
"externalRefId": "123",
"lastUpdatedOn": "2017-12-04",
"warnings":[]
}

Retrieves the details of a specific survey.

Resource Information

Information Value
URI /survey?{surveyId/extRefId}
Authentication Yes
HTTP Method GET
Batch Support No

Request URL

http:///v2/survey?{surveyId/extRefId}={value}

Request Attributes

Parameter Description
surveyId The unique id of the survey campaign generated by Capillary
extRefId The unique id for the survey generated by the vendor

Retrieve Survey Questions

Sample Request

http://us.intouch.capillarytech.com/v2/survey/questions?surveyId=214

Sample Response

{
    "data": [
        {
            "id": 208,
            "qxnExternalId": "Question01",
            "question": "Question01",
            "fieldOptions": "{\r\n\"opt1\": \"product not available\",\r\n\"opt2\": \"price too high \",\r\n\"opt3 \": \"I just don’t like your store\"\r\n}",
            "fieldType": "Checkboxes",
            "tag": "Nps",
            "isActive": true,
            "lastUpdatedOn": "2017-12-05",
            "parentId": 0,
            "params": "string"
        },
        {
            "id": 209,
            "qxnExternalId": "Question02",
            "question": "Question02",
            "fieldOptions": "{\r\n\"opt1\": \"product not available\",\r\n\"opt2\": \"price too high \",\r\n\"opt3 \": \"I just don’t like your store\"\r\n}",
            "fieldType": "Checkboxes",
            "tag": "Nps",
            "isActive": true,
            "lastUpdatedOn": "2017-12-05",
            "parentId": 0,
            "params": "string"
        },
        {
            "id": 210,
            "qxnExternalId": "Question01",
            "question": "Question01",
            "fieldOptions": "{\r\n\"opt1\": \"product not available\",\r\n\"opt2\": \"price too high \",\r\n\"opt3 \": \"I just don’t like your store\"\r\n}",
            "fieldType": "Checkboxes",
            "tag": "Nps",
            "isActive": true,
            "lastUpdatedOn": "2017-12-05",
            "parentId": 0,
            "params": "string"
        },
        {
            "id": 211,
            "qxnExternalId": "Question01",
            "question": "Question01",
            "fieldOptions": "{\r\n\"opt1\": \"product not available\",\r\n\"opt2\": \"price too high \",\r\n\"opt3 \": \"I just don’t like your store\"\r\n}",
            "fieldType": "Checkboxes",
            "tag": "Nps",
            "isActive": true,
            "lastUpdatedOn": "2017-12-06",
            "parentId": 0,
            "params": "string"
        },
        {
            "id": 216,
            "qxnExternalId": "Question01",
            "question": "Question01",
            "fieldOptions": "{\r\n\"opt1\": \"product not available\",\r\n\"opt2\": \"price too high \",\r\n\"opt3 \": \"I just don’t like your store\"\r\n}",
            "fieldType": "Checkboxes",
            "tag": "Nps",
            "isActive": true,
            "lastUpdatedOn": "2017-12-06",
            "parentId": 0,
            "params": ""
        }
    ],
    "warnings": [
    ],
    "errors": [
    ]
}

Retrieves all questions of a specific survey.

Resource Information

Information Value
URI /survey/questions?={value}
Authentication Yes
HTTP Method GET
Batch Support No

Request URL

http://<cluster url>/v2/survey/questions/surveyId=<survey id>

http://<cluster url>/v2/survey/questions/extRefId=<external reference id>

Request Parameters

Parameter Description
surveyId/extRefId Pass the survey id or external reference id of the survey for which you want to retrieve all the questions

Retrieve Survey Question

Sample Request

http://api.nightly.capillary.in/v2/survey/questions/214

Sample Response

{
    "id": 214,
    "qxnExternalId": "Question01",
    "question": "Question01",
    "fieldOptions": "{\r\n\"opt1\": \"product not available\",\r\n\"opt2\": \"price too high \",\r\n\"opt3 \": \"I just don’t like your store\"\r\n}",
    "fieldType": "Multiple Choice",
    "tag": "nps",
    "isActive": true,
    "lastUpdatedOn": "2017-12-06",
    "parentId": 0,
    "params": "",
    "warnings": [
    ]
}

Retrieves details of a specific question.

Resource Information

Information Value
URI /survey/questions/{survey question Id}
Authentication Yes
HTTP Method GET
Batch Support No

Request URL

http://<Cluster URL>/v2/survey/questions/<survey question id>

Request Parameter

Parameter Description
Survey question id* Pass the question id for which you want to see the details

Retrieve Question ID

Sample Request

http://us.intouch.capillarytech.com/v2/survey/questions/lookup/112

Sample Response


{
    "entity": 255,
    "warnings": [
    ]
}

Retrieves the id of a specific survey question.

Resource Information

Information Value
URI /survey/questions/lookup/{question external id}
Authentication Yes
HTTP Method GET
Batch Support No

Request URL

http://<cluster url>/v2/survey/questions/lookup/<question external id>

Request Parameters

Parameter Description
Question External ID Pass the unique external id of the question

Retrieve Response Details

Sample Request

http://us.intouch.capillarytech.com/v2/survey/responses/118

Sample Response

{
    "id": 118,
    "surveyQuestionId": 256,
    "entityId": 0,
    "fieldValue": "Sample answer",
    "formId": 1234,
    "userId": 13422223,
    "tokenId": 23,
    "lastUpdatedOn": "2017-12-07",
    "warnings": [
    ]
}

Retrieves the details of a specific survey response.

Resource Information

Information Value
URI /responses/{response id}
Authentication Yes
HTTP Method GET
Batch Support No

Request URL

http://<Cluster URL>/v2/survey/responses/<response id>

Request Parameters

Parameters Description
response id* Provide the response id that you want to fetch

Response Codes

Code Description
9001 Invalid survey id
9002 Invalid survey question id
9003 No surveys found
9004 No survey questions found
9005 No survey responses found
9006 Invalid survey external reference id passed
9007 Unable to add survey questions
9008 Survey external reference id already exists
9010 Question external id {x} already exists
9011 Invalid survey question external id {0} passed for lookup
9012 Duplicate survey question external id {0} in request

User Authentication

The userAuth resource allows existing customers of InStore to register on the org’s web page/mobile app, authenticate login credentials, and update user details.

Register Users

Sample Request



https://us.api.capillarytech.com/v2/user_auth/register

Sample POST Request


{
  "mobile": "71000000000",
  "email": "tom.sawyer@example.com",
  "password": "tom123"
}

Sample Response



{
"id": 24335250,
"profiles": [
  {
"firstName": "Tom",
"lastName": "Sawyer",
"attribution": {
"createDate": "2016-06-22T00:00:00+05:30",
"createdBy": {
"code": "org2.till1",



"name": "org2.till1",
"type": "TILL"
},
"modifiedBy": {
"type": "TILL"
},
"modifiedDate": "2016-12-05T13:04:22+05:30"
},
"fields": {},
"identifiers": [
  {
"type": "email",
"value": "autoemail734253194812111111@gmail.com"
},
  {
"type": "externalId",
"value": "ext_id7342531948111"
}
],
"commChannels": [
  {
"type": "email",
"value": "autoemail734253194812111111@gmail.com",
"primary": true,
"verified": false,
"meta": {
"residence": false,
"office": false
},
"attributes": {}
}
],
"source": "INSTORE",
"userId": 24335250,
"accountId": "",
"conflictingProfileList": [],
"autoUpdateTime": "2017-08-04T11:12:14+05:30"
}
],
"loyaltyInfo": {
"loyaltyType": "loyalty",
"attributionV2": {
"createDate": "2016-06-22T00:00:00+05:30",
"createdBy": {
"code": "org2.till1",
"name": "org2.till1",
"type": "TILL"
},
"modifiedBy": {
"type": "TILL"
},
"modifiedDate": "2016-12-05T13:04:22+05:30"
},
"lifetimePurchases": 2000,
"score": 97
},
"segments": {},
"warnings": [],
}


Allows the org’s InStore customers to register on their web page or mobile app. You need to use only the mobile number/email id that is registered on InStore.

Resource Information

Information Value
URI `/user_auth/register’
Authentication Yes
HTTP Method POST
Batch Support No

Request URL

https://<Respective cluster’s API URL>/v2/user_auth/register

Request Attributes

Parameter Description
mobile Specify a valid mobile number of the user that is already registered with your org (in any source)
email Specify a valid email id of the user that is already registered with your org (in any source)
password Specify a password for the user account as a MD5 hash

User Authentication

Sample Request


https://us.api.capillarytech.com/v2/user_auth/authorize_user

Sample POST Request


{
  "mobile": "71000000000",
  "email": "tom.sawyer@example.com",
  "password": "tom1234"
}

Sample Response

{
    "entity": true,
    "warnings": []
}

Validates whether the provided user credentials are valid or not.

Resource Information

Information Value
URI `/user_auth/authorize_user’
Authentication Yes
HTTP Method POST
Batch Support No

Request URL

https://<Respective cluster’s API URL>/v2/user_auth/authorize_user

Request Attributes

Parameter Description
mobile Provide the registered mobile number of the user
email Provide the registered email id of the user
password Provice the password in md5 hash form

Update Password

Sample Request

https://us.api.capillarytech.com/v2/user_auth/update

Sample PUT Request


{
  "mobile": "71000000000",
  "email": "tom.sawyer@example.com",
  "password": "tom12345"
}

Sample Response

{
    "entity": true,
    "warnings": []
}

Allows updating password of an user account.

Resource Information

Information Value
URI `/user_auth/update’
Authentication Yes
HTTP Method PUT
Batch Support No

Request URL

https://<Respective cluster’s API URL>/v2/user_auth/update

Request Attributes

Parameter Description
mobile Provide the registered mobile number of the user
email Provide the registered email id of the user
password Provide the new password in md5 hash form

Response Codes

Success Codes

Code Description
91025 Password updated successfully
91030 User is registered successfully

Error Codes

Code Description
91024 Authentation failed. Unable to authorize user with the given credentials
91026 Unable to update password
91027 Invalid username (mobile number/email id)
91028 Invalid password format. Pass the password in MD5 Hash format
91029 User is registered already
91031 Unable to register user

Customer Walk-in

Trigger Customer Walk-in Notifications on InStore

# Sample Request

https://us.api.capillarytech.com/v2/customer/walkin?till_code=kn.003&identifierName=mobile&identifierValue={{mobile1}}&source=INSTORE
# Sample Response

{
   "entity": "Customer check-in successful",
   "warnings": [],
   "errors": [],
   "success": true
}

Triggers customer walkin notifications on InStore, i.e., when a customer walks in to the store, InStore triggers a desktop notification with the customer details.

Resource Information

Information Value
URI `/customer/walkin’
Authentication Yes
HTTP Method GET
Batch Support No

Request URL

https://{host}/v2/customer/walkin?till_code={till code}&identifierName={mobile/email/external_id}&identifierValue={value}&source={sourceName} &accountId=<account id>

Request Parameters

Parameter Description
till_code Destination TILL code that you want to push the notification
identifierName Identifier tracked when the customer walked in. Values: MOBILE, EMAIL,
identifierValue The respective identifier value
source Source in which the customer is identified
accountId account in which the customer is identified (for sources with multiple account ids)

Response Codes

Error Codes

Code Description
8099 No identifier passed in the param
8098 Invalid Till
8097 SNS service not working
8096 Invalid Till code
8095 Invalid source passed
8094 No identifier value passed in the param
8093 Walkin failed from store network

Verticals

Retrieve All Verticals Available for the Org

# Sample Request
https://us.api.capillarytech.com/v2/verticals/meta
# Sample Response

{
    "pagination": {
        "limit": 10,
        "offset": 0,
        "total": 5
    },
    "data": [
        {
            "id": 1,
            "name": "Jewellery"
        },
        {
            "id": 2,
            "name": "E-commerce"
        },
        {
            "id": 3,
            "name": "Electronics"
        },
        {
            "id": 4,
            "name": "Apparel"
        },
        {
            "id": 5,
            "name": "F&B"
        }
    ],
    "warnings": [],
    "errors": []
}

Retrieves the list of all verticals available for the org. This include both active and inactive verticals.

Resource Information

Information Value
URI /verticals/meta
Authentication Yes
HTTP Method GET
Batch Support NA

Request URL

htpps://{host}/v2/verticals/meta

Retrieve Verticals Enabled for the Org

# Sample Request
https://us.api.capillarytech.com/v2/verticals
# Sample Response

{
    "pagination": {
        "limit": 10,
        "offset": 0,
        "total": 5
    },
    "data": [
        {
            "orgId": 1,
            "verticalId": 1,
            "verticalName": "Jewellery",
            "isActive": true
        },
        {
            "orgId": 1,
            "verticalId": 2,
            "verticalName": "E-commerce",
            "isActive": true
        },
        {
            "orgId": 1,
            "verticalId": 1,
            "verticalName": "Electronics",
            "isActive": true
        },
        {
            "orgId": 1,
            "verticalId": 4,
            "verticalName": "Apparel",
            "isActive": true
        },
        {
            "orgId": 1,
            "verticalId": 5,
            "verticalName": "Home Appliance",
            "isActive": true
        }
    ],
    "warnings": [],
    "errors": []
}

Retrieves the list of verticals enabled for the org (active verticals).

Resource Information

Information Value
URI /verticals
Authentication Yes
HTTP Method GET
Batch Support NA

Request URL

htpps://{host}/v2/verticals

Response Codes

Code Description
91027 Unable to find vertical
91028 Invalid vertical
91029 Unable to add vertical. Invalid vertical name passed
91030 Unable to add org vertical
91031 Unable to disable the vertical
91032 Org is already mapped to the specified vertical id

Organization Sources

The org entity lets you fetch details of a specific org including sources configured for the org. This category provides the list of APIs related to adding and fetching sources and accounts of the org.

Add Source Account

# Sample Request

https://us.api.capillarytech.com/v2/org/9081/sources
# Sample POST Request

{
  "name": "PUSH289-CM",
  "sourceAccountIdentifier": "PUSH289-CM",
  "sourceTypeName": "WEB_ENGAGE",
  "toMirror": 0,
  "configs": {
    "licenseCode": "0",
    "accessToken": "1",
    "android": "0",
    "ios": "1",
    "validTill": "cm.1",
    "loginIdentifierType": "email",
    "deeplink" : "open.my.app"
  }


}

Sample Response

{
    "id": 2421,
    "uuid": "ca46ee9cc14b46d1837bd6e923d52775",
    "name": "PUSH289-CM",
    "sourceAccountIdentifier": "PUSH289-CM",
    "toMirror": false,
    "sourceTypeId": 2,
    "sourceTypeName": "WEB_ENGAGE",
    "isActive": true,
    "commChannels": [
        "android",
        "ios"


    ],
    "attribution": {
        "createDate": "2017-08-17",
        "modifiedDate": "2017-08-17"
    },
    "warnings": []
}

Allows adding a source account to the org. Currently, the following sources are supported: * Facebook * WEB_ENGAGE * WECHAT
* INSTORE
* MARTJACK
* TMALL
* TAOBAO
* JD

Resource Information

Attribute Value
URI /org/{orgId}/sources
HTTP Method POST
Batch Support No

Request URL

https://{host}/v2/org/{orgId}/sources

Request Parameters

Parameter Description
org id* Provide the org id to which you want to add a new source.

Update Source Account Details

> Sample Request
https://api.us.capillarytech.com/v2/org/9876/sources/ca46ee9cc14b46d1837bd6e923d52775
> Sample PUT Request

{

    "name": "PUSH289-CM",
    "sourceAccountIdentifier": "PUSH289-CM",
    "toMirror": false,
    "sourceTypeId": 2,
    "sourceTypeName": "WEB_ENGAGE",
    "isActive": true,

  "configs": {
        "accessToken": "1",
        "android": "0",
        "deeplink": "",
        "ios": "1",
        "licenseCode": "0",
        "loginIdentifierType": "email",
        "validTill": "cm.1"
    }
}

> Sample Response

{
    "id": 2421,
    "uuid": "ca46ee9cc14b46d1837bd6e923d52775",
    "sourceTypeId": 2,
    "configs": {
        "accessToken": "1",
        "android": "0",
        "deeplink": "",
        "ios": "1",
        "licenseCode": "0",
        "loginIdentifierType": "email",
        "validTill": "cm.1"
    },
    "attribution": {
        "createDate": "2017-08-17T12:21:37+05:30",
        "createdBy": {},
        "modifiedBy": {},
        "modifiedDate": "2017-08-17T12:21:37+05:30"
    },
    "warnings": []
}

Allows updating all the details of a source account except UUID and source type. You can also activate or deactivate an account using isActive tag.

Resource Information

Attribute Value
URI /org/{orgId}/sources
HTTP Method PUT
Batch Support No

Request URL

https://{host}/v2/org/{orgId}/sources?<account's UUID>

Request Parameters

Parameter Description
org id Provide the org id for which you want to update account
UUID Specify the UUID of the account that you want to modify

Retrieve All Source Accounts of an Org

https://us.api.capillarytech.com/v2/org/9081/sources?details=true

> Sample Response

{
  "data":[
    {
      "id":2408,
      "uuid":"547c36977a2e49edbf22c04bd27b1303",
      "name":"Facebook1-cm",
      "sourceAccountIdentifier":"Facebook1-cm",
      "toMirror":true,
      "sourceTypeId":1,
      "sourceTypeName":"Facebook",
      "isActive":true,
      "commChannels":[
        "email",
        "mobile"
      ],
      "attribution":{
        "createDate":"2017-08-14",
        "modifiedDate":"2017-08-14"
      }
    },
    {
      "id":2380,
      "uuid":"0ca36340e5144b2f9e206e5ebf090845",
      "name":"cc",
      "sourceAccountIdentifier":"ccc",
      "toMirror":false,
      "sourceTypeId":2,
      "sourceTypeName":"WEB_ENGAGE",
      "isActive":true,
      "commChannels":[
        "android",
        "ios"
      ],
      "attribution":{
        "createDate":"2017-07-28",
        "modifiedDate":"2017-07-28"
      }
    },
    {
      "id":185,
      "uuid":"403743f59bce4e92b45fc98191684b7f",
      "name":"MT-CM",
      "sourceAccountIdentifier":"MT-CM",
      "toMirror":true,
      "sourceTypeId":6,
      "sourceTypeName":"MARTJACK",
      "isActive":true,
      "attribution":{
        "createDate":"2017-06-16",
        "modifiedDate":"2017-06-16"
      }
    }
  ],
  "warnings":[

  ],
  "errors":[

  ]
}

Retrieves the list of all account accounts of an org.

Resource Information

Attribute Value
URI org/{orgId}/sources?details=true
HTTP Method GET
Batch Support No

Request URL

https://{host}/v2/org/{orgId}</sources?details=true

Request Parameters

Parameter Description
org id* Provide the org id for which you want to retrieve source details

Retrieve Details of a Specific Source Account

https://api.us.capillarytech.com/v2/org/9876/sources/ca46ee9cc14b46d1837bd6e923d52775
{
    "id": 2421,
    "uuid": "ca46ee9cc14b46d1837bd6e923d52775",
    "name": "PUSH289-CM",
    "sourceAccountIdentifier": "PUSH289-CM",
    "toMirror": false,
    "sourceTypeId": 2,
    "sourceTypeName": "WEB_ENGAGE",
    "isActive": true,
    "commChannels": [
        "android",
        "ios"
    ],
    "configs": {
        "accessToken": "1",
        "android": "0",
        "deeplink": "my.app",
        "ios": "1",
        "licenseCode": "0",
        "loginIdentifierType": "email",
        "validTill": "cm.1"
    },
    "attribution": {
        "createDate": "2017-08-17",
        "modifiedDate": "2017-08-17"
    },
    "warnings": []
}

Retrieves details of a specific account based on the UUID (universally unique identifier).

Resource Information

Attribute Value
URI /org/{orgId}/sources?{UUID}
HTTP Method GET
Batch Support No

Request URL

https://{host}/v2/org/{orgId}/sources?/{account's UUID}

Request Parameters

Parameter Description
org id* Provide the org id for which you want to retrieve source details
UUID* Pass the UUID (universally unique identifier) of the account that you want to retrieve

Error Codes

Code Description
3213 Unable to find org source
3214 Unable to add org source
3215 No source types found
3216 Invalid source name
3217 Invalid account identifier of the source
3218 Invalid source type
3219 Unable to update source. Invalid UUID
3220 Org source already exists with the given values
3221 Unable to update org source / Invalid org id
3222 No configurations found for the provided source id

Staff

A Staff is a member of the org or associated with the org who deals with selling items to end-users. This concept is introduced mainly for B2B marketing. This resource contains APIs related to managing staff accounts. The staff user will have the properties of both Admin and TILL user.

Create a Staff Account

Sample Request

https://us.api.capillarytech.com/v2/staff

Sample POST Request

{
   "username":"timjames",
   "mobile":"9800500000",
   "email":"tim.james@example.com",
   "firstname":"Tim",
   "lastname":"James",
   "title":"Manager",
   "password":"timpass45",
   "storeCode":"east_store",
   "zoneCode":"north346",
   "conceptCode":"mobiles3458"
}

Sample Response

{
   "entity":75025585,
   "warnings":[

   ],
   "errors":[

   ],
   "success":true
}

Lets admin users create a staff account for your organization.

Resource Information

URI v2/staff
Rate Limited? Yes
Authentication Yes
Response Formats JSON
HTTP Methods POST
Batch Support No

Request URL

https://<Respective cluster’s API URL>/v2/staff

Additional Headers Required

X-CAP-API-AUTH-KEY : Authentication key of the admin user

X-CAP-API-AUTH-ORG-ID : The org id to which you want to associate the staff user

Request Attributes

At least one staff identifier is mandatory.

Attribute Description
username Specify the username for the current staff account. No special characters are allowed
mobile Specify the mobile number of the staff
email Specify the mobile number of the staff
password Specify the password for the account
storeCode Specify the store code to which you want to associate the staff. If no store code is passed, the user is associated to the InfluenceStore by default store
zoneCode Specify a valid zone code associated to the store. If this is not passed, the zone will be associated according to the store code
ConceptCode Specify the concept code associated to the store. If this is not passed, the concept will be associated according to to the store code
firstname First name of the staff user
lastname Last name of the staff user
title Role of the staff user

Response Codes

Code Description
1001 Password not set
1007 username or identifier not set
1215 Invalid ParentZoneId/External Id/ParentConceptId specified. The the specific id will be set to the default values
1005 The identifier already exits
1009 Invalid identifier details passed
1007 email/mobile-identifier not set

Send OTP

Sample Request

https://us.api.capillarytech.com/v2/staff/sendOtp?otp_type=VALIDATE_EMAIL

Sample POST Request

{
   "id":"12",
   "mobile":"9800500000",
   "email":"tim.james@example.com",
   "username":"timjames"
}

Sample Response

{
    "entity": 75025586,
    "warnings": [
    ],
    "errors": [
    ],
    "success": true
}

To complete a staff account creation, you (admin users) need to validate the mobile number and email id through OTP sent to the registered identifiers to complete the account creation.

This API issues OTP to validate mobile number/email id. This is also used to authenticate login through OTP.

Resource Information

URI v2/staff/sendOtp?otp_type="<otp type>"
Rate Limited? Yes
Authentication Yes
Response Formats JSON
HTTP Methods POST
Batch Support No

Request URL

https://<Respective cluster’s API URL>/v2/staff/sendOtp?otp_type=<otp type>

Request Parameter otp_type : The purpose for which you want to issue OTP - either to login, validate email id, or validate mobile number. Values: LOGIN, VALIDATE_EMAIL, VALIDATE_MOBILE respectively

Additional Headers Required

X-CAP-API-AUTH-KEY : Authentication key of the admin user

X-CAP-API-AUTH-ORG-ID : The org id to which you want to associate the staff user

Request Attributes

Attribute Description
id* The unique id created for the staff
username* Registered username of the staff
mobile Registered mobile number of the staff to send OTP. You can use this to validate mobile number and also to authenticate login
email Registered email id of the staff to send OTP. You can use this to validate email id and also to authenticate login

Response Codes

Code Description
1007 EMAIL or Mobile identifier is not set
1010 Invalid otp type passed
1009 Invalid identifier details passed

Validate OTP

Sample Request

https://us.api.capillarytech.com/v2/staff/validate

Sample POST Request

{
   "username":"timjames",
   "mobile":"9800500000",
   "email":"tim.james@example.com",
   "id":18,
   "identifierType":"EMAIL",
   "password":"timpass45",
   "otp":"335713"
}

Sample Response

{
   "entity":75025586,
   "warnings":[

   ],
   "errors":[

   ],
   "success":true
}

Lets admin users validate OTP sent to the staff’s registered mobile number or email id through the staff/sendOtp API.

Resource Information

URI /staff/validate
Rate Limited? Yes
Authentication Yes
Response Formats JSON
HTTP Methods POST
Batch Support No

Request URL

https://<Respective cluster’s API URL>/v2/staff/validate

Additional Headers Required

X-CAP-API-AUTH-KEY : Authentication key of the admin user

X-CAP-API-AUTH-ORG-ID : The org id to which you want to associate the staff user

Parameter Description
username Specify the user name for the current staff account
mobile Specify the mobile number of the staff
email Specify the mobile number of the staff
id Unique user id generated for the staff account
identifierType Specify EMAIL for email id validation and MOBILE for mobile number validation
password Specify the password of the staff account
otp Specify the one time password received on the specified identifierType

Response Codes

Code Description
1700 Authentication service error. Invalid otp
1009 Invalid identifier details passed
1008 Invalid identifier type passed

Change Identifier

Sample Request (Send OTP)

https://us.api.capillarytech.com/v2/staff/changeidentifier/sendotp

Sample POST Request (Send OTP)

{ 
  "identifier":"tom1.sawyer@example.com",
 "type":"email", 
 "notes":"changing email"
}

Sample Request (Validate OTP)

https://us.api.capillarytech.com/v2/staff/changeidentifier

Sample POST Request (Validate OTP)

{ 
  "identifier":"tom1.sawyer@example.com",
 "type":"email", 
 "notes":"changing email",
"otp":"13482"
} 

Sample Response

{
   "entity": 75027185,
   "warnings": [
   ],
   "errors": [
   ],
   "success": true
}

Lets you update the mobile number/email id of the current staff user through OTP. This is a two step process - 1. Send OTP to the new identifier 2. Validate the OTP received to the new identifier.

Resource Information

Info Value
URI /staff/changeidentifier/sendotp, /staff/changeidentifier/
Rate Limited? Yes
Authentication Yes
Response Formats JSON
HTTP Methods POST
Batch Support No

Request URL

  1. https://<Respective cluster’s API URL>/v2/staff/changeidentifier/sendotp

  2. https://<Respective cluster’s API URL>/v2/staff/changeidentifier

Response Codes

Code Description
1009 Invalid identifier passed
1010 Invalid otp type passed (identifier type)
1005 Identifier already exits
1012 Unable to send OTP to the new identifier
1007 No identifier (email/mobile) passed to validate OTP
1700 Invalid OTP or OTP expired
401 Invalid authentication. Please check your username,password or authentication token

Transfer Staff User

Sample Request

https://us.api.capillarytech.com/v2/staff/transfer

Sample POST Request

{

  "id":18,

  "username":"timjames",

  "mobile":"9800500000",

  "email":"tim.james@example.com",

  "storeCode":"stb23"

}

Sample Response

{
    "entity": 50007782,
    "warnings": [
    ],
    "errors": [
    ],
    "success": true
}

Lets admin user change the store id associated to a staff user.

Resource Information

Info Value
URI /staff/transfer
Rate Limited? Yes
Authentication Yes
Response Formats JSON
HTTP Methods POST
Batch Support No

Request URL

https://<Respective cluster’s API URL>/v2/staff/transfer

Additional Headers Required

X-CAP-API-AUTH-KEY : Authentication key of the admin user

X-CAP-API-AUTH-ORG-ID : The org id to which you want to associate the staff user

Request Attributes

Attribute Description
id/username/mobile/email* Pass any one identifier of the staff user. Id is the unique id generated for the staff account.
storeCode* The new store code to which you want to transfer the current staff

Response Codes

Code Description
1009 Invalid identifier details passed
1215 Invalid ParentZoneId/External Ids/ParentConceptId specified. The corresponding value is to the default value

Get Staff Users of a Store/Zone

Sample Request

https://us.api.capillarytech.com/v2/staff/getUsersList?storeCode=st123

Sample Response

{

    "entity": [

        {

            "username": "timjames",

            "mobile": "91841400000",

            "storeCode": "store1",

            "zoneCode": "root",

            "id": 50007775

        },

        {

            "username": "tomsawyer",

            "mobile": "91939511111",

            "storeCode": "store1",

            "zoneCode": "root",

            "id": 50007777

        },

        {

            "username": "sivaru",

            "mobile": "919395222222",

            "email": "abc4@gmail.com",

            "storeCode": "store1",

            "zoneCode": "root",

            "id": 50007782

        }

    ],

    "warnings": [

    ],

    "errors": [

    ],

    "success": true

}

Retrieve registered staff users of a specific store or zone. Accessible only to admin users.

Resource Information

Info Value
URI /staff/getUsersList?<Request param>=<values>
Rate Limited? Yes
Authentication Yes
Response Formats JSON
HTTP Methods GET
Batch Support No

Request URL

https://<Respective cluster’s API URL>/v2/staff/getUsersList?<Request Param>=<value>

Additional Headers Required

X-CAP-API-AUTH-KEY : Authentication key of the admin user

X-CAP-API-AUTH-ORG-ID : The org id to which you want to associate the staff user

Request Parameters

Any one among the following parameters is mandatory.

Parameter Description
zoneCode Fetch registered users of a specific zone. Pass the respective zone code
storeCode Fetch registered users of a specific store. Pass the respective store code

Error Code

Code Description
1009 Invalid identifier details passed

Deactivate a Staff Account

Sample Request

https://us.api.capillarytech.com/v2/staff/delete

Sample POST Request

{

"username":"staff28",

"email":"staff.28@example.com",

"refId":222

}

Sample Response


Deactivates an existing staff user account.

Resource Information

Info Value
URI /staff/delete
Rate Limited? Yes
Authentication Yes
Response Formats JSON
HTTP Methods POST
Batch Support No

Request URL

https://<Respective cluster’s API URL>/v2/staff/delete

Additional Headers Required

X-CAP-API-AUTH-KEY : Authentication key of the admin user

X-CAP-API-AUTH-ORG-ID : The org id to which you want to associate the staff user

Request Attributes

Attribute Description
username/email/mobile/refId* Pass any one of these identifiers. refId is the unique id generated for the staff account

Response Codes

Code Description
1011 inactive user passed
1009 Invalid identifier details passed

Get Access Token

Sample Request

https://us.api.capillarytech.com/v2/staff/accessToken

Sample Response

{
   "entity":"6F0-ZTOYwp4P7b6ngXx5UkDDYXm2J82mP5xxYDQ_BCV_epool6uOif_xQ7IkMNhO",
   "warnings":[

   ],
   "errors":[

   ],
   "success":true
}

Generates access token of the current staff. Use the staff login credentials to authenticate.

Resource Information

Info Value
URI /staff/accessToken
Rate Limited? Yes
Authentication Yes
Response Formats JSON
HTTP Methods POST
Batch Support No

Request URL

https://<Respective cluster’s API URL>/v2/staff/accessToken

Change Staff Account Password

Sample Request

https://us.api.capillarytech.com/v2/staff/changePassword

Sample POST Request

{

"password":"newpassword"

}

Sample Response

{
    "entity": 75025586,
    "warnings": [
    ],
    "errors": [
    ],
    "success": true
}

Lets you change the password of the staff using the associated Auth or AccessToken. Either you can use the auth or the login credentials.

Resource Information

URI /staff/changePassword
Rate Limited? Yes
Authentication Yes
Response Formats JSON
HTTP Methods POST
Batch Support No

Request URL

https://<Respective cluster’s API URL>/v2/staff/changePassword

Additional Header required for access token based authentication

X-CAP-API-ACCESS-TOKEN : The access token of the staff user

Request Attribute Attribute | Description ——— | ———– password* | Specify your preferred new password

Get Staff Details

Sample Request

https://us.api.capillarytech.com/v2/staff/users?username=timjames

Sample Response

{
    "entity": {
        "username": "timjames",
        "email": "tim.james@example.com",
        "storeCode": "eu.store1",
        "zoneCode": "root",
        "conceptCode": "root",
        "tillCode": "eu.store1staff1",
        "id": 75025598
    },
    "warnings": [
    ],
    "errors": [
    ],
    "success": true
}

Retrieves the details of a specific staff.

Resource Information

URI /staff/users?<identifier>=<value>
Rate Limited? Yes
Authentication Yes
Response Formats JSON
HTTP Methods GET
Batch Support No

Request URL

https://<Respective cluster’s API URL>/v2/staff/users?<identifier>=<value>

Request Parameter

Parameter Description
user identifier* Pass any one identifier (username, mobile, email or the unique id generated for the user (refId)) of the user that you want to fetch in the format =. Identifiers: username, mobile, email, refId

Error Code

Code Description
1009 Invalid identifier details passed

Edit Staff User Details

Sample Request

https://us.api.capillarytech.com/v2/staff/edit

Sample POST Request

{

  "firstname":"Tom",

  "id":50007774,

  "lastname":"Sawyer",

  "title":"Manager"

}

Sample Response

{

    "entity": {

        "firstname": "Tom",

       "lastname":"Sawyer",

       "title":"Manager",s

        "id": 50007774

    },

    "warnings": [

    ],

    "errors": [

    ],

    "success": true

}

Updates profile information of the respective staff user. You can use direct login or token based login. You need a new header X-CAP-API-ACCESS-TOKEN for token based authentication.

Resource Information

URI /staff/edit
Rate Limited? Yes
Authentication Yes
Response Formats JSON
HTTP Methods POST
Batch Support No

Request URL

https://<Respective cluster’s API URL>/v2/staff/edit

Request Attributes

Attribute Description
id/username/mobile/email Pass any of the staff identifier. Id is the unique id generated for the staff user
firstname First name of the user
lastname Last name of the user
title Role or Designation of the user

Response Codes

Code Description
1009 Invalid identifier details passed
1011 Inactive user passed

Logout

Sample Request

https://us.api.capillarytech.com/v2/staff/logout

Sample Response

{
    "warnings": [
    ],
    "errors": [
    ],
    "success": true
}

Logs out the current staff user’s access token (only for token based authentication). You need to pass the new header X-CAP-API-ACCESS-TOKEN which is the user’s access token.

Resource Information

URI /staff/logout
Rate Limited? Yes
Authentication Yes
Response Formats JSON
HTTP Methods GET
Batch Support No

Request URL

https://<Respective cluster’s API URL>/v2/staff/logout

Leads (LMS)

A lead is an individual interested in buying a product. Leads can be created for both loyalty and non-loyalty customers. This resource provides you the APIs to create, manage and fetch leads.

Following are the predefined enum values for type and status respectively.

Get Reasons

http://us.api.capillarytech.com/v2/leads/reasons

Sample Request

{
    "data": [
        {
            "id": 1,
            "reason": "Item not available in store"
        },
        {
            "id": 2,
            "reason": "Best price availabe at another store"
        },
        {
            "id": 3,
            "reason": "Interested in our brand products"
        }
    ],
    "warnings": [],
    "errors": []
}

Retrieves the list of reasons added for the org with reason ids. These reason ids are required to create or update leads.

Resource Information

URI /leads/reasons
Rate Limited? Yes
Authentication Yes
Response Formats JSON
HTTP Methods GET
Batch Support No

Request URL

http://{host}/v2/leads/reasons

Add Lead

Sample Request URL

http://us.api.capillarytech.com/v2/leads

Sample POST Request

{  
   "type":"SKU",
   "leadFor":"item001",
   "idType":"EMAIL",
   "identifier":"tom.sawyer@example.com",
   "status":"ON_HOLD",
   "nextFollowUp":"2018-10-05T08:00:00+05:30",
   "createdOn":"2018-10-04T13:30:00+05:30",
   "createdBy":28812689,
   "followUpDetails":[  
      {  
         "scheduledFollowUp":"2018-10-04T12:30:00+05:30",
         "followedUpOn":"2018-10-04T12:45:00+05:30",
         "followedUpBy":28812689,
         "notes":"notes 1",
         "nextFollowUp":"2018-10-04T13:15:00+05:30"
      },
      {  
         "scheduledFollowUp":"2018-10-04T12:30:00+05:30",
         "followedUpOn":"2018-10-04T12:45:00+05:30",
         "followedUpBy":28812689,
         "notes":"notes 2",
         "nextFollowUp":"2018-10-04T13:15:00+05:30"
      }
   ],
   "extendedFields": {
    "trial_status":"Not Done"
  },

   "statusLogDetails":[  
      {  
         "status":"OPEN",
         "createdBy":28812689,
         "reasonId":1
      },
      {  
         "status":"ON_HOLD",
         "createdBy":28812689,
         "reasonId":2
      }
   ],
   "orgSourceId":-1
}

Sample Response

{
    "id": 1,
    "userId": 368754334,
    "type": "SKU",
    "leadFor": "item001",
    "status": "ON_HOLD",
    "nextFollowUp": "2018-10-05T08:00:00+05:30",
    "createdOn": "2018-10-04T13:30:00+05:30",
    "createdBy": 28812689,
    "lastUpdatedOn": "2018-11-14T15:38:04+05:30",
    "lastUpdatedBy": 15002926,
    "followUpDetails": [
        {
            "id": 1,
            "userId": 368754334,
            "leadId": 1,
            "notes": "notes 1",
            "createdBy": 15002926,
            "createdOn": "2018-11-14T15:38:04+05:30",
            "followedUpBy": 28812689,
            "followedUpOn": "2018-10-04T12:45:00+05:30",
            "scheduledFollowUp": "2018-10-04T12:30:00+05:30"
        },
        {
            "id": 2,
            "userId": 368754334,
            "leadId": 1,
            "notes": "notes 2",
            "createdBy": 15002926,
            "createdOn": "2018-11-14T15:38:04+05:30",
            "followedUpBy": 28812689,
            "followedUpOn": "2018-10-04T12:45:00+05:30",
            "scheduledFollowUp": "2018-10-04T12:30:00+05:30"
        }
    ],
    "extendedFields":
  {
    "trial_status":"Not Done"
  },
    "statusLogDetails": [
        {
            "id": 1,
            "userId": 368754334,
            "leadId": 1,
            "status": "OPEN",
            "createdBy": 15002926,
            "createdOn": "2018-11-14T15:38:04+05:30",
            "reasonId": 5,
            "reason": "Best price available at another store"
        },
        {
            "id": 2,
            "userId": 368754334,
            "leadId": 1,
            "status": "ON_HOLD",
            "createdBy": 15002926,
            "createdOn": "2018-11-14T15:38:04+05:30",
            "reasonId": 4,
            "reason": "Item not available in store"
        }
    ],
    "orgSourceId": -1,
    "warnings": []
}

Adds a new lead. A new non-loyalty customer will be created if you pass a new customer identifier.

Resource Information

URI /leads
Rate Limited? Yes
Authentication Yes
Response Formats JSON
HTTP Methods POST
Batch Support No

Request URL

http://{host}/v2/leads

Request Body Parameters

Parameter Data type Description
type enum Item or hierarchy for which the lead is generated. Values: SKU, BRAND, CATEGORY, or CUSTOM. Default value is SKU
leadFor* string Name of SKU, brand or category based on the type specified
userId int Unique id of the customer associated to the lead. If this is left blank, then you need to pass idType and identifier as mandatory parameters
idType enum Specified identifier type either EMAIL or MOBILE
identifier string Value of the specified idType
nextFollowUp date Next follow up date of the lead
createdOn date-time Date and time of lead creation in YYYY-MM-DDThh:mm:ssTZD format. Example: 2018-10-05T08:00:00+05:30
createdBy int Entity id of the staff who creates the lead.
Default value is the id of the entity from which the request has come
lastUpdatedOn date-time Date and time when the lead is recently updated in YYYY-MM-DDThh:mm:ssTZD format
lastUpdatedBy int Entity id of the staff who recently updated the lead
extendedFields obj Key-value pairs of extended fields and its values
orgSourceId enum Unique id of the org channel account. Default value is -1 for InStore account
lastFollowUp Date and time of recent follow up of the lead in YYYY-MM-DDThh:mm:ssTZD format
owner string Username of the staff user who is assigned to the lead
subStatus enum Current sub-status of the lead. Use only names that are created using leads/substatus API

Assign Lead

Lets you change the owner of an existing lead.

Get Lead Details

Retrieves the details of leads created in an org. You can use filter parameters to get personalized results.

Sample Request

https://eu.api.capillarytech.com/v2/leads?userId=90486448

Sample Response

{
    "data": [
        {
            "id": 3,
            "userId": 90486448,
            "type": "SKU",
            "leadFor": "Denim",
            "status": "ON_HOLD",
            "nextFollowUp": "2018-10-05T02:30:00Z",
            "createdOn": "2018-10-04T08:00:00Z",
            "createdBy": 75029724,
            "lastUpdatedOn": "2019-02-20T15:28:13Z",
            "lastUpdatedBy": 75029724,
            "followUpDetails": [
                {
                    "id": 5,
                    "userId": 90486448,
                    "leadId": 3,
                    "notes": "notes 1",
                    "createdBy": 75029724,
                    "createdOn": "2019-02-20T15:28:13Z",
                    "followedUpBy": 75029724,
                    "followedUpOn": "2018-10-04T07:15:00Z",
                    "scheduledFollowUp": "2018-10-04T07:00:00Z"
                },
                {
                    "id": 6,
                    "userId": 90486448,
                    "leadId": 3,
                    "notes": "notes 2",
                    "createdBy": 75029724,
                    "createdOn": "2019-02-20T15:28:13Z",
                    "followedUpBy": 75029724,
                    "followedUpOn": "2018-10-04T07:15:00Z",
                    "scheduledFollowUp": "2018-10-04T07:00:00Z"
                }
            ],
            "statusLogDetails": [
                {
                    "id": 5,
                    "userId": 90486448,
                    "leadId": 3,
                    "status": "OPEN",
                    "createdBy": 75029724,
                    "createdOn": "2019-02-20T15:28:13Z",
                    "reasonId": 3,
                    "reason": "APICALL"
                },
                {
                    "id": 6,
                    "userId": 90486448,
                    "leadId": 3,
                    "status": "ON_HOLD",
                    "createdBy": 75029724,
                    "createdOn": "2019-02-20T15:28:13Z",
                    "reasonId": 4,
                    "reason": "NOT PICKING CALL"
                }
            ],
            "orgSourceId": -1,
            "extendedFields": {
                "trial_status": "Not Done"
            }
        },
        {
            "id": 4,
            "userId": 90486448,
            "type": "SKU",
            "leadFor": "CasualShirt",
            "status": "ON_HOLD",
            "nextFollowUp": "2018-10-05T02:30:00Z",
            "createdOn": "2018-10-04T08:00:00Z",
            "createdBy": 75029724,
            "lastUpdatedOn": "2019-02-20T15:28:51Z",
            "lastUpdatedBy": 75029724,
            "followUpDetails": [
                {
                    "id": 7,
                    "userId": 90486448,
                    "leadId": 4,
                    "notes": "notes 1",
                    "createdBy": 75029724,
                    "createdOn": "2019-02-20T15:28:51Z",
                    "followedUpBy": 75029724,
                    "followedUpOn": "2018-10-04T07:15:00Z",
                    "scheduledFollowUp": "2018-10-04T07:00:00Z"
                },
                {
                    "id": 8,
                    "userId": 90486448,
                    "leadId": 4,
                    "notes": "notes 2",
                    "createdBy": 75029724,
                    "createdOn": "2019-02-20T15:28:51Z",
                    "followedUpBy": 75029724,
                    "followedUpOn": "2018-10-04T07:15:00Z",
                    "scheduledFollowUp": "2018-10-04T07:00:00Z"
                }
            ],
            "statusLogDetails": [
                {
                    "id": 7,
                    "userId": 90486448,
                    "leadId": 4,
                    "status": "OPEN",
                    "createdBy": 75029724,
                    "createdOn": "2019-02-20T15:28:51Z",
                    "reasonId": 3,
                    "reason": "APICALL"
                },
                {
                    "id": 8,
                    "userId": 90486448,
                    "leadId": 4,
                    "status": "ON_HOLD",
                    "createdBy": 75029724,
                    "createdOn": "2019-02-20T15:28:51Z",
                    "reasonId": 4,
                    "reason": "NOT PICKING CALL"
                }
            ],
            "orgSourceId": -1,
            "extendedFields": {
                "trial_status": "Not Done"
            }
        },
        {
            "id": 5,
            "userId": 90486448,
            "type": "SKU",
            "leadFor": "Polo",
            "status": "ON_HOLD",
            "nextFollowUp": "2018-10-05T02:30:00Z",
            "createdOn": "2018-10-04T08:00:00Z",
            "createdBy": 75029724,
            "lastUpdatedOn": "2019-02-20T15:29:29Z",
            "lastUpdatedBy": 75029724,
            "followUpDetails": [
                {
                    "id": 9,
                    "userId": 90486448,
                    "leadId": 5,
                    "notes": "notes 1",
                    "createdBy": 75029724,
                    "createdOn": "2019-02-20T15:29:29Z",
                    "followedUpBy": 75029724,
                    "followedUpOn": "2018-10-04T07:15:00Z",
                    "scheduledFollowUp": "2018-10-04T07:00:00Z"
                },
                {
                    "id": 10,
                    "userId": 90486448,
                    "leadId": 5,
                    "notes": "notes 2",
                    "createdBy": 75029724,
                    "createdOn": "2019-02-20T15:29:29Z",
                    "followedUpBy": 75029724,
                    "followedUpOn": "2018-10-04T07:15:00Z",
                    "scheduledFollowUp": "2018-10-04T07:00:00Z"
                }
            ],
            "statusLogDetails": [
                {
                    "id": 9,
                    "userId": 90486448,
                    "leadId": 5,
                    "status": "OPEN",
                    "createdBy": 75029724,
                    "createdOn": "2019-02-20T15:29:29Z",
                    "reasonId": 3,
                    "reason": "APICALL"
                },
                {
                    "id": 10,
                    "userId": 90486448,
                    "leadId": 5,
                    "status": "ON_HOLD",
                    "createdBy": 75029724,
                    "createdOn": "2019-02-20T15:29:29Z",
                    "reasonId": 4,
                    "reason": "NOT PICKING CALL"
                }
            ],
            "orgSourceId": -1,
            "extendedFields": {
                "trial_status": "Not Done"
            }
        }
    ],
    "warnings": [],
    "errors": []
}

Resource Information

URI v2/leads
Rate Limited? No
Authentication Yes
Response Formats JSON
HTTP Methods GET
Batch Support No

Request URL

http://{host}/v2/leads?{queryParams}={value}

Request Query Parameters

Parameter Datatype Description
userId long Get leads of a specific customer. Pass the user ID of the customer.
status enum Get leads of a specific status. Values: OPEN, ON_HOLD, WON, LOST, DELETED.
substatus string Get leads by lead sub-status.
owner string Fetch leads assigned to a specific associate. Pass the associate/staff ID (user id of the staff).
limit int Limit the number of results to retrieve.
offset long Number of rows (as per the data entered into the table) that you want omit from showing.
entityType enum Get leads of a specific entity. You also need to pass the entityCode accordingly. Pass entityType and e Values: ZONE, CONCEPT, STORE, TILL, STR_SERVER, ADMIN_USER, ASSOCIATE, STAFF.
entityCode string Pass the code of the respective entityType. For example, if entityType is STORE, then entityCode should be store code by which you want to get leads.

Additional Header

Header Description
language Specify the ISO code of a language to get extended field values in your preferred language. For example, zh for Chinese, id for Indonesian, ar for Arabic. English is the default language.

Update Lead

Updates extended fields for an existing lead

Sample Request URL

http://us.api.capillarytech.com/v2/leads/19

Sample PUT Request

{
"extendedFields":
  {
    "trial_status":"Not Done"
  }

}

Sample Response

{
    "id": 19,
    "userId": 316804150,
    "type": "SKU",
    "leadFor": "item001",
    "status": "ON_HOLD",
    "nextFollowUp": "2018-10-05T08:00:00+05:30",
    "createdOn": "2018-10-04T13:30:00+05:30",
    "createdBy": 28812689,
    "lastUpdatedOn": "2018-11-28T10:31:19+05:30",
    "lastUpdatedBy": 15147364,
    "followUpDetails": [
        {
            "id": 37,
            "userId": 316804150,
            "leadId": 19,
            "notes": "notes 1",
            "createdBy": 15147364,
            "createdOn": "2018-11-28T10:31:19+05:30",
            "followedUpBy": 28812689,
            "followedUpOn": "2018-10-04T12:45:00+05:30",
            "scheduledFollowUp": "2018-10-04T12:30:00+05:30"
        },
        {
            "id": 38,
            "userId": 316804150,
            "leadId": 19,
            "notes": "notes 2",
            "createdBy": 15147364,
            "createdOn": "2018-11-28T10:31:19+05:30",
            "followedUpBy": 28812689,
            "followedUpOn": "2018-10-04T12:45:00+05:30",
            "scheduledFollowUp": "2018-10-04T12:30:00+05:30"
        }
    ],
    "statusLogDetails": [
        {
            "id": 39,
            "userId": 316804150,
            "leadId": 19,
            "status": "OPEN",
            "createdBy": 15147364,
            "createdOn": "2018-11-28T10:31:19+05:30",
            "reasonId": 1,
            "reason": "not available"
        },
        {
            "id": 40,
            "userId": 316804150,
            "leadId": 19,
            "status": "ON_HOLD",
            "createdBy": 15147364,
            "createdOn": "2018-11-28T10:31:19+05:30",
            "reasonId": 2,
            "reason": "phone not working"
        }
    ],
    "orgSourceId": -1,
    "extendedFields": {
        "trial_status": "Not Done"
    },
    "warnings": [
    ]
}

Resource Information

URI /leads/{leadId}
Rate Limited? Yes
Authentication Yes
Response Formats JSON
HTTP Methods PUT
Batch Support No

Request URL

http://{host}/v2/leads/{leadId}

Request Body Parameters

Parameter Type Description
extendedFields obj Key-value pairs of extended fields and its values
owner string Username of the owner (staff) of the lead

Create Lead Substatus

Lets you create a new sub-status to a lead status.

Sample Request

http://us.api.capillarytech.com/v2/leads/substatus

Sample POST Request

{
    "status": "ON_HOLD",
    "subStatus": "YetToDecide"
}

Sample Response

{
    "status": "ON_HOLD",
    "subStatus": "YetToDecide",
    "warnings": []
}

Resource Information

URI /leads/substatus
Rate Limited? Yes
Authentication Yes
Response Formats JSON
HTTP Methods POST
Batch Support No

Request URL

http://{host}/v2/leads/substatus

Request Body Parameters

Parameter Type Description
status* enum Status for which you want to add sub-status. Values: OPEN, WON, LOST, ON_HOLD, DELETED
subStatus* string Name of the new sub-status that you want to create

Get Lead Substatus

Retrieves all the sub-statuses added (for each status) to the organization.

Sample Request

http://us.api.capillarytech.com/v2/leads/substatuses

Sample Response

{
    "data": [
        {
            "status": "LOST",
            "subStatus": "InvalidPhoneNumber"
        },
        {
            "status": "ON_HOLD",
            "subStatus": "YetToDecide"
        }
    ],
    "warnings": [],
    "errors": []
}

Resource Information

URI /leads/substatuses
Rate Limited? Yes
Authentication Yes
Response Formats JSON
HTTP Methods GET
Batch Support No

Request URL

http://{host}/v2/leads/substatuses

Update Lead Status

Sample Request URL

http://us.api.capillarytech.com/v2/leads/21/status

Sample PUT Request

{
    "status": "ON_HOLD",
    "subStatus": "YetToDecide",
    "createdBy": 28812689,
    "reasonId": 2
}

Sample Response

{
    "id": 2,
    "userId": 368754334,
    "type": "SKU",
    "leadFor": "item001",
    "status": "ON_HOLD",
    "nextFollowUp": "2018-10-05T08:00:00+05:30",
    "createdOn": "2018-10-04T13:30:00+05:30",
    "createdBy": 28812689,
    "lastUpdatedOn": "2019-04-15T14:58:39+05:30",
    "lastUpdatedBy": 15002926,
    "followUpDetails": [
        {
            "id": 3,
            "userId": 368754334,
            "leadId": 2,
            "notes": "notes 1",
            "createdBy": 15002926,
            "createdOn": "2018-12-06T17:36:28+05:30",
            "followedUpBy": 28812689,
            "followedUpOn": "2018-10-04T12:45:00+05:30",
            "scheduledFollowUp": "2018-10-04T12:30:00+05:30"
        },
        {
            "id": 4,
            "userId": 368754334,
            "leadId": 2,
            "notes": "notes 2",
            "createdBy": 15002926,
            "createdOn": "2018-12-06T17:36:28+05:30",
            "followedUpBy": 28812689,
            "followedUpOn": "2018-10-04T12:45:00+05:30",
            "scheduledFollowUp": "2018-10-04T12:30:00+05:30"
        }
    ],
    "statusLogDetails": [
        {
            "id": 4,
            "userId": 368754334,
            "leadId": 2,
            "status": "OPEN",
            "createdBy": 15002926,
            "createdOn": "2018-12-06T17:36:28+05:30",
            "reasonId": 1,
            "reason": "Item not available in store"
        },
        {
            "id": 5,
            "userId": 368754334,
            "leadId": 2,
            "status": "ON_HOLD",
            "createdBy": 15002926,
            "createdOn": "2018-12-06T17:36:28+05:30",
            "reasonId": 2,
            "reason": "Best price availabe at another store"
        },
        {
            "id": 16,
            "userId": 368754334,
            "leadId": 2,
            "status": "LOST",
            "createdBy": -1,
            "createdOn": "2019-01-28T14:34:46+05:30",
            "reasonId": 11,
            "reason": "AUTO_CLOSE"
        },
        {
            "id": 23,
            "userId": 368754334,
            "leadId": 2,
            "status": "ON_HOLD",
            "createdBy": 28812689,
            "createdOn": "2019-04-15T14:58:39+05:30",
            "reasonId": 2,
            "reason": "Best price availabe at another store",
            "subStatus": "YetToDecide"
        }
    ],
    "orgSourceId": -1,
    "extendedFields": {
        "trial_status": "Not Done"
    },
    "subStatus": "YetToDecide",
    "warnings": []
}

Updates the status and substatus of an existing lead. You can have status as OPEN (for new lead), WON (for a successful purchase lead), LOST (for unreverted lead), ON_HOLD, DELETED.

Resource Information

URI /leads/{leadId}/status
Rate Limited? Yes
Authentication Yes
Response Formats JSON
HTTP Methods PUT
Batch Support No

Request URL

http://{host}/v2/leads/{leadId}/status

Request Body Parameters

Parameter Type Description
status* enum Current status of the lead. Values: OPEN,WON,LOST,ON_HOLD,DELETED`
reasonId* int Reason id that you want to associate to the lead
subStatus string Current sub-status of the lead
createdBy int Entity id of the staff who created the lead
createdOn ate-time Date and time of lead creation in YYYY-MM-DDThh:mm:ssTZD format. Example: 2018-10-05T08:00:00+05:30

Update Lead follow-ups

Lets you update the recent follow up date and till id of a lead.

Sample Request

http://us.api.capillarytech.com/v2/leads/63/followup

Sample POST Request

{
 "followedUpOn": "2018-10-05T08:00:00+05:30",
 "createdBy": 124
}

Sample Response

{
          "createdBy": 124, 
          "createdOn": "2019-04-16T05:19:06Z", 
          "extendedFields": {
                    "trial_status": "Not Done"
          }, 
          "followUpDetails": [
                    {
                              "createdBy": 124, 
                              "createdOn": "2019-04-16T05:19:06Z", 
                              "followedUpBy": 124, 
                              "followedUpOn": "2019-04-17T05:19:06Z", 
                              "id": 122, 
                              "leadId": 63, 
                              "notes": "notes 1", 
                              "scheduledFollowUp": "2019-04-17T05:19:06Z", 
                              "userId": 340417059
                    }, 
                    {
                              "createdBy": 124, 
                              "createdOn": "2019-04-16T05:19:06Z", 
                              "followedUpBy": 124, 
                              "followedUpOn": "2019-04-18T05:19:06Z", 
                              "id": 123, 
                              "leadId": 63, 
                              "notes": "notes 2", 
                              "scheduledFollowUp": "2019-04-18T05:19:06Z", 
                              "userId": 340417059
                    }, 
                    {
                              "createdBy": 124, 
                              "createdOn": "2019-04-16T05:19:06Z", 
                              "followedUpBy": 124, 
                              "followedUpOn": "2019-04-17T05:19:06Z", 
                              "id": 124, 
                              "leadId": 63, 
                              "scheduledFollowUp": "2019-04-17T05:19:06Z", 
                              "userId": 340417059
                    }
          ], 
          "id": 63, 
          "lastFollowUp": "2019-04-17T05:19:06Z", 
          "lastUpdatedBy": 124, 
          "lastUpdatedOn": "2019-04-16T05:19:06Z", 
          "leadFor": "sku_902307", 
          "orgSourceId": -1, 
          "status": "OPEN", 
          "statusLogDetails": [
                    {
                              "createdBy": 124, 
                              "createdOn": "2019-04-16T05:19:06Z", 
                              "id": 137, 
                              "leadId": 63, 
                              "reason": "Reason1", 
                              "reasonId": 2, 
                              "status": "OPEN", 
                              "userId": 340417059
                    }, 
                    {
                              "createdBy": 124, 
                              "createdOn": "2019-04-16T05:19:06Z", 
                              "id": 138, 
                              "leadId": 63, 
                              "reason": "AUTO_CLOSE", 
                              "reasonId": 3, 
                              "status": "OPEN", 
                              "userId": 340417059
                    }
          ], 
          "type": "SKU", 
          "userId": 340417059, 
          "warnings": []
}

Resource Information

URI /leads/{leadId}/followup
Rate Limited? Yes
Authentication Yes
Response Formats JSON
HTTP Methods POST
Batch Support No

Request URL

http://{host}/v2/leads/{leadId}/followup

Request Parameters

Parameter Type Description
leadId* path Unique id of the lead
followedUpOn* date-time Date of recent follow up discussion with the customer in YYYY-MM-DDTHH:MM:SS+TZD
followedUpBy int Entity id of the staff who followed up with the customer
createdBy* int Till id that updated the follow up
nextFollowUp date-time Date and time of the next follow up discussion with the customer in YYYY-MM-DDTHH:MM:SS+TZD
notes string Brief follow up notes
scheduledFollowUp date-time Actual scheduled date and time of the current follow up discussion with the customer in YYYY-MM-DDTHH:MM:SS+TZD

Search Lead

Sample Request

http://us.api.capillarytech.com/v2/leads?sortOrder=DESC&type=ALL&limit=10&orgSourceId=-1

Sample Response

{
    "data": [
        {
            "id": 1,
            "userId": 368754334,
            "type": "SKU",
            "leadFor": "item001",
            "status": "WON",
            "nextFollowUp": "2018-10-05T08:00:00+05:30",
            "createdOn": "2018-10-04T13:30:00+05:30",
            "createdBy": 28812689,
            "lastUpdatedOn": "2018-11-14T15:44:26+05:30",
            "lastUpdatedBy": 15002926,
            "followUpDetails": [
                {
                    "id": 1,
                    "userId": 368754334,
                    "leadId": 1,
                    "notes": "notes 1",
                    "createdBy": 15002926,
                    "createdOn": "2018-11-14T15:38:04+05:30",
                    "followedUpBy": 28812689,
                    "followedUpOn": "2018-10-04T12:45:00+05:30",
                    "scheduledFollowUp": "2018-10-04T12:30:00+05:30"
                },
                {
                    "id": 2,
                    "userId": 368754334,
                    "leadId": 1,
                    "notes": "notes 2",
                    "createdBy": 15002926,
                    "createdOn": "2018-11-14T15:38:04+05:30",
                    "followedUpBy": 28812689,
                    "followedUpOn": "2018-10-04T12:45:00+05:30",
                    "scheduledFollowUp": "2018-10-04T12:30:00+05:30"
                }
            ],

            "statusLogDetails": [
                {
                    "id": 1,
                    "userId": 368754334,
                    "leadId": 1,
                    "status": "OPEN",
                    "createdBy": 15002926,
                    "createdOn": "2018-11-14T15:38:04+05:30",
                    "reasonId": 5,
                    "reason": "Best price available at another store"
                },
                {
                    "id": 2,
                    "userId": 368754334,
                    "leadId": 1,
                    "status": "ON_HOLD",
                    "createdBy": 15002926,
                    "createdOn": "2018-11-14T15:38:04+05:30",
                    "reasonId": 4,
                    "reason": "Item not available in store"
                },
                {
                    "id": 3,
                    "userId": 368754334,
                    "leadId": 1,
                    "status": "WON",
                    "createdBy": 15002926,
                    "createdOn": "2018-11-14T15:44:27+05:30",
                    "reasonId": 5,
                    "reason": "Best price available at another store"
                }
            ],
            "orgSourceId": -1
        }
    ],
    "warnings": [],
    "errors": []
}

Retrieves leads based on the input parameters.

Resource Information

URI /leads?{input params}={param values}
Rate Limited? Yes
Authentication Yes
Response Formats JSON
HTTP Methods GET
Batch Support No

Request URL

http://{host}/v2/leads?{input params}={param values}

Input Parameters

Parameter Description
type Fetch by lead type. Values: SKU, CATEGORY, BRAND, CUSTOM (for any custom types)
limit Limit the number of results to be fetched
orgSourceId Specify the source account id from which you want to fetch the leads. Sources can be FACEBOOK, WEB_ENGAGE, WECHAT, INSTORE, MARTJACK, TMALL, TAOBAO, JD, ECOMMERCE, LINE, and WEBSITE. For example, -1 for INSTORE.
userId Fetch the leads of a specific user
status Fetch leads by status. Values: OPEN, WON, LOST, ON_HOLD, DELETED
substatus Fetch leads with a specific sub-status
offset Fetches leads > the offset number. Offset is the position of the lead in the db record. The value is assigned based on the sequence of creation. . For example, offset=10 retrieves all the leads from record number 11.
sortBy Lets you sort the list by createdon or lastUpdatedOn
sortOrder Sort the results in ascending (ASC) or descending (DESC) order

Configure Lead Reasons

Sample Request

http://us.api.capillarytech.com/v2/leads/reasons

Sample POST Request

[
  {
    "reason": "Item not available in store"
  },
  {
    "reason": "Best price availabe at another store"
  },
  {
    "reason": "Interested in our brand products"  }
]

Sample Response

{
    "data": [
        {
            "id": 1,
            "reason": "Item not available in store"
        },
        {
            "id": 2,
            "reason": "Best price availabe at another store"
        },
        {
            "id": 3,
            "reason": "Interested in our brand products"
        }
    ],
    "warnings": [],
    "errors": []
}

Lets you add your preferred reasons that are required while adding or updating a lead at the organization level.

Reasons are used to add or update a lead status. Lead reasons are org specific. You can create reasons of your own and use the respective reason ids to add or update a lead status.

Resource Information

URI /leads/reasons
Rate Limited? Yes
Authentication Yes
Response Formats JSON
HTTP Methods POST
Batch Support No

Request URL

http://{host}/v2/leads/reasons

Request Body Parameters

Parameter Type Description
reason* string Specify a meaningful reason that you want to add to the organization

User Groups

A User Group is a customer group that could contain friends, family members, colleagues, or relatives of a customer. A user group consists of an admin user and group members. The usergroups resource provides APIs to manage user groups .

Create User Group

Lets you create a new user group.

Sample Request

http://us.api.capillarytech.com/v2/usergroups

Sample POST Request (Using User ID)

{
  "name": "Harsh",
  "primaryUserId": 281348774
}

Sample POST Request (Using Customer Identifiers)

 {
      "name": "Harsh",
      "primaryMemberIdentifier": {
        "type": "mobile",
        "value": "91934000000"
      }
    }

Sample Response

{
   "id":1,
   "name":"Harsh",
   "primaryUserId":281348774,
   "createdOn":"2018-12-31T12:59:30+05:30",
   "createdBy":15002926,
   "updatedOn":"2018-12-31T12:59:30+05:30",
   "updatedBy":15002926,
   "members":[
      {
         "groupId":1,
         "userId":281348774,
         "role":"PRIMARY",
         "joinedOn":"2018-12-31T12:59:30+05:30",
         "addedBy":15002926,
         "autoUpdateTime":"2018-12-31T12:59:30+05:30"
      }
   ],
   "lifetimePurchases":1000.0,
   "warnings":[

   ]
}

Resource Information

URI /usergroups
Rate Limited? No
Authentication Yes
HTTP Methods POST
Batch Support No

Request URL

https://{host}/v2/usergroups

Request Body Parameters

Parameter Datatype Description
name* string Name of the user group
primaryUserId* long Unique user id of the group admin

Join User Group (with UserId)

Adds user to an existing group.

Sample Request

http://us.api.capillarytech.com/v2/usergroups/1/members/313099450

Sample Response

{
    "warnings": [],
    "errors": [],
    "success": true
}

Resource Information

URI /{groupId}/members/{userId}
Rate Limited? No
Authentication Yes
HTTP Methods POST (No Body required)
Batch Support No

Request URL

https://{host}/v2/usergroups/{groupId}/members/{userId}

Request Query Parameters

Parameter Datatype Description
groupId* long Unique id the group that the user wants to joinedOn.
userId** long Unique id of the user who wants to join the group.
primaryMemberIdentifier** obj Use this create user group with customer identifier such as mobile number, email ID, or external ID.
type* enum Type of the identifier. Values: mobile, email, externalId.
value* string Value of the respective identifier type (mobile number/email ID/external ID).

Join User Group (with Customer Identifiers)

Adds user to an existing group.

Sample Request

https://eu.api.capillarytech.com/v2/usergroups/2876/members

Sample POST Request


{
  "secondaryMemberIdentifiers": [
    {
      "type": "userId",
      "value": "126080386"
    }
  ]
}

Sample Response

{
  "data": [
      {
       "entity": {
        "identifier": [
        {
         "type": "userId",
         "value": "126080386"
         }
         ]
         },
       "warnings": [],
       "errors": [],
       "success": true
      }
    ],
    "warnings": [],
    "errors": []
}

Resource Information

URI /{groupId}/members
Rate Limited? No
Authentication Yes
HTTP Methods POST
Batch Support Yes

Request URL

https://{host}/v2/usergroups/{groupId}/members

Request Query Parameters

Parameter Datatype Description
groupId* long Unique id the group that the user wants to joinedOn.

Request Body Parameters

Parameter Datatype Description
secondaryMemberIdentifiers* obj Details of secondary member(s).
type* enum Identifier by which you want to use to add secondary member. Supported values: mobile, email, externalId, userId.
value* string Value of the respective identifier type.

Join User Group (OTP Based)

Lets you add user to an existing group upon OTP validation. This API issues OTP to the customer and you need to validate it using v2/otp/validate API. Once the OTP is validated, the user join will be confirmed.

To use OTP based calls, the following three options should have been enabled for the organization. You can enable these through organization/configs v1.1 API.

Sample Request

http://us.api.capillarytech.com/v2/usergroups/1/members/313099450

Sample Response

{
    "warnings": [],
    "errors": [],
    "success": true
}

Resource Information

URI /v2/usergroups/{groupId}/members/{userId}
Rate Limited? No
Authentication Yes
HTTP Methods PUT
Batch Support No

Request URL

https://{host}/v2/usergroups/{groupId}/members/{userId}

Request Body Parameters

Parameter Datatype Description
groupId* long Unique id the group that the user wants to joinedOn
userId* long Unique id of the user who wants to join the group

Get User Group Details (by group ID)

Retrieves the details of a specific user group.

Sample Request URL

https://us.ap.capillarytech.com/v2/usergroups/1

Sample POST Request

{
    "id": 1,
    "name": "Harsh",
    "primaryUserId": 281348774,
    "createdOn": "2018-12-31T12:59:30+05:30",
    "createdBy": 15002926,
    "updatedOn": "2018-12-31T12:59:30+05:30",
    "updatedBy": 15002926,
    "members": [
        {
            "groupId": 1,
            "userId": 281348774,
            "role": "PRIMARY",
            "joinedOn": "2018-12-31T12:59:30+05:30",
            "addedBy": 15002926,
            "autoUpdateTime": "2018-12-31T12:59:30+05:30"
        },
        {
            "groupId": 1,
            "userId": 313099450,
            "role": "SECONDARY",
            "joinedOn": "2018-12-31T13:13:52+05:30",
            "addedBy": 15002926,
            "autoUpdateTime": "2018-12-31T13:13:52+05:30"
        },
        {
            "groupId": 1,
            "userId": 368881003,
            "role": "SECONDARY",
            "joinedOn": "2018-12-31T13:18:42+05:30",
            "addedBy": 15002926,
            "autoUpdateTime": "2018-12-31T13:18:42+05:30"
        },
        {
            "groupId": 1,
            "userId": 368881005,
            "role": "SECONDARY",
            "joinedOn": "2018-12-31T13:21:05+05:30",
            "addedBy": 15002926,
            "autoUpdateTime": "2018-12-31T13:21:05+05:30"
        }
    ],
    "lifetimePurchases": 0,
    "warnings": []
}

Resource Information

URI /usergroups/{groupId}
Rate Limited? No
Authentication Yes
HTTP Methods GET
Batch Support No

Request URL

https://{host}/v2/usergroups/{groupId}

Request Query Parameters

Parameter Datatype Description
groupId* long Unique id the user group that you want to fetch

Get Group Details & Group Loyalty Details (by Identifier)

Retrieves the details of a specific user group and group loyalty information using any of the identifiers of the primary or secondary member of the group.

Sample Request URL

https://eu.api.capillarytech.com/v2/usergroups?identifierName=mobile&identifierValue=919740000000&loyaltyDetails=true

Sample POST Request

{
   "id":2876,
   "name":"TomGroup",
   "primaryUserId":98662653,
   "createdOn":"2020-09-02T06:26:55Z",
   "createdBy":75040399,
   "updatedOn":"2020-09-02T06:26:55Z",
   "updatedBy":75040399,
   "members":[
      {
         "groupId":2876,
         "userId":98662653,
         "role":"PRIMARY",
         "joinedOn":"2020-09-02T06:26:55Z",
         "addedBy":75040399,
         "autoUpdateTime":"2020-09-02T06:26:55Z",
         "name":"Tom Sawyer",
         "joinSource":"",
         "joinAccountId":"",
         "identifiers":[
            {
               "type":"externalId",
               "value":"anjvat123"
            },
            {
               "type":"email",
               "value":"tom.sawyer@capillarytech.com"
            },
            {
               "type":"mobile",
               "value":"919740000000"
            }
         ],
         "firstName":"Tom",
         "lastName":"Sawyer",
         "loyaltySummary":{
            "enrolledPrograms":[
               {
                  "redeemed":450.12,
                  "expired":4498.83,
                  "returned":0.0,
                  "adjusted":-0.01,
                  "lifetimePoints":6630.32,
                  "loyaltyPoints":1681.37,
                  "cumulativePurchases":67597.0,
                  "loyaltyId":310120407,
                  "currentSlab":"Albatross Elite",
                  "nextSlab":"Platinum",
                  "nextSlabSerialNumber":4,
                  "nextSlabDescription":"Top level tier",
                  "slabSNo":3,
                  "slabExpiryDate":"2020-10-31T23:59:59Z",
                  "programId":469,
                  "delayedPoints":0.0,
                  "delayedReturnedPoints":0.0,
                  "totalAvailablePoints":0.0,
                  "totalReturnedPoints":0.0,
                  "linkedPartnerPrograms":[

                  ],
                  "programTitle":"BUKLDefaultProgram",
                  "programDescription":"Default program for BUKL",
                  "programPointsToCurrencyRatio":1.0,
                  "pointsContributionToGroup":0.0
               }
            ],
            "groupPrograms":[
               {
                  "groupProgramId":469,
                  "title":"BUKLDefaultProgram",
                  "description":"Default program for BUKL",
                  "programsList":[
                     {
                        "id":469,
                        "name":"BUKLDefaultProgram",
                        "description":"Default program for BUKL"
                     }
                  ],
                  "lifetimePoints":6630.32,
                  "loyaltyPoints":1681.37,
                  "promisedPoints":0.0,
                  "pointsToCurrencyRatio":1.0
               }
            ]
         }
      },
      {
         "groupId":2876,
         "userId":126080386,
         "role":"SECONDARY",
         "joinedOn":"2020-09-02T09:53:23Z",
         "addedBy":75040399,
         "autoUpdateTime":"2020-09-02T09:53:23Z",
         "name":"test",
         "joinSource":"",
         "joinAccountId":"",
         "identifiers":[
            {
               "type":"mobile",
               "value":"917575700000"
            },
            {
               "type":"email",
               "value":"test789@test.com"
            }
         ],
         "firstName":"test",
         "lastName":"test",
         "loyaltySummary":{
            "enrolledPrograms":[
               {
                  "redeemed":0.0,
                  "expired":0.0,
                  "returned":0.0,
                  "adjusted":0.0,
                  "lifetimePoints":0.0,
                  "loyaltyPoints":0.0,
                  "cumulativePurchases":0.0,
                  "loyaltyId":364845637,
                  "currentSlab":"Albatross Elite",
                  "nextSlab":"Employee",
                  "nextSlabSerialNumber":4,
                  "nextSlabDescription":"Employee",
                  "slabSNo":3,
                  "slabExpiryDate":"2020-10-31T23:59:59Z",
                  "programId":469,
                  "delayedPoints":0.0,
                  "delayedReturnedPoints":0.0,
                  "totalAvailablePoints":0.0,
                  "totalReturnedPoints":0.0,
                  "linkedPartnerPrograms":[

                  ],
                  "programTitle":"BUKLDefaultProgram",
                  "programDescription":"Default program for BUKL",
                  "programPointsToCurrencyRatio":1.0,
                  "pointsContributionToGroup":0.0
               }
            ],
            "groupPrograms":[
               {
                  "groupProgramId":469,
                  "title":"BUKLDefaultProgram",
                  "description":"Default program for BUKL",
                  "programsList":[
                     {
                        "id":469,
                        "name":"BUKLDefaultProgram",
                        "description":"Default program for BUKL"
                     }
                  ],
                  "lifetimePoints":0.0,
                  "loyaltyPoints":0.0,
                  "promisedPoints":0.0,
                  "pointsToCurrencyRatio":1.0
               }
            ]
         }
      }
   ],
   "lifetimePurchases":0.0,
   "warnings":[

   ]
}

Resource Information

URI /usergroups/{queryParams}
Rate Limited? No
Authentication Yes
HTTP Methods GET
Batch Support No

Request URL

https://{host}/v2/usergroups?identifierName={identifierName}&identifierValue={identifierValue}&{loyaltyDetails=true}

Request Query Parameters

Parameter Datatype Description
identifierName* enum Unique identifier to identifier of the primary or secondary member of a group. Value: mobile, email, externalId, userId.
identifierValue* string The respective identifier value. For example if the identifierName is email, then the identifierValue needs to the email ID of the primary or any of the secondary members of the group.
loyaltyDetails=true** - Pass to get loyalty details of the group.

Update Group Admin

Lets you update the admin user for a specific user group.

Sample Request

https://us.api.capillarytech.com/v2/usergroups/1

Sample POST Request

{
    "id": 1,
    "name": "Harsh",
    "primaryUserId": 368881003,
    "createdOn": "2018-12-31T12:59:30+05:30",
    "createdBy": 15002926,
    "updatedOn": "2018-12-31T12:59:30+05:30",
    "updatedBy": 15002926,
    "members": [
        {
            "groupId": 1,
            "userId": 281348774,
            "role": "SECONDARY",
            "joinedOn": "2018-12-31T12:59:30+05:30",
            "addedBy": 15002926,
            "autoUpdateTime": "2018-12-31T15:59:18+05:30"
        },
        {
            "groupId": 1,
            "userId": 313099450,
            "role": "SECONDARY",
            "joinedOn": "2018-12-31T13:13:52+05:30",
            "addedBy": 15002926,
            "autoUpdateTime": "2018-12-31T13:13:52+05:30"
        },
        {
            "groupId": 1,
            "userId": 368881003,
            "role": "PRIMARY",
            "joinedOn": "2018-12-31T13:18:42+05:30",
            "addedBy": 15002926,
            "autoUpdateTime": "2018-12-31T15:59:18+05:30"
        },
        {
            "groupId": 1,
            "userId": 368881005,
            "role": "SECONDARY",
            "joinedOn": "2018-12-31T13:21:05+05:30",
            "addedBy": 15002926,
            "autoUpdateTime": "2018-12-31T13:21:05+05:30"
        }
    ],
    "lifetimePurchases": 0,
    "warnings": []
}

Resource Information

URI /usergroups/{groupId}
Rate Limited? No
Authentication Yes
HTTP Methods PUT
Batch Support No

Request URL

https://{host}/v2/usergroups/{groupId}

Request Parameters

Parameter Datatype Description
groupId* long Unique id the user group that you want to fetch.
primaryUserId* long User id of the new admin.
name string Name of the user group .

Update Group Admin (OTP Based)

Lets you update the admin user of a user group through OTP validation. When this API is called, a OTP will be issued to the customer. You need to validate the OTP using v2/otp/validate API.

To use OTP based calls, the following three options should have been enabled for the organization. You can enable these through organization/configs v1.1 API.

This is applicable only if OTP based authentication is enabled.

Sample Request

https://us.api.capillarytech.com/usergroups/1/primaryuser/368881003

Sample PUT Request

{
    "id": 1,
    "name": "Harsh",
    "primaryUserId": 368881003,
    "createdOn": "2018-12-31T12:59:30+05:30",
    "createdBy": 15002926,
    "updatedOn": "2018-12-31T12:59:30+05:30",
    "updatedBy": 15002926,
    "members": [
        {
            "groupId": 1,
            "userId": 281348774,
            "role": "SECONDARY",
            "joinedOn": "2018-12-31T12:59:30+05:30",
            "addedBy": 15002926,
            "autoUpdateTime": "2018-12-31T15:59:18+05:30"
        },
        {
            "groupId": 1,
            "userId": 313099450,
            "role": "SECONDARY",
            "joinedOn": "2018-12-31T13:13:52+05:30",
            "addedBy": 15002926,
            "autoUpdateTime": "2018-12-31T13:13:52+05:30"
        },
        {
            "groupId": 1,
            "userId": 368881003,
            "role": "PRIMARY",
            "joinedOn": "2018-12-31T13:18:42+05:30",
            "addedBy": 15002926,
            "autoUpdateTime": "2018-12-31T15:59:18+05:30"
        },
        {
            "groupId": 1,
            "userId": 368881005,
            "role": "SECONDARY",
            "joinedOn": "2018-12-31T13:21:05+05:30",
            "addedBy": 15002926,
            "autoUpdateTime": "2018-12-31T13:21:05+05:30"
        }
    ],
    "lifetimePurchases": 0,
    "warnings": []
}

Resource Information

URI /usergroups/{groupId}/primaryuser/{userId}
Rate Limited? No
Authentication Yes
Response Formats JSON
HTTP Methods PUT
Batch Support No

Request URL

https://{host}/v2/usergroups/{groupId}/primaryuser/{userId}

Request Parameters

Parameter Datatype Description
groupId* long Unique id the user group that you want to fetch.
primaryUserId* long User id of the new admin.
name string Name of the user group.

Exit User Group

Exits a user from a user group.

Sample Request

https://us.api.capillarytech.com/v2/usergroups/1

Sample Response

{
    "warnings": [],
    "errors": [],
    "success": true
}

Resource Information

URI /usergroups/{groupId}/members/{userId}
Authentication Yes
HTTP Methods DELETE
Batch Support No

Request URL

https://{host}/v2/usergroups/{groupId}/members/{userId}

Request Query Parameters

Parameter Datatype Description
groupId* long Group id from which you want to exit the user.
userId* long Unique id of the user that you want to exit from the group.

Get Points Contribution by Secondary Members

Retrieves the details of points transferred from secondary members to the primary member of the group on predefined events. Pass any of the identifiers of the primary member or any of the secondary members of the group. For more details on the configurations related to points pooling, see Group Loyalty Overview.

Sample Request

https://eu.api.capillarytech.com/v2/usergroups/pointContributionHistory?identifierName=mobile&identifierValue=917487000000

Sample Response

{
   "id":6705,
   "name":"TomGroup",
   "createdOn":"2020-08-10T11:31:14+05:30",
   "updatedOn":"2020-08-10T11:31:14+05:30",
   "primaryMember":{
      "userId":379353267,
      "firstName":"Tom",
      "primaryMemberIdentifier":[
         {
            "type":"mobile",
            "value":"917487000000"
         },
         {
            "type":"email",
            "value":"tom.sawyer@example.com"
         }
      ]
   },
   "groupPointContributionRecords":1,
   "groupPointContributions":[
      {
         "userId":379353651,
         "role":"SECONDARY",
         "firstName":"Kevin",
         "identifiers":[
            {
               "type":"email",
               "value":"kevin.3533611762@example.com"
            },
            {
               "type":"mobile",
               "value":"917487000000"
            }
         ],
         "loyaltyProgramId":1400,
         "pointsContributed":480.0,
         "pointsContributedDate":"2020-08-10T12:21:32+05:30",
         "tillId":50021323,
         "programName":"TestOrgDefaultProgram",
         "eventName":"GroupMemberJoin",
         "eventIdentifiers":[
            {
               "key":"customerId",
               "value":"379353651"
            }
         ]
      },
      {
         "userId":379353654,
         "role":"SECONDARY",
         "firstName":"Jim",
         "identifiers":[
            {
               "type":"mobile",
               "value":"917487000000"
            },
            {
               "type":"email",
               "value":"jim.3533611763@example.com"
            }
         ],
         "loyaltyProgramId":1400,
         "pointsContributed":480.0,
         "pointsContributedDate":"2020-08-10T12:37:36+05:30",
         "tillId":50021323,
         "programName":"OrgDefaultProgram",
         "eventName":"GroupMemberJoin",
         "eventIdentifiers":[
            {
               "key":"customerId",
               "value":"379353654"
            }
         ]
      }
   ],
   "warnings":[

   ]
}

Resource Information

URI /usergroups/pointContributionHistory?identifierName={identifierName}&identifierValue={identifierValue}
Authentication Yes
HTTP Methods GET
Batch Support No

Request URL

https://{host}/v2/usergroups/pointContributionHistory?identifierName={identifierName}&identifierValue={identifierValue}

Request Query Parameters

Parameter Datatype Description
identifierName* enum Unique identifier to identifier of the primary or a secondary member of the group that you want to get. Value: mobile, email, externalId, userId.
identifierValue* string The respective identifier value. For example if the identifierName is email, then the identifierValue needs to the email ID of the primary or any of the secondary members of the group.

Get Transactions of User Group

Retrieves transactions of all members of a specific group

Sample Request

https://eu.api.capillarytech.com/v2/usergroups/1/transactions

Sample Response

{  
   "data":[  
      {  
         "attribution":{  
            "createDate":"2018-12-17T00:00:00+05:30",
            "createdBy":{  
               "id":15147364,
               "code":"hyd_2",
               "description":"",
               "name":"hyd_2",
               "type":"TILL",
               "adminType":"GENERAL",
               "isActive":true,
               "isOuEnabled":false,
               "timeZoneId":0,
               "currencyId":0,
               "languageId":0
            },
            "modifiedBy":{  

            },
            "modifiedDate":"2018-12-17"
         },
         "billDetails":{  
            "amount":6,
            "billingStore":{  
               "id":15147363,
               "code":"hyd_2",
               "description":"",
               "name":"HYD2",
               "type":"STORE",
               "adminType":"GENERAL",
               "isActive":true,
               "isOuEnabled":false,
               "timeZoneId":0,
               "currencyId":-1,
               "languageId":-1
            },
            "billNumber":"de0000049",
            "billingTime":"2018-12-17T00:00:00+05:30",
            "discount":0,
            "grossAmount":5,
            "note":"2 line items",
            "returnDetails":{  
               "canceled":false
            },
            "niReturnDetails":{  

            },
            "invalidBill":false
         },
         "customFields":{  

         },
         "addWithLocalCurrency":false,
         "customerId":28812689,
         "deliveryStatus":"DELIVERED",
         "id":33572481,
         "lineItems":[  
            {  
               "id":82713570,
               "customerId":0,
               "details":{  
                  "amount":5,
                  "description":"skip",
                  "discount":1,
                  "itemCode":"number0-1",
                  "qty":2,
                  "rate":3,
                  "serial":0,
                  "value":6,
                  "attributes":{  

                  },
                  "extendedFields":{  

                  },
                  "extendedFieldsSet":[  

                  ],
                  "discountSupportingNull":1,
                  "qtySupportingNull":2,
                  "rateSupportingNull":3,
                  "valueSupportingNull":6,
                  "attributesSet":[  

                  ]
               },
               "outlierStatus":"NORMAL",
               "returnDetails":{  

               },
               "valid":true,
               "returnLineItemsDtos":[  

               ],
               "niReturnLineItemsDtos":[  

               ],
               "addonDetails":[  

               ],
               "splitItemsDetails":[  

               ],
               "niReturn":false
            },
            {  
               "id":82713571,
               "customerId":0,
               "details":{  
                  "amount":5,
                  "description":"skip",
                  "discount":1,
                  "itemCode":"number0-2",
                  "qty":2,
                  "rate":3,
                  "serial":0,
                  "value":6,
                  "attributes":{  

                  },
                  "extendedFields":{  

                  },
                  "extendedFieldsSet":[  

                  ],
                  "discountSupportingNull":1,
                  "qtySupportingNull":2,
                  "rateSupportingNull":3,
                  "valueSupportingNull":6,
                  "attributesSet":[  

                  ]
               },
               "outlierStatus":"NORMAL",
               "returnDetails":{  

               },
               "valid":true,
               "returnLineItemsDtos":[  

               ],
               "niReturnLineItemsDtos":[  

               ],
               "addonDetails":[  

               ],
               "splitItemsDetails":[  

               ],
               "niReturn":false
            }
         ],
         "outlierStatus":"NORMAL",
         "type":"REGULAR",
         "warnings":[  

         ],
         "lifeTimePurchases":0,
         "ignorePoints":false,
         "extendedFields":{  

         },
         "returnDetails":{  
            "canceled":false
         },
         "basketSize":4,
         "customFieldsSet":[  

         ],
         "niReturnDetails":{  

         },
         "extendedFieldsSet":[  

         ]
      },
      {  
         "attribution":{  
            "createDate":"2018-12-17T00:00:00+05:30",
            "createdBy":{  
               "id":15147364,
               "code":"hyd_2",
               "description":"",
               "name":"hyd_2",
               "type":"TILL",
               "adminType":"GENERAL",
               "isActive":true,
               "isOuEnabled":false,
               "timeZoneId":0,
               "currencyId":0,
               "languageId":0
            },
            "modifiedBy":{  

            },
            "modifiedDate":"2018-12-17"
         },
         "billDetails":{  
            "amount":6,
            "billingStore":{  
               "id":15147363,
               "code":"hyd_2",
               "description":"",
               "name":"HYD2",
               "type":"STORE",
               "adminType":"GENERAL",
               "isActive":true,
               "isOuEnabled":false,
               "timeZoneId":0,
               "currencyId":-1,
               "languageId":-1
            },
            "billNumber":"de0049",
            "billingTime":"2018-12-17T00:00:00+05:30",
            "discount":0,
            "grossAmount":5,
            "note":"2 line items",
            "returnDetails":{  
               "canceled":false
            },
            "niReturnDetails":{  

            },
            "invalidBill":false
         },
         "customFields":{  

         },
         "addWithLocalCurrency":false,
         "customerId":28812689,
         "deliveryStatus":"DELIVERED",
         "id":33572483,
         "lineItems":[  
            {  
               "id":82713577,
               "customerId":0,
               "details":{  
                  "amount":5,
                  "description":"skip",
                  "discount":1,
                  "itemCode":"number0-1",
                  "qty":2,
                  "rate":3,
                  "serial":0,
                  "value":6,
                  "attributes":{  

                  },
                  "extendedFields":{  

                  },
                  "extendedFieldsSet":[  

                  ],
                  "discountSupportingNull":1,
                  "qtySupportingNull":2,
                  "rateSupportingNull":3,
                  "valueSupportingNull":6,
                  "attributesSet":[  

                  ]
               },
               "outlierStatus":"NORMAL",
               "returnDetails":{  

               },
               "valid":true,
               "returnLineItemsDtos":[  

               ],
               "niReturnLineItemsDtos":[  

               ],
               "addonDetails":[  

               ],
               "splitItemsDetails":[  

               ],
               "niReturn":false
            },
            {  
               "id":82713578,
               "customerId":0,
               "details":{  
                  "amount":5,
                  "description":"skip",
                  "discount":1,
                  "itemCode":"number0-2",
                  "qty":2,
                  "rate":3,
                  "serial":0,
                  "value":6,
                  "attributes":{  

                  },
                  "extendedFields":{  

                  },
                  "extendedFieldsSet":[  

                  ],
                  "discountSupportingNull":1,
                  "qtySupportingNull":2,
                  "rateSupportingNull":3,
                  "valueSupportingNull":6,
                  "attributesSet":[  

                  ]
               },
               "outlierStatus":"NORMAL",
               "returnDetails":{  

               },
               "valid":true,
               "returnLineItemsDtos":[  

               ],
               "niReturnLineItemsDtos":[  

               ],
               "addonDetails":[  

               ],
               "splitItemsDetails":[  

               ],
               "niReturn":false
            }
         ],
         "outlierStatus":"NORMAL",
         "type":"REGULAR",
         "warnings":[  

         ],
         "lifeTimePurchases":0,
         "ignorePoints":false,
         "extendedFields":{  

         },
         "returnDetails":{  
            "canceled":false
         },
         "basketSize":4,
         "customFieldsSet":[  

         ],
         "niReturnDetails":{  

         },
         "extendedFieldsSet":[  

         ]
      }
   ],
   "warnings":[  

   ],
   "errors":[  

   ]
}

Resource Information

URI /usergroups/{groupId}/transactions
Rate Limited? No
Authentication Yes
HTTP Methods GET
Batch Support No

Request URL

`https://{host}/v2/usergroups/{groupId}/transactions

Request Query Parameters

Parameter Datatype Description
groupId* long Unique id the user group that you want to fetch.

Response Codes

Code Description
93001 Group name cannot be empty.
93002 Invalid user id {x}.
93003 User {x} is already associated with a group. Where x is the group ID.
93004 Invalid group id {x}. Where x is the group ID.
93005 User {y} is not secondary member of the group {y}. Where y is the user ID and x is the group ID.
93006 Failed to remove the user {y} from group {x}. Where y is the user ID and x is the group ID.
93007 UserId should not be empty.
93008 Validation code should not be empty.
93009 Group Name {x} is already taken. Where x is the group ID.
93010 Group ID should not be empty.
93011 Unable to add member to the group.
93012 Group size has reached maximum limit.
93013 Invalid userId specified {y}. Where y is the user ID.
93014 User {y} is not part of the group. Where y is the user ID.
93015 Primary user cannot be changed.
93016 User group feature is disabled.

Other APIs (Org Level)

This section provides all other APIs that are not in any of the resources mentioned above.

Update Org Currency Ratio

Lets you add or update currency ratios with respect to Indian Rupee (INR).

Sample Request

https://us.api.capillarytech.com/v2/currencyratio

Sample POST Request

{ 
    "ratioInr":51, 
    "currencyCode":"SGD" 
}

Sample Response

{
   "entity":{
      "currencyCode":"SGD",
      "ratioInr":51
   },
   "errors":[

   ],
   "success":true,
   "warnings":[

   ]
}

Resource Information

URI /currencyratio
Rate Limited? No
Authentication Yes
HTTP Methods POST
Batch Support No

Request URL

https://{host}/v2/currencyratio

Request Body Parameters

Parameter Datatype Description
ratioInr double Conversion ratio with respect to INR.
currencyCode string ISO currency code that you want to update. For example EUR for Euro, SGD for Singapore Dollar, CNY for China Yuan Renminbi, SAR Saudi Riyal. For more codes, Google for ISO currency codes.

Generate External IDs

Sample Request

https://us.api.capillarytech.com/v2/cardNumber

Sample Response


{
    "entity": "1000000010",
    "warnings": []
}

This API lets you generate external ids manually which can be tagged to a customer while registering. A unique external id is generated every time you call this API. To generate external ids, the option CONF_CARD_NUMBER_GENERATION_ENABLED on InTouch > Settings > Miscellaneous> Registration Configuration page should have enabled. When a customer is registered without an external id, this API is called in the back-end and the unique external id is tagged to the customer automatically. However, it will not ove…(line truncated)…

Prerequisites

Request URL

https://{host}/v2/cardNumber

Show/Hide Extended Fields on InTouch

Sample Request

http://us.intouch.capillarytech.com/v2/entity/extended_field_config

Sample POST Request

{  
   "extendedFieldId":10,
   "hideDisplay":false,
   "mandatory":false,
   "updatable":true,
   "position":101
}

Sample Response

{  
   "extendedFieldId":10,
   "createdBy":-1,
   "modifiedBy":-11,
   "hideDisplay":false,
   "position":101,
   "createdOn":"2017-01-03 10:20:42",
   "modifiedOn":"2018-01-03 10:20:42",
   "mandatory":false,
   "updatable":true,
   "warnings":[  

   ]
}

This API lets you show or hide a specific extended field on your org’s InTouch account.

Resource Information

URI /entity/extended_field_config
Rate Limited? No
Authentication Yes
HTTP Methods POST
Batch Support No

Request URL

https://{host}/v2/entity/extended_field_config

Request Body Parameters

Attribute | Datatype | Description ——— | ———– extendedFieldId* | long | Specify the unique id of the extended field that you want to show/hide createdOn | date | Date on which the field is created in YYYY-MM-DD format. createdBy | string | Unique id of the user that created the extended field. modifiedOn | date | Date when the extended field is updated (usually the Current date) modifiedBy | date | Unique id of the user that modified the extended field. hideDisplay* | boolen | Pass true to hide the extended field on UI, false to show extended field. mandatory | boolen | Pass true to make the extended a mandatory option on the UI, false to make it an optional field. updatable | boolean | Specify true to allow updating extended field values once entered, false to disable updating extended field values position | boolean | Specify the position order of the extended field on the UI.

Retrieve Org Extended Fields

Sample Request

https://us.api.capillarytech.com/v2/extendedFields

Sample Response

{
    "entity": {
        "customer": [
            {
                "id": 7,
                "name": "gender",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-04-14",
                "label": "Gender",
                "dataType": "STANDARD_ENUM",
                "parentId": -1
            },
            {
                "id": 24,
                "name": "marital_status",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-05-19",
                "label": "Marital Status",
                "dataType": "STANDARD_ENUM",
                "parentId": -1
            },
            {
                "id": 25,
                "name": "city",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-06-13",
                "label": "City",
                "dataType": "STRING",
                "parentId": -1
            },
            {
                "id": 26,
                "name": "dob",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-06-13",
                "label": "Date of Birth",
                "dataType": "DATETIME",
                "parentId": -1
            },
            {
                "id": 27,
                "name": "ssnNumber",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-06-13",
                "label": "SSN Number",
                "dataType": "STRING",
                "parentId": -1
            },
            {
                "id": 28,
                "name": "nationality",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-06-13",
                "label": "Nationality",
                "dataType": "COUNTRY",
                "parentId": -1
            },
            {
                "id": 43,
                "name": "ethnicity",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-07-20",
                "label": "Ethnicity",
                "dataType": "STRING",
                "parentId": -1
            },
            {
                "id": 44,
                "name": "zip",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-07-20",
                "label": "Zip Code",
                "dataType": "STRING",
                "parentId": -1
            },
            {
                "id": 45,
                "name": "born_in",
                "createdBy": -1,
                "createdOn": "2017-08-22",
                "modifiedBy": -1,
                "modifiedOn": "2017-08-22",
                "label": "Birth Country",
                "dataType": "COUNTRY",
                "parentId": -1
            },
            {
                "id": 46,
                "name": "preferred_store",
                "createdBy": -1,
                "createdOn": "2017-08-22",
                "modifiedBy": -1,
                "modifiedOn": "2017-08-22",
                "label": "Preferred Store",
                "dataType": "ORG_ENTITY",
                "parentId": -1
            },
            {
                "id": 47,
                "name": "preferred_cashier",
                "createdBy": -1,
                "createdOn": "2017-08-22",
                "modifiedBy": -1,
                "modifiedOn": "2017-08-22",
                "label": "Preferred Cashier",
                "dataType": "ASSOCIATE_USER",
                "parentId": -1
            },
            {
                "id": 48,
                "name": "preferred_language",
                "createdBy": -1,
                "createdOn": "2017-08-22",
                "modifiedBy": -1,
                "modifiedOn": "2017-08-22",
                "label": "Preferred Language",
                "dataType": "LANGUAGE",
                "parentId": -1
            },
            {
                "id": 49,
                "name": "preferred_currency",
                "createdBy": -1,
                "createdOn": "2017-08-22",
                "modifiedBy": -1,
                "modifiedOn": "2017-08-22",
                "label": "Preferred Currency",
                "dataType": "CURRENCY",
                "parentId": -1
            },
            {
                "id": 52,
                "name": "profession",
                "createdBy": -1,
                "createdOn": "2017-08-22",
                "modifiedBy": -1,
                "modifiedOn": "2017-08-22",
                "label": "Profession",
                "dataType": "STRING",
                "parentId": -1
            },
            {
                "id": 53,
                "name": "religion",
                "createdBy": -1,
                "createdOn": "2017-08-22",
                "modifiedBy": -1,
                "modifiedOn": "2017-08-22",
                "label": "Religion",
                "dataType": "STRING",
                "parentId": -1
            },
            {
                "id": 54,
                "name": "wedding_date",
                "createdBy": -1,
                "createdOn": "2017-08-22",
                "modifiedBy": -1,
                "modifiedOn": "2017-08-22",
                "label": "Wedding Date",
                "dataType": "DATETIME",
                "parentId": -1
            },
            {
                "id": 60,
                "name": "country_of_residence",
                "createdBy": -1,
                "createdOn": "2017-11-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-11-14",
                "label": "Country of Residence",
                "dataType": "COUNTRY",
                "parentId": -1
            },
            {
                "id": 62,
                "name": "kid_status",
                "createdBy": -1,
                "createdOn": "2017-11-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-11-14",
                "label": " Is customer having kids",
                "dataType": "STANDARD_ENUM",
                "parentId": -1
            }
        ],
        "lineitem": [
            {
                "id": 5,
                "name": "uuid",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-04-14",
                "label": "UUID",
                "dataType": "STRING",
                "parentId": -1
            },
            {
                "id": 8,
                "name": "serial_number",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-05-19",
                "label": "Serial Number",
                "dataType": "STRING",
                "parentId": -1
            },
            {
                "id": 10,
                "name": "vat_tax_percentage",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-05-19",
                "label": "Vat Tax Percentage",
                "dataType": "DOUBLE",
                "parentId": -1
            },
            {
                "id": 11,
                "name": "vat_amount",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-05-19",
                "label": "Vat Tax Amount",
                "dataType": "DOUBLE",
                "parentId": -1
            },
            {
                "id": 12,
                "name": "service_tax_amount",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-05-19",
                "label": "Service Tax Amount",
                "dataType": "DOUBLE",
                "parentId": -1
            },
            {
                "id": 13,
                "name": "service_tax_percentage",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-05-19",
                "label": "Service Tax Percentage",
                "dataType": "DOUBLE",
                "parentId": -1
            },
            {
                "id": 37,
                "name": "CentralGST",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-06-23",
                "label": "Central GST",
                "dataType": "DOUBLE",
                "parentId": -1
            },
            {
                "id": 38,
                "name": "StateGST",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-06-23",
                "label": "State GST",
                "dataType": "DOUBLE",
                "parentId": -1
            },
            {
                "id": 39,
                "name": "IntegratedGST",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-06-23",
                "label": "Integrated GST",
                "dataType": "DOUBLE",
                "parentId": -1
            },
            {
                "id": 50,
                "name": "size",
                "createdBy": -1,
                "createdOn": "2017-08-22",
                "modifiedBy": -1,
                "modifiedOn": "2017-08-22",
                "label": "Size",
                "dataType": "STRING",
                "parentId": -1
            },
            {
                "id": 55,
                "name": "special_lineitem_type",
                "createdBy": -1,
                "createdOn": "2017-10-23",
                "modifiedBy": -1,
                "modifiedOn": "2017-10-23",
                "label": "Special LineItem Type",
                "dataType": "STANDARD_ENUM",
                "parentId": -1
            },
            {
                "id": 1,
                "name": "MetalRate",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-04-14",
                "label": "Metal Rate",
                "dataType": "DOUBLE",
                "parentId": -1
            },
            {
                "id": 2,
                "name": "MetalWeight",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-04-14",
                "label": "Metal Weight",
                "dataType": "DOUBLE",
                "parentId": -1
            },
            {
                "id": 3,
                "name": "StoneCharge",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-04-14",
                "label": "Stone Charge",
                "dataType": "DOUBLE",
                "parentId": -1
            },
            {
                "id": 4,
                "name": "MakingCharge",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-04-14",
                "label": "Making Charge",
                "dataType": "DOUBLE",
                "parentId": -1
            },
            {
                "id": 32,
                "name": "GrossWeight",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-06-23",
                "label": "Gross Weight",
                "dataType": "DOUBLE",
                "parentId": -1
            },
            {
                "id": 33,
                "name": "MetalPurity",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-06-23",
                "label": "Metal Purity",
                "dataType": "DOUBLE",
                "parentId": -1
            },
            {
                "id": 40,
                "name": "Unit",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-06-28",
                "label": "Unit",
                "dataType": "STANDARD_ENUM",
                "parentId": -1
            },
            {
                "id": 41,
                "name": "DesignCode",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-07-20",
                "label": "Design Code",
                "dataType": "STRING",
                "parentId": -1
            },
            {
                "id": 42,
                "name": "SupplierCode",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-07-20",
                "label": "Supplier Code",
                "dataType": "STRING",
                "parentId": -1
            },
            {
                "id": 9,
                "name": "imei_number",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-05-19",
                "label": "regular_transaction",
                "dataType": "STRING",
                "parentId": -1
            },
            {
                "id": 51,
                "name": "inseam",
                "createdBy": -1,
                "createdOn": "2017-08-22",
                "modifiedBy": -1,
                "modifiedOn": "2017-08-22",
                "label": "Inseam",
                "dataType": "DOUBLE",
                "parentId": -1
            }
        ],
        "transaction": [
            {
                "id": 29,
                "name": "cashier_id",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-06-13",
                "label": "Cashier Id",
                "dataType": "STRING",
                "parentId": -1
            },
            {
                "id": 34,
                "name": "CentralGST",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-06-23",
                "label": "Central GST",
                "dataType": "DOUBLE",
                "parentId": -1
            },
            {
                "id": 35,
                "name": "StateGST",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-06-23",
                "label": "State GST",
                "dataType": "DOUBLE",
                "parentId": -1
            },
            {
                "id": 36,
                "name": "IntegratedGST",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-06-23",
                "label": "Integrated GST",
                "dataType": "DOUBLE",
                "parentId": -1
            },
            {
                "id": 61,
                "name": "tax_amount",
                "createdBy": -1,
                "createdOn": "2017-11-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-11-14",
                "label": " Tax Amount",
                "dataType": "DOUBLE",
                "parentId": -1
            },
            {
                "id": 63,
                "name": "NPS",
                "createdBy": -1,
                "createdOn": "2017-11-28",
                "modifiedBy": -1,
                "modifiedOn": "2017-11-28",
                "label": "NPS",
                "dataType": "INTEGER",
                "parentId": -1
            },
            {
                "id": 30,
                "name": "GrossWeight",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-06-23",
                "label": "Gross Weight",
                "dataType": "DOUBLE",
                "parentId": -1
            },
            {
                "id": 31,
                "name": "MetalPurity",
                "createdBy": -1,
                "createdOn": "2017-04-14",
                "modifiedBy": -1,
                "modifiedOn": "2017-06-23",
                "label": "Metal Purity",
                "dataType": "DOUBLE",
                "parentId": -1
            },
            {
                "id": 56,
                "name": "booking_type",
                "createdBy": -1,
                "createdOn": "2017-10-23",
                "modifiedBy": -1,
                "modifiedOn": "2017-10-23",
                "label": "Booking Type",
                "dataType": "STANDARD_ENUM",
                "parentId": -1
            },
            {
                "id": 57,
                "name": "order_date_time",
                "createdBy": -1,
                "createdOn": "2017-10-23",
                "modifiedBy": -1,
                "modifiedOn": "2017-10-23",
                "label": "Order Time",
                "dataType": "DATETIME",
                "parentId": -1
            },
            {
                "id": 58,
                "name": "delivery_date_time",
                "createdBy": -1,
                "createdOn": "2017-10-23",
                "modifiedBy": -1,
                "modifiedOn": "2017-10-23",
                "label": "Delivery Time",
                "dataType": "DATETIME",
                "parentId": -1
            },
            {
                "id": 59,
                "name": "order_channel",
                "createdBy": -1,
                "createdOn": "2017-10-23",
                "modifiedBy": -1,
                "modifiedOn": "2017-10-23",
                "label": "Order Channel",
                "dataType": "CUSTOM_ENUM",
                "parentId": -1
            }
        ]
    },
    "warnings": [],
    "errors": [],
    "success": true
}

Retrieves the details of all extended fields configured for the organization.

Resource Information

URI /extendedFields
Authentication Yes
HTTP Method GET
Batch Support No

Additional Header

Header Description
language Specify the ISO code of a language to get extended field values in your preferred language. For example, zh for Chinese, id for Indonesian, ar for Arabic. English is the default language.

Request URL

https://{host}/v2/extendedFields

Create Store Associates

Sample Request

https://us.api.capillarytech.com/v2/orgEntity/associate

Sample POST Request

{
 "code": "01099-james",
 "name": "William James ",
 "storeId": 50007863,
 "isActive": true
}

Sample Response

{
   "createdId": 50011749,
   "warnings": [
   ]
}

Allows adding new associates to a store. Only admin users of the org can create associates.

Resource Information

URI orgEntity/associate
Authentication Yes
HTTP Method POST
Batch Support No

Request URL

https://<cluster url>v2/orgEntity/associate

Retrieve Org Loyalty Programs

Sample Request

https://us.api.capillarytech.com/v2/organization/programs

Sample Response

{
   "data": [
       {
           "programId": 1124,
           "programName": "DefaultLoyaltyProgram",
           "pointsToCurrencyRatio": 1,
           "default": true
       },
       {
           "programId": 1254,
           "programName": "SouthLoyaltyProgram",
           "pointsToCurrencyRatio": 1,
           "default": false
       }
   ],
   "warnings": [
   ],
   "errors": [
   ]
}

Retrieves all the active loyalty programs of the org.

Resource Information

URI organization/programs
Authentication Yes
HTTP Method GET
Batch Support No

Request URL

https://{host}/v2/organization/programs

Feed (Scan Event)

Sample Request

https://us.api.capillarytech.com/v2/feed?source=INSTORE

Sample POST Request

{  
   "eventName":"GetPromotion",
   "openId":"",
   "eventTime":"2018-09-28T15:26:45+05:30",
   "scanId":"scanId_571910",
   "details":"details_571910",
   "customer":{  
      "id":"293653070",
      "mobile":"917799497290",
      "email":"2245@gmail.com",
      "externalId":"ext_i9422176957"
   },
   "sku":"Levis-001",
   "promotionCode":""
}

Sample Response

{  
   "orgId":50210,
   "openId":"",
   "eventTime":"2018-09-28T15:26:45+05:30",
   "eventName":"GETPROMOTION",
   "scanId":"scanId_571910",
   "details":"details_571910",
   "source":"INSTORE",
   "accountId":"",
   "attributes":{  

   },
   "autoUpdateTime":"2018-10-03T15:44:49+05:30",
   "eventMode":0,
   "customerId":316749198,
   "sku":"Levis-001",
   "sideEffects":[  
      {  
         "id":29800985,
         "couponType":"DVS",
         "couponCode":"60XQGEHW",
         "validTill":"2018-10-31T23:59:59+05:30",
         "description":"1",
         "discountCode":"1perc",
         "discountValue":1,
         "discountType":"PERC",
         "type":"coupon",
         "trimmedCouponCode":"60XQGEHW"
      }
   ],
   "warnings":[  

   ]
}

Captures details of an events based on qrcodes ,menuclick, and getpromotion.

Resource Information

URI feed?source=INSTORE
Authentication Yes
HTTP Method POST
Batch Support No

Request URL

https://{host}/v2/feed?source=INSTORE

Request Body Parameters

Parameter Description
eventName* Pass the name of the scan event to capture - Value: GetPromotion (for scan event)
eventTime Time of the event
scanId ID of the scanned code
sku SKU of the scanned item
promotionCode The coupon code of the promotion (Place holder for future use case. Not implemented yet)
details Details of the event item
id/mobile/email/externalId* Pass any one of the customer’s unique identifier

FFC

This contains the list of APIs required to post and fetch footfall details such as visitors count, group count, heat map details and device heartbeat. The host address of FFC is different from the other v 2.0 APIs.

The following are the host addresses of different clusters:

Add FFC Details (Hourly)

Saves hourly data of visitors and staff count to the Capillary database. The data include both in count and out count.

Sample Request

https://sg.storecare.capillarytech.com/pages/ffcDetails

Sample POST Request


{
   "org_id":"781",
   "till_id":"15000323",
   "zone_id":"15000398",
   "store_id":"15001761",
   "source":"till",
   "store_server_id":null,
   "store_server_name":null,
   "till_name":"demo_till",
   "store_name":"KNIGHT_STOER_SERVER",
   "timestamp":1549564200,
   "deviceId":202481590706864,
   "counterDetails":[
      {
         "outCount":0,
         "inCount":0,
         "startDate":1549564200,
         "endDate":1549567799
      },
      {
         "outCount":0,
         "inCount":0,
         "startDate":1549567800,
         "endDate":1549571399
      },
      {
         "outCount":0,
         "inCount":0,
         "startDate":1549571400,
         "endDate":1549574999
      },
      {
         "outCount":0,
         "inCount":0,
         "startDate":1549575000,
         "endDate":1549578599
      },
      {
         "outCount":0,
         "inCount":0,
         "startDate":1549614600,
         "endDate":1549618199
      },
      {
         "outCount":0,
         "inCount":0,
         "startDate":1549618200,
         "endDate":1549621799
      },
      {
         "outCount":223,
         "inCount":222,
         "startDate":1549621800,
         "endDate":1549625399
      },
      {
         "outCount":274,
         "inCount":275,
         "startDate":1549625400,
         "endDate":1549628999
      },
      {
         "outCount":0,
         "inCount":0,
         "startDate":1549629000,
         "endDate":1549632599
      },
      {
         "outCount":0,
         "inCount":0,
         "startDate":1549632600,
         "endDate":1549636199
      },
      {
         "outCount":0,
         "inCount":0,
         "startDate":1549636200,
         "endDate":1549639799
      },
      {
         "outCount":0,
         "inCount":0,
         "startDate":1549639800,
         "endDate":1549643399
      },
      {
         "outCount":0,
         "inCount":0,
         "startDate":1549643400,
         "endDate":1549646999
      },
      {
         "outCount":0,
         "inCount":0,
         "startDate":1549647000,
         "endDate":1549650599
      }
   ]
}

Sample Response

{
   "response":{
      "status":{
         "success":true,
         "code":"200",
         "message":"Success"
      }
   }
}

Resource Information

URI /pages/ffcDetails?eventType={0/1}
Rate Limited? No
Authentication Yes
Response Formats JSON
HTTP Methods POST
Batch Support No

Request URL

https://{host}/pages/ffcDetails?eventType={0/1}

Request Body Parameters

Parameter Type Description
org_id* int Unique id of the org for which you want to add group count
till_id* int Unique id of the TILL where the device is installed
zone_id int Zone id associated to the TILL
store_id int Store id associated to the TILL
source string Source from which the Data is coming to the system. Value: till
store_server_id string Store server id if applicable
store_server_name string Name of the store server
till_name string Name of the TILL associated to the device
store_name string Name of the store in which the device is installed
timestamp* timestamp Timestamp of the device
deviceId* long Unique id of the device
outCount int Out count during the specific hour
inCount int In count during the specific hour
startDate* date-time Hourly duration of the current count (between startDate - endDate)
endDate* date-time Hourly duration of the current count (between startDate - endDate)

Get FFC Details (Hourly)

Retrieves hourly count of visitors and staff which includes both in count and out count separately.

Sample Request

https://sg.storecare.capillarytech.com/pages/ffcDetails?org_id=781&date=2019/02/12&timezone=UTC+0530&deviceId=201807070301

Sample Response

{
    "response": {
        "status": {
            "success": true,
            "code": "200",
            "message": "Success"
        },
        "get_ffc_details": {
            "applications": {
                "application": []
            },
            "store_servers": {
                "store_server": []
            },
            "thin_clients": {
                "thin_client": []
            },
            "tills": {
                "till": [
                    {
                        "deviceId": 201807070301,
                        "eventType": 0,
                        "org_id": "781",
                        "source": "till",
                        "store_id": "50013131",
                        "store_server_id": null,
                        "till_id": "50013136",
                        "zone_id": "15098817",
                        "store_name": "KoramangalaStore1",
                        "store_server_name": null,
                        "till_name": "DemoTill",
                        "counterDetails": [
                            {
                                "outCount": 0,
                                "endDate": 1549913400,
                                "inCount": 0,
                                "startDate": 1549909800
                            },
                            {
                                "outCount": 0,
                                "endDate": 1549917000,
                                "inCount": 0,
                                "startDate": 1549913400
                            },
                            {
                                "outCount": 0,
                                "endDate": 1549920600,
                                "inCount": 0,
                                "startDate": 1549917000
                            },
                            {
                                "outCount": 0,
                                "endDate": 1549924200,
                                "inCount": 0,
                                "startDate": 1549920600
                            },
                            {
                                "outCount": 0,
                                "endDate": 1549927800,
                                "inCount": 0,
                                "startDate": 1549924200
                            },
                            {
                                "outCount": 0,
                                "endDate": 1549931400,
                                "inCount": 0,
                                "startDate": 1549927800
                            },
                            {
                                "outCount": 0,
                                "endDate": 1549935000,
                                "inCount": 0,
                                "startDate": 1549931400
                            },
                            {
                                "outCount": 0,
                                "endDate": 1549938600,
                                "inCount": 0,
                                "startDate": 1549935000
                            },
                            {
                                "outCount": 0,
                                "endDate": 1549942200,
                                "inCount": 0,
                                "startDate": 1549938600
                            },
                            {
                                "outCount": 0,
                                "endDate": 1549945800,
                                "inCount": 0,
                                "startDate": 1549942200
                            },
                            {
                                "outCount": 8,
                                "endDate": 1549949400,
                                "inCount": 7,
                                "startDate": 1549945800
                            },
                            {
                                "outCount": 6,
                                "endDate": 1549953000,
                                "inCount": 5,
                                "startDate": 1549949400
                            },
                            {
                                "outCount": 5,
                                "endDate": 1549956600,
                                "inCount": 4,
                                "startDate": 1549953000
                            },

                            {
                                "outCount": 8,
                                "endDate": 1549985400,
                                "inCount": 7,
                                "startDate": 1549981800
                            },
                            {
                                "outCount": 10,
                                "endDate": 1549989000,
                                "inCount": 9,
                                "startDate": 1549985400
                            },
                            {
                                "outCount": 0,
                                "endDate": 1549992600,
                                "inCount": 0,
                                "startDate": 1549989000
                            },
                            {
                                "outCount": 0,
                                "endDate": 1549996200,
                                "inCount": 0,
                                "startDate": 1549992600
                            }
                        ],
                        "timestamp": 1549935001,
                        "auto_update_time": "2019-02-12T01:33:58.930Z"
                    }
                ]
            }
        }
    }
}

Resource Information

URI /pages/ffcDetails
Rate Limited? No
Authentication Yes
Response Formats JSON
HTTP Methods GET
Batch Support No

Request URL

https://{host}/pages/ffcDetails

Request Path Parameters

Parameter Type Description
org_id int Retrieves org level in and out count of visitors on a hourly basis
date date Retrieves hourly data of in and out count for a specific date ( YYYY/MM/DD format)
timezone string UTC timezone of the device
deviceId string Specify the device id for which you want to fetch the data

Add FFC Details V2 (Event Level)

Sample Request


https://sg.storecare.capillarytech.com/v2/add/ffcDetails?eventType=0

Sample POST Request

{
   "org_id":"781",
   "till_id":"15000375",
   "zone_id":"15000372",
   "store_id":"15001861",
   "source":"till",
   "store_server_id":null,
   "store_server_name":null,
   "till_name":"kn.003",
   "store_name":"KNIGHT_STOER_SERVER",
   "timestamp":1549883986,
   "deviceId":202481585925581,
   "counterDetails":[
      {
         "inCountTimeStamps":[
            1549712713,
            1549712717,
            1549712721,
            1549712725,
            1549712729,
            1549712733,
            1549712737,
            1549712741,
            1549712745,
            1549712749,
            1549712753,
            1549712757,
            1549712761,
            1549712765,
            1549712769,
            1549712773,
            1549712777,
            1549712781,
            1549712785,
            1549712789,
            1549712793,
            1549712797,
            1549712801,
            1549712805,
            1549712809,
            1549712813,
            1549712817,
            1549712821,
            1549712825,
            1549712829,
            1549712833,
            1549712837,
            1549712841,
            1549712845,
            1549712849,
            1549712853,
            1549712857,
            1549712861,
            1549712865,
            1549712869,
            1549712873,
            1549712877,
            1549712881,
            1549712885,
            1549712889,
            1549712893
         ],
         "outCountTimeStamps":[
            1549712715,
            1549712719,
            1549712723,
            1549712727,
            1549712731,
            1549712735,
            1549712739,
            1549712743,
            1549712747,
            1549712751,
            1549712755,
            1549712759,
            1549712763,
            1549712767,
            1549712771,
            1549712775,
            1549712779,
            1549712783,
            1549712787,
            1549712791,
            1549712795,
            1549712799,
            1549712803,
            1549712807,
            1549712811,
            1549712815,
            1549712819,
            1549712823,
            1549712827,
            1549712831,
            1549712835,
            1549712839,
            1549712843,
            1549712847,
            1549712851,
            1549712855,
            1549712859,
            1549712863,
            1549712867,
            1549712871,
            1549712875,
            1549712879,
            1549712883,
            1549712887,
            1549712891
         ],
         "outCount":45,
         "inCount":46,
         "startDate":1549712711,
         "endDate":1549713611
      }
   ]
}

Sample Response

{
   "response":{
      "status":{
         "success":true,
         "code":"200",
         "message":"Success"
      }
   }
}

Resource Information

URI v2/add/ffcDetails?eventType={0/1}
Rate Limited? No
Authentication Yes
Response Formats JSON
HTTP Methods POST
Batch Support No

Request URL

https://{host}/v2/add/ffcDetails?eventType={0/1}

Request Body Parameters

Parameter Type Description
org_id* int Unique id of the org for which you want to add group count
till_id* int Unique id of the TILL where the device is installed
zone_id int Zone id associated to the TILL
store_id int Store id associated to the TILL
source string Source from which the Data is coming to the system. Value: till
store_server_id string Store server id if applicable
store_server_name string Name of the store server
till_name string Name of the TILL associated to the device
store_name string Name of the store in which the device is installed
inCountTimeStamps* timestamp Timestamps of each in count event
outCountTimeStamps* timestamp Timestamps of each out count event
deviceId* long Unique id of the device
outCount int Total out count recorded
inCount int Total in count recorded
startDate* date-time Hourly duration of the current count (between startDate - endDate)
endDate* date-time Hourly duration of the current count (between startDate - endDate)

Get V2 FFC Details (Event Level)

Retrieves in and out count of both visitors and staff separately at event level providing more granular level details compared to v1.

Sample Request

https://sg.storecare.capillarytech.com/pages/v2/ffcDetails?orgId=781&date=2019/02/12&timezone=UTC+0530&storeId=15001861&begin=0&size=5

Sample Response

{
   "response":{
      "status":{
         "success":true,
         "code":"200",
         "message":"Success"
      },
      "get_ffc_v2_details":{
         "thin_clients":{
            "thin_client":[

            ]
         },
         "store_servers":{
            "store_server":[

            ]
         },
         "applications":{
            "application":[

            ]
         },
         "tills":{
            "till":[
               {
                  "deviceId":202481586113930,
                  "direction":1,
                  "eventTime":"2019-02-12T09:24:50.000Z",
                  "eventType":"CUSTOMER",
                  "orgId":781,
                  "source":"till",
                  "storeId":15001861,
                  "storeServerId":null,
                  "tillId":15000375,
                  "zoneId":15000372,
                  "timestamp":1549963805,
                  "tillName":"kn.003",
                  "storeServerName":null,
                  "storeName":"KNIGHT_STOER_SERVER",
                  "count":1,
                  "inCount":1,
                  "outCount":0,
                  "autoUpdateTime":"2019-02-12T09:34:24.086Z"
               },
               {
                  "deviceId":202481586113930,
                  "direction":1,
                  "eventTime":"2019-02-12T09:22:00.000Z",
                  "eventType":"CUSTOMER",
                  "orgId":781,
                  "source":"till",
                  "storeId":15001861,
                  "storeServerId":null,
                  "tillId":15000375,
                  "zoneId":15000372,
                  "timestamp":1549963805,
                  "tillName":"kn.003",
                  "storeServerName":null,
                  "storeName":"KNIGHT_STOER_SERVER",
                  "count":1,
                  "inCount":1,
                  "outCount":0,
                  "autoUpdateTime":"2019-02-12T09:34:24.082Z"
               },
               {
                  "deviceId":202481586113930,
                  "direction":1,
                  "eventTime":"2019-02-12T09:24:57.000Z",
                  "eventType":"CUSTOMER",
                  "orgId":781,
                  "source":"till",
                  "storeId":15001861,
                  "storeServerId":null,
                  "tillId":15000375,
                  "zoneId":15000372,
                  "timestamp":1549963805,
                  "tillName":"kn.003",
                  "storeServerName":null,
                  "storeName":"KNIGHT_STOER_SERVER",
                  "count":1,
                  "inCount":1,
                  "outCount":0,
                  "autoUpdateTime":"2019-02-12T09:34:24.086Z"
               },

               {
                  "deviceId":202481586113930,
                  "direction":0,
                  "eventTime":"2019-02-12T07:08:17.000Z",
                  "eventType":"CUSTOMER",
                  "orgId":781,
                  "source":"till",
                  "storeId":15001861,
                  "storeServerId":null,
                  "tillId":15000375,
                  "zoneId":15000372,
                  "timestamp":1549955703,
                  "tillName":"kn.003",
                  "storeServerName":null,
                  "storeName":"KNIGHT_STOER_SERVER",
                  "count":1,
                  "inCount":0,
                  "outCount":1,
                  "autoUpdateTime":"2019-02-12T07:19:22.088Z"
               },

               {
                  "deviceId":202481586113930,
                  "direction":0,
                  "eventTime":"2019-02-12T07:13:43.000Z",
                  "eventType":"CUSTOMER",
                  "orgId":781,
                  "source":"till",
                  "storeId":15001861,
                  "storeServerId":null,
                  "tillId":15000375,
                  "zoneId":15000372,
                  "timestamp":1549955703,
                  "tillName":"kn.003",
                  "storeServerName":null,
                  "storeName":"KNIGHT_STOER_SERVER",
                  "count":1,