Customer Portal Integration

APIs for customer-facing affiliate functionality

Redeem Affiliate Code

POST /api/v1/affiliate/portal/redeem/

Request Body

{
  "code": "AFFILIATE123",
  "customer_email": "customer@example.com",
  "customer_name": "Alice Johnson"
}

Example Response

{
  "success": true,
  "data": {
    "redemption_id": "REDEM_456789",
    "affiliate_id": 123,
    "affiliate_name": "John Smith",
    "code": "AFFILIATE123",
    "customer_email": "customer@example.com",
    "benefits": {
      "discount_percentage": 15.0,
      "loyalty_points": 500,
      "special_offers": ["free_shipping", "extended_warranty"]
    },
    "redemption_date": "2024-01-20T14:30:00Z",
    "expires_date": "2024-03-20T23:59:59Z"
  }
}

Validate Code

GET /api/v1/affiliate/portal/validate-code/{code}/

Example Response

{
  "success": true,
  "data": {
    "valid": true,
    "code": "AFFILIATE123",
    "affiliate_name": "John Smith",
    "benefits": {
      "discount_percentage": 15.0,
      "description": "Get 15% off your entire purchase"
    },
    "expires_date": "2024-12-31T23:59:59Z",
    "usage_limit": 1000,
    "usage_count": 247
  }
}