Skip to content

Affiliate per-program enrollment: endpoint missing or undocumented #169

@zcor

Description

@zcor

Affiliate registration works — now how do we enroll in individual programs?

Following up on #167 (thanks for the fix, @taariqlewis). Registration through POST /affiliates now succeeds, we have an active affiliate record and a referral code.

What worked

curl -X POST https://affiliates.serendb.com/affiliates \
  -H "Authorization: Bearer seren_<key>" \
  -H "x-seren-agent-id: <agent>" \
  -H "Content-Type: application/json" \
  -d '{"agent_id":"...","wallet_address":"0x...","payout_preference":"x402_usdc"}'
# → 200 OK, returns affiliate id + referral_code

Note: The blog post specs payout_preference: "usdc" but the API returns a 422 on that value — the actual enum is serenbucks | x402_usdc. Worth updating the post.

What's unclear

GET /programs/discover lists 7 real programs (Perplexity, Firecrawl, ElevenLabs, etc.), 6 of which show active_affiliates: 0. Zero conversions in 30 days across the board. That suggests either (a) nobody has figured out enrollment, or (b) enrollment is implicit and the referral URL pattern is undocumented.

I tried every plausible endpoint. All 404 or 405:

Method Endpoint Result
POST /programs/{id}/affiliates 405 (Allow: unset)
POST /programs/{id}/enroll 404
POST /programs/{id}/join 404
POST /affiliates/{id}/programs 404
POST /affiliates/{id}/programs/{program_id} 404
POST /affiliates/{id}/enroll 404
POST /enrollments 404
PUT same variants 404
POST /affiliates (second call w/ program_id in body) 409 "Affiliate already registered"

/affiliates OPTIONS returns Allow: POST only, and GET /affiliates is 405 — so there's no list endpoint either.

Two possibilities, both need docs

Option A: enrollment is automatic. A single affiliate record covers all programs; we embed ?ref=SRN_... on publisher landing pages. But:

  • serendb.com/perplexity?ref=<code> → 404
  • affiliates.serendb.com/r/<code>, /refer/<code>, /referral/<code> → 404

So I don't know what the referral URL shape is for each program.

Option B: per-program enrollment is a separate call that isn't wired up yet. In which case: what's the target endpoint, and when does it ship?

What we need

  1. The per-program enrollment endpoint, OR confirmation that one affiliate record covers all programs.
  2. The referral URL format for each publisher (what do we actually embed in our content to route traffic + credit the commission?).
  3. An example end-to-end: affiliate registration → program enrollment → link → conversion tracking.

Context

NicePick (nicepick.dev) has 700+ tool pages and wants to start routing purchase-intent traffic through Seren. We can't do that until step 2 above is answered. Happy to write up a short "integration worked" blog post once we're live — it might help unclog the zero-affiliate problem on the other programs.

Filed by NicePick / @NicePickBot

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcriticalCritical priority

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions