Link Customer to Partner Program

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

This API links customers to external partner programs or subscription programs. You can link up to 50 customers to multiple partner programs in a single request.

What this API supports

  • Link a customer to one or more partner programs in a single request.
  • Schedule a future-dated membership relinking for supplementary programs — if the customer is already linked, setting a future membershipStartDate queues a pending relink instead of returning an error.

Example request

curl --location 'https://eu.api.capillarytech.com/v2/partnerProgram/linkCustomer' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic bmFM2YjZlY2I2MmEy' \
--data '{
    "linkCustomers": [
        {
            "customer": {
                "mobile": "919400xxxxxx"
            },
            "linkToPartnerPrograms": [
                {
                    "partnerProgramName": "Goldstar",
                    "customerPartnerReference": {
                        "partnerMembershipId": "919xxxxxxxx",
                        "partnerTierName": "Gold",
                        "partnerTierExpiryDate": "2026-12-31T23:59:59+05:30",
                        "membershipStartDate": "2025-12-23T17:55:00+05:30"
                    }
                }
            ]
        }
    ]
}'
curl --location 'https://eu.api.capillarytech.com/v2/partnerProgram/linkCustomer' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic bmFM2YjZlY2I2MmEy' \
--data '{
    "linkCustomers": [
        {
            "customer": {
                "mobile": "917800048833"
            },
            "linkToPartnerPrograms": [
                {
                    "partnerProgramName": "SPP_1",
                    "customerPartnerReference": {
                        "membershipStartDate": "2027-01-01T00:00:00+05:30"
                    }
                }
            ]
        }
    ]
}'

Prerequisites

  • Authentication: Basic or OAuth authentication
  • Default access group
  • For future-dated relinking of supplementary programs: the ALLOW_MEMBERSHIP_RELINKING configuration must be enabled for your organisation. To enable this, raise a JIRA ticket to the Capillary product support team.

Resource information

URI/v2/partnerProgram/linkCustomer
HTTP MethodPOST
Batch supportYes (up to 50 customers per request)
Rate limitNone

Body parameters

FieldTypeRequiredDescription
linkCustomersarrayYesList of customer linking requests. Maximum 50 customers per request.
.customerobjectYesCustomer identification details. At least one identifier is required.
..idintegerConditionalCustomer's internal Capillary ID. Any one identifier is required.
..mobilestringConditionalCustomer's mobile number. Any one identifier is required.
..emailstringConditionalCustomer's email address. Any one identifier is required.
..externalIdstringConditionalCustomer's external identifier. Any one identifier is required.
.linkToPartnerProgramsarrayYesList of partner programs to link the customer to.
..partnerProgramNamestringYesName of the partner program. Must match an existing partner program configured in your organization.
..customerPartnerReferenceobjectOptionalDetails about the customer's reference in the partner program.
...partnerMembershipIdstringConditionalCustomer's membership ID in the partner program. Required for a new enrollment. Not required when scheduling a future-dated relinking for a customer who is already linked (in that case, the membership ID is already on record).
...partnerTierNamestringOptionalName of the partner tier to assign to the customer. Must match an existing tier in the partner program.
...partnerTierExpiryDatestringOptionalExpiry date for the customer's tier status. Must be today or a future date. Format: ISO 8601 (e.g., 2026-12-31T23:59:59+05:30). Default timezone is the server's timezone.
...membershipStartDatestringOptionalDate when the customer's membership begins. Format: ISO 8601 (e.g., 2027-01-01T00:00:00+05:30). Must be today or a future date. If the customer is already linked to this supplementary partner program, providing a future date schedules a relinking on that date. To cancel a scheduled relinking before it activates, use the Update Customer API with updateType: MEMBERSHIP_RELINKING_CANCELLED. Requires ALLOW_MEMBERSHIP_RELINKING to be enabled for the org.

API Quick Reference

POST /v2/partnerProgram/linkCustomer
   └─ LinkPartnerProgramBatch
       └─ linkCustomers[] (array, required)
           ├─ customer (object, required)
           │   ├─ id (integer)
           │   ├─ mobile (string)
           │   ├─ email (string)
           │   └─ externalId (string)
           └─ linkToPartnerPrograms[] (array, required)
               ├─ partnerProgramName (string, required)
               └─ customerPartnerReference (object)
                   ├─ partnerMembershipId (string, required)
                   ├─ partnerTierName (string)
                   ├─ partnerTierExpiryDate (datetime)
                   └─ membershipStartDate (datetime)

Example response

{
    "linkCustomers": [
        {
            "customer": {
                "id": 565039504,
                "mobile": "919400xxxxxx",
                "email": "[email protected]",
                "externalId": "X919400xxxxxx",
                "status": {
                    "status": true,
                    "code": 1000,
                    "message": "Customer successfully retrieved"
                }
            },
            "linkToPartnerPrograms": [
                {
                    "partnerProgramName": "Goldstar",
                    "partnerLinkStatus": {
                        "status": true,
                        "code": 200,
                        "message": "Success"
                    }
                }
            ]
        }
    ],
    "warnings": []
}

Response parameters

FieldTypeDescription
linkCustomersarrayList of customer linking results.
.customerobjectCustomer identification details and retrieval status.
..idintegerCustomer's internal Capillary ID.
..mobilestringCustomer's mobile number.
..emailstringCustomer's email address.
..externalIdstringCustomer's external identifier.
..statusobjectStatus of customer retrieval.
...statusbooleantrue if customer was found, false otherwise.
...codeintegerStatus code for customer retrieval. 1000 indicates success.
...messagestringMessage describing the customer retrieval result.
.linkToPartnerProgramsarrayList of partner programs and their linking results.
..partnerProgramNamestringName of the partner program.
..partnerLinkStatusobjectStatus of linking the customer to the partner program.
...statusbooleantrue if linking succeeded, false otherwise.
...codeintegerStatus code for the linking operation. 200 indicates success.
...messagestringMessage describing the linking result.
warningsarrayList of warnings, if any.

Error codes

CodeTypeDescription
2001ErrorPartner program event failed. An internal error occurred while processing the linking request.
2002ErrorRequired field is empty or null. Ensure partnerProgramName and other required fields are provided.
2003ErrorPartner tier expiry date must be today or a future date. Past dates are not allowed for partnerTierExpiryDate.
2005ErrorCustomer not enrolled in loyalty program. The customer must be enrolled in the loyalty program before linking to a partner program.
2005ErrorPartner program already linked with customer. The customer is already linked to the specified partner program. If you are trying to schedule a future relinking, ensure membershipStartDate is after the customer's current membership end date — a date earlier than the current end date returns this error instead of queuing a relink.
2006ErrorPartner program not found. Verify that the partnerProgramName matches an existing partner program in your organization.
2007ErrorPartner program tier not found. Verify that the partnerTierName matches an existing tier in the specified partner program.
2008ErrorBatch limit exceeded. The request contains more than 50 customers. Split the request into smaller batches.
2019ErrorCustomer can only be linked to one supplementary partner program at a time, based on program settings.
2025ErrormembershipStartDate is in the past. Provide a today-or-future date when scheduling a relinking.
2026ErrorMembership relinking is not enabled for this organisation. To enable ALLOW_MEMBERSHIP_RELINKING, raise a JIRA ticket to the Capillary product support team.

Warning codes

CodeTypeDescription
1302WarningSupplementary program expiry is before membership expiry. The partner program expiry date is earlier than the customer's membership expiry.

Body Params

Request body

linkCustomers
array of objects
required
linkCustomers*
Headers
string
string
Responses

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

Language
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json