Broker Onboarding
Brokers handle the user-facing onboarding flow: collecting bank details, KYC, tax info, anything else needed to issue payouts. The protocol surface is intentionally small. A broker exposes recipient.profile.get and returns a fresh hosted onboarding link whenever the user isn't fully ready. Our reference broker implements the back-end with Stripe Connect; the wire protocol is the same for any broker.
The broker side
When a client calls recipient.profile.get on a broker (i.e. proxied through atproto_pos with the broker's DID as the audience), the response carries a brokerView:
{broker: {did: "did:web:broker.example",status: "none" | "pending" | "needs_info"| "ready" | "restricted" | "disabled",onboardingUrl?: "https://broker.example/onboard/<token>"}}
Only ready means the user can receive payouts. For any other status, the broker should mint a short-lived hosted-onboarding URL and return it on onboardingUrl so the client can redirect.
Redirect back to the caller
The client can pass a redirectUrl parameter on recipient.profile.get. The broker embeds it in the returned onboardingUrl so the user lands back at the calling app once onboarding finishes (or is cancelled).
// Client-side: ask the broker for the user's status with a return URLconst { data } = await agent.xrpcClient.withProxy("atproto_pos", brokerDid).com.atiproto.recipient.profile.get({redirectUrl: `${window.location.origin}/payments/settings`,});if (data.broker?.status !== "ready" && data.broker?.onboardingUrl) {window.location.href = data.broker.onboardingUrl;}
Brokers without a return-URL flow can ignore the parameter; the client should still handle the case where the user completes onboarding and finds their own way back.
Driving onboarding from the broker side
When a user picks your broker in an app, the typical loop is:
- Client calls
recipient.profile.geton your broker withredirectUrl. - You return
status+onboardingUrl. If you've never seen this DID before, mint a Stripe Connect (or equivalent) account and start onboarding. - The user finishes the hosted flow and your back end gets notified (e.g. Stripe webhook). Mark the user as
ready. - The user is redirected to
redirectUrl. The calling app re-runsrecipient.profile.getand seesready.
Recommending a broker
New users start with no brokers on their DID document, so the loop above only runs after they've picked one. A recipient AppView can recommend one or more brokers (showing a curated list, a single default, etc.) but should never add an entry directly. Only the broker itself should write to the user's broker list, and it does so via com.appendBroker at the end of its hosted onboarding flow. This keeps the broker accountable for the entry on the user's DID document.
A simple discovery check: ask the PoS for the user's brokers list. An empty list means no broker is configured yet, so the AppView shows its recommendation UI and lets the user pick.
const { data } = await agent.com.atiproto.recipient.profile.get();const brokers = data.brokers ?? [];if (brokers.length === 0) {// No broker yet. Show the recommendation UI. Each "recommendation"// is just a broker DID the AppView wants to surface to the user.showBrokerPicker(["did:web:broker.example","did:web:other-broker.example",]);}// When the user picks one, send them to the broker's hosted onboarding// (the broker will append itself to the DID document on success).async function pickBroker(brokerDid: string) {const { data } = await agent.xrpcClient.withProxy("atproto_pos", brokerDid).com.atiproto.recipient.profile.get({redirectUrl: `${window.location.origin}/payments/settings`,});if (data.broker?.onboardingUrl) {window.location.href = data.broker.onboardingUrl;}}
Once the broker has appended itself to the user's DID document, the standard recipient.profile.get loop above can drive the rest of onboarding.
Status values
none: never seen this user; mint a fresh account on first sight.pending: account exists, waiting on verification.needs_info: blocked on additional info from the user. Always returns anonboardingUrl.ready: user can receive payouts.onboardingUrloptional (useful for editing details).restricted: payouts partially or temporarily disabled (e.g. KYC re-review).disabled: payouts off, account effectively dormant.
Values follow knownValues: brokers may emit additional strings for implementation-specific states, and consumers should treat unknown statuses as not-ready.
Checking other users
To check whether another user can receive payments (e.g. before showing a payment button), use repo.profile.get. The profile view's acceptingPayments flag is server-derived from the user's DID document (the mere presence of a PaymentBroker service entry is taken as readiness in v2).
const { data } = await agent.com.atiproto.repo.profile.get({did: "did:plc:creator123",});if (data.profile?.acceptingPayments) {// Show the payment button}