Wallet settings
The calling key's environment's wallet settings.
the low-balance threshold.
| Operation | Method | SDK |
|---|---|---|
| Get the wallet settings | GET | hixel.walletSettings.get |
| Update the wallet settings | PATCH | hixel.walletSettings.update |
Get the wallet settings#
GET/v1/wallet_settingshixel.walletSettings.get
The environment's low-balance threshold, which wallet.balance_low uses.
Takes an environment key with the management scope, or a project key with the member role or higher, naming the environment in x-hixel-environment.
Response 200: WalletSettings
| Field | Type | Description |
|---|---|---|
environment_id required | string | The id of an environment (env_…). |
low_balance_threshold_micros required | string | null | wallet.balance_low is sent when a customer's balance falls below it, once per crossing; null, the default, sends none. |
updated_at required | string | null | null while the environment has the defaults. |
Errors
- 400
invalid_request: The request is malformed or fails validation;paramnames the field.environment_required: a project key was sent withoutx-hixel-environment.
- 401
api_key_required,invalid_api_key,expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired. - 403
key_inactive: the key was revoked or expired while the request ran, or an environment's key lost themanagementscope.management_scope_required: the environment's key does not have themanagementscope.
- 404
environment_not_found:x-hixel-environmentnames an environment outside the project key's project, an archived one, or another than the environment key's own. - 500
internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned. - 503
database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
curl "https://api.hixel.dev/v1/wallet_settings" \
-H "Authorization: Bearer $HIXEL_API_KEY"const walletSettings = await hixel.walletSettings.get();Update the wallet settings#
PATCH/v1/wallet_settingshixel.walletSettings.update
Sets the low-balance threshold: a positive amount of at most 1,000,000 USD, or null for none.
Takes an environment key with the management scope, or a project key with the admin role, naming the environment in x-hixel-environment. Accepts an Idempotency-Key header: a retry with the same key runs once.
Request body: UpdateWalletSettingsBody
| Field | Type | Description |
|---|---|---|
low_balance_threshold_micros required | string | null | A positive threshold of at most 1,000,000 USD, or null for none. |
Response 200: WalletSettings
| Field | Type | Description |
|---|---|---|
environment_id required | string | The id of an environment (env_…). |
low_balance_threshold_micros required | string | null | wallet.balance_low is sent when a customer's balance falls below it, once per crossing; null, the default, sends none. |
updated_at required | string | null | null while the environment has the defaults. |
Errors
- 400
invalid_amount: The request is malformed or fails validation;paramnames the field.invalid_idempotency_key: anIdempotency-Keyis 1 to 255 characters of visible ASCII.environment_required: a project key was sent withoutx-hixel-environment.invalid_payload,malformed_body,body_too_large: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
- 401
api_key_required,invalid_api_key,expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired. - 403
key_inactive: the key was revoked or expired while the request ran, or an environment's key lost themanagementscope.management_scope_required: the environment's key does not have themanagementscope.role_not_allowed: the project key'smemberrole does not allow this; it takesadmin.
- 404
environment_not_found:x-hixel-environmentnames an environment outside the project key's project, an archived one, or another than the environment key's own. - 409
project_archived: This project is archived.environment_archived: This environment is archived.idempotency_key_reused,idempotency_key_in_use: the key was used for another request (method, path or body), or the first request with it is still running.
- 500
internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned. - 503
database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.database_unavailable: the stored response to the key could not be read or written; retry later.
curl -X PATCH "https://api.hixel.dev/v1/wallet_settings" \
-H "Authorization: Bearer $HIXEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"low_balance_threshold_micros": "5000000"
}'const walletSettings = await hixel.walletSettings.update({
low_balance_threshold_micros: "5000000",
});