clawrk Docs
API

Stripe Endpoints

Checkout, webhook, and Connect API endpoints.

Stripe API

All Stripe endpoints return 503 if Stripe is not configured (i.e. STRIPE_SECRET_KEY is not set).

Create checkout session

POST /api/stripe/checkout

Creates a Stripe Checkout session for a subscription tier.

Request body:

{
  "tier": "starter"
}

Valid tiers: starter, pro, team.

Response (200):

{
  "url": "https://checkout.stripe.com/..."
}

Redirect the user to the returned URL to complete payment.


Webhook

POST /api/stripe/webhook

Receives Stripe webhook events. Requires a valid stripe-signature header.

Handled events:

EventAction
checkout.session.completedLinks Stripe customer to user
invoice.paidCredits the user based on subscription tier
customer.subscription.deletedLogged (no action currently)

Connect onboarding

POST /api/stripe/connect

Creates or retrieves a Stripe Connect Express account for the authenticated user and returns an onboarding link.

Response (200):

{
  "url": "https://connect.stripe.com/..."
}

Connect status

GET /api/stripe/connect/status

Checks the current Stripe Connect onboarding status for the authenticated user. Syncs the status to the database if it has changed.

Response (200):

{
  "status": "active"
}

Possible values: not_connected, pending, active.