Register Affiliates (Bulk)

Add up to 100 affiliates in a single API call.

POST/api/v1/affiliates/bulk

Register multiple affiliates at once. Each affiliate is processed independently - failures for individual entries don't affect others. Maximum 100 affiliates per request.

Request body

ParameterTypeDescription
affiliatesrequired
arrayArray of affiliate objects (1-100 items).
affiliates[].emailrequired
stringEmail address of the affiliate.
affiliates[].name
stringFull name (1-200 characters).
affiliates[].referralCode
stringCustom referral code (3-50 chars, alphanumeric with hyphens/underscores).
notify
booleanSend welcome emails to all affiliates. Defaults to true.

Example request

bash
curl -X POST https://anderro.com/api/v1/affiliates/bulk \
  -H "Content-Type: application/json" \
  -H "x-api-key: sk_your_secret_key" \
  -d '{
    "affiliates": [
      { "email": "[email protected]", "name": "Alice" },
      { "email": "[email protected]", "name": "Bob", "referralCode": "bob-ref" },
      { "email": "[email protected]" }
    ],
    "notify": true
  }'

Responses

200Bulk operation completed
json
{
  "results": [
    {
      "email": "[email protected]",
      "success": true,
      "action": "created",
      "partnershipId": "cuid_aaa"
    },
    {
      "email": "[email protected]",
      "success": true,
      "action": "joined",
      "partnershipId": "cuid_bbb"
    },
    {
      "email": "[email protected]",
      "success": false,
      "error": "Already in program"
    }
  ],
  "summary": {
    "total": 3,
    "created": 1,
    "joined": 1,
    "failed": 1
  }
}

Result actions

ActionMeaning
createdNew user account created and added to your program
joinedExisting Anderro user added to your program
reactivatedPreviously removed affiliate re-added to your program

Partial success

The bulk endpoint always returns 200 even if some entries fail. Check the results array and summary to see which entries succeeded or failed.