Merge User Rewards

Merge the rewards of two customers

This API merges the rewards of two customers. Provide the customerId of both customers to merge reward consumption details, reward transactions, and purchased rewards.

Prerequisites

  • Authentication: Basic/OAuth authentication
  • Access group: Default access group

Resource Information

URIapi_gateway/rewards/core/v1/user-merge
HTTP MethodPOST
PaginationNo
Batch supportNA
Rate limit informationNA

API endpoint example

https://eu.api.capillarytech.com/api_gateway/rewards/core/v1/user-merge

Request body

{
    "fromUserId": 423930934,
    "toUserId": 423930935,
    "requestId": "100"
  }

Request body parameters

Parameter (Parameters marked as * are required)Data TypeDescription
fromUserId*LongUnique customer ID of the victim customer. This is the user account from which rewards and their data will be transferred.
toUserId*LongUnique customer ID of the surviving customer. This user account receives the rewards and their data data from the victim account.
requestId*StringA unique, custom ID that you can define to identify the merge. This ID can be any value of your choice and is used to track the merge status and handle errors. There is no character limit.

Response body

{
    "status": {
        "success": true,
        "code": 200,
        "message": "User merged successfully"
    }
}
{
    "status": {
        "success": false,
        "code": 8012,
        "message": "User already merged"
    }
}
{
    "status": {
        "success": false,
        "code": 400,
        "message": "toUserId can't be null.,fromUserId can't be null."
    }
}
{
    "status": {
        "success": false,
        "code": 400,
        "message": "requestId can't be null."
    }
}

Response body paramters

ParameterTypeDescription
successBooleanIndicates the success status of the merge.
true: Merge was successful.
false: Merge was unsuccessful due to an error.
codeIntegerStatus code for the merge.
messageStringStatus message for the merge.

API specific errors

Error CodeDescriptionReason
8012User already mergedUsers have already been merged. To re-attempt a merge, provide a new, unique requestId.
400requestId can't be null.requestId is not provided.
400toUserId can't be null.,fromUserId can't be null.toUserId or fromUserId are not provided.
Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!