admin

Add or subtract prepaid credits for a team (audited, idempotent)

Moves credits through the existing ledger primitives only (atomic grant / clamped FOR-UPDATE drawdown, so a balance can never go negative), writes the money-trail row and the tenant audit entry in the SAME transaction, and claims the client-supplied idempotency key so a retried submit replays the stored outcome instead of moving credits twice. Requires a human reason. Admin only.

post/v1/admin/cockpit/teams/{tenant_id}/credit-adjustments

Request

  • Base URL: https://api.patricia.app (the document declares no server; this is the origin it was published from)
  • URL: https://api.patricia.app/v1/admin/cockpit/teams/{tenant_id}/credit-adjustments
  • Auth: HTTP bearer

Path parameters

tenant_idstring uuid required

Request body

direction'add' | 'subtract' required
reasonstring required
idempotency_keystring required

Client-generated once per submit; resending it replays the stored outcome instead of moving credits again.

Response

Successful Response

idstring uuid required
amountstring required

Signed requested credits (positive = add).

applied_creditsstring required

Signed credits actually moved on the COGS ledger.

applied_retail_micro_usdinteger required

Signed micro-USD moved on the legacy retail ledger.

balance_afterstring required
retail_balance_after_micro_usdinteger required
reasonstring required
created_atstring date-time required
created_by_emailstring nullable

Admin's email when the principal was a user.

created_by_principal_typestring nullable
replayedboolean

True when this response replays a previous idempotency claim.

Changes

No recorded changes to this operation across all 1 revision of this API.