Refresh Onboarding Link
Get a fresh hosted onboarding link for an existing Stripe Connect account. Use when the previous link expired or the user closed the tab without finishing.
POST /api/v1/creators/stripe-connect/refresh-link — 🔑 Bearer · Rate limit: 10 req / hour
Generates a fresh hosted onboarding link for the existing Stripe Connect account. Use when the previously-issued link expired (Stripe links are short-lived) or the user closed the tab mid-onboarding and you need to resume.
This is not the same as /initiate — it requires an existing account (stripeAccountId already set). If the creator hasn't started onboarding yet, call /initiate instead. Both endpoints return the same onboardingUrl shape.
Request
No body, no params. Identity comes from the bearer token.
| Header | Required | Notes |
|---|---|---|
Authorization: Bearer <accessToken> | ✓ | JWT from POST /auth/login |
Response
200 OK — ApiResponseOf<StripeConnectRefreshLinkResponseDto>
{
"success": true,
"data": {
"onboardingUrl": "https://connect.stripe.com/express/onboarding/..."
}
}| Field | Type | Notes |
|---|---|---|
onboardingUrl | string | Fresh hosted onboarding URL. Same characteristics as the link returned by /initiate — single-use, time-limited. |
Errors
| HTTP | code / i18nKey | Reason |
|---|---|---|
400 | creator.stripe.account_not_found | No stripeAccountId on the creator — call POST /creators/stripe-connect/initiate first |
401 | (guard) | Missing / invalid bearer token |
404 | creator.stripe.not_creator | No CreatorProfile for this user |
429 | (throttle) | Rate limit exceeded (10 req/hour) |
Side effects
- Lookup
CreatorProfile; thrownot_creatorif missing. - Assert
stripeAccountIdis non-null; otherwiseaccount_not_found. - Call
createAccountLink(stripeAccountId)(StripeaccountLinks.create). - Return
{ onboardingUrl }. No DB writes — this endpoint only generates a link.
Code samples
curl -X POST https://api.bio.re/api/v1/creators/stripe-connect/refresh-link \
-H "Authorization: Bearer $ACCESS_TOKEN"async function refreshOnboardingLink(accessToken: string): Promise<string> {
const res = await fetch('https://api.bio.re/api/v1/creators/stripe-connect/refresh-link', {
method: 'POST',
headers: { Authorization: `Bearer ${accessToken}` },
});
const json = await res.json();
if (!res.ok || !json.success) {
throw Object.assign(new Error(json?.error?.message ?? 'Refresh link failed'), {
code: json?.error?.code,
});
}
return json.data.onboardingUrl as string;
}import { useMutation } from '@tanstack/react-query';
export function useRefreshOnboardingLink() {
return useMutation({
mutationFn: async () => {
const res = await fetch('/api/v1/creators/stripe-connect/refresh-link', { method: 'POST' });
const json = await res.json();
if (!res.ok || !json.success) {
throw Object.assign(new Error(json?.error?.message ?? 'Refresh link failed'), {
code: json?.error?.code,
i18nKey: json?.error?.i18nKey,
});
}
return json.data.onboardingUrl as string;
},
});
}Try it
Authorization
bearer In: header
Response Body
application/json
application/json
curl -X POST "https://loading/api/v1/creators/stripe-connect/refresh-link"{
"success": true,
"data": {
"onboardingUrl": "string"
}
}{
"success": false,
"error": {
"code": "AUTH_UNAUTHORIZED",
"message": "Invalid credentials",
"i18nKey": "auth.login.invalid_credentials",
"i18nVars": {
"field": "email"
},
"details": [
{
"message": "email must be an email"
}
],
"correlationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
}Source
| Source | Path | Lines |
|---|---|---|
| Controller | apps/api-core/src/modules/creator/stripe-connect.controller.ts | 35–42 (refreshLink) |
| DTO (response) | apps/api-core/src/modules/creator/dto/stripe-connect-response.dto.ts | 40–43 (StripeConnectRefreshLinkResponseDto) |
| Service | apps/api-core/src/modules/creator/stripe-connect.service.ts | 167–178 (refreshLink), createAccountLink() (Stripe link generation) |
| Prisma model | packages/prisma/prisma/schema.prisma | CreatorProfile.stripeAccountId |
Get Stripe Connect Status
Real-time pull from the Stripe API with DB sync. Falls back to stored DB values when Stripe SDK is unavailable. Returns charges/payouts enabled flags + onboarding completion flag.
Get Dashboard Login Link
One-shot login URL for the creator's Stripe Express dashboard. Requires the account to be ACTIVE. Use to deep-link into payouts, payment methods, and settings.