Update Customer Details

Lets you update existing customer details.

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

Limitations of the customer update API -

  • Cannot update identifiers with this API
  • Cannot modify source type
  • Cannot change a loyalty customer to non-loyalty but can change a non-loyalty customer to a loyalty

Prerequisites

The following are the prerequisites for updating customer details -

  • Unique customer id of the respective customer
  • Source in which you want to modify the details
  • Account id of the specific source in which you want to modify the customer details

Header information

You can define certain attributes in the API header section and define the user context details. For more information, refer to the user context section in the Audit Details documentation.

Resource information

URI/v2/promotion/customer
HTTP methodPUT
Pagination supported?NA
Rate limitNA
Batch supportNA

API endpoint example

`https://eu.api.capillarytech.com/v2/customers/{userId}?{query_parameters}

Request path parameters

ParameterTypeDescription
userId*stringUnique ID of the customer whose details need to be updated.

Request query parameters

ParameterTypeDescription
source*enumSpecify 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 account
accountIdstringAccount in which you want to update the customer details. (Required only for sources with multiple accounts).
use_asyncbooleanPass true to run loyalty activities in the background. Hence, sideEffects are not returned in the response. Pass false to wait for loyalty activities to complete and return the side effects.

Request body parameters

ParameterData TypeDescription
profilesObjectMeta information of the customer
- firstNameStringFirst Name of the customer.
- lastNameStringLast Name of the customer.
- fieldsObjectAssociated custom fields.
-- genderStringGender of the customer.
-- cityStringCustomer's city of residence.
- commChannelsObjectCommunication channels of the customer.
-- typeStringType of the communication channel.
Value: mobile, email, wechat, ios, android, line, mobilePush.
-- valueStringBased on the channel type enter the channel value. For example, mobile number is the value for mobile. Note: For mobile numbers, add the mobile number with the country code.
-- primaryStringWhether the current identifier of the customer (primary identifier as per the org's configuration).
-- verifiedStringWhether the current identifier is the primary identifier or not. For example, through OTP.
-- metaObjectAdditional details of the identifier.
loyaltyInfoObjectObject containing the loyalty information of the customer.
- loyaltyTypeStringLoyalty status of the customer.
Value: loyalty, non_loyalty.
extendedFieldsObjectExtended 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 value.
- genderStringGender of the customer.
- cityStringCustomer's city of residence.
loyaltyProgramEnrollmentsObjectLets you enroll customers into loyalty programs.
- programIdIntegerUnique ID of the loyalty program in which you want to enrol. You cannot update if the customer is already enrolled in the loyalty program.
- tierNumberIntegerSequence number of the tier that you want to allocate to the customer. For example, 1 for the lower tier, and 2 for the next tier, and so on.
- loyaltyPointsIntegerLoyalty points to credit in customer's account.
- tierExpiryDateStringExpiry date and time of the specified tier. Supported format:
YYYY-MM-DDTHH:MM:SS +/- (timezone).
- pointsExpiryDateStringExpiry date and time of the points issued. Supported format:
YYYY-MM-DDTHH:MM:SS +/- (timezone).

curl --location --request PUT 'https://eu.api.capillarytech.com/v2/customers/171891944?source=INSTORE&use_async=false' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic dGVzdiNmY2OWZmZmRkYg==' \
--data-raw '{
    "profiles": [
        {
            "firstName": "Tom",
            "lastName": "Sawyer",
            "fields": {
                "gender": "Male",
                "city": "Bangalore"
            },
            "commChannels": [
            {
                "type": "mobile",
                "value": "9999000000",
                "primary": "true",
                "verified": "true",
                "meta": {
            "residence": "true"
          }
        },
        {
          "type": "email",
          "value": "[email protected]",
          "primary": "true",
          "verified": "true",
          "meta": {
            "residence": "true"
          }
        }
      ]
        }
    ],
    
    "loyaltyInfo": {
        "loyaltyType": "loyalty"
    },
    "extendedFields": {
        "gender": "MALE",
        "city": "Bangalore"
    },
    "loyaltyProgramEnrollments": [
    {
      "programId": 699,
      "tierNumber": 1,
      "loyaltyPoints": 0,
      "tierExpiryDate": "2024-07-11T16:36:17+05:30",
      "pointsExpiryDate": "2024-07-11T16:36:17+05:30"
    }
  ]
}'

Response parameters

ParameterDatatypeDescription
createdIdStringUnique ID of the customer whose details are updated.
warningsObjectObject containing the warning details, if any.
sideEffectsObjectObject containing the information on results.
- entityTypeStringEntity affected by the API. Example: USER
- rawAwardedPointsNumberThe raw number of points awarded
- awardedPointsNumberThe awarded points after adjustments
- typeStringEffect of running the API. Example: points
Language
URL
Click Try It! to start a request and see the response here!