Upsert customer

This page provides you with information on Customer Upsert API.

This API allows you to update a customer or register a customer if the customer entity is not found with the provided identifiers. This is a wrapper API and uses the following APIs:

  • v2 GET customer lookup API - v2/customers/lookup/customerDetails
  • v2 customer update API - v2/customers/{userId}
  • v2 customer ADD API - v2/customers
  • v2 change identifier API - v2/{userId}/changeIdentifier

👍

For detailed information about our APIs and for hands-on testing, refer documentation in API overview and step-by-step guide on making your first API call in Make your first API call .

🚧

WARNING

Make sure that you enter the correct source details. Wrong source info can lead to data corruption and inappropriate data update or addition.

Usecase

This API enables the update of customer details, including identifiers, in a single request. For instance, if you need to update a customer's address and mobile number, you can use this API to perform both tasks instead of making multiple requests.

Prerequisites

  • Basic or OAuth credentials
  • Write access to customer access group

Resource information

API endpoint example

[https://eu.api.capillarytech.com/v2/integrations/customer/upsert/bulk?skipChangeIdentifier=false](<>)

Path parameter

ParameterTypeDescription
skipChangeIdentifierbooleanEnter False to make changes to the identifiers

Request body parameters

ParameterTypeDescription
profilesArrayArray of user profiles
- firstNameStringFirst name of the user
- lastNameStringLast name of the user
- identifiers*ArrayArray of user identifiers
-- typeStringType of identifier (e.g., "externalId")
-- valueStringValue of the identifier. Note: For mobile numbers, add the mobile number with the country code.
- commChannelsArrayArray of communication channels
-- typeStringType of communication channel (e.g., "mobile")
-- valueStringValue of the communication channel
-- primaryBooleanIndicates if the channel is primary
-- verifiedBooleanIndicates if the channel is verified
-- metaObjectMetadata related to the communication channel
--- lastViewedDateStringLast viewed date of the channel
--- residenceBooleanIndicates if the channel is for residence
--- officeBooleanIndicates if the channel is for office
- source*StringSource of the user data (e.g., "WEB_ENGAGE")
- accountId*StringUser's account ID
- extendedFieldsObjectAdditional fields with extended information
-- genderStringGender of the user

You can also update subscription info. See the below example for more details.

[{
"profiles":
[
{
"firstName": "Vishal",
"lastName": "K",
"identifiers":
[
{
"type": "externalId",
"value": "VISHKWJEJWJC2381"
},
  {
          "type": "mobile",
          "value": "916360499160"
        }
],
"commChannels": [
            {
          "type": "mobile",
          "value": "916360499160",
          "primary": true,
          "verified": true,
          "meta": {
            "lastViewedDate": "",
            "residence": true,
            "office": false
          }
        }
 ],
"source": "WEB_ENGAGE",
"accountId":"311c4dd1"
}
],"extendedFields": {
"gender":"Male"
}
}]
[
    {
        "loyaltyInfo": {
            "loyaltyType": "loyalty"
        },
        "profiles": [
            {
                "identifiers": [
                    {
                        "type": "mobile",
                        "value": "6289999999"
                    }
                ]
            }
        ],
        "statusLabel": "Active",
        "subscriptionInfo": {
            "subscriptions": [
                {
                    "channel": "ios",
                    "accountId": "~1341059D8",
                    "priority": "BULK",
                    "type": "OPTIN",
                    "sourceName": "WEB_ENGAGE"
                }
            ]
        }
    }
]

📘

Note

In addition to the parameters mentioned above, you can update any parameter that is supported by v2 customer update and v2 change customer identifier API. For more information refer to:

Response parameters

ParameterTypeDescription
responseArrayArray of responses
- resultObjectResult information
-- profilesArrayArray of user profiles
--- attributionObjectAttribution information
---- createdByObjectCreated by information
------ modifiedByObjectModified by information
--- identifiersArrayArray of user identifiers
---- statusLabelInfoObjectStatus label information
----- orgIdNumberOrganization ID of the status
---- metaObjectMetadata related to the communication channel
---- attributesObjectAdditional attributes
-- loyaltyInfoObjectLoyalty information
---- attributionV2ObjectAttribution information for loyalty
----- createdByObjectCreated by information
------ modifiedByObjectModified by information
--- cardDetailsArrayArray of card details
---- customFieldsObjectCustom fields of the card
---- statusInfoObjectStatus information of the card
----- actionsArrayActions related to the status
---- labelInfoObjectLabel information for the status
----- actionsArrayActions related to the label
----- autoUpdateTimeStringAuto-update time for the label
----- createdOnStringCreated on date for the label
---- conflictingProfileListArrayList of conflicting profiles
---- activeAndDigitalBooleanIndicates if the card is active and digital
- errorsArrayArray of errors
-- statusBooleanStatus of the error
-- codeNumberError code
-- messageStringError message
- warningsArrayArray of warnings
{
    "response": [
        {
            "entityId": 176671442,
            "result": {
                "id": 176671442,
                "profiles": [
                    {
                        "firstName": "Vishal",
                        "lastName": "K",
                        "attribution": {
                            "createDate": "2022-12-19T09:12:11Z",
                            "createdBy": {
                                "id": 75036445,
                                "code": "bukl.ind.solution",
                                "description": "",
                                "name": "Mobile App",
                                "type": "TILL"
                            },
                            "modifiedBy": {
                                "id": 75036445,
                                "code": "bukl.ind.solution",
                                "description": "",
                                "name": "Mobile App",
                                "type": "TILL"
                            },
                            "modifiedDate": "2023-11-15T06:39:05Z"
                        },
                        "fields": {},
                        "allFields": {},
                        "identifiers": [
                            {
                                "type": "externalId",
                                "value": "VISHKWJEJWJC2381"
                            },
                            {
                                "type": "cardnumber",
                                "value": "BUKL0000022598PR",
                                "statusLabelInfo": {
                                    "orgId": 100458,
                                    "type": "CARD",
                                    "internalStatus": "NOT_ISSUED",
                                    "default": false
                                },
                                "cardId": 615182
                            }
                        ],
                        "commChannels": [
                            {
                                "type": "mobile",
                                "value": "916360499160",
                                "primary": true,
                                "verified": true,
                                "meta": {
                                    "residence": true,
                                    "office": false
                                },
                                "attributes": {}
                            }
                        ],
                        "source": "WEB_ENGAGE",
                        "userId": 176671442,
                        "accountId": "311c4dd1",
                        "conflictingProfileList": [],
                        "autoUpdateTime": "2023-11-15T06:39:05Z",
                        "identifiersAll": [
                            {
                                "type": "externalId",
                                "value": "VISHKWJEJWJC2381"
                            },
                            {
                                "type": "cardnumber",
                                "value": "BUKL0000022598PR",
                                "statusLabelInfo": {
                                    "orgId": 100458,
                                    "type": "CARD",
                                    "internalStatus": "NOT_ISSUED",
                                    "default": false
                                },
                                "cardId": 615182
                            }
                        ]
                    }
                ],
                "loyaltyInfo": {
                    "loyaltyType": "loyalty",
                    "attributionV2": {
                        "createDate": "2022-12-19T09:12:12Z",
                        "createdBy": {
                            "id": 75036445,
                            "code": "bukl.ind.solution",
                            "name": "Mobile App",
                            "type": "TILL"
                        },
                        "modifiedBy": {
                            "id": 75036445,
                            "code": "bukl.ind.solution",
                            "name": "Mobile App",
                            "type": "TILL"
                        },
                        "modifiedDate": "2023-11-15T06:39:05Z",
                        "createdFromSource": "WEB_ENGAGE"
                    },
                    "lifetimePurchases": 0.000
                },
                "segments": {},
                "associatedWith": "bukl.ind.solution",
                "extendedFields": {
                    "gender": "Male"
                },
                "cardDetails": [
                    {
                        "cardId": 615182,
                        "issuedDate": "2022-12-19T09:12:12Z",
                        "createdDate": "2022-12-19",
                        "expiryDays": 365,
                        "seriesName": "BUKL Premier",
                        "customerId": 176671442,
                        "maxActiveCards": 1,
                        "customFields": {},
                        "type": "DIGITAL",
                        "cardNumber": "BUKL0000022598PR",
                        "seriesId": 46,
                        "seriesCode": "BUKLPRM",
                        "orgId": 100458,
                        "entityId": 75036445,
                        "statusInfo": {
                            "reason": "",
                            "createdBy": 75036445,
                            "actions": [],
                            "autoUpdateTime": "2022-12-19",
                            "createdOn": "2022-12-19T09:12:12Z",
                            "entityId": 615182,
                            "id": 733103,
                            "isActive": true,
                            "labelId": 24,
                            "label": "NEW CARD",
                            "status": "ACTIVE"
                        },
                        "id": 615182,
                        "activeAndDigital": true,
                        "transactionNotAllowed": true,
                        "expiryDate": "2023-12-19T00:00:00Z"
                    }
                ]
            },
            "errors": [
                {
                    "status": false,
                    "code": 3017,
                    "message": "status label invalid"
                }
            ],
            "warnings": []
        }
    ],
    "totalCount": 1,
    "failureCount": 1
}

Errors

ErrorDescription
Conflicting profile errorMake sure that the source and identifier information is correct.
Language
Authorization
Basic
base64
:
URL
Click Try It! to start a request and see the response here!