toll-booth exposes several HTTP endpoints (/create-invoice, /invoice-status/:paymentHash, /nwc-pay, /cashu-redeem) but there is no machine-readable API specification. An OpenAPI document would help integrators understand the request/response shapes without reading source code, and could eventually power client SDK generation.
Scope
- Create
docs/openapi.yaml describing the four payment endpoints
- Document request bodies, response shapes, and error codes (402, 400, 404, 200)
- Include the
Authorization: L402 <macaroon>:<preimage> header schema
- Reference the existing types in
src/core/types.ts for request/response shapes
Helpful context
src/core/create-invoice.ts - invoice creation handler (request body: { tier?, route? }, response: { paymentHash, bolt11, macaroon })
src/core/invoice-status.ts - status polling handler (response: { paid, preimage?, creditBalance? })
src/core/nwc-pay.ts - NWC payment handler
src/core/cashu-redeem.ts - Cashu redemption handler
src/core/types.ts - all request/result type definitions
- Estimated effort: 2-3 hours
toll-booth exposes several HTTP endpoints (
/create-invoice,/invoice-status/:paymentHash,/nwc-pay,/cashu-redeem) but there is no machine-readable API specification. An OpenAPI document would help integrators understand the request/response shapes without reading source code, and could eventually power client SDK generation.Scope
docs/openapi.yamldescribing the four payment endpointsAuthorization: L402 <macaroon>:<preimage>header schemasrc/core/types.tsfor request/response shapesHelpful context
src/core/create-invoice.ts- invoice creation handler (request body:{ tier?, route? }, response:{ paymentHash, bolt11, macaroon })src/core/invoice-status.ts- status polling handler (response:{ paid, preimage?, creditBalance? })src/core/nwc-pay.ts- NWC payment handlersrc/core/cashu-redeem.ts- Cashu redemption handlersrc/core/types.ts- all request/result type definitions