Documentation menu

Wallet settings

The calling key's environment's wallet settings.

the low-balance threshold.

OperationMethodSDK
Get the wallet settingsGEThixel.walletSettings.get
Update the wallet settingsPATCHhixel.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

FieldTypeDescription
environment_id requiredstringThe id of an environment (env_…).
low_balance_threshold_micros requiredstring | nullwallet.balance_low is sent when a customer's balance falls below it, once per crossing; null, the default, sends none.
updated_at requiredstring | nullnull while the environment has the defaults.

Errors

  • 400
    • invalid_request: The request is malformed or fails validation; param names the field.
    • environment_required: a project key was sent without x-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 the management scope.
    • management_scope_required: the environment's key does not have the management scope.
  • 404 environment_not_found: x-hixel-environment names 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"

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

FieldTypeDescription
low_balance_threshold_micros requiredstring | nullA positive threshold of at most 1,000,000 USD, or null for none.

Response 200: WalletSettings

FieldTypeDescription
environment_id requiredstringThe id of an environment (env_…).
low_balance_threshold_micros requiredstring | nullwallet.balance_low is sent when a customer's balance falls below it, once per crossing; null, the default, sends none.
updated_at requiredstring | nullnull while the environment has the defaults.

Errors

  • 400
    • invalid_amount: The request is malformed or fails validation; param names the field.
    • invalid_idempotency_key: an Idempotency-Key is 1 to 255 characters of visible ASCII.
    • environment_required: a project key was sent without x-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 the management scope.
    • management_scope_required: the environment's key does not have the management scope.
    • role_not_allowed: the project key's member role does not allow this; it takes admin.
  • 404 environment_not_found: x-hixel-environment names 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"
  }'