client.wallet.createRefillSession
Create a Stripe refill checkout session
Signature
class Client {
wallet: {
createRefillSession(workspaceId: string, input: CreateRefillInput): Promise<RefillSession>
}
}
Parameters
| Name | Type | Required | Notes |
|---|---|---|---|
| workspaceId | | Yes | Workspace ID |
| input | | Yes | Refill parameters (amountCents, successUrl, cancelUrl) |
Throws
— workspace not foundNotFoundError
— insufficient permissionsAuthError
Examples
import { Client } from '@blueforge/client'
const bf = new Client({ apiKey: process.env.BF_API_KEY!, url: 'https://your-project.blueforge.dev' })
const { sessionUrl, sessionId } = await bf.wallet.createRefillSession('ws_abc', {
amountCents: 2000,
successUrl: 'https://app.com/wallet',
cancelUrl: 'https://app.com/wallet',
})
Pitfalls
- Redirect-based — the user must be redirected to the returned Stripe Checkout URL
See also
client.wallet.getAutoRefillclient.wallet.configureAutoRefill
Tested against
- Unit:
packages/client/src/__tests__/wallet.test.ts