> ## Documentation Index
> Fetch the complete documentation index at: https://docs.affonso.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Affiliate

> Retrieve a single affiliate by ID with optional expanded data

## Path Parameters

<ParamField path="id" type="string" required>
  The unique identifier of the affiliate to retrieve
</ParamField>

## Query Parameters

<ParamField query="expand" type="string">
  Comma-separated list of related data to include in the response. Valid values: `promoCodes`, `commissionOverrides`, `invoiceDetails`, `payoutMethod`. You can combine multiple values: `promoCodes,payoutMethod`.
</ParamField>

## Response

The response includes the affiliate object with the following fields:

<ResponseField name="success" type="boolean">
  Always `true` for successful responses
</ResponseField>

<ResponseField name="data" type="object">
  The affiliate object.

  <Expandable title="Data Object Properties">
    <ResponseField name="id" type="string">
      Unique identifier for the affiliate
    </ResponseField>

    <ResponseField name="name" type="string">
      The affiliate's display name
    </ResponseField>

    <ResponseField name="email" type="string">
      The affiliate's email address
    </ResponseField>

    <ResponseField name="tracking_id" type="string">
      Unique tracking ID for the affiliate
    </ResponseField>

    <ResponseField name="source" type="string">
      Source of the affiliate creation (e.g., `"api"`, `"dashboard"`)
    </ResponseField>

    <ResponseField name="partnership_status" type="string | null">
      Partnership status with the program: `"PENDING"`, `"APPROVED"`, `"REJECTED"`, or `null` if no partnership exists
    </ResponseField>

    <ResponseField name="onboarding_completed" type="boolean">
      Whether the affiliate has completed their onboarding process
    </ResponseField>

    <ResponseField name="program_id" type="string">
      The affiliate program ID the affiliate is assigned to
    </ResponseField>

    <ResponseField name="group_id" type="string | null">
      The affiliate group ID if assigned, otherwise `null`
    </ResponseField>

    <ResponseField name="created_at" type="string">
      ISO 8601 timestamp of when the affiliate was created
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://api.affonso.io/v1/affiliates/cmj8pptm10002p3010z8mk9ak" \
    -H "Authorization: Bearer sk_live_your_api_key"
  ```

  ```bash cURL with Expand theme={null}
  curl -X GET "https://api.affonso.io/v1/affiliates/cmj8pptm10002p3010z8mk9ak?expand=promoCodes,commissionOverrides,invoiceDetails,payoutMethod" \
    -H "Authorization: Bearer sk_live_your_api_key"
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "id": "cmj8pptm10002p3010z8mk9ak",
      "name": "John Doe",
      "email": "john@example.com",
      "tracking_id": "PARTNER123",
      "source": "api",
      "partnership_status": "APPROVED",
      "onboarding_completed": true,
      "program_id": "cm7xutqbb0001yfkcrnpextmp",
      "group_id": "efbf3f29-efb1-4837-8924-7322606858f3",
      "created_at": "2024-01-15T10:30:00Z"
    }
  }
  ```

  ```json Response with Expand theme={null}
  {
    "success": true,
    "data": {
      "id": "cmj8pptm10002p3010z8mk9ak",
      "name": "John Doe",
      "email": "john@example.com",
      "tracking_id": "PARTNER123",
      "source": "api",
      "partnership_status": "APPROVED",
      "onboarding_completed": true,
      "program_id": "cm7xutqbb0001yfkcrnpextmp",
      "group_id": "efbf3f29-efb1-4837-8924-7322606858f3",
      "created_at": "2024-01-15T10:30:00Z",
      "promoCodes": [
        {
          "code": "JOHN25",
          "promo_code_id": null,
          "coupon_id": "coupon_123",
          "discount_type": "percentage",
          "discount_value": 25,
          "duration": "forever",
          "created_at": "2024-01-15T10:30:00Z"
        }
      ],
      "commissionOverrides": [
        {
          "id": "override_123",
          "incentive_id": "incentive_456",
          "incentive_name": "Premium Commission",
          "incentive_type": "commission",
          "amount": 15,
          "is_percentage": true,
          "apply_to": "all_plans",
          "product_ids": [],
          "approval_type": "hold_period",
          "hold_period_days": 30,
          "incentive_length": "customer_lifetime",
          "length_value": null,
          "variable_commission": false,
          "variable_config": null
        }
      ],
      "invoiceDetails": {
        "company_name": "John LLC",
        "first_name": "John",
        "last_name": "Doe",
        "address_line_1": "123 Main St",
        "address_line_2": null,
        "city": "New York",
        "postal_code": "10001",
        "state": "NY",
        "country": "US",
        "vat_id": null,
        "tax_id": null,
        "vat_validated": false,
        "vat_validated_at": null
      },
      "payoutMethod": {
        "type": "paypal",
        "details": {
          "email": "john@example.com"
        }
      }
    }
  }
  ```
</ResponseExample>
