put https://{host}/v2/customers/
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 method | PUT |
Pagination supported? | NA |
Rate limit | NA |
Batch support | NA |
API endpoint example
`https://eu.api.capillarytech.com/v2/customers/{userId}?{query_parameters}
Request path parameters
Parameter | Type | Description |
---|---|---|
userId* | string | Unique ID of the customer whose details need to be updated. |
Request query parameters
Parameter | Type | Description |
---|---|---|
source* | enum | 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 account |
accountId | string | Account in which you want to update the customer details. (Required only for sources with multiple accounts). |
use_async | boolean | Pass 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
Parameter | Data Type | Description |
---|---|---|
profiles | Object | Meta information of the customer |
- firstName | String | First Name of the customer. |
- lastName | String | Last Name of the customer. |
- fields | Object | Associated custom fields. |
-- gender | String | Gender of the customer. |
-- city | String | Customer's city of residence. |
- commChannels | Object | Communication channels of the customer. |
-- type | String | Type of the communication channel. Value: mobile , email , wechat , ios , android , line , mobilePush . |
-- value | String | Based 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. |
-- primary | String | Whether the current identifier of the customer (primary identifier as per the org's configuration). |
-- verified | String | Whether the current identifier is the primary identifier or not. For example, through OTP. |
-- meta | Object | Additional details of the identifier. |
loyaltyInfo | Object | Object containing the loyalty information of the customer. |
- loyaltyType | String | Loyalty status of the customer. Value: loyalty , non_loyalty . |
extendedFields | Object | 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 value. |
- gender | String | Gender of the customer. |
- city | String | Customer's city of residence. |
loyaltyProgramEnrollments | Object | Lets you enroll customers into loyalty programs. |
- programId | Integer | Unique ID of the loyalty program in which you want to enrol. You cannot update if the customer is already enrolled in the loyalty program. |
- tierNumber | Integer | Sequence 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. |
- loyaltyPoints | Integer | Loyalty points to credit in customer's account. |
- tierExpiryDate | String | Expiry date and time of the specified tier. Supported format: YYYY-MM-DDTHH:MM:SS +/- (timezone). |
- pointsExpiryDate | String | Expiry 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
Parameter | Datatype | Description |
---|---|---|
createdId | String | Unique ID of the customer whose details are updated. |
warnings | Object | Object containing the warning details, if any. |
sideEffects | Object | Object containing the information on results. |
- entityType | String | Entity affected by the API. Example: USER |
- rawAwardedPoints | Number | The raw number of points awarded |
- awardedPoints | Number | The awarded points after adjustments |
- type | String | Effect of running the API. Example: points |