Skip to content

Billing & Usage

b'nerd records resource usage hourly per project and product. Invoices are issued through EasyBill: they are the legally binding documents, and you download them as PDF (see below). The payment-method endpoints store a card or SEPA direct-debit method for your organization with Stripe and mark one as the default.

Endpoints

Method Path Description
GET /billing/usage?organization_id=<uuid> Get usage data for a period
GET /subscriptions List subscriptions
GET /subscriptions/{id} Show a subscription
PATCH /organizations/{id} Update organization name / billing address
GET /invoices List invoices (issued ones only — see below)
GET /invoices/{id} Show invoice with line items (issued ones only)
GET /organizations/{id}/invoices List EasyBill invoices
GET /organizations/{id}/invoices/download?invoice_id=<id> Download invoice PDF
GET /organizations/{id}/payment_methods List payment methods
POST /organizations/{id}/payment_methods/payment_intent Create a SEPA setup intent (Stripe SetupIntent) and return its client secret
POST /organizations/{id}/payment_methods Store a confirmed payment method on the organization
POST /organizations/{id}/payment_methods/create_and_attach Attach a Stripe payment method
PUT /organizations/{id}/payment_methods/{payment_method_id}/set_default Set default payment method
DELETE /organizations/{id}/payment_methods/{payment_method_id} Remove a payment method

Usage data

GET /billing/usage?organization_id=<uuid>&from=2026-01-01T00:00:00Z&to=2026-01-31T23:59:59Z
Authorization: Bearer <token>

Returns resource consumption broken down by project and product for the requested window. Use this to build cost forecasts and chargeback reports.

Subscriptions

Subscriptions link a product to a project with a start (and optional end) date. Hourly usage entries are recorded against active subscriptions.

GET /subscriptions
Authorization: Bearer <token>

Subscription fields:

Field Description
id Subscription UUID
organization_id Organization UUID
project_id Project UUID (nullable — org-level subscriptions have none)
product_id Product UUID
start_date ISO 8601 datetime the subscription began
end_date ISO 8601 datetime the subscription ended; null if active

Organization billing address

The organization's name and billing address feed EasyBill invoicing (VAT handling, invoice header). Update them with:

PATCH /organizations/{id}
Authorization: Bearer <token>
Content-Type: application/json

{
  "organization": {
    "address": {
      "street": "Musterstraße 1",
      "city": "Hamburg",
      "zip_code": "20095",
      "country": "DE"
    }
  }
}

Address fields: first_name, name, email, street, city, state, zip_code, country — see the Address schema in the interactive reference.

country is an ISO 3166-1 alpha-2 code, uppercase (DE, AT, CH, …), or null. On write, hq accepts an alpha-2 code in any case or a known country name in English or German (for the EU/EFTA/UK/US set) and normalizes it to uppercase alpha-2; anything else is rejected with 422 Unprocessable Content. This endpoint returns a bare Rails errors.details hash — no message text and no errors/request_id envelope:

{
  "address.country": [
    { "error": "inclusion", "value": "Freedonia" }
  ]
}

An unrecognised country always reports "error": "inclusion" (the value you sent is echoed back in "value"); build any user-facing message client-side from that code rather than relying on server text.

This is a deliberate deviation from the standard ErrorEnvelope shape used by the rest of the API.

An empty string ("") normalizes to null, clearing the country.

Tax identity is locked once the organization is active

When the organization is active or suspended (or already has a billing account), changing legal_name, vat_id or the address country is refused with 422 Unprocessable Content, code: "billing_identity_locked"; the envelope's errors[0].field names the field. Contact support to change them. See Organization standing. If the stored legal name is empty, you can fill it in once.

Partial address updates merge — omit keys you don't change

address updates merge into the existing address rather than replacing it wholesale. Send only the keys you intend to change; omit the rest. Do not send "" for a field you want to leave untouched — for most address fields (unlike country) an empty string is written literally and blanks that field. To update just the city, for example, send { "organization": { "address": { "city": "Hamburg" } } } with no other address keys.

Invoices

The platform generates two invoice representations:

Internal invoices (/invoices) reflect the platform's usage metering. You see an invoice here once it has been issued, that is, once it has reached EasyBill (state pushed or finalized). Drafts, reviewed invoices and voided ones are internal working states: they are not listed, and GET /invoices/{id} does not return them either. An invoice that is not issued yet appears here once b'nerd has issued it.

GET /invoices/{id}
Authorization: Bearer <token>

Fields: period, total (Money object: {cents, currency_iso}), and items (array of line items with product, project, unit price, and unit).

EasyBill invoices (/organizations/{id}/invoices) are the legally binding invoices delivered via the EasyBill integration. Download a PDF:

GET /organizations/{id}/invoices/download?invoice_id=<id>
Authorization: Bearer <token>

The response is JSON, not a PDF body: the PDF comes Base64-encoded in data.document.

{
  "metadata": { "organization_id": "<uuid>", "project_id": null, "timestamp": "2026-11-14T12:00:00+01:00" },
  "data": { "document": "JVBERi0xLjcK..." }
}

(The document value is shortened here.) Decode it to get the file, for example:

curl -fsS -H "Authorization: Bearer $TOKEN" \
  "https://api.bnerd.cloud/organizations/$ORG_ID/invoices/download?invoice_id=$INVOICE_ID" \
  | jq -r '.data.document' | base64 -d > invoice.pdf

INVOICE_ID is the id of an entry from GET /organizations/{id}/invoices. On older macOS use base64 -D. With -f, curl stops on an error status instead of writing an empty file.

Only final documents of your own organization (invoices, reminders, dunning letters, cancellations) can be downloaded. Any other id (a draft, another organization's document, an unknown id) returns 404.

Payment methods

Payment methods are Stripe payment instruments attached to an organization.

GET /organizations/{id}/payment_methods
Authorization: Bearer <token>

Payment method fields:

Field Description
id Internal UUID
payment_type card, sepa_debit, etc.
default Whether this is the default payment method
brand Card brand (e.g. visa); null for non-card methods
last4 Last four digits of the card number
exp_month / exp_year Card expiry
iban IBAN (SEPA debit only)

Attach a payment method

Use the Stripe.js PaymentElement in the dashboard to collect card details and generate a Stripe paymentMethodId, then attach it:

POST /organizations/{id}/payment_methods/create_and_attach
Authorization: Bearer <token>
Content-Type: application/json

{ "payment_method_id": "pm_..." }

Add a SEPA direct debit (setup intent)

Create a Stripe setup intent for SEPA direct debit:

POST /organizations/{id}/payment_methods/payment_intent
Authorization: Bearer <token>

The response carries the setup intent's client secret for Stripe.js confirmSetup:

{
  "metadata": { "organization_id": "<uuid>", "project_id": null, "timestamp": "2026-11-14T12:00:00+01:00" },
  "data": { "client_secret": "seti_...secret_..." }
}

After confirmSetup, store the resulting SEPA payment method on the organization:

POST /organizations/{id}/payment_methods
Authorization: Bearer <token>
Content-Type: application/json

{ "payment_method_id": "pm_..." }

Payment method required

Creating a priced resource may require a payment method on your organization. When it does and none is on file, the create call is refused with 422 Unprocessable Content and code: "payment_required". Nothing is created and nothing is billed.

The check covers creating:

  • servers, routers and floating IPs
  • DNS zones
  • Kubernetes clusters
  • object storage users and buckets
  • VPN gateways
  • workspaces
  • app orders

A payment method counts when your organization's default payment method is a card or SEPA direct debit. An invoice default counts only when b'nerd has enabled invoice billing for your organization. Organizations billed under a signed contract are not asked for a payment method.

{
  "request_id": "...",
  "errors": [
    {
      "code": "payment_required",
      "message": "A payment method (SEPA direct debit or card) is required before creating priced resources. Add one under Billing, or contact b'nerd for invoice billing.",
      "status": 422,
      "source": { "service": "billing", "operation": "create" },
      "meta": { "retryable": false, "reasons": ["no_payment_method"] }
    }
  ]
}

source.operation is the name of the endpoint that was called (for example create_server), so it differs between calls. meta.reasons lists what is missing:

Reason Meaning What to do
no_payment_method No usable default payment method. Attach a payment method and make it the default.
no_billing_account Your organization's billing account has not been set up yet. Nothing you can do yourself — contact support. If this is the only reason, the message says so instead.

The error is not retryable until the payment method is in place. After you add one, repeat the call.

Requesting access to a cost-incurring feature (see Request feature access) can also answer 422 payment_required, with the message Payment method required for <feature> and no meta.reasons.

Note

A pending organization can add a payment method while it waits for approval — payment methods are part of the onboarding surface. See Organization standing.

Suspended organizations

b'nerd can suspend an organization. While it is suspended, writes that are not on the exception list answer 403 Forbidden with code: "organization_suspended"; reads and deletes keep working, and existing resources keep running and stay billable. Organization standing has the full list of what stays available. errors[0].meta.reason names the reason: dunning, false_data, abuse or other.

dunning is the reason used for payment problems. If your organization is suspended for it, check your invoices and payment methods, then contact support. You can add or change a payment method while suspended for dunning — see the next section. b'nerd lifts the suspension and sends you an email when the reason no longer applies.

Payment methods and organization standing

Listing and removing payment methods works in every standing. Adding a payment method or setting the default requires an organization that is pending, active, or suspended for dunning, and that is not billed by contract. Any other organization — for example a rejected one, one suspended for abuse, or a contract-billed one — gets 403 Forbidden:

{
  "request_id": "...",
  "errors": [
    {
      "code": "organization_not_eligible",
      "message": "This organization cannot add payment methods in its current state.",
      "status": 403,
      "source": { "service": "stripe", "operation": "create_and_attach" },
      "meta": { "retryable": false }
    }
  ]
}

source.operation is the endpoint that was called. Repeating the request does not help; contact support.

Authorization

Billing read operations require the billing:read permission. Update operations (setting default, removing a payment method) require billing:update. See RBAC Presets for which roles carry these permissions.