Skip to main content
Deposits add real capital to the Treasury through Stripe Checkout. Both calls require Stripe to be connected; otherwise they fail honestly.

Start a deposit

POST /api/hermesco/treasury/deposit
Creates a real Stripe Checkout session for the amount and returns the URL to redirect to.
amountUsd
number
required
The amount to deposit. Minimum $1.
workspaceId
string
default:"demo"
The workspace to credit on return.
The response is the Checkout session (including its url). The success URL returns to /command?deposit_session={CHECKOUT_SESSION_ID} and the cancel URL to /command?deposit_cancelled=1.
curl -s https://hermesco.ai/api/hermesco/treasury/deposit \
  -H "content-type: application/json" \
  -d '{"workspaceId":"g_demo","amountUsd":100}' | jq

Confirm a deposit

GET /api/hermesco/treasury/deposit
Confirms a returned Checkout session and credits the Treasury. Crediting is idempotent on the Stripe session id, so a refresh or double return cannot double-count.
session_id
string
required
The Stripe Checkout session id returned to the success URL.
workspaceId
string
default:"demo"
The workspace to credit. Must match the workspace the deposit was started for.
paid
boolean
Whether Stripe confirms the session was paid.
duplicate
boolean
True if this session was already credited.
depositedUsd
number
The confirmed amount.
state
TreasuryState
The Treasury state after crediting.

Errors

StatusCondition
400Stripe not connected, amountUsd below $1, or session_id missing.
403The deposit belongs to a different workspace.
500A Stripe error (returned in error).