---
title: "Affiliate"
method: GET
path: "/affiliates/{affiliate_id}"
tags: ["Affiliates"]
---

# Affiliate

`GET /affiliates/{affiliate_id}`

## Request

- Base URL: `https://api.onelence.com/v1`
- URL: `https://api.onelence.com/v1/affiliates/{affiliate_id}`
- Auth: one of:
  - OAuth 2 (authorization code, authorization URL `https://api.onelence.com/oauth/authorize`, token URL `https://api.onelence.com/oauth/token`, scopes: `analytics:read`)
  - HTTP bearer

One affiliate partner by id or referral code, with codes and its clicks and conversions (all time, or in the window passed).

## Path parameters

- `affiliate_id` string, required

## Query parameters

- `start` string
- `end` string
- `compare` 'none' | 'previous_period'

## Response `200`

Success.

- object
  - `object` 'affiliate', required
  - `id` string, required
  - `name` string, required
  - `status` string, required
  - `site_id` string, nullable, required
  - `code` string, nullable, required
  - `coupon_codes` string[], required
  - `metrics_state` 'available' | 'unavailable', required
  - `clicks` number, nullable, required
  - `conversions` number, nullable, required
  - `conversion_rate_pct` number, nullable, required
  - `created_at` string, nullable, required
  - `previous_clicks` number, nullable
  - `clicks_change_pct` number, nullable
  - `previous_conversions` number, nullable
  - `conversions_change_pct` number, nullable
  - `window` object, required
    - `start` string, nullable, required
    - `end` string, nullable, required
  - `comparison` object, nullable, required
    - `window` object, required
      - `start` string, required
      - `end` string, required

## Other responses

- `400`: Invalid input; `error.param` names the field.
- `401`: Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.
- `402`: subscription_required or upgrade_required; the error carries billing_url.
- `403`: insufficient_scope or admin_required.
- `404`: Unknown endpoint, site, source or record.
- `429`: Rate limited. Retry after Retry-After seconds.
- `500`: OneLence could not complete the request.

---

[API](https://skmtc.dev/onelence/apis/onelence-api.md) · [All operations](https://skmtc.dev/onelence/apis/onelence-api/llms.txt) · [OpenAPI document](https://skmtc.dev/onelence/apis/onelence-api/revisions/971c72fe9a42?raw)
