Add Customer

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.

You can also issue loyalty card to the customer using this API.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
❗️

Make sure you have the appropriate access control configured. For more information, see access group documentation.

Example Request

curl --location 'https://eu.api.capillarytech.com/v2/customers' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic bmVlcmFqLmRTcwNmM0YzM0YTE2ODkxZjg0ZTdi' \
--header 'Cookie: _cfuvid=jJD8ai0qoDkyBs88swzPhdWr7Zrog49xTlDBOl11Kmg-1765536308629-0.0.1.1-604800000' \
--data-raw '{
    "associatedWith": "sant.p_123",
    "profiles": [
        {
            "firstName": "NeerajDec12",
            "lastName": "Loyal",
            "identifiers": [
                {
                    "type": "mobile",
                    "value": "9986000555"
                },
                {
                    "type": "email",
                    "value": "[email protected]"
                },
                {
                    "type": "externalId",
                    "value": "test1223322"
                }
            ],
            "fields": {
                "employee": "loyal",
                "dateofbirth": "01/01/1996"
            },
            "source": "INSTORE"
             
        }
    ],
    "extendedFields": {
        "gender": "Male",
        "city": "Sattari",
        "state": "GOA",
        "area": "House no 2051,opposite  Sesa Goa  Colony,",
        "zip": "403505"
    },
    "referralCode": "xyzwqw"
}'

API Behavior

  • Updates existing customer details other than primary/secondary identifiers including custom fields and extended fields.
  • Secondary identifiers only with null values will be updated. Hence, existing identifiers cannot be updated with this API.
  • Automatically trims leading and trailing whitespace from firstName and lastName values.
  • Only the v2 Add Customer API supports automatic External ID generation during customer registration. Other methods, such as MAPP_SDK Upsert or /v1.1/customer/add, do not assign or generate External IDs. To ensure consistent External ID assignment, use this v2 API for all customer registrations.
📘

Notes

You can update secondary identifiers (mobile no./email id./external id) only if the respective config mentioned in the following are enabled on InTouch Settings > Miscellaneous > Registration Configuration.

  • CONF_ALLOW_MOBILE_UPDATE (for mobile number).
  • CONF_ALLOW_EMAIL_UPDATE (for email id).
  • CONF_LOYALTY_ALLOW_EXTERNAL_ID_UPDATE (for external id).

Extended field empty and null value validation

By default, the V2 Customer Add API rejects empty or null values in extended fields. This is controlled by the CONF_REJECT_EMPTY_OR_NULL_EF_VALUES configuration.

Strict validation (default)

When CONF_REJECT_EMPTY_OR_NULL_EF_VALUES is set to true (default), the API rejects:

  • Null values in extended fields (null, NULL "NULL","null" etc.
  • Empty strings ("")

The API won't store these fields in the customer profile and will omit them from the response.

To allow empty or null values in extended fields, set CONF_REJECT_EMPTY_OR_NULL_EF_VALUES to false. Contact Capillary Product support to modify this configuration.

When set to false, the API will accept all extended field values (including empty strings and null values) and process them according to standard extended field validation rules.

Use cases

Strict validation is recommended for:

  • Ensuring data quality and completeness
  • Preventing accidental empty value submissions
  • Maintaining consistent customer profiles

Permissive mode is useful for:

  • Data migrations where extended fields may be legitimately empty
  • Integrations with systems that don't enforce required field validation
  • Flexible data collection workflows where extended fields are optional

Header information

You can define certain attributes in the API header section and define the user context details.

Header nameDescription
SKIP-DOWNSTREAMIf set to true, the API request adds the customer record directly without notifying downstream systems such as the Loyalty Engine (EMF) or event notification services, and no side effects will be generated. This allows the API to behave like a data import, where no loyalty actions or event triggers are executed.

Body Parameters

ParameterDescription
Mobile/email/external_id/id*Pass any one of the following identifiers of the customer whose details you want to update.

Note: For external_id, the value must match the prefix and length configured in Org Settings > Registration. The API strictly enforces these rules. Only external IDs that meet the configured prefix (for example, LM*) and length (for example, 10 digits) are accepted. If the external ID does not match the required format, the request will be rejected. This ensures consistency across import and API workflows.
firstnameFirst name of the customer.
lastnameLast name of the customer.
registered_onDate on which the customer is registered. Format: YYYY-MM-DD HH:MM:SS,
Example: 2016-09-11 11:11:11
registered_tillThe TILL at which customer is registered.
associated_withTill code that you want to associate with the customer.
typePass LOYALTY to convert a non_loyalty customer to loyalty. You cannot change a loyalty customer non-loyalty (NON_LOYALTY).
custom_fieldsProvide the custom field values of the customer in name and value pairs. You can only pass custom fields that are configured for the org. For information on custom fields refer to Custom Fields Documentation.
extended_fieldsProvide the extended field details of the customer in name and value pairs. You can only pass extended fields that are configured for the org. Note: By default, empty or null values are rejected. For more information, see Extended field empty and null value validation.
subscriptionsProvide the subscription details of the customer.
priorityType of message. Value: TRANS for personalized or transaction messages, BULK for promotional messages.
channelCurrent communication channel. Value: sms<code>, </code>email.
fraud_statusUpdate the fraud status of the customer in status. Values: CONFIRMED, NONE.

Parameter marked with * is mandatory.

Response Parameters

ParameterDescription
user_idUnique ID of the customer generated by the system.
totalNumber of customers passed for registration.
success_countNumber of customers that registered successfully.
lifetime_pointsTotal loyalty points earned by the customer to date.
lifetime_purchasesTotal purchases amount (loyalty or non-loyalty transactions) of the customer across all stores of the org.
loyalty_pointsCurrent active loyalty points (neither redeemed nor expired) of the customers.
current_slabCurrent loyalty tier of the customer.
tier_expiry_dateExpiry date of the current tier in YYYY-MM-DD HH:MM:SS format.
points_summariesShows the details of the loyalty points.
programIdUnique ID of the loyalty program associated to the points summary.
redeemedIn total points earned from the program, the total number of points that are redeemed.
expiredIn total points earned from the program, the total number of points that are expired.
returnedIn total points earned from the program, the total number of points that are returned. Usually, for transaction returns.
adjustedPoints that are either credited to or debited from the customer account in adjustments. The value will be negative if debited points are more than credited, and positive if credited points are more than debited.
cumulativePurchasesTotal purchases amount of the customer in the stores associated to the current loyalty program.
currentSlabCurrent tier of the customer in the loyalty program.
nextSlabNext loyalty tier of the customer.
nextSlabSerialNumberSerial number of the next tier. Lowest tier will have 1, succeeding tier will have 2 and so on.
nextSlabDescriptionDescription of the next tier as saved in the loyalty program.
slabSNoSerial number of the current tier of the customer. Lowest tier will have 1, succeeding tier will have 2 and so on.
slabExpiryDateExpiry date of the current loyalty tier of the customer in YYYY-MM-DD HH:MM:SS.
registered_onDate on which the customer is enrolled in the org's loyalty.
updated_onRecent date on which the customer details are updated.
typeLoyalty type of the customer. LOYALTY if the customer is enrolled in the org's loyalty program, NON_LOYALTY if customer has not enrolled in the loyalty program but registered mobile number or email id with the org.
custom_fieldsCustom field details of the customer - custom field name (name<code>) and custom field value (</code>value).
extended_fieldsExtended field details of the customer - extended field name (name) and extended field value (value).
subscriptionsMobile number and email ID subscription details of the customer.
channelSubscription channel. Value: SMS, EMAIL.
priorityType of subscription. Value: TRANS<code> for transaction or personalized messages, </code>BULK for campaign or promotion messages.
status0 for unsubscribed, 1 for subscribed.
side_effectsOther activities triggered because of the customer update. For example, points rewarded to the customer for updating profile (if configured).

API specific Error Code

Error codeDescriptionReason
500All requests have failed due to errors
  • Invalid inputs passed.
    - Tried to update secondary identifier
8014Mobile number validation failedThe organization's 'Base Country' is not set, or the country configuration is missing required mobile number validation details (mobile_country_code, mobile_regex, or mobile_length_csv).
1006Mobile number validation failedThe organization's 'Base Country' is not set, or the country configuration is missing required mobile number validation details (mobile_country_code, mobile_regex, or mobile_length_csv).
8020External ID validation failedThe external ID does not match the required prefix or length as configured in Org Settings > Registration.
Query Params
boolean
Defaults to false

Pass true to get complete details of incentives such as awardOn, expiryDate, strategyIds and so on. See rawSideEffects in response for more details.

boolean
Defaults to false

Pass true to enroll a customer in all the loyalty programs available for the org. Pass false to enroll in a specific program or the default program of the till.

string
enum

Source in which the customer needs to be added.

string

Specific account ID of the source. Required for sources with multiple accounts.

Body Params
json
Headers
string
boolean

Pass true to wait for the loyalty activities to complete and then respond to the client with side effects in the API response; pass false to run Loyalty activities in the background. No side effects are returned in the API response.

boolean

Pass true to add the customer but enable loyalty events to be executed at a later point of time. The events will be pushed to queue and will be executed in near real-time.

string

If required, add entity information of the user who is adding or updating this info.

string

Enter user ID

string

Enter user source.

string

Enter user source ID.

Responses

Language
Credentials
Basic
base64
:
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json