Prefixx[ API v1 ]

Prefixx API v1

Base URL https://api.prefixx.app. Bearer tokens are minted on the client app's API keys page (https://prefixx.app/account/api-keys). Every request acts for the token owner's current organization and nothing else; there is no organization parameter anywhere. Send Authorization: Bearer <key> and Accept: application/json.

Abilities are chosen at mint time: lease:read, lease:order, partner:read. A token without the ability for a route gets 403.

All prices are USD per month unless named otherwise, already net of the caller's partner discount. Errors are {"error": "..."} with 422 for a refused action, 403 for scope, 404 for a thing that is not yours.

Method Path Ability What it does
GET /v1/me any User, organization, kyb.can_order, partner tier
GET /v1/lease/catalog lease:read The rate card at your discount, products, terms, purposes
GET/POST /v1/lease/search lease:read prefix (20–24), rir?, purpose?, guarantee?, pool? (any/standard/discount), exclude[]? → up to 5 blocks
POST /v1/lease/holds lease:order allocation_id, cidr, product, term, price_lock?, guarantee?, purpose? → hold for 10 min, returns the cart
DELETE /v1/lease/holds/{id} lease:order Release one hold
GET /v1/lease/cart lease:read Active holds, totals, seconds_left; ?touch=1 extends every hold
POST /v1/lease/checkout lease:order Cart → open quote (24 h)
GET /v1/lease/quotes lease:read Your quotes, newest first
GET /v1/lease/quotes/{id} lease:read One quote
GET /v1/lease/quotes/{id}/document lease:read The Work Order PDF (executed, or a watermarked quotation)
POST /v1/lease/quotes/{id}/accept lease:order signer_name, accept_terms: true → executes the Work Order
POST /v1/lease/quotes/{id}/decline lease:order reason? → releases the blocks
GET /v1/partner partner:read Tier, discount, group MRR with brand split, ladder, history
GET /v1/partner/rates partner:read Discounts locked on past orders

The flow

  1. search with the size and conditions. Results are cut best-fit from the smallest free gap, bottom-aligned, so taking one never fragments the rest. Send the CIDRs you have seen back as exclude[] to shuffle; when the pool is thin some are shown again and reshown says how many.
  2. holds for each block you want (max 10). A hold takes the block out of everyone else's results for ten minutes. Everything you send is re-checked server side under a lock: a CIDR that is not aligned inside a free gap, a guarantee on a block whose holder has not signed the covenant, a use the holder forbids, or a term the product does not offer is a 422.
  3. checkout freezes the cart into a quote. Every block in one order must share product, term and price lock. Holds are extended to the quote's validity.
  4. accept with the signer's name. The KYB gate is checked first (/me says kyb.can_order). On success, in one transaction: the blocks are carved out of inventory and registered to your organization as pending leases, the partner discount is locked for the life of the order, the Work Order PDF is rendered and its SHA-256 recorded, a subscription is created for each block, and the first invoice is raised. If the organization has a saved payment method it is charged at once; the lease activates when the invoice is paid.

Broker-prepared quotes (custom sizes, custom rates) appear in the same quotes list with source: "broker" and are accepted the same way.

Billing (prefixx.app session routes)

These routes need the app's own session token (ability *); an API key with lease abilities cannot reach them.

Route What it does
GET billing/overview Outstanding, credit balance, autopay state, default method, recurring total
GET billing/invoices, GET billing/invoices/{id}, .../pdf Invoices with lines and payments
GET billing/methods Which ways of paying are switched on
POST billing/invoices/{id}/pay method: saved (+ payment_method_id), card (+ save), paypal (+ save), credit. Credit is applied first in every case
POST billing/stripe/confirm After Stripe.js confirms a card; the server re-reads the PaymentIntent before booking anything
GET billing/payment-methods Saved cards and PayPal accounts
POST billing/payment-methods/card/setup, .../card SetupIntent, then save the confirmed card
POST billing/payment-methods/paypal/setup Returns the PayPal approval URL for vaulting
POST billing/payment-methods/{id}/default, DELETE billing/payment-methods/{id} Choose the autopay method, remove one
PATCH billing/autopay enabled true or false
GET billing/credit, POST billing/credit/top-up Ledger, and a top-up by card or PayPal (10 to 50,000)
GET billing/subscriptions What recurs, next invoice date, term
POST billing/subscriptions/{id}/cancel, .../resume Month-to-month only; ends on the last day already invoiced
PATCH billing/profile Billing email, tax id and address

Example

curl -s https://prefixx.net/api/v1/lease/search \
  -H "Authorization: Bearer $KEY" -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"prefix":24,"rir":"ripe","guarantee":true}'