Link Customer to Partner Program

Example request

curl --location 'https://{Host}/v2/partnerProgram/linkCustomer' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic bmF2YjZlY2I2MmEy' \
--header 'Cookie: _cfuvid=NAQ4HgB44RVb.T4FcfWZG1Jc9l3BBXFf9RtUsugH0Yc-1722221805804-0.0.1.1-604800000; _cfuvid=PAcz6g34coC.KuLpQ3zQ4jqvi8tC1CgqB2DR3x6P81Y-1758113265920-0.0.1.1-604800000' \
--data '{
  "linkCustomers": [
    {
      "customer": {
        "mobile": "9400xxxx",
        "email": "",
        "externalId": ""
      },
      "linkToPartnerPrograms": [
        {
          "partnerProgramName": "1stProgram",
          "customerPartnerReference": {
            "partnerMembershipId": "621000000",
            "partnerTierName": "1stSlab",
            "partnerTierExpiryDate": "2022-12-29T23:59:59+05:30"
          }
        },
        {
          "partnerProgramName": "NoTierPartnerProgram",
          "customerPartnerReference": {
            "partnerMembershipId": "91621000000"
          }
        },
        {
          "partnerProgramName": "2ndProgram",
          "customerPartnerReference": {
            "partnerMembershipId": "621000000",
            "partnerTierName": "1stSlab",
            "membershipStartDate":"2023-12-29T23:59:59+05:30"
          }
        }
      ]
    },
    {
      "customer": {
        "mobile": "91974xxxx",
        "email": "",
        "externalId": ""
      },
      "linkToPartnerPrograms": [
        {
          "partnerProgramName": "Apparel-Partner",
          "customerPartnerReference": {
            "partnerMembershipId": "App-919886886886",
            "partnerTierName": "Bronze",
            "partnerTierExpiryDate": "2022-12-29T23:59:59+05:30"
          }
        }
      ]
    }
  ]
}'

Prerequisites

  • Authentication: Basic or OAuth authentication.
  • Default access group

Rate limit

  • Demo and Testing Clusters: 1,000 requests per minute per API key
  • Other Organizations: The rate limit is brand-specific.

To modify the limit, create a ticket with the Capillary Product support team.

Body parameters

FieldTypeRequiredDescription
linkCustomersArrayYesSpecifies the list of customer linking requests. Multiple customers can be linked in one request.
..customerObjectYesSpecifies customer identification details. At least one identifier must be provided. Supported identifiers : externalid, mobile, email
....externalIdStringYesSpecifies the customer's external identifier. Any one identifier is required.
....mobileStringOptionalSpecifies the customer's mobile number. Any one identifier is required.
....emailStringOptionalSpecifies the customer's email address. Any one identifier is required.
..linkToPartnerProgramsArrayYesSpecifies the list of partner programs to link the customer to. Multiple programs can be linked in a single request.
....partnerProgramNameStringYesSpecifies the name of the partner program. Determines which program the customer is linked to.
....customerPartnerReferenceObjectYesSpecifies details about the customer's reference in the partner program.
......partnerMembershipIdStringYesSpecifies the customer's membership ID in the partner program.
......partnerTierNameStringOptionalSpecifies the name of the partner tier. Determines the tier assigned to the customer.
......partnerTierExpiryDateStringOptionalIndicates when a customer's specific tier status, such as Gold or Silver, is set to expire. After this date, the customer will no longer receive the benefits associated with that tier. You should use this field only if your program has different levels and you want to set a specific expiration date for a member's tier status. Example: If partnerTierExpiryDate is set to December 31, 2025, for a Gold Member like Priya, her Gold status and its associated benefits will expire on that specific date. This is the case even if her general membership in the loyalty program remains active. The supported time format is ISO 8601, and the default timezone is the server's timezone.
......membershipStartDateStringOptionalSpecifies the exact date when a customer's membership in a program starts. A customer is considered an active member and can access benefits only on or after this specified date. For instance, if Rahul's membershipStartDate is set to September 17, 2025, he becomes an active member on that day. The date must be in the ISO 8601 format, and the default timezone is the server's timezone.

Example response

{
    "linkCustomers": [
        {
            "customer": {
                "id": 56503xx04,
                "mobile": "9194xxxx",
                "email": "[email protected]",
                "status": {
                    "status": true,
                    "message": "Customer successfully retrieved",
                    "code": 1000
                }
            },
            "linkToPartnerPrograms": [
                {
                    "partnerProgramName": "1stProgram",
                    "partnerLinkStatus": {
                        "status": false,
                        "message": "partner tier expiry date should be future date or today date",
                        "code": 2003
                    }
                },
                {
                    "partnerProgramName": "NoTierPartnerProgram",
                    "partnerLinkStatus": {
                        "status": false,
                        "message": "ERR_PE_INVALID_DATA",
                        "code": 999999
                    }
                },
                {
                    "partnerProgramName": "2ndProgram",
                    "partnerLinkStatus": {
                        "status": false,
                        "message": "ERR_PARTNER_MEMBERSHIP_START_DATE",
                        "code": 999999
                    }
                }
            ]
        },
        {
            "customer": {
                "mobile": "919740390055",
                "email": "",
                "externalId": "",
                "status": {
                    "status": false,
                    "message": "Cannot find customer for provided mobile/external-id/e-mail/id",
                    "code": 1012
                }
            },
            "linkToPartnerPrograms": [
                {
                    "partnerProgramName": "Apparel-Partner"
                }
            ]
        }
    ],
    "warnings": []
}

Response parameters

FieldTypeDescription
linkCustomersArrayDefines a list of customer linking statuses.
..customerObjectSpecifies customer identification details and their status.
....idLongIndicates the customer's internal ID. Example: 565039504
....mobileStringSpecifies the customer's mobile number.
....emailStringIndicates the customer's email address.
....externalIdStringIndicates the customer's external identifier.
....statusObjectDefines the status of customer retrieval.
......statusBooleanIndicates the success or failure of the customer retrieval. Possible values: true, false
......messageStringSpecifies a message related to the customer retrieval status.
......codeIntegerIndicates a numeric code for the customer retrieval status.
..linkToPartnerProgramsArray of ObjectsSpecifies a list of partner programs and their linking statuses.
....partnerProgramNameStringDefines the name of the partner program. Example: "1stProgram", "NoTierPartnerProgram"
....partnerLinkStatusObjectIndicates the status of linking the customer to a specific partner program. This field might be absent if there's no specific linking status (e.g., if the customer wasn't found).
......statusBooleanIndicates the success or failure of the partner program linking. Possible values: true, false.
......messageStringSpecifies a message related to the partner program linking status. Example: "partner tier expiry date should be future date or today date".
......codeIntegerIndicates a numeric code for the partner program linking status.

Error codes

CodeDescription
400Invalid Request: Cannot find customer for provided mobile/external-id/e-mail/id. Verify that the mobile, externalId, email, or id provided in the customer object corresponds to an existing customer in the system and is correct.
400Invalid Request: partner tier expiry date should be future date or today date. Ensure the partnerTierExpiryDate in the customerPartnerReference object is set to a date that is either today or a future date. Past dates are not allowed for tier expiry.
400Invalid Request: ERR_PE_INVALID_DATA. This indicates invalid data within the Points Engine. Review all fields in the customerPartnerReference object for correctness, data types, and adherence to any specific constraints not explicitly mentioned.
400Invalid Request: ERR_PARTNER_MEMBERSHIP_START_DATE. Verify that the membershipStartDate in the customerPartnerReference object is a valid date and adheres to any rules regarding its relation to the current date or other dates within the system.

Language
URL
Click Try It! to start a request and see the response here!