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.

POST+GET/wallet/x402/topup

Top up the wallet over x402 (HTTP 402) with Curvy: private USDC or USDT on Arbitrum, paid by an agent without a browser. POST returns 402 with the payment options; pay and repeat the same request with a PAYMENT-SIGNATURE header. The wallet is credited once the shielded note is confirmed. Amount: 5–10,000 USD.

1. Request, answer 402
json
POST /api/v1/wallet/x402/topup
{ "amount": 25 }

402 Payment Required
PAYMENT-REQUIRED: <base64 payment options>
// scheme "curvy-transfer", USDC and USDT on
// Arbitrum One (eip155:42161), one-time payTo
2. Pay, repeat, then poll
json
POST /api/v1/wallet/x402/topup   (same body)
PAYMENT-SIGNATURE: <payment>

202 { "transactionId": "…", "status": "processing" }

GET /api/v1/wallet/x402/topup?transactionId=…
{ "status": "completed", "creditedUsd": 25 }

An agent can use createX402Payer from @0xcurvy/payments-sdk/x402 with a send function that transfers the token itself. Pay the exact amount in USDC or USDT: a payment the network rejects (too small, wrong token, failed screening) is not credited.

GET+POST/wallet/auto-topup

Low-balance payment link: when the balance drops below a threshold, Bashrack emails a crypto payment link for the set amount; nothing is charged until it is paid. GET returns the current config; POST updates it (threshold 0–10,000, amount 5–10,000). Only the NOWPayments provider is supported.

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.