Workspace Billing

Credit Grant

Webhook callback — credit a workspace from a confirmed Stripe payment.

Called by kolens-web/app/api/stripe/webhook/route.ts after Stripe's signature verifies. Idempotent on stripe_session_id (UNIQUE) — a duplicate delivery short-circuits and returns credited=False with the current balance.

NOT api-key-gated — the Vercel webhook may not have a user session when Stripe re-delivers, so we gate purely on X-Admin-Secret.

post/api/workspaces/{slug}/billing/credit-grant

Request

  • Base URL: https://api.kolens.ai (the document declares no server; this is the origin it was published from)
  • URL: https://api.kolens.ai/api/workspaces/{slug}/billing/credit-grant
  • Auth: none declared

Path parameters

slugstring required

Headers

X-Admin-Secretstring nullable

Request body

stripe_session_idstring required
creditsnumber required
amount_centsinteger required
user_idstring nullable
receipt_urlstring nullable

Response

Successful Response

creditedboolean required
workspace_idstring required
balancenumber required
purchase_idstring nullable

Changes

No recorded changes to this operation across all 1 revision of this API.