Documentation menu

Wallets

Customers' prepaid balances and their ledgers.

Every amount is an integer number of micro-USD as a decimal string. A customer's balance is purchased credit plus the grants that have not expired; requests that name the customer are paid from it when the environment's wallet policy is on.

OperationMethodSDK
Grant creditPOSThixel.wallets.grant
Credit a walletPOSThixel.wallets.credit
Get a customer's walletGEThixel.wallets.get
List a customer's ledgerGEThixel.wallets.listLedger
List walletsGEThixel.wallets.list
Get outstanding creditGEThixel.wallets.outstanding
List the environment's ledgerGEThixel.ledger.list
Summarize the ledgerGEThixel.ledger.summary

Grant credit#

POST/v1/customers/{external_id}/grantshixel.wallets.grant

Adds credit without payment, such as a plan's allowance, optionally expiring. Written to the ledger at once, then applied to the gateway's balance of the customer; the wallet's pending_credits counts the credits the gateway has not confirmed yet, which are retried until it does. A retry with the same idempotency_key answers the same entry (200); the same key with another kind, amount or expiry is credit_idempotency_key_reused.

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.

Parameters

NameInTypeDescription
external_id requiredpathstringYour id for the customer.

Request body: GrantBody

FieldTypeDescription
amount_micros requiredstringPositive micro-USD as a decimal string, at most 1,000,000 USD.
expires_atstring (date-time)When the grant's unspent credit expires; never when left out.
idempotency_key requiredstringGrants once per key, forever: a plan allowance keys on its billing period.
reasonstringWhy, in your words; kept on the ledger entry.

Response 200: LedgerEntry

FieldTypeDescription
id requiredstringThe id of a ledger entry (led_…).
organization_id requiredstringThe id of your organization (org_…).
project_id requiredstringThe id of a project (proj_…).
environment_id requiredstringThe id of an environment (env_…).
wallet_id requiredstringThe id of a customer's wallet (wal_…).
customer requiredstringYour id for the customer (its external_id), as every path takes it.
kind required"grant" | "top_up" | "auto_refill" | "usage" | "refund" | "adjustment" | …Why a ledger entry moved a wallet's balance.
amount_micros requiredstringSigned: credits are positive, usage and expiry negative.
idempotency_key requiredstring
grant_key requiredstring | nullThe grant a usage or expiry entry draws from (its idempotency key).
grant_entry_id requiredstring | null
expires_at requiredstring | nullA grant's expiry; null for one that never expires.
usage_event_id requiredstring | null
reason requiredstring | null
actor requiredobject
actor.user_id requiredstring | nullnull for a key or for the platform itself.
actor.label requiredstringAn email address, a key id, or hixel:usage.
created_at requiredstring (date-time)

Errors

  • 400
    • invalid_amount, invalid_expiry, invalid_parameter: 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_params, 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
    • customer_not_found: The resource does not exist in the key's environment; a resource outside it reads the same.
    • 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.
    • credit_idempotency_key_reused: This idempotency_key already credited this wallet with another kind, amount or expiry. Use a new key for a new credit.
    • 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 POST "https://api.hixel.dev/v1/customers/org_42/grants" \
  -H "Authorization: Bearer $HIXEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount_micros": "5000000",
    "idempotency_key": "plan:org_42:2026-11"
  }'

Credit a wallet#

POST/v1/customers/{external_id}/creditshixel.wallets.credit

A manual top-up, an adjustment or a refund. Written to the ledger at once, then applied to the gateway's balance of the customer; the wallet's pending_credits counts the credits the gateway has not confirmed yet, which are retried until it does. A retry with the same idempotency_key answers the same entry (200); the same key with another kind, amount or expiry is credit_idempotency_key_reused.

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.

Parameters

NameInTypeDescription
external_id requiredpathstringYour id for the customer.

Request body: CreditBody

FieldTypeDescription
kind required"top_up" | "adjustment" | "refund"top_up (positive), adjustment (either sign) or refund (positive returns purchased credit, negative takes it back). A top-up paid through Stripe Checkout is credited by the platform itself.
amount_micros requiredstringMicro-USD as a decimal string: positive for a top-up, signed for an adjustment or refund.
idempotency_key requiredstringCredits once per key, forever: 1 to 200 characters of visible ASCII, not starting with usage:, expiry: or stripe:.
reasonstringWhy, in your words; kept on the ledger entry.

Response 200: LedgerEntry

FieldTypeDescription
id requiredstringThe id of a ledger entry (led_…).
organization_id requiredstringThe id of your organization (org_…).
project_id requiredstringThe id of a project (proj_…).
environment_id requiredstringThe id of an environment (env_…).
wallet_id requiredstringThe id of a customer's wallet (wal_…).
customer requiredstringYour id for the customer (its external_id), as every path takes it.
kind required"grant" | "top_up" | "auto_refill" | "usage" | "refund" | "adjustment" | …Why a ledger entry moved a wallet's balance.
amount_micros requiredstringSigned: credits are positive, usage and expiry negative.
idempotency_key requiredstring
grant_key requiredstring | nullThe grant a usage or expiry entry draws from (its idempotency key).
grant_entry_id requiredstring | null
expires_at requiredstring | nullA grant's expiry; null for one that never expires.
usage_event_id requiredstring | null
reason requiredstring | null
actor requiredobject
actor.user_id requiredstring | nullnull for a key or for the platform itself.
actor.label requiredstringAn email address, a key id, or hixel:usage.
created_at requiredstring (date-time)

Errors

  • 400
    • invalid_amount, invalid_expiry, invalid_parameter: 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_params, 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
    • customer_not_found: The resource does not exist in the key's environment; a resource outside it reads the same.
    • 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.
    • credit_idempotency_key_reused: This idempotency_key already credited this wallet with another kind, amount or expiry. Use a new key for a new credit.
    • 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 POST "https://api.hixel.dev/v1/customers/org_42/credits" \
  -H "Authorization: Bearer $HIXEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "kind": "top_up",
    "amount_micros": "5000000",
    "idempotency_key": "plan:org_42:2026-11"
  }'

Get a customer's wallet#

GET/v1/customers/{external_id}/wallethixel.wallets.get

The customer's balance, grants and the gateway's live view of them; customer_not_found when the environment has no customer by this id. A customer without a ledger entry has a zero balance and wallet_id null.

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.

Parameters

NameInTypeDescription
external_id requiredpathstringYour id for the customer.

Response 200: Wallet

FieldTypeDescription
customer requiredstringYour id for the customer (its external_id), as every path takes it.
wallet_id requiredstring | nullnull until the first entry.
balance requiredobjectAs the ledger sums it, unexpired grants only: purchased credit plus grants.
balance.purchased_micros requiredstringAn amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number.
balance.grants_micros requiredstringAn amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number.
balance.total_micros requiredstringAn amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number.
grants requiredarray of objectThe grants with credit left, soonest expiry first.
grants[].entry_id requiredstringThe id of a ledger entry (led_…).
grants[].key requiredstringThe grant's idempotency key.
grants[].amount_micros requiredstringAn amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number.
grants[].remaining_micros requiredstringAn amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number.
grants[].expires_at requiredstring | null
pending_credits requiredintegerCredits the gateway has not confirmed yet.
rejected_credits requiredintegerCredits the gateway refused for good: in the ledger, not in the balance the gateway holds.
live requiredobjectThe gateway's live view of the balance, or unavailable when it could not be read just now.
live.status required"available"
live.balance requiredobject
live.balance.purchased_micros requiredstringAn amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number.
live.balance.grants_micros requiredstringAn amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number.
live.balance.total_micros requiredstringAn amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number.
live.reserved_micros requiredstringHeld by requests still running.
live.available_micros requiredstringThe balance minus what running requests hold: what a new request may spend.
live.spend requiredobjectSettled spend in each current window (UTC; weeks start on Monday).
live.spend.day_micros requiredstringAn amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number.
live.spend.week_micros requiredstringAn amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number.
live.spend.month_micros requiredstringAn amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number.
live.spend.total_micros requiredstringAn amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number.

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.
    • invalid_params: 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.
  • 404
    • customer_not_found: The resource does not exist in the key's environment; a resource outside it reads the same.
    • 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/customers/org_42/wallet" \
  -H "Authorization: Bearer $HIXEL_API_KEY"

List a customer's ledger#

GET/v1/customers/{external_id}/ledgerhixel.wallets.listLedger

A page of the customer's ledger entries, newest first.

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.

Parameters

NameInTypeDescription
external_id requiredpathstringYour id for the customer.
cursorquerystringThe next_cursor of the previous page, to read the next one; left out for the first page. Pass the same filters with it.
limitqueryintegerHow many items the page holds: an integer from 1 to 100; 50 when left out.

Response 200: LedgerEntryList

FieldTypeDescription
data requiredarray of LedgerEntry
data[].id requiredstringThe id of a ledger entry (led_…).
data[].organization_id requiredstringThe id of your organization (org_…).
data[].project_id requiredstringThe id of a project (proj_…).
data[].environment_id requiredstringThe id of an environment (env_…).
data[].wallet_id requiredstringThe id of a customer's wallet (wal_…).
data[].customer requiredstringYour id for the customer (its external_id), as every path takes it.
data[].kind required"grant" | "top_up" | "auto_refill" | "usage" | "refund" | "adjustment" | …Why a ledger entry moved a wallet's balance.
data[].amount_micros requiredstringSigned: credits are positive, usage and expiry negative.
data[].idempotency_key requiredstring
data[].grant_key requiredstring | nullThe grant a usage or expiry entry draws from (its idempotency key).
data[].grant_entry_id requiredstring | null
data[].expires_at requiredstring | nullA grant's expiry; null for one that never expires.
data[].usage_event_id requiredstring | null
data[].reason requiredstring | null
data[].actor requiredobject
data[].actor.user_id requiredstring | nullnull for a key or for the platform itself.
data[].actor.label requiredstringAn email address, a key id, or hixel:usage.
data[].created_at requiredstring (date-time)
next_cursor requiredstring | nullPass back as cursor for the next page; null on the last page.

Errors

  • 400
    • invalid_request: The request is malformed or fails validation; param names the field.
    • invalid_cursor: The cursor is not one this list gave.
    • environment_required: a project key was sent without x-hixel-environment.
    • invalid_params, invalid_query: 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.
  • 404
    • customer_not_found: The resource does not exist in the key's environment; a resource outside it reads the same.
    • 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/customers/org_42/ledger" \
  -H "Authorization: Bearer $HIXEL_API_KEY"

List wallets#

GET/v1/walletshixel.wallets.list

A page of the environment's wallets (customers with a ledger entry), by balance. Balances move while usage is recorded, so a wallet whose balance crosses the page boundary between two calls may be listed twice or skipped.

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.

Parameters

NameInTypeDescription
sortquery"balance_asc" | "balance_desc"By total balance: balance_asc (the default) or balance_desc.
balance_alertqueryarray of "none" | "low" | "depleted"Only wallets in one of these states, given once or several times: none, low (below the environment's threshold) or depleted (at or below zero).
customerqueryarray of stringOnly these customers' wallets, by your ids for them, given once or up to 100 times. A customer without a wallet is not listed.
cursorquerystringThe next_cursor of the previous page, to read the next one; left out for the first page. Pass the same filters with it.
limitqueryintegerHow many items the page holds: an integer from 1 to 100; 50 when left out.

Response 200: WalletList

FieldTypeDescription
data requiredarray of WalletSummary
data[].id requiredstringThe id of a customer's wallet (wal_…).
data[].customer requiredstringYour id for the customer (its external_id), as every path takes it.
data[].customer_name requiredstring | nullThe customer's name; null when you never named it.
data[].balance requiredobject
data[].balance.purchased_micros requiredstringAn amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number.
data[].balance.grants_micros requiredstringAn amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number.
data[].balance.total_micros requiredstringAn amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number.
data[].balance_alert required"none" | "low" | "depleted"Which low-balance webhook a wallet last sent: none while its balance is at or above the environment's threshold, low once wallet.balance_low was sent, depleted once wallet.depleted was.
data[].last_activity_at requiredstring (date-time)When the wallet's latest ledger entry was written.
data[].created_at requiredstring (date-time)
next_cursor requiredstring | nullPass back as cursor for the next page; null on the last page.

Errors

  • 400
    • invalid_parameter: The request is malformed or fails validation; param names the field.
    • invalid_cursor: The cursor is not one this list gave.
    • environment_required: a project key was sent without x-hixel-environment.
    • invalid_query: 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.
  • 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/wallets" \
  -H "Authorization: Bearer $HIXEL_API_KEY"

Get outstanding credit#

GET/v1/wallets/outstandinghixel.wallets.outstanding

The credit the environment's customers hold now, summed over every wallet as each wallet's balance is defined: purchased credit and grants, how many wallets are low or depleted, and how many credits the gateway has not confirmed.

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: OutstandingCredit

FieldTypeDescription
environment_id requiredstringThe id of an environment (env_…).
balance requiredobject
balance.purchased_micros requiredstringAn amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number.
balance.grants_micros requiredstringAn amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number.
balance.total_micros requiredstringAn amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number.
wallets requiredinteger
low_wallets requiredinteger
depleted_wallets requiredinteger
pending_credits requiredinteger
rejected_credits requiredinteger
as_of requiredstring (date-time)

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/wallets/outstanding" \
  -H "Authorization: Bearer $HIXEL_API_KEY"

List the environment's ledger#

GET/v1/ledgerhixel.ledger.list

A page of the ledger across the environment's customers, newest first. customer_not_found when customer names no customer of the environment.

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.

Parameters

NameInTypeDescription
kindqueryarray of "grant" | "top_up" | "auto_refill" | "usage" | "refund" | "adjustment" | …Only entries of these kinds, given once or several times.
customerquerystringOnly this customer's entries, by your id for it.
fromquerystring (date-time)Only entries written at or after this instant.
toquerystring (date-time)Only entries written before this instant.
cursorquerystringThe next_cursor of the previous page, to read the next one; left out for the first page. Pass the same filters with it.
limitqueryintegerHow many items the page holds: an integer from 1 to 100; 50 when left out.

Response 200: EnvironmentLedgerEntryList

FieldTypeDescription
data requiredarray of EnvironmentLedgerEntry
data[].id requiredstringThe id of a ledger entry (led_…).
data[].organization_id requiredstringThe id of your organization (org_…).
data[].project_id requiredstringThe id of a project (proj_…).
data[].environment_id requiredstringThe id of an environment (env_…).
data[].wallet_id requiredstringThe id of a customer's wallet (wal_…).
data[].customer requiredstringYour id for the customer (its external_id), as every path takes it.
data[].kind required"grant" | "top_up" | "auto_refill" | "usage" | "refund" | "adjustment" | …Why a ledger entry moved a wallet's balance.
data[].amount_micros requiredstringSigned: credits are positive, usage and expiry negative.
data[].idempotency_key requiredstring
data[].grant_key requiredstring | nullThe grant a usage or expiry entry draws from (its idempotency key).
data[].grant_entry_id requiredstring | null
data[].expires_at requiredstring | nullA grant's expiry; null for one that never expires.
data[].usage_event_id requiredstring | null
data[].reason requiredstring | null
data[].actor requiredobject
data[].actor.user_id requiredstring | nullnull for a key or for the platform itself.
data[].actor.label requiredstringAn email address, a key id, or hixel:usage.
data[].created_at requiredstring (date-time)
data[].customer_name requiredstring | nullThe customer's name; null when you never named it.
next_cursor requiredstring | nullPass back as cursor for the next page; null on the last page.

Errors

  • 400
    • invalid_request: The request is malformed or fails validation; param names the field.
    • invalid_cursor: The cursor is not one this list gave.
    • invalid_range: from must be before to, and a summary covers at most 92 days.
    • environment_required: a project key was sent without x-hixel-environment.
    • invalid_query: 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.
  • 404
    • customer_not_found: The resource does not exist in the key's environment; a resource outside it reads the same.
    • 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/ledger" \
  -H "Authorization: Bearer $HIXEL_API_KEY"

Summarize the ledger#

GET/v1/ledger/summaryhixel.ledger.summary

The environment's ledger by UTC day and kind over the range, at most 92 days.

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.

Parameters

NameInTypeDescription
from requiredquerystring (date-time)The start of the range, inclusive.
to requiredquerystring (date-time)The end of the range, exclusive: at most 92 days after from.

Response 200: LedgerSummary

FieldTypeDescription
from requiredstring (date-time)
to requiredstring (date-time)
rows requiredarray of object
rows[].day requiredstring
rows[].kind required"grant" | "top_up" | "auto_refill" | "usage" | "refund" | "adjustment" | …Why a ledger entry moved a wallet's balance.
rows[].entries requiredinteger
rows[].amount_micros requiredstringAn amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number.
rows[].credited_micros requiredstringAn amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number.
rows[].debited_micros requiredstringAn amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number.

Errors

  • 400
    • invalid_request: The request is malformed or fails validation; param names the field.
    • invalid_range: from must be before to, and a summary covers at most 92 days.
    • environment_required: a project key was sent without x-hixel-environment.
    • invalid_query: 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.
  • 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/ledger/summary?from=2026-11-01T00%3A00%3A00Z&to=2026-12-01T00%3A00%3A00Z" \
  -H "Authorization: Bearer $HIXEL_API_KEY"