client.wallet.configureAutoRefill
Create or update auto-refill configuration
Signature
class Client {
wallet: {
configureAutoRefill(workspaceId: string, input: ConfigureAutoRefillInput): Promise<{ config: AutoRefillConfig }>
}
}
Parameters
| Name | Type | Required | Notes |
|---|---|---|---|
| workspaceId | | Yes | Workspace ID |
| input | | Yes | Auto-refill config (triggerBalanceCents, refillAmountCents, paymentMethodId?) |
Throws
— workspace not foundNotFoundError
— invalid configValidationError
Examples
import { Client } from '@blueforge/client'
const bf = new Client({ apiKey: process.env.BF_API_KEY!, url: 'https://your-project.blueforge.dev' })
const { config } = await bf.wallet.configureAutoRefill('ws_abc', {
triggerBalanceCents: 500,
refillAmountCents: 2000,
})
Pitfalls
- Requires a saved payment method — run
first to collect onecreateRefillSession
See also
client.wallet.getAutoRefillclient.wallet.createRefillSession
Tested against
- Unit:
packages/client/src/__tests__/wallet.test.ts