# Merge two members This method is used to merge two member accounts. The Secondary member account is merged with the Primary member account. Post merge, all the activities on the secondary member account are owned by the primary member. Also, if the primary member is missing member details, these details are filled in by the secondary member's details if available. Note - For 'Multi Template Summary Flag' enabled sites, the response shown below is sent to the email address provided against the mergedBy parameter. Endpoint: POST /mergeuser Version: 3.0.0 Security: ## Request fields (application/json): - `primaryUID` (string, required) Enter the primary member’s ID. The primary member survives post merge. Example: "User1@domain.com" - `secondaryUID` (string, required) Enter the secondary member's ID. The data of secondary member is deleted post merge as all the information is added to primary member. Example: "User2@domain.com" - `mergedBy` (string, required) Enter the email ID of the individual who initiated the merge. Example: "User3@domain.com" - `reason` (string) Enter the reason for which the individual wants to perform the merge operation. Example: "Duplicate records" - `secondaryUserMultitemplateId` (integer, required) Enter the secondary member multi-template ID. Note - This parameter is only required for cross-template merging. Example: 253 - `duplicateActions` (array) Enter the actions that should be retained from either the primary or secondary member when both members have performed the same action. - `duplicateActions.userIdToRetainActions` (string) Enter either the primary or secondary member's ID to retain their actions. Example: "User2@domain.com" - `duplicateActions.actionID` (integer) Enter the action ID. Note - This parameter is required only when duplicate actions are passed. Example: 102 ## Response 200 fields (application/json): - `Data` (object) Displays the following details- - `Data.siteID` (string) Displays the Annex Cloud site ID for the loyalty program. Example: "29235480" - `Data.primaryUID` (string) Displays the primary member ID. The primary member survives post merge. Example: "User1@domain.com" - `Data.secondaryUID` (string) Displays the secondary member user ID. The data of secondary member is deleted post merge as all the information is added to primary member. Example: "User2@domain.com" - `Data.id` (string) Displays the updated primary member ID. All the information of the secondary member is merged with the updated primary member. Example: "User3@domain.com" - `Data.mergedBy` (string) Displays the email address of the individual who initiated the merge. Example: "User4@domain.com" - `Data.reason` (string) Displays the reason for which the individual wanted to perform the merge operation. Example: "Duplicate records" - `Data.mergeDate` (string) Displays the date the merge occured. Example: "2022-11-30" - `Data.userDetail` (object) Displays the following details of the loyalty member- - `Data.userDetail.firstName` (string) Displays the first name of the loyalty member. Example: "John" - `Data.userDetail.lastName` (string) Displays the last name of the loyalty member. Example: "Deo" - `Data.userDetail.zipCode` (integer) Displays the zip code of the loyalty member's residence. Example: 51750 - `Data.userDetail.optInStatus` (string) Displays the opt-in status as YES for opt-in or NO for opt-out. The default opt-in status is YES. Example: "YES" - `Data.userDetail.status` (string) Displays the loyalty member’s status as active or inactive. By default, it is active and can be changed to inactive as per the client’s request. Example: "ACTIVE" - `Data.userDetail.phone` (integer) Displays the phone number of the loyalty member. Example: 8975498777 - `Data.userDetail.birthDate` (string) Displays the date of birth of the loyalty member in yyyy-MM-dd format. Example: "1989-12-11" - `Data.userDetail.anniversaryDate` (string) Displays the loyalty member's anniversary date, which can be their birthdate, the date they joined the loyalty program or marriage date in yyyy-MM-dd format. Example: "2023-12-11" - `Data.userDetail.createDate` (string) Displays the date on which the loyalty member was created in yyyy-MM-dd'T'HH:mm:ssZ format. Example: "2024-08-08T07:00:12+0000" - `Data.userDetail.updateDate` (string) Displays the date on which the loyalty member’s information was updated in yyyy-MM-dd'T'HH:mm:ssZ format. Example: "2024-08-08T07:00:12+0000" - `Data.userDetail.source` (string) Displays the source of the loyalty member's profile creation, whether it was from a website, application, or in-store. Example: "website" - `Data.userDetail.optInDate` (string) Displays the earliest opt-in date out of the two member accounts in yyyy-MM-dd'T'HH:mm:ssZ format. For example, if the primary and secondary members opted for the loyalty program on 2020-04-02 and 2020-05-02, respectively, post-merge, the earliest opt-in date would be selected, that is, 2020-04-02. Example: "2024-08-08T07:00:12+0000" - `Data.userDetail.totalSpendCurrency` (integer) Displays the total currency spent by the loyalty member. NOTE - This amount represents the user's total lifetime spend within the loyalty program. Example: 134 - `Data.userDetail.lastPurchaseDate` (string) Displays the date when the member last made a purchase. Example: "2024-11-15" - `Data.userDetail.lastActivityDate` (string) Displays the date when the member last engaged in an activity. Example: "2024-11-15" - `Data.userDetail.hierarchyData` (object) Displays the following information about the group with which the member is associated. - `Data.userDetail.hierarchyData.groupId` (string) Displays the ID of the group that the loyalty member belongs to. Example: "91" - `Data.userDetail.hierarchyData.addedOn` (string) Displays the date on which the loyalty member was added to the group in yyyy-MM-dd'T'HH:mm:ssZ format. Example: "2020-10-12T00:00:00+0000" - `Data.userDetail.hierarchyData.groupAvailablePoints` (string) Displays the total available points for the group. It is the cumulative points of the group members. Example: "500" - `Data.userDetail.raf` (object) Displays the details regarding RAF.(If applicable) - `Data.pointsDetail` (object) Displays the following details- - `Data.pointsDetail.availablePoints` (integer) Displays the available points in the loyalty member’s account. Example: 10 - `Data.pointsDetail.usedPoints` (integer) Displays the points used by the loyalty member. - `Data.pointsDetail.expiredPoints` (integer) Displays the points which have expired. - `Data.pointsDetail.lifetimePoints` (integer) Displays the lifetime points earned by the loyalty member. Example: 10 - `Data.pointsDetail.holdPoints` (integer) Displays the points on hold. - `Data.pointsDetail.pointsToExpire` (integer) Displays the points which are about to expire. Example: 10 - `Data.pointsDetail.pointsToNextTier` (integer) Displays the number of points required to achieve the next tier. This depends on the point threshold required to reach the next tier and the number of points the member currently has in their account. Example: 50 - `Data.pointsDetail.spendToNextTier` (integer) Displays the amount the member must spend to achieve the next tier. This is only applicable to tiers where the metric is spend-based. If the tier metric is points-based or based on extended attributes, it will not show any additional values. Example: 200 - `Data.pointsDetail.pointsToExpireDate` (string) Displays the next immediate expiration date of the points. Example: "2023-06-30 23:59:59" - `Data.pointsDetail.totalSpent` (integer) Displays the total amount spent by the loyalty member. Example: 50 - `Data.pointsDetail.availableRedemptionPoints` (integer) Displays the available points which can be redeemed by the loyalty member. Example: 40 - `Data.pointsDetail.usedRedemptionPoints` (integer) Displays the used redemption points by the loyalty member. Example: 60 - `Data.pointsDetail.groupDetails` (object) Displays the following information about the group with which the member is associated. - `Data.pointsDetail.groupDetails.groupId` (string) Displays the unique group ID generated during group creation. Example: "91" - `Data.pointsDetail.groupDetails.groupName` (string) Displays the name of the group to which the member belongs. Example: "Loyalty Circle" - `Data.pointsDetail.groupDetails.groupLifetimePoints` (string) Displays the total number of group points accumulated throughout its time in the loyalty program. Example: "100" - `Data.pointsDetail.groupDetails.groupUsedPoints` (string) Displays the number of points used from the group account. Example: "200" - `Data.pointsDetail.groupDetails.groupExpiredPoints` (string) Displays the number of expired points from the group account. Example: "0" ## Response 201 fields ## Response 400 fields ## Response 404 fields ## Response 405 fields