Path B — embedded integration

Embed it inside your own app

Already have a customer dashboard? Drop the kernel SDK in and let your users enroll as affiliates from inside your app — no leaving the brand. Same payout infrastructure as the standalone product.

Public docs are coming soon.

Embedded integrations are bespoke per-customer. We hand-walk you through it on a 60-min technical call and provide HMAC-signed JWT credentials, custom prefix, and a white-glove handoff.

Book a technical call

What's in the integration

Service-to-service auth

HMAC-signed JWTs. Your backend signs as a known consumer (e.g. 'newgensales'); the kernel rate-limits and scopes per consumer.

Membership-scoped enrollment

POST /kernel/affiliates/provision creates the affiliate row AND a membership scoped to your vendor_id, so they appear in your dashboard automatically.

Webhook hooks

Push your billing events (subscription.created, charge.succeeded, refund.processed) to fire commission attribution + payouts.

White-label affiliate dashboard

Embed it at affiliates.yourbrand.com via custom-domain support, or iframe specific surfaces inside your app.

Provision an affiliate

When a user clicks "become an affiliate" inside your app, your backend signs a JWT and calls the kernel. One call, two writes (affiliate row + membership row).

POST https://api.b2bprogram.com/api/v1/kernel/affiliates/provision
Authorization: Bearer <your_kernel_jwt>
Content-Type: application/json

{
  "external_id": "user_abc123",     // your PK for this user
  "email": "rep@your-saas.com",
  "name": "Alex Rep",
  "vendor_id": "<your_vendor_id>",  // makes them a member of YOUR program
  "stripe_account_id": "acct_..."   // optional: reuse Stripe Connect
}

→ 200 OK
{
  "affiliate_id": "8a3c…",
  "affiliate_code": "alex-rep-7g2k",
  "membership_id": "f1d2…",
  "external_source": "your-app",
  "external_id": "user_abc123",
  "created": true
}

Idempotent on (external_source, external_id) — re-calling returns the same affiliate row. Email collisions stamp external fields onto the existing row, so an affiliate who self-signed-up doesn't get duplicated.

Want the full integration spec?

Send us your stack and use case. We'll pair you with an engineer for a 60-min walkthrough and follow up with credentials + a per-customer integration doc.