Skip to content

Add OpenAPI spec for toll-booth payment endpoints #2

@TheCryptoDonkey

Description

@TheCryptoDonkey

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions