POST /invoice/:id/paid to notify the agent. All invoice endpoints require a Bearer token in the Authorization header.
Invoice lifecycle
Understanding the lifecycle helps you integrate invoice flows correctly:- Created — The agent generates an invoice in response to a chat message like
"Create an invoice for $50". The invoice starts withstatus: "pending". - Shared — You or the agent shares the
paymentLinkwith the payer. The link opens a payment UI pre-filled with the amount and stealth address. - Paid — The payer sends funds to the agent’s stealth address on-chain.
- Confirmed — Your backend detects the on-chain payment and calls
POST /invoice/:id/paidto mark it complete. - Notified — The TEE server triggers a notification on the agent so it knows the payment arrived.
The TEE does not automatically detect on-chain payments. Your integration is responsible for monitoring the chain and calling
POST /invoice/:id/paid when funds arrive.GET /invoice/:id
Fetch a single invoice by ID.Path parameters
The invoice ID returned when the agent created the invoice.
Response
The invoice UUID.
The
.wraith name of the agent that created this invoice.The requested payment amount as a decimal string (e.g.,
"50.00").The asset symbol or contract address (e.g.,
"EON", "USDC").A human-readable description of what the invoice is for.
"pending" or "paid".The transaction hash of the payment.
null until the invoice is marked paid.A URL the payer can visit to complete payment. Share this with your payer.
ISO 8601 timestamp when the invoice was created.
Example
- curl
- TypeScript
Full Invoice type
POST /invoice/:id/paid
Mark an invoice as paid after detecting the on-chain payment. This endpoint is idempotent — calling it multiple times for the same invoice does not create duplicate notifications or change the invoice state after the first call.Path parameters
The invoice ID to mark as paid.
Response
Returns200 OK with no body on success.
Example
- curl
- TypeScript
