WalletD developers
Users and balances

Set a business user's credit line (audited; API keys only)

Sets a business user's credit line, the floor below zero its cash account may go.

POST/v1/users/{userId}/credit_limit

Sets a business user's credit line, the floor below zero its cash account may go. Requires credit:write and an API key or staff session: a user token is refused forbidden (403) even with the scope, because a customer does not set their own limit. Refuses user_not_found (404), user_not_business (422) for a consumer wallet, and credit_limit_below_balance (422) when the new limit is under what the user has already drawn. Every change lands in the audit log.

Authorization

bearerAuth
AuthorizationBearer <token>

A tenant API key (sk_{env}_{id}_{secret}), a wallet user token, or an IdP access token. Which principal the credential resolves to decides the scopes it carries; see the authentication guide.

In: header

Path Parameters

userId*string
Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://example.com/v1/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/credit_limit" \  -H "Content-Type: application/json" \  -d '{    "credit_limit": 0  }'
{  "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",  "account_id": "449e7a5c-69d3-4b8a-aaaf-5c9b713ebc65",  "credit_limit": 0,  "previous": 0}