nozle.Decimal strings. Keep their exact decimal representation throughout your application.
List credit systems and read balances
ListCreditSystems follows every active Core page. Customer and Entity balance and operation methods expose sources, exact amounts, and cursors. DeallocateCredits returns eligible credits to the customer; transfer amounts must be positive strings with at most 12 decimal places.
Use GetCreditBalance and ListCreditBalances for customer balances. GetEntityCreditBalance includes EntityAvailable, SharedAvailable, EffectiveAvailable, and PoolPolicy. Pool policy can be entity_only, entity_then_customer, or customer_only.
Operation history and transfers
ListCreditOperations and ListEntityCreditOperations take PageOptions{CreditSystemCode, Limit, Cursor}. Limits are 1–100. Read NextCursor to fetch the next page. Operations include exact amounts, status, reason, rate snapshot, occurrence time, and source allocations. AllocateCredits and DeallocateCredits require stable idempotency keys of at most 255 UTF-8 bytes.
Advisory check and atomic tracking
CheckUsage is advisory. TrackUsage atomically evaluates and deducts credits, records the operation, and requires an idempotency key.
Set UsageParams.Timestamp (a string) once per operation and store it with the idempotency key. A retry with the same key, the same parameters and the same Timestamp replays the original result: the same OperationID and no second charge. A retry without a Timestamp sends a different body, and the API returns *APIError with StatusCode 409 (idempotency_key_reused).
Set UsageParams.Properties for conversion or attribution metadata. UsageResult includes Allowed, exact CreditsRequired, Available, ProjectedRemaining, and deduction details. A check never reserves credits; inspect Allowed on the tracking result before granting the operation.
Legacy wallet adapter
For applications still using the legacy wallet,CheckAndDeduct calls Engine’s legacy wallet adapter with a customer ID and a numeric credit amount. CheckAndDeductParams.Feature is deprecated: it is ignored, not validated and not sent. This endpoint has no idempotency key. Use CheckUsage and TrackUsage for product credits, which preserve exact decimal values.
Keep reads and mutations behind authenticated backend routes. Derive customer and Entity IDs from trusted identity data.