API reference › Finance › Overview, clients and work items

Get client credit wallet balance and ledger entries

GET /v1/finance/clients/{clientId}/credit-wallet

Scope
finance:read
Roles
admin, scheduler

T23 — Returns client-level unapplied credit wallet balance and ledger rows. Entries may include soft earmark metadata (from_invoice:{id}) from Reverse & Cancel apply_to_new_invoice; earmark is UX-only (soft_lock=false) and does not hard-lock spend. Wallet balance is readable; applying credit to an invoice (spend API) is not shipped yet (T22 deferred).

Parameters

Path parameters

NameTypeDescription
clientId requiredstring

Client ID

Example CLT-XZQLQ1.

Every call also sends Authorization and X-Tenant-ID; see Getting started.

Example request

Shell
curl "https://api.fetchfido.ai/v1/finance/clients/{clientId}/credit-wallet" \
  -H "Authorization: Bearer $FIDO_API_KEY" \
  -H "X-Tenant-ID: $FIDO_TENANT_ID"

Try it

Responses

200 Client credit wallet retrieved successfully

Client credit wallet retrieved successfully

JSON
{
  "success": true,
  "message": "Client credit wallet retrieved successfully",
  "data": {
    "balance": 120,
    "entries": [
      {
        "id": 1,
        "amount": 120,
        "entry_type": "rc_fold_credit",
        "tag": "from_invoice:INV-ABC123",
        "earmark": {
          "source_invoice_id": "INV-ABC123",
          "soft_lock": false
        }
      }
    ]
  }
}
Response fields (12)
FieldTypeDescription
successboolean

Example true.

messagestring

Example Client credit wallet retrieved successfully.

dataobject
data.balancenumber (float)

Example 120.

data.entriesarray of object
data.entries[].idinteger

Example 1.

data.entries[].amountnumber (float)

Example 120.

data.entries[].entry_typestring

Example rc_fold_credit.

data.entries[].tagstring

Example from_invoice:INV-ABC123.

data.entries[].earmarkobject or null
data.entries[].earmark.source_invoice_idstring

Example INV-ABC123.

data.entries[].earmark.soft_lockboolean

Example false.

401 Not signed in

Missing, invalid or expired API key.

JSON
{
  "success": false,
  "message": "Invalid API key. Org and user tier keys must send an X-Tenant-ID header naming the organization the key was issued for.",
  "errors": null,
  "code": "API_KEY_MISSING"
}
Response fields (4)
FieldTypeDescription
successboolean

Example false.

messagestring

Example Invalid API key. Org and user tier keys must send an X-Tenant-ID header naming the organization the key was issued for..

errorsany or null

Null on this status.

codestring

Machine-readable reason, for branching on in client code.

One of: API_KEY_MISSING, API_KEY_INVALID, API_KEY_EXPIRED. Example API_KEY_MISSING.

403 Not allowed

Scope, tenant, IP allow-list or RBAC check failed.

JSON
{
  "success": false,
  "message": "You don't have permission to access this endpoint. This API key is missing the 'finance:read' scope.",
  "errors": null,
  "code": ""
}
Response fields (4)
FieldTypeDescription
successboolean

Example false.

messagestring

Example You don't have permission to access this endpoint. This API key is missing the 'finance:read' scope..

errorsany or null

Null on this status.

codestring

Always empty on this status.

Example .

429 Too many requests

Rate limit exceeded. See Retry-After.

JSON
{
  "success": false,
  "message": "You've exceeded this API key's rate limit of 120 requests per minute. Try again in 37 seconds.",
  "errors": null,
  "code": "RATE_LIMITED"
}
Response fields (4)
FieldTypeDescription
successboolean

Example false.

messagestring

Example You've exceeded this API key's rate limit of 120 requests per minute. Try again in 37 seconds..

errorsany or null

Null on this status.

codestring

Machine-readable reason, for branching on in client code.

One of: RATE_LIMITED. Example RATE_LIMITED.

500 Server error

Server error

JSON
{
  "success": false,
  "message": "An unexpected error occurred — please try again.",
  "errors": null,
  "code": ""
}
Response fields (4)
FieldTypeDescription
successboolean

Example false.

messagestring

Example An unexpected error occurred — please try again..

errorsstring or null

Null in production. The exception message only when the application runs with debug on, so nothing is leaked to an integrator.

codestring

Always empty: the server-error response carries no error code.

Example .