Skip to main content

API Overview

bnbpay-api is the off-chain source of truth for invoices, indexed payments, sessions, and relay execution.

Base URL

https://api.bnbpay.org

Use createApiClient({ baseUrl }) from @pepaylabs/bnbpay for a typed client.

Auth

  • GET endpoints are public and rate-limited.
  • Relay endpoints accept x-api-key when relay auth is enforced.

Error shape

Errors typically return:

{
"error": "Human readable message"
}

The SDK client throws BnbpayApiError with statusCode + details.

Endpoint map

CategoryEndpoints
HealthGET /health
PaymentsGET /payments, GET /payments/:paymentId, GET /payments/:paymentId/status, POST /payments/build-intent, GET /can-pay
WalletsGET /wallets/:address/payments
SessionsGET /sessions, GET /sessions/agent/:address, GET /sessions/:sessionId, GET /sessions/:sessionId/spends, GET /sessions/:sessionId/payments
InvoicesPOST /invoices, GET /invoices/:invoiceId, GET /invoices/:invoiceId/status, POST /invoices/:invoiceId/cancel, POST /invoices/:invoiceId/confirm-payment, GET /invoices/:invoiceId/stream-sse, GET /invoices/:invoiceId/stream
RelayPOST /relay/payment, POST /relay/permit2/bundle, POST /relay/session/open, POST /relay/session/open-claimable, POST /relay/session/claim, POST /relay/session/revoke
NetworksGET /networks
TokensGET /tokens
Gift CardsPOST /giftcards/create, POST /giftcards/claim, POST /giftcards/redeem, POST /giftcards/:cardId/cancel, GET /giftcards/:cardId, GET /giftcards

OpenAPI

The canonical spec lives at bnbpay-api/docs/openapi.yaml in the repo. Use it for codegen or validation.