Skip to content
# Billing

Billing

Wallet balance and transactions, top-ups, auto top-up and invoices.

GET/wallet

Current balance plus paginated wallet transactions. Query params: ?page=0 (default 0), ?limit=50 (1–200).

json
{
  "balance": 12.34,
  "transactions": [
    {
      "id": "txn_3Kd...",
      "type": "topup",
      "amount": 10.0,
      "balanceAfter": 22.34,
      "provider": "paypal",
      "status": "completed",
      "createdAt": "2026-07-10T12:00:00Z"
    },
    {
      "id": "txn_9Lw...",
      "type": "hourly_charge",
      "amount": -0.061,
      "balanceAfter": 12.34,
      "provider": null,
      "status": "completed",
      "createdAt": "2026-07-11T13:00:00Z"
    }
  ],
  "hasMore": false,
  "page": 0
}

type is one of topup, hourly_charge, order_charge, admin_adjustment.

POST/wallet/topups

Start a wallet top-up. Returns a checkout URL — redirect the user there to pay. Amount: 5–10,000 USD. Provider: paypal or nowpayments (crypto).

Request body
json
{
  "amount": 25,
  "provider": "paypal"
}
Response 200
json
{
  "transactionId": "txn_3Kd...",
  "provider": "paypal",
  "approveUrl": "https://www.paypal.com/checkoutnow?token=..."
}

nowpayments returns invoiceUrl instead. The balance is credited by the payment webhook once the payment clears.

GET+POST/wallet/auto-topup

Automatic top-up when the balance drops below a threshold. GET returns the current config; POST updates it (threshold 0–10,000, amount 5–10,000). Only the NOWPayments provider is supported — crypto auto top-up emails an invoice rather than charging silently.

GET response 200
json
{
  "enabled": true,
  "threshold": 5,
  "amount": 20,
  "provider": "nowpayments"
}
POST body → 200
json
{
  "enabled": true,
  "threshold": 5,
  "amount": 20,
  "provider": "nowpayments"
}

→ { "ok": true }
GET/wallet/payment-methods

Which payment providers are enabled on this deployment. Not rate-limited.

json
{
  "paypal": true,
  "nowpayments": true
}
GET/invoices

List your invoices, newest first. GET /invoices/{id} returns a single invoice (404 if not yours).

json
[
  {
    "id": "inv_5Rt...",
    "amount": 25.0,
    "description": "Wallet top-up",
    "status": "paid",
    "creditWallet": true,
    "dueDate": "2026-07-15",
    "sentAt": "2026-07-08T09:00:00Z",
    "paidAt": "2026-07-08T09:04:00Z",
    "createdAt": "2026-07-08T09:00:00Z",
    "invoiceNumber": "BRK-20260708-A1B2C3D4",
    "paymentProvider": "nowpayments",
    "paymentUrl": "https://nowpayments.io/payment/...",
    "paypalInvoiceNumber": null
  }
]

status is one of draft, sent, paid, cancelled.