BIO.RE
Creator

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.

HeaderRequiredNotes
Authorization: Bearer <accessToken>JWT from POST /auth/login

Response

200 OKApiResponseOf<StripeConnectRefreshLinkResponseDto>

{
  "success": true,
  "data": {
    "onboardingUrl": "https://connect.stripe.com/express/onboarding/..."
  }
}
FieldTypeNotes
onboardingUrlstringFresh hosted onboarding URL. Same characteristics as the link returned by /initiate — single-use, time-limited.

Errors

HTTPcode / i18nKeyReason
400creator.stripe.account_not_foundNo stripeAccountId on the creator — call POST /creators/stripe-connect/initiate first
401(guard)Missing / invalid bearer token
404creator.stripe.not_creatorNo CreatorProfile for this user
429(throttle)Rate limit exceeded (10 req/hour)

Side effects

  1. Lookup CreatorProfile; throw not_creator if missing.
  2. Assert stripeAccountId is non-null; otherwise account_not_found.
  3. Call createAccountLink(stripeAccountId) (Stripe accountLinks.create).
  4. 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

POST
/api/v1/creators/stripe-connect/refresh-link
AuthorizationBearer <token>

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

SourcePathLines
Controllerapps/api-core/src/modules/creator/stripe-connect.controller.ts35–42 (refreshLink)
DTO (response)apps/api-core/src/modules/creator/dto/stripe-connect-response.dto.ts40–43 (StripeConnectRefreshLinkResponseDto)
Serviceapps/api-core/src/modules/creator/stripe-connect.service.ts167–178 (refreshLink), createAccountLink() (Stripe link generation)
Prisma modelpackages/prisma/prisma/schema.prismaCreatorProfile.stripeAccountId

On this page