Skip to content

Status Codes

HTTP status codes returned by the API.

Success Codes

CodeMeaning
200 OKRequest successful
201 CreatedResource created

Error Codes

CodeMeaning
400 Bad RequestInvalid request data
401 UnauthorizedMissing or invalid API key
403 ForbiddenKey doesn't have permission
404 Not FoundResource doesn't exist
409 ConflictResource already exists
422 Unprocessable EntityValidation error
500 Internal Server ErrorServer error

Error Response Format

json
{
  "detail": "Plan not found"
}

Common Errors

Authentication

json
{
  "detail": "Invalid API key"
}

→ Check your API key is correct and has the right permissions.

Validation

json
{
  "detail": "amount_sats must be greater than 0"
}

→ Check your request data matches the expected format.

Not Found

json
{
  "detail": "Subscription not found"
}

→ The resource ID doesn't exist or belongs to a different wallet.

Conflict

json
{
  "detail": "You already have an active subscription to this plan"
}

→ The subscriber already has an active subscription.

NWC Error Codes

Error codes returned by NWC (Nostr Wallet Connect) operations.

Validation Errors

These are returned when validating an NWC connection string:

Error MessageCause
"Please provide a wallet connection string"Empty NWC string
"Invalid connection string format..."Doesn't start with nostr+walletconnect://
"Invalid wallet public key..."Missing or malformed pubkey
"Invalid or missing secret..."Missing or malformed secret
"Connection timed out..."Wallet didn't respond
"Relay rejected the connection..."HTTP 403 from relay

Payment Error Codes

These codes are returned in the error_code field when an NWC payment fails:

CodeMeaningUser Message
INSUFFICIENT_BALANCEWallet doesn't have enough satsYour wallet doesn't have enough sats for this payment.
QUOTA_EXCEEDEDSpending limit reachedYour wallet's spending limit has been reached.
RATE_LIMITEDToo many requestsToo many payment requests. Please wait a moment.
UNAUTHORIZEDConnection revoked/expiredWallet connection was revoked. Please reconnect.
PAYMENT_FAILEDGeneric failurePayment couldn't be completed.
TIMEOUTNo response in timeYour wallet didn't respond in time.
NO_RESPONSENo response receivedNo response received from your wallet.
CONNECTION_ERRORRelay connection failedCould not connect to your wallet.
NOT_FOUNDInvoice not found/expiredInvoice not found or expired.
INTERNALWallet internal errorWallet encountered an internal error.
OTHERUnknown errorSomething went wrong with the payment.

Example NWC Error Response

json
{
  "subscription_id": "sub_xyz789",
  "status": "pending",
  "message": "Your wallet doesn't have enough sats for this payment.",
  "error_code": "INSUFFICIENT_BALANCE"
}